<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>40231</bug_id>
          
          <creation_ts>2021-06-16 13:59:30 +0300</creation_ts>
          <short_desc>installkernel игнорирует INSTALL_PATH</short_desc>
          <delta_ts>2023-04-28 11:54:40 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>Distributions</classification>
          <product>Branch p9</product>
          <component>bootloader-utils</component>
          <version>не указана</version>
          <rep_platform>x86_64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alexey Sheplyakov">asheplyakov</reporter>
          <assigned_to name="qa-team@altlinux.org">qa-team</assigned_to>
          <cc>iv</cc>
    
    <cc>qwetwe</cc>
    
    <cc>sbolshakov</cc>
    
    <cc>vt</cc>
          
          <qa_contact name="qa-p9@altlinux.org">qa-p9</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>199234</commentid>
    <comment_count>0</comment_count>
    <who name="Alexey Sheplyakov">asheplyakov</who>
    <bug_when>2021-06-16 13:59:30 +0300</bug_when>
    <thetext>Собираю ядро для arm64 платы, и устанавливаю его во временную директорию. Вот так:

git clone --depth=1 -b baikalm-5.10.y git://github.com/altlinux/linux-be-m1000.git
cd linux-be-m1000
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j`nproc` baikal_minimal_defconfig
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j`nproc` all
rm -rf _inst
mkdir -p -m755 _inst
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- INSTALL_PATH=`pwd`/_inst/boot INSTALL_MOD_PATH=`pwd`/_inst install modules_install


Ожидаемый результат: в _inst/boot появляются файлы {vmlinuz,System.map,config}-${krelease}

Наблюдаемый результат: 
 make \
	ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- \
	INSTALL_PATH=`pwd`/_inst/boot \
	INSTALL_MOD_PATH=`pwd`/_inst \
	install modules_install
make[1]: Entering directory &apos;/home/asheplyakov/linux-be-m1000&apos;
sh ./arch/arm64/boot/install.sh 5.10.41-05484-g72af9fca9403-dirty \
arch/arm64/boot/Image System.map &quot;/home/asheplyakov/linux-be-m1000/_inst/boot&quot;
/sbin/installkernel: /boot: Permission denied
make[3]: *** [arch/arm64/boot/Makefile:40: install] Error 1
make[2]: *** [arch/arm64/Makefile:165: install] Error 2
make[1]: *** [Makefile:336: __build_one_by_one] Error 2
make[1]: Leaving directory &apos;/home/asheplyakov/linux-be-m1000&apos;
make: *** [Makefile.qtcreator:45: install] Error 2

Что за самодеятельность - зачем тащить ядро в /boot, если явно указан INSTALL_PATH (и ядро вообще для другой архитектуры)?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>199237</commentid>
    <comment_count>1</comment_count>
    <who name="Ivan A. Melnikov">iv</who>
    <bug_when>2021-06-16 14:18:23 +0300</bug_when>
    <thetext>И правда, исправление[1] из 0.5.3-alt1 в p9 не дошло.

[1] http://git.altlinux.org/gears/b/bootloader-utils.git?a=commitdiff;h=93a4efba28ce3c40ceb86cb16026bbd9e39a0157

Попробуйте bootloader-utils из #274649.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>199244</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Sheplyakov">asheplyakov</who>
    <bug_when>2021-06-16 15:43:34 +0300</bug_when>
    <thetext>В 0.5.3-alt1 есть некоторые улучшения: ядро, .config и System.map таки копируются именно туда, куда сказано. Однако installkernel всё равно пытается создать initramfs и что-то сделать с загрузчиком. Об этом никто не просил, и это, очевидно, не удаётся:
- ядро для другой архитектуры, собирать для него initramfs из хостовых бинарников заведомо провальная затея
- модули еще не установлены
- установят их не в /lib/modules, а тоже во временную директорию (которая потом копируется на плату тем или иным способом)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>199247</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Sheplyakov">asheplyakov</who>
    <bug_when>2021-06-16 15:54:45 +0300</bug_when>
    <thetext>(In reply to Ivan A. Melnikov from comment #1)
&gt; И правда, исправление[1] из 0.5.3-alt1 в p9 не дошло.
&gt; 
&gt; [1]
&gt; http://git.altlinux.org/gears/b/bootloader-utils.git?a=commitdiff;
&gt; h=93a4efba28ce3c40ceb86cb16026bbd9e39a0157
&gt; 
&gt; Попробуйте bootloader-utils из #274649.

make \
	ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- \
	INSTALL_PATH=`pwd`/_inst/boot \
	INSTALL_MOD_PATH=`pwd`/_inst \
	install modules_install
make[1]: Entering directory &apos;/home/asheplyakov/linux-be-m1000&apos;
sh ./arch/arm64/boot/install.sh 5.10.41-05484-g72af9fca9403-dirty \
arch/arm64/boot/Image System.map &quot;/home/asheplyakov/linux-be-m1000/_inst/boot&quot;
depmod: ERROR: could not open directory /lib/modules/5.10.41-05484-g72af9fca9403-dirty: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
make-initrd: /lib/modules/5.10.41-05484-g72af9fca9403-dirty: Not readable
make[3]: *** [arch/arm64/boot/Makefile:40: install] Error 1
make[2]: *** [arch/arm64/Makefile:165: install] Error 2
make[1]: *** [Makefile:336: __build_one_by_one] Error 2

Пытается запустить depmod, создать initramfs, и далее со всеми остановками.
Объяснил, что так делать не надо:

diff --git a/installkernel b/installkernel
index eed1dae..e5535c3 100644
--- a/installkernel
+++ b/installkernel
@@ -104,6 +104,12 @@ if [ $# -ge 4 ]; then
        cp -S.old --preserve=timestamps &quot;$KIMG&quot; &quot;$BOOTDIR/vmlinuz-$VERSION&quot;
        cp -S.old --preserve=timestamps &quot;$KMAP&quot; &quot;$BOOTDIR/System.map-$VERSION&quot;
        NOFLAVOUR=y
+       if [ &quot;$BOOTDIR&quot; != &quot;/boot&quot; ]; then
+               # The kernel image is being installed into staging directory, i.e.
+               # make install INSTALL_PATH=`pwd`/inst ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
+               # Don&apos;t generate initramfs, and don&apos;t touch boot loader.
+               exit 0
+       fi
 fi
 
 : ${INITRD_GENERATOR:=make-initrd}



#274656 FAILED #1 [test-only] p9 bootloader-utils.git=0.5.3-alt2

(failed потому, что новее, чем в sisyphus)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>203462</commentid>
    <comment_count>4</comment_count>
    <who name="Ivan A. Melnikov">iv</who>
    <bug_when>2021-10-04 10:37:49 +0300</bug_when>
    <thetext>Ждём

#286347 EPERM #2 [locked] p10 bootloader-utils.git=0.5.3-alt2
#286348 POSTPONED #2 p9 bootloader-utils.git=0.5.3-alt2</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>224722</commentid>
    <comment_count>5</comment_count>
    <who name="Ivan Alekseev">qwetwe</who>
    <bug_when>2023-04-19 16:58:51 +0300</bug_when>
    <thetext>Алексей, здравствуйте.

По указанным шагам ошибка &quot;/boot: Permission denied&quot; не воспроизвелась. В то же время, мой результат не соответствует ожидаемому - в _inst создается только папка lib:

host-48 linux-be-m1000 # make \
ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- \
INSTALL_PATH=`pwd`/_inst/boot \
INSTALL_MOD_PATH=`pwd`/_inst \
install modules_install
sh ./arch/arm64/boot/install.sh 5.10.101-gb5513a086915 \
arch/arm64/boot/Image System.map &quot;/root/linux-be-m1000/_inst/boot&quot;
cp: невозможно создать обычный файл &apos;/root/linux-be-m1000/_inst/boot/config-5.10.101-gb5513a086915&apos;: Нет такого файла или каталога
cp: невозможно создать обычный файл &apos;/root/linux-be-m1000/_inst/boot/vmlinuz-5.10.101-gb5513a086915&apos;: Нет такого файла или каталога
cp: невозможно создать обычный файл &apos;/root/linux-be-m1000/_inst/boot/System.map-5.10.101-gb5513a086915&apos;: Нет такого файла или каталога
  INSTALL arch/arm64/lib/xor-neon.ko
  INSTALL crypto/async_tx/async_memcpy.ko
...
  INSTALL sound/usb/snd-usbmidi-lib.ko
  DEPMOD  5.10.101-gb5513a086915

host-48 linux-be-m1000 # l _inst/
итого 12
drwxr-xr-x  3 root root 4096 апр 19 16:21 lib/
drwxr-xr-x  3 root root 4096 апр 19 16:21 ./
drwxr-xr-x 26 root root 4096 апр 19 16:21 ../

- Стенд: виртуальная машина с системой, установленной из образа alt-workstation-9.2-aarch64.iso и обновленной до p9.

- Версия пакета: bootloader-utils-0.5.3-alt2.noarch

Подскажите, пожалуйста, актуальные шаги для воспроизведения ошибки.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>