Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 664904 - sys-kernel/genkernel: Generated initramfs fails to boot when using encrypted root with luks2 due to missing libgcc_s.so.1
Summary: sys-kernel/genkernel: Generated initramfs fails to boot when using encrypted ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-30 19:11 UTC by Christian Widmer
Modified: 2019-03-22 14:14 UTC (History)
2 users (show)

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


Attachments
patch working around the issue (genkernel-cryptsetup-include-libgcc_s.patch,753 bytes, patch)
2019-03-05 23:09 UTC, Maciej S. Szmigiero
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Widmer 2018-08-30 19:11:17 UTC
In a setup with an encrypted root created by cryptsetup-2.4.0-r1 using luks2 and argon2 as pbkdf, the initramfs generated by genkernel leads to an unbootable system because it needs libgcc_s.so.1.
Adding the library manually by using the --initramfs-overlay option to include libgcc_s.so.1 allows the system to boot again. This issue has been observed in other distributions as well[1][2].

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=890798
[2] https://bugs.archlinux.org/task/56771
Comment 1 Maciej S. Szmigiero 2019-03-05 23:05:18 UTC
+1 confirmed

ZFS has basically hit the same issue earlier in bug #617666:
libgcc_s.so.1 is a dependency loaded during runtime (dlopen()-style)
rather than one pulled in by some ELF file DT_NEEDED entry.
This makes libgcc_s.so.1 essentially invisible to ldd or lddtree.

I've hacked the genkernel ZFS fix in commit
https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=6b5eb0fe52a49b1aa050f4b9f2e46b03f5c2940c
to workaround the problem (patch attached), but I think that
libgcc_s.so.1 should be just unconditionally included in an initramfs
(as hunting down such implicit dependencies is hard and fragile).

BTW. The issue probably comes up from argon2 library and might be limited
to cryptsetup invocations that use argon2 as the PBKDF
(that is, only to systems that have sys-fs/cryptsetup[argon2]).
Comment 2 Maciej S. Szmigiero 2019-03-05 23:09:34 UTC
Created attachment 567904 [details, diff]
patch working around the issue