summaryrefslogtreecommitdiffstats
path: root/debian/initramfs/hooks
diff options
context:
space:
mode:
Diffstat (limited to 'debian/initramfs/hooks')
-rw-r--r--debian/initramfs/hooks/cryptroot22
1 files changed, 22 insertions, 0 deletions
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