Trying to install custom kernel, all the packages installed succeffully: /root/wget_TMP/selfgz319610330/kernel/rpm/kernel-5.10.107-1.x86_64.rpm /root/wget_TMP/selfgz319610330/kernel/rpm/kernel-devel-5.10.107-1.x86_64.rpm /root/wget_TMP/selfgz319610330/kernel/rpm/kernel-headers-5.10.107-1.x86_64.rpm # rpm -Uvh --noscripts --nodeps /root/wget_TMP/selfgz319610330/kernel/rpm/kernel-5.10.107-1.x86_64.rpm /root/wget_TMP/selfgz319610330/kernel/rpm/kernel-devel-5.10.107-1.x86_64.rpm /root/wget_TMP/selfgz319610330/kernel/rpm/kernel-headers-5.10.107-1.x86_64.rpm Подготовка... ################################# [100%] Обновление / установка... 1: kernel-headers-5.10.107-1 ################################# [ 33%] 2: kernel-devel-5.10.107-1 ################################# [ 67%] 3: kernel-5.10.107-1 ################################# [100%] Running /usr/lib/rpm/posttrans-filetriggers [00:00:00] Config file: /etc/initrd.mk [00:00:06] Generating module dependencies on host ... [00:03:59] Used features: add-modules add-udev-rules buildinfo cleanup compress depmod-image gpu-drm kbd locales network plymouth qemu rdshell rootfs system-glibc ucode [00:03:59] Packed modules: 8139cp ahci ata_generic ata_piix cdrom crc32c-intel crc-t10dif crct10dif_common crct10dif_generic crct10dif-pclmul drm drm_kms_helper e1000 ext4 failover fb_sys_fops jbd2 libahci libata mbcache mii net_failover pata_acpi pcnet32 sd_mod serio_raw sr_mod syscopyarea sysfillrect sysimgblt t10-pi virtio virtio_balloon virtio_blk virtio_console virtio_dma_buf virtio-gpu virtio_input virtio_mem virtio_net virtio_pci virtio_ring virtio-rng virtio_scsi vmw_vsock_virtio_transport vmw_vsock_virtio_transport_common vsock [00:03:59] Unpacked size: 175M [00:03:59] Image size: 42M [00:03:59] Image is saved as /boot/initrd-5.10.107.img Then calling /sbin/installkernel 5.10.107 and got the following error: [00:00:00] Config file: /etc/initrd.mk [00:00:03] Generating module dependencies on host ... /usr/share/make-initrd/tools/initrd-release: строка 8: cd: .//make-initrd.iph3cJUdj/5.10.107.initrd/img: Нет такого файла или каталога make[2]: *** [/usr/share/make-initrd/mk/make-initrd.mk:118: create] Ошибка 1 make[1]: *** [/usr/share/make-initrd/mk/make-initrd.mk:182: process-config] Ошибка 2 make: *** [/usr/share/make-initrd/mk/make-initrd.mk:172: all] Ошибка 1
As far as I can tell, make-initrd is not the problem. The utility runs correctly when called from /usr/lib/rpm/posttrans-filetriggers. As you can see the initramfs has been created. The problem is in the environment of /sbin/installkernel. Please show the output: $ rpm -q --scripts kernel-5.10.107-1
postinstall scriptlet (using /bin/sh): if [ -x /sbin/installkernel -a -r /boot/vmlinuz-5.10.107 -a -r /boot/System.map-5.10.107 ]; then cp /boot/vmlinuz-5.10.107 /boot/.vmlinuz-5.10.107-rpm cp /boot/System.map-5.10.107 /boot/.System.map-5.10.107-rpm rm -f /boot/vmlinuz-5.10.107 /boot/System.map-5.10.107 /sbin/installkernel 5.10.107 /boot/.vmlinuz-5.10.107-rpm /boot/.System.map-5.10.107-rpm rm -f /boot/.vmlinuz-5.10.107-rpm /boot/.System.map-5.10.107-rpm fi preuninstall scriptlet (using /bin/sh): if [ -x /sbin/new-kernel-pkg ]; then new-kernel-pkg --remove 5.10.107 --rminitrd --initrdfile=/boot/initramfs-5.10.107.img elif [ -x /usr/bin/kernel-install ]; then kernel-install remove 5.10.107 fi postuninstall scriptlet (using /bin/sh): if [ -x /sbin/update-bootloader ]; then /sbin/update-bootloader --remove 5.10.107 fi
(Ответ для Elijah Zarezky на комментарий #2) > postinstall scriptlet (using /bin/sh): > if [ -x /sbin/installkernel -a -r /boot/vmlinuz-5.10.107 -a -r > /boot/System.map-5.10.107 ]; then > cp /boot/vmlinuz-5.10.107 /boot/.vmlinuz-5.10.107-rpm > cp /boot/System.map-5.10.107 /boot/.System.map-5.10.107-rpm > rm -f /boot/vmlinuz-5.10.107 /boot/System.map-5.10.107 > /sbin/installkernel 5.10.107 /boot/.vmlinuz-5.10.107-rpm > /boot/.System.map-5.10.107-rpm > rm -f /boot/.vmlinuz-5.10.107-rpm /boot/.System.map-5.10.107-rpm > fi Ok. I saw that the trigger created the image. Image creation is also available in postinstall of rpm package. (Ответ для Elijah Zarezky на комментарий #0) > Then calling > > /sbin/installkernel 5.10.107 You are calling installkernel by hand. Why ? The problem, regardless of your answer, is in the installkernel environment. The make-initrd allows you to change the configuration using environment variables. This cannot be changed. Perhaps installkernel should be more specific to the environment in which the make-inintrd is executed.
I am calling installkernel by hand only to make this newly installed kernel to be default choice in the GRUB menu. Is this unnecessary?
Does your environment set TMPDIR=./ ? I bet such a definition breaks a lot of software!
(Ответ для Elijah Zarezky на комментарий #4) > I am calling installkernel by hand only to make this newly installed kernel > to be default choice in the GRUB menu. Is this unnecessary? The /usr/lib/rpm/boot_kernel.filetrigger is responsible for this. But honestly I don't think it will switch the default kernel in your case. On the table is still the question of how such an environment came about.
(In reply to Alexey Gladkov from comment #6) > (Ответ для Elijah Zarezky на комментарий #4) > > I am calling installkernel by hand only to make this newly installed kernel > > to be default choice in the GRUB menu. Is this unnecessary? > > The /usr/lib/rpm/boot_kernel.filetrigger is responsible for this. But > honestly I don't think it will switch the default kernel in your case. Calling installkernel is the right way to make a certain kernel default. But that's what already happens for any installed kernel package, AFAIR.
No, my environment does NOT set TMPDIR=./
(In reply to Elijah Zarezky from comment #8) > No, my environment does NOT set TMPDIR=./ May be you have INITRD_WORKDIR variable in your environment or in the /etc/sysconfig/installkernel config?
(Ответ для Elijah Zarezky на комментарий #8) > No, my environment does NOT set TMPDIR=./ env |grep WORKDIR ?
Created attachment 10500 [details] ALT environment
(In reply to Alexey Gladkov from comment #10) > (Ответ для Elijah Zarezky на комментарий #8) > > No, my environment does NOT set TMPDIR=./ > > env |grep WORKDIR > > ? https://bugzilla.altlinux.org/attachment.cgi?id=10500
Please, try these two commands: make-initrd -k 5.10.107 env -i /usr/sbin/make-initrd -k 5.10.107
Created attachment 10501 [details] ALT make-initrd
(In reply to Gleb F-Malinovskiy from comment #13) > Please, try these two commands: > > make-initrd -k 5.10.107 > env -i /usr/sbin/make-initrd -k 5.10.107 https://bugzilla.altlinux.org/attachment.cgi?id=10501
(In reply to Elijah Zarezky from comment #14) > Created attachment 10501 [details] > ALT make-initrd Ok, but I don't see how it's even possible. Are you sure that installkernel 5.10.107 command doesn't work in this environment?
(In reply to Gleb F-Malinovskiy from comment #16) > Ok, but I don't see how it's even possible. Are you sure that > installkernel 5.10.107 > command doesn't work in this environment? Hm-m-m... it's looks like a mircacle. I've just successfully performed export KV="5.10.107" /sbin/installkernel ${KV} But it was succeeded after previously executed make-initrd -k 5.10.107 env -i /usr/sbin/make-initrd -k 5.10.107 So tomorrow I will try to do this on the clear VM. Thanks for your support!
The next time it doesn't work, try looking at your environment variables.
You're right guys! I've dumped "env | sort" just before "installkernel" call on the our testing VM - and surprise-surprise, there is "TMPDIR=./" :-D
Although the environment is erroneous, make-initrd could take this situation into account and be more tolerant of such an error.
make-initrd-2.27.0-alt1 -> sisyphus: Wed Jul 06 2022 Alexey Gladkov <legion@altlinux.ru> 2.27.0-alt1 - New version (2.27.0). - Feature luks: + Add crypttab support (ALT#43056). + Try to remember the uuid of the luks device and automatically add it to crypttab. + Use luks.keys if the file is already in the initramfs (ALT#42987). - Feature kickstart: + Use /proc/devices to detect sd and virtblk block devices. - Feature locales: + Read system-wide locales. - Utilities: + initrd-ls: Fix infinite loop when unpacking zstd. + initrd-put: Add option to exclude files by pattern. + initrd-scanmod: module must satisfy all the rules from the ruleset. + mkinitrd-make-initrd: Fixed misprint, make-initrd can be found now. + make-initrd: Enforce absolute path in TMPDIR (ALT#42322). - Misc: + Check bzip2 library as the last chance for detection if there is no bzip2.pc.