diff --git a/sys-kernel/mkinitcpio/files/mkinitcpio-42-encrypt-gentoo-paths.patch b/sys-kernel/mkinitcpio/files/mkinitcpio-42-encrypt-gentoo-paths.patch new file mode 100644 index 0000000000..d34cfa241d --- /dev/null +++ b/sys-kernel/mkinitcpio/files/mkinitcpio-42-encrypt-gentoo-paths.patch @@ -0,0 +1,23 @@ +install/encrypt: resolve libgcc_s and the OpenSSL modules dir at build time + +Gentoo keeps libgcc_s.so.1 under the active gcc's libdir (or in +/usr/lib64 from sys-libs/libgcc on clang systems) and the OpenSSL +providers under /usr/$(get_libdir)/ossl-modules, so the /usr/lib paths +hardcoded here are never found. Ask the dynamic loader cache and openssl +itself instead, which also follows toolchain and libdir changes. + +--- a/install/encrypt ++++ b/install/encrypt +@@ -20,10 +20,10 @@ build() { + '95-dm-notify.rules' + + # cryptsetup calls pthread_create(), which dlopen()s libgcc_s.so.1 +- add_binary '/usr/lib/libgcc_s.so.1' ++ add_binary "$(ldconfig -p | awk '/[[:space:]]libgcc_s\.so\.1 \(/ { print $NF; exit }')" /usr/lib/libgcc_s.so.1 + + # cryptsetup loads the legacy provider which is required for whirlpool +- add_binary '/usr/lib/ossl-modules/legacy.so' ++ add_binary "$(openssl version -m | sed 's/.*"\(.*\)"/\1/')/legacy.so" + + add_runscript + } diff --git a/sys-kernel/mkinitcpio/mkinitcpio-42-r1.ebuild b/sys-kernel/mkinitcpio/mkinitcpio-42-r2.ebuild similarity index 84% rename from sys-kernel/mkinitcpio/mkinitcpio-42-r1.ebuild rename to sys-kernel/mkinitcpio/mkinitcpio-42-r2.ebuild index e532701c3d..da8244a0d7 100644 --- a/sys-kernel/mkinitcpio/mkinitcpio-42-r1.ebuild +++ b/sys-kernel/mkinitcpio/mkinitcpio-42-r2.ebuild @@ -46,18 +46,16 @@ BDEPEND=" QA_PREBUILT="/usr/lib/initcpio/busybox" +PATCHES=( + "${FILESDIR}"/${PN}-42-encrypt-gentoo-paths.patch +) + src_prepare() { default # tools/dist.sh reads the version from git describe, which the tarball lacks sed -i "s|run_command('tools/dist.sh', 'get-version', check: true).stdout().strip()|'${PV}'|" \ meson.build || die sed -i "s:/usr/lib/libkmod.so.2:/usr/$(get_libdir)/libkmod.so.2:" install/udev || die - # libgcc_s lives under the active gcc's libdir, resolve it when the image is built - local libgcc='add_binary "$(gcc-config -L | cut -d: -f1)/libgcc_s.so.1" /usr/lib/libgcc_s.so.1' - sed -i \ - -e "/add_binary.*libgcc_s\.so\.1/s#.*# ${libgcc}#" \ - -e "s:/usr/lib/ossl-modules/legacy.so:/usr/$(get_libdir)/ossl-modules/legacy.so:" \ - install/encrypt || die } src_configure() {