Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 946203 - sys-kernel/dracut with custom portage profile fails to include shared library dependencies from /usr/lib
Summary: sys-kernel/dracut with custom portage profile fails to include shared library...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal minor
Assignee: Alexander Tsoy
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-10 13:36 UTC by David Carlos Manuelda
Modified: 2024-12-10 21:38 UTC (History)
4 users (show)

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


Attachments
emerge --config gentoo-kernel output (dracut-create.log,204.03 KB, text/x-log)
2024-12-10 13:36 UTC, David Carlos Manuelda
Details
emerge --info (emergeinfo.txt,21.66 KB, text/plain)
2024-12-10 13:36 UTC, David Carlos Manuelda
Details
dracut.log.gz (dracut.log.gz,200.02 KB, application/gzip)
2024-12-10 20:40 UTC, David Carlos Manuelda
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Carlos Manuelda 2024-12-10 13:36:02 UTC
Created attachment 913728 [details]
emerge --config gentoo-kernel output

When configuring gentoo-kernel (happens also with gentoo-kernel-bin), generated dracut image is not bootable if root is under a NVME device because despite the nvme.ko module is included into the image, it is not automatically modprobed and therefore boot will always fail (or drop to console after all the failed retries (a lot of time)).

Additional data:
* Version tested: 105-r4
* The kernel cmdline is embedded into image (and marked to override anything else)
* Tested with options:
add_drivers+=" sha256_ssse3 sha512_ssse3 "
force_drivers+=" sha256_ssse3 sha512_ssse3 "
hostonly="no" # Also fails with yes
i18n_install_all="yes"
i18n_vars="/etc/conf.d/keymaps:KEYMAP,EXTENDED_KEYMAPS-EXT_KEYMAPS /etc/conf.d/consolefont:CONSOLEFONT-FONT,CONSOLETRANSLATION-FONT_MAP /etc/rc.conf:UNICODE" 
early_microcode="yes"
do_strip="no"

As a workaround, adding force_drivers+=" nvme " makes the image to load correctly (but it takes more than than it should enabling late kayboard leds and taking >5 seconds into /etc/init.d/keymaps)
Comment 1 David Carlos Manuelda 2024-12-10 13:36:39 UTC
Created attachment 913729 [details]
emerge --info
Comment 2 David Carlos Manuelda 2024-12-10 13:37:25 UTC
Not sure if this is the same issue but I could find that on version 100 something similar with similar woraround was found (and fixed later): https://github.com/dracut-ng/dracut-ng/issues/130

Maybe a reintroduced issue?
Comment 3 David Carlos Manuelda 2024-12-10 13:48:36 UTC
Not sure if it is relevant but this is a secureboot + modules_sign installation (with signature enforcing checking).

Other information is that this started happening "suddenly" after an update, but I don't know what was the last working version
Comment 4 Alexander Tsoy 2024-12-10 19:20:31 UTC
I don't see libkmod.so* and libnss_files* in your initramfs. They should be installed by udev-rules module. Please manually run dracut with --debug option and attach the log. Something like this:

/usr/bin/dracut --force --verbose --kernel-image /usr/src/linux-6.12.4-Wesker.Umbrella/arch/x86/boot/bzImage --no-uefi /usr/src/linux-6.12.4-Wesker.Umbrella/arch/x86/boot/initrd 6.12.4-Wesker.Umbrella --debug >/tmp/dracut.log 2>&1
Comment 5 David Carlos Manuelda 2024-12-10 20:40:51 UTC
Created attachment 913757 [details]
dracut.log.gz
Comment 6 David Carlos Manuelda 2024-12-10 20:46:26 UTC
I think one of the relevant lines are:
/usr/lib/dracut/dracut-init.sh@675(inst_libdir_file): [[ -e /usr/lib64/libkmod.so* ]]

Because libkmod.so is under /usr/lib not under /usr/lib64 (no multilib profile) and at least in my case /usr/lib is not a symlink of /usr/lib64
Comment 7 Mike Gilbert gentoo-dev 2024-12-10 21:04:09 UTC
Ah, it might be related to the funky musl libdir setup. The "normal" libdir for amd64 is lib64, but musl profiles override this.

dracut-init.sh detects the presence of the lib64 directory and ignores the lib directory.

Also, musl doesn't have a functioning ldconfig, so ldconfig_paths doesn't output anything.

I'm mostly wondering how this works for ANY musl user.
Comment 8 David Carlos Manuelda 2024-12-10 21:05:38 UTC
(In reply to Mike Gilbert from comment #7)
> Ah, it might be related to the funky musl libdir setup. The "normal" libdir
> for amd64 is lib64, but musl profiles override this.
> 
> dracut-init.sh detects the presence of the lib64 directory and ignores the
> lib directory.
> 
> Also, musl doesn't have a functioning ldconfig, so ldconfig_paths doesn't
> output anything.
> 
> I'm mostly wondering how this works for ANY musl user.

The funny part is that this is a llvm profile but no musl
Comment 9 David Carlos Manuelda 2024-12-10 21:06:35 UTC
Just to add information:

equery files kmod
(...)
/usr/lib
/usr/lib/libkmod.so -> libkmod.so.2.5.0
/usr/lib/libkmod.so.2 -> libkmod.so.2.5.0
/usr/lib/libkmod.so.2.5.0
(...)
Comment 10 Mike Gilbert gentoo-dev 2024-12-10 21:19:20 UTC
(In reply to David Carlos Manuelda from comment #8)
> The funny part is that this is a llvm profile but no musl

Are you using a custom profile? Why is LIBDIR_amd64 set to "lib"?
Comment 11 David Carlos Manuelda 2024-12-10 21:21:10 UTC
(In reply to Mike Gilbert from comment #10)
> (In reply to David Carlos Manuelda from comment #8)
> > The funny part is that this is a llvm profile but no musl
> 
> Are you using a custom profile? Why is LIBDIR_amd64 set to "lib"?

This is a thing I have just realized. Yes, I had it set in an old config file somewhere as a leftover.

Anyway I think that /usr/lib should not be ignored
Comment 12 Mike Gilbert gentoo-dev 2024-12-10 21:24:01 UTC
Supporting custom profiles with custom libdirs is pretty low on the list of priorities.
Comment 13 David Carlos Manuelda 2024-12-10 21:38:45 UTC
Thanks for pointing me into the specific problem, I found my changes on libdirs and dropped them to use the original amd64 profile's default.