Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 949722 - sys-kernel/dracut: failed boot (kernel panic) due to misdetected initrd compression support
Summary: sys-kernel/dracut: failed boot (kernel panic) due to misdetected initrd compr...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Alexander Tsoy
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-13 23:36 UTC by Anton Repko
Modified: 2025-02-16 03:03 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
kernel config trying to be minimal (for my AMD CPU, but boots with Intel as well) (config-6.6.74_no_zstd,152.64 KB, text/plain)
2025-02-13 23:36 UTC, Anton Repko
Details
output of a first run of 'make install' (log-install6.6.74slim.txt,135.59 KB, text/plain)
2025-02-13 23:41 UTC, Anton Repko
Details
output of a second run of 'make install' (log-install6.6.74slim2.txt,135.74 KB, text/plain)
2025-02-13 23:43 UTC, Anton Repko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Repko 2025-02-13 23:36:48 UTC
Created attachment 918899 [details]
kernel config trying to be minimal (for my AMD CPU, but boots with Intel as well)

During installation of a new kernel using gentoo-sources and installkernel[dracut], the command 'make install' will print, among other messages,

dracut[I]: Using auto-determined compression method 'zstd'

even if the kernel doesn't support it, due to the following item in my .config (see attachment):

# CONFIG_RD_ZSTD is not set

What is interesting, when I run 'make config' the second time in the same /usr/src/linux directory (and when installkernel appends '.old' to the previous files in /boot), then dracut employs gzip compression:

dracut[I]: Using auto-determined compression method 'gzip'

Please note that the default kernel config supports all compression methods, therefore this bug was not spotted previously. My current config supported only gzip (CONFIG_RD_GZIP=y), so only the repeatedly installed kernel+initrd could boot.

When I'm trying to boot kernel with incompatible initrd compression, then initramfs apparently won't load (which is not obvious from the screen output), and the kernel fails to find root partition due to only UUID provided by the default grub configuration, leading to kernel panic. Therefore, the situation can be "solved" by one of three ways:

a) enable CONFIG_RD_ZSTD in the kernel configuration
b) execute 'make install' two times, and then (optionally) delete .old items from /boot
c) uncomment 'GRUB_DISABLE_LINUX_UUID=true' in /etc/default/grub before 'make install'

Nevertheless, a proper autodetection by dracut would be a more consistent solution. One could argue that a suitable /etc/dracut.conf can be provided, but anyway, the root cause of such boot-time "kernel panic" is not at all obvious, especially for a Linux novice.

I'm using hardened no-multilib profile, with the following USE flags:

[ebuild   R    ] sys-kernel/dracut-103-r4::gentoo  USE="(-selinux) -test" 0 KiB
[ebuild   R    ] sys-kernel/gentoo-sources-6.6.74:6.6.74::gentoo  USE="-build -experimental -symlink" 136 782 KiB
[ebuild   R    ] sys-kernel/installkernel-50::gentoo  USE="dracut grub (-efistub) -refind -systemd -systemd-boot -ugrd -uki -ukify" 0 KiB

The same behavior was observed in all tested scenarios (AMD Zen 2 or Intel Xeon Broadwell), as follows:
gcc-14 + AMD CPU + installkernel-50
gcc-14 + AMD CPU + installkernel-48-r1
gcc-13 + AMD CPU + installkernel-50
gcc-14 + Intel CPU + installkernel-50
gcc-13 + linux-6.12.12 + AMD + installkernel-50
gcc-14 + linux-6.12.12 + Intel + installkernel-50

In the following messages, I will attach 'make install' logs for
gcc-14 + Intel CPU + installkernel-50
Comment 1 Anton Repko 2025-02-13 23:41:59 UTC
Created attachment 918900 [details]
output of a first run of 'make install'

contains:  dracut[I]: Using auto-determined compression method 'zstd'
Comment 2 Anton Repko 2025-02-13 23:43:20 UTC
Created attachment 918901 [details]
output of a second run of 'make install'

contains:  dracut[I]: Using auto-determined compression method 'gzip'
Comment 3 Anton Repko 2025-02-14 06:43:45 UTC
(In reply to Anton Repko from comment #0)
> What is interesting, when I run 'make config' the second time in the same
> /usr/src/linux directory
misprint, should be 'make install'
Comment 4 Mike Gilbert gentoo-dev 2025-02-16 03:03:24 UTC
This should be fixed already fixed in dracut-104. Please upgrade.

https://github.com/dracut-ng/dracut-ng/commit/cc17951ec350d0e3a8f95550579d4515c18a4649