|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
PREREQ="cryptroot"
|
|
|
|
|
|
|
|
prereqs()
|
|
|
|
{
|
|
|
|
echo "$PREREQ"
|
|
|
|
}
|
|
|
|
|
|
|
|
case $1 in
|
|
|
|
prereqs)
|
|
|
|
prereqs
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
. /usr/share/initramfs-tools/hook-functions
|
|
|
|
|
|
|
|
# Hooks for loading smartcard reading software into the initramfs
|
|
|
|
|
|
|
|
# Install directories needed by smartcard reading daemon, command, and
|
|
|
|
# key-script
|
|
|
|
for dir in etc/opensc usr/lib/pcsc var/run tmp ; do
|
|
|
|
if [ ! -d ${DESTDIR}/${dir} ] ; then mkdir -p ${DESTDIR}/${dir} ; fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# Install pcscd daemon, drivers, conf file, and include libgcc as well since
|
|
|
|
# pcscd utilizes pthread_cancel
|
|
|
|
mkdir -p ${DESTDIR}/lib
|
|
|
|
copy_exec /usr/sbin/pcscd /sbin
|
|
|
|
if [ -e /lib/*/libgcc_s.so.1 ]
|
|
|
|
then
|
|
|
|
copy_exec /lib/*/libgcc_s.so.1 /lib
|
|
|
|
else
|
|
|
|
copy_exec /lib/libgcc_s.so.1 /lib
|
|
|
|
fi
|
|
|
|
copy_exec /lib/libpcsclite.so.1 /lib
|
|
|
|
cp -r /usr/lib/pcsc ${DESTDIR}/usr/lib
|
|
|
|
cp /etc/reader.conf ${DESTDIR}/etc
|
|
|
|
|
|
|
|
# Install opensc commands and conf file
|
|
|
|
copy_exec /usr/bin/opensc-tool /bin
|
|
|
|
copy_exec /usr/bin/pkcs15-crypt /bin
|
|
|
|
cp /etc/opensc/opensc.conf ${DESTDIR}/etc/opensc
|
|
|
|
|
|
|
|
# Install other required utilities
|
|
|
|
copy_exec /bin/grep /bin
|
|
|
|
copy_exec /bin/mv /bin
|
|
|
|
copy_exec /bin/cat /bin
|
|
|
|
copy_exec /bin/sleep /bin
|
|
|
|
copy_exec /usr/bin/opensc-explorer /bin
|
|
|
|
copy_exec /usr/bin/openssl /bin
|
|
|
|
copy_exec /usr/bin/perl /bin
|
|
|
|
copy_exec /bin/rm /bin
|
|
|
|
copy_exec /usr/bin/xxd /bin
|
|
|
|
copy_exec /usr/bin/killall /bin
|
|
|
|
copy_exec /bin/sed /bin
|
|
|
|
copy_exec /usr/bin/tr /bin
|
|
|
|
copy_exec /bin/bash /bin
|
|
|
|
|
|
|
|
# Main scripts
|
|
|
|
copy_exec /usr/bin/scriptor_standalone /bin
|
|
|
|
copy_exec /usr/bin/smartauth.sh /bin
|
|
|
|
|
|
|
|
# Libraries
|
|
|
|
# cp /usr/lib/libltdl.so* ${DESTDIR}/usr/lib
|
|
|
|
# cp /lib/libncurses.so.5 ${DESTDIR}/lib
|
|
|
|
cp /lib/libncursesw.so.5 ${DESTDIR}/lib
|