FS#74207 - [mkinitcpio] local libraries (home partition) included in initramsfs
Attached to Project:
Arch Linux
Opened by Damir Franusic (dfranusic) - Wednesday, 23 March 2022, 09:21 GMT
Last edited by Jelle van der Waa (jelly) - Monday, 18 September 2023, 17:44 GMT
Opened by Damir Franusic (dfranusic) - Wednesday, 23 March 2022, 09:21 GMT
Last edited by Jelle van der Waa (jelly) - Monday, 18 September 2023, 17:44 GMT
|
Details
Description:
mkinitcpio creates initramfs with local libraries (~/.local/lib) included in initramfs-linux.img (lsinitcpio /boot/initramfs-linux.img); this causes kernel panic and you are unable to boot your system. This happens when you install libraries to your home dir and have a custom ld config file (/etc/ld.so.conf.d/99-local.conf) which lists one or more directories from your /home/user directory. Steps to reproduce: 1. install a shared library into your ~/.local/lib 2. add ~/.local/lib to /etc/ld.so.conf.d/99-local.conf 3. run ldconfig 4. run mkinitcpio -P or reinstall your kernel (linux package) 5. reboot |
This task depends upon
Closed by Jelle van der Waa (jelly)
Monday, 18 September 2023, 17:44 GMT
Reason for closing: Moved
Additional comments about closing: https://gitlab.archlinux.org/archlinux/m kinitcpio/mkinitcpio/issues/207
Monday, 18 September 2023, 17:44 GMT
Reason for closing: Moved
Additional comments about closing: https://gitlab.archlinux.org/archlinux/m kinitcpio/mkinitcpio/issues/207
2. add ~/.local/lib to /etc/ld.so.conf.d/99-local.conf
You explicitly add those paths to replace the system wide ones.
So it's your custom configuration which blows your system.
Setting LD_LIBRARY_PATH or LD_PRELOAD specifically when testing is the way to do what you want. Doing that globally is just asking for all kinds of probolems.
https://www.collabora.com/news-and-blog/blog/2022/03/30/spotlight-on-meson-full-featured-developer-environment/
I don't see how this is a `mkinitcpio` issue.
I spent the best part of my afternoon figuring out why kmod couldn't find libcrypto.so.3 while I saw it plain and perfect in /usr/lib.
In my case it was an AUR package which added such an override in /etc/ld.so.conf.d: https://aur.archlinux.org/packages/dell-command-configure
Yes, it's definitely bad for a package to do that kind of thing. And I'm glad I found this override, as it meant lots of my system would be using an out of date libcrypto.
But it's also bad of mkinitcpio to generate a broken init image by
1) taking into account these ld.so overrides at generation time
2) not taking into account these overrides when actually booting, as the init environment could not find the libraries mkinitcpio thought it needed to include...
I would appreciate that such an inconsistency in mkinitcpio is resolved, even though I agree the current result could ultimately boil down to "user error".
It's just quite a leap to realize that /etc/ld.so.conf.d content can break init image generation in an otherwise perfectly functioning system.