#!/bin/sh set -e PREREQ="cryptroot" prereqs() { echo "$PREREQ" } case $1 in prereqs) prereqs exit 0 ;; esac . /usr/share/initramfs-tools/hook-functions if [ ! -x ${DESTDIR}/lib/cryptsetup/scripts/decrypt_gnupg_sc ] ; then exit 0 fi # Deploy the keyring. cp -a /etc/keys/ "${DESTDIR}/etc/" # Deploy terminfo (required for pinentry-curses). mkdir -p "${DESTDIR}/etc/terminfo/l/" cp -a /lib/terminfo/l/linux "${DESTDIR}/etc/terminfo/l/linux" # Deploy GnuPG binaries and pinentry-curses. copy_exec /usr/bin/gpg copy_exec /usr/bin/gpg2 copy_exec /usr/bin/gpg-agent copy_exec /usr/bin/pinentry-curses # some more libs for pcscd copy_exec /usr/sbin/pcscd copy_exec /usr/lib/pcsc/drivers/serial/libccidtwin.so copy_exec /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Linux/libccid.so copy_exec /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Info.plist copy_exec /etc/libccid_Info.plist if uname -r | grep -q amd64; then copy_exec /usr/lib/x86_64-linux-gnu/libpcsclite.so.1.0.0 copy_exec /lib/x86_64-linux-gnu/libgcc_s.so.1 else copy_exec /usr/lib/i386-linux-gnu/libpcsclite.so.1.0.0 copy_exec /lib/i386-linux-gnu/libgcc_s.so.1 fi # we need some more stuff from gnupg2 copy_exec /usr/lib/gnupg/scdaemon copy_exec /usr/bin/pinentry echo "initramfs for luks decryption with gnupg-card done" exit 0