Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 676076 - sys-kernel/dracut: cannot unlock luks2 volume because /lib/systemd/systemd-cryptsetup has a dependency on libgcc_s.so.1
Summary: sys-kernel/dracut: cannot unlock luks2 volume because /lib/systemd/systemd-cr...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: ARM64 Linux
: Normal normal (vote)
Assignee: Patrick McLean
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-22 21:58 UTC by Andrius Štikonas
Modified: 2019-01-26 17:29 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrius Štikonas 2019-01-22 21:58:22 UTC
I am using dracut to unlock my LUKS2 encrypted rootfs on ARM64 machine. However, generated initramfs is unable to unlock rootfs.

The reason for this is that /lib/systemd/systemd-cryptsetup has a dependency on libgcc_s.so.1. This dependency is indirect (via dlopen), not visible in ldd.

dracut has a code to deal with this but it relies on libgss_s.so.1 being in libdir.

At the moment on gentoo this is located in
/usr/lib/gcc/aarch64-unknown-linux-gnu/7.3.0/libgcc_s.so.1
but obviously, this will change as gcc versions change...

Normally, dracut uses libdir autodetection and will look at the contents of
/etc/ld.so.conf.d/05gcc-aarch64-unknown-linux-gnu.conf
which contains this path (/usr/lib/gcc/aarch64-unknown-linux-gnu/7.3.0).

However, gentoo ebuild hardcodes libdir in the ebuild. Ebuild installs file
/usr/lib/dracut/dracut.conf.d/gentoo.conf
with the following contents:
libdirs="/lib64 /usr/lib64"

Thus libgcc_s.so.1 is not in the libdir path.


Reproducible: Always

Steps to Reproduce:
1. Encrypt rootfs with LUKS2
2. Use dracut to generate initramfs.
3. Possibly ARM64 machine is necessary.
Actual Results:  
Initramfs is unable to unlock rootfs

Expected Results:  
System boots.
Comment 1 Alexander Tsoy 2019-01-23 16:29:38 UTC
(In reply to Andrius Štikonas from comment #0)
> However, gentoo ebuild hardcodes libdir in the ebuild. Ebuild installs file
> /usr/lib/dracut/dracut.conf.d/gentoo.conf
> with the following contents:
> libdirs="/lib64 /usr/lib64"
libdirs was introduces due to bug 485204. It seems that it was fixed upstream recently:
https://github.com/dracutdevs/dracut/commit/f6e777ec4b1031b18b835cd34ed644ebf4a2ace6

But we probably still need to preserve lib -> lib64 symlinks in initramfs. Currently I don't have any SYMLINK_LIB=yes system to test this.
Comment 2 Andrius Štikonas 2019-01-23 23:46:53 UTC
Also, a bit annoyingly, if I remove gentoo.conf with libdirs, some other files are go missing (although, libgcc_s.so.1 is included)

Only in 3/lib64: device-mapper
Only in 3/lib64: libdevmapper-event-lvm2.so.2.02
Only in 3/lib64: libdevmapper-event-lvm2mirror.so
Only in 3/lib64: libdevmapper-event-lvm2raid.so
Only in 3/lib64: libdevmapper-event-lvm2snapshot.so
Only in 3/lib64: libdevmapper-event-lvm2thin.so
Only in 3/lib64: liblvm2cmd.so.2.02
Only in 3/lib64: libnss_dns-2.27.so
Only in 3/lib64: libnss_dns.so.2
Only in 3/lib64: libnss_files-2.27.so
Only in 3/lib64: libnss_files.so.2
Only in 3/lib64: libnss_myhostname.so.2
Only in 3/lib64: libnss_resolve.so.2
Comment 3 Andrius Štikonas 2019-01-23 23:53:04 UTC
(In reply to Andrius Štikonas from comment #2)
> Also, a bit annoyingly, if I remove gentoo.conf with libdirs, some other
> files are go missing (although, libgcc_s.so.1 is included)
> 
> Only in 3/lib64: device-mapper
> Only in 3/lib64: libdevmapper-event-lvm2.so.2.02
> Only in 3/lib64: libdevmapper-event-lvm2mirror.so
> Only in 3/lib64: libdevmapper-event-lvm2raid.so
> Only in 3/lib64: libdevmapper-event-lvm2snapshot.so
> Only in 3/lib64: libdevmapper-event-lvm2thin.so
> Only in 3/lib64: liblvm2cmd.so.2.02
> Only in 3/lib64: libnss_dns-2.27.so
> Only in 3/lib64: libnss_dns.so.2
> Only in 3/lib64: libnss_files-2.27.so
> Only in 3/lib64: libnss_files.so.2
> Only in 3/lib64: libnss_myhostname.so.2
> Only in 3/lib64: libnss_resolve.so.2

Sorry, ignore that, I had a file in /etc/dracut.conf.d/. Just deleting gentoo.conf fixes boot.
Comment 4 Mike Gilbert gentoo-dev 2019-01-24 00:23:05 UTC
Note to self: SYMLINK_LIB logic comes from bug 508652.
Comment 5 Alexander Tsoy 2019-01-24 10:45:36 UTC
(In reply to Alexander Tsoy from comment #1)
> But we probably still need to preserve lib -> lib64 symlinks in initramfs.
> Currently I don't have any SYMLINK_LIB=yes system to test this.
/lib is always created in initramfs, be it a symlink or a directory:
https://github.com/dracutdevs/dracut/blob/58e0d2d5b5b3a5e7d6dbf74baa2f08f041de5a81/dracut.sh#L1401

And the absence of /usr/lib symlink should not be a problem. At least it worked fine before dracut-033-r2 where $libdirs was introduced. :)
Comment 6 Larry the Git Cow gentoo-dev 2019-01-26 17:29:55 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d2232b443f0a608c6a6ea578484187d82dec0573

commit d2232b443f0a608c6a6ea578484187d82dec0573
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2019-01-26 17:06:12 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2019-01-26 17:29:45 +0000

    sys-kernel/dracut: remove libdirs override
    
    This prevents autodetection via ldconfig from working.
    
    Closes: https://bugs.gentoo.org/676076
    Package-Manager: Portage-2.3.56_p3, Repoman-2.3.12_p50
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 sys-kernel/dracut/dracut-049-r1.ebuild | 156 +++++++++++++++++++++++++++++++++
 sys-kernel/dracut/dracut-9999.ebuild   |  11 ---
 2 files changed, 156 insertions(+), 11 deletions(-)