From a1d39386db04d06315363b0e275437f725081ebd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 07:26:49 +0200 Subject: Reverting switch from libargon to libopenssl for backports. Signed-off-by: Daniel Baumann --- debian/initramfs/hooks/cryptroot | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'debian/initramfs/hooks') diff --git a/debian/initramfs/hooks/cryptroot b/debian/initramfs/hooks/cryptroot index dd5c798..83d29fd 100644 --- a/debian/initramfs/hooks/cryptroot +++ b/debian/initramfs/hooks/cryptroot @@ -313,6 +313,27 @@ copy_libssl_legacy_library() { fi } +# See #1032221: newer libargon2 are built with glibc ≥2.34 hence no +# longer links libpthread. This in turns means that initramfs-tool's +# copy_exec() is no longer able to detect pthread_*() need and thus +# doesn't copy libgcc_s.so anymore. So we need to do it manually +# instead. +copy_libgcc_argon2() { + local libdir rv=0 + libdir="$(env --unset=LD_PRELOAD ldd /sbin/cryptsetup | sed -nr '/.*=>\s*(\S+)\/libargon2\.so\..*/ {s//\1/p;q}')" + copy_libgcc "$libdir" || rv=$? + if [ $rv -ne 0 ]; then + # merged-/usr mismatch, see #1032518 + if [ "${libdir#/usr/}" != "$libdir" ]; then + libdir="${libdir#/usr}" + else + libdir="/usr/${libdir#/}" + fi + copy_libgcc "$libdir" && rv=0 || rv=$? + fi + return $rv +} + ####################################################################### # Begin real processing @@ -349,6 +370,7 @@ manual_add_modules dm_crypt copy_exec /sbin/cryptsetup copy_exec /sbin/dmsetup +copy_libgcc_argon2 [ "$ASKPASS" = n ] || copy_exec /lib/cryptsetup/askpass -- cgit v1.2.3