#!/bin/sh
ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH)
. /usr/share/initramfs-tools/hook-functions
copy_exec /lib/usec-crypt-kit/usec-askpass
copy_exec /bin/lsblk
copy_exec /sbin/cryptsetup
copy_exec /bin/tpm2_startauthsession
copy_exec /bin/tpm2_pcrread
copy_exec /bin/tpm2_policypcr
copy_exec /bin/tpm2_policypassword
copy_exec /bin/tpm2_flushcontext
copy_exec /bin/tpm2_createprimary
copy_exec /bin/tpm2_create
copy_exec /bin/tpm2_load
copy_exec /bin/tpm2_encryptdecrypt
copy_exec /bin/tpm2_dictionarylockout
copy_exec /sbin/e2fsck
copy_exec /sbin/resize2fs
copy_exec /sbin/usec-boot-encrypt
copy_exec /sbin/e2image
copy_exec /sbin/dmsetup
copy_exec /sbin/e2label
copy_exec /bin/btrfs
cp /lib/$ARCH/libtss2-tcti-device.so.0 $DESTDIR/lib/$ARCH/
cp /lib/$ARCH/plymouth/label.so $DESTDIR/lib/$ARCH/
mkdir -p $DESTDIR/etc/usec-crypt/
mkdir -p $DESTDIR/usr/share/locale/zh_CN/LC_MESSAGES/
cp /usr/share/locale/zh_CN/LC_MESSAGES/usec-crypt.mo $DESTDIR/usr/share/locale/zh_CN/LC_MESSAGES/
cp /etc/fstab $DESTDIR/etc/
if [ -e /etc/usec-crypt/encrypt.json ]; then
    cp /etc/usec-crypt/encrypt.json $DESTDIR/etc/usec-crypt/
fi
mkdir -p $DESTDIR/etc/default/
cp /etc/default/locale $DESTDIR/etc/default/
mkdir -p $DESTDIR/lib/locale/
cp /lib/locale/locale-archive $DESTDIR/lib/locale/
mkdir -p $DESTDIR/usr/share/fonts/truetype/unifont/
cp /usr/share/fonts/truetype/unifont/unifont.ttf $DESTDIR/usr/share/fonts/truetype/unifont/