]> git.pld-linux.org Git - packages/opensc.git/blame - opensc-initramfs-hook
- BR: pcsc-lite-devel
[packages/opensc.git] / opensc-initramfs-hook
CommitLineData
7a7d4f39
JR
1#!/bin/sh
2
3set -e
4
5PREREQ="cryptroot"
6
7prereqs()
8{
9 echo "$PREREQ"
10}
11
12case $1 in
13 prereqs)
14 prereqs
15 exit 0
16 ;;
17esac
18
19. /usr/share/initramfs-tools/hook-functions
20
21# Hooks for loading smartcard reading software into the initramfs
22
23# Check whether cryptroot hook has installed decrypt_opensc script
24if [ ! -x ${DESTDIR}/keyscripts/decrypt_opensc ] ; then
25 exit 0
26fi
27
28# Install cryptroot key files into initramfs
29keys=$(sed 's/^\(.*,\|\)key=//; s/,.*//' ${DESTDIR}/conf/conf.d/cryptroot)
30
31if [ "${keys}" != "none" ]; then
32 if [ -z "${keys}" ]; then
33 echo $0: Missing key files in ${DESTDIR}/conf/conf.d/cryptroot >&2
34 cat ${DESTDIR}/conf/conf.d/cryptroot >&2
35 exit 1
36 fi
37 for key in ${keys} ; do
38 if [ ! -d ${DESTDIR}/$(dirname ${key}) ] ; then
39 mkdir -p ${DESTDIR}/$(dirname ${key})
40 fi
41 cp ${key} ${DESTDIR}/${key}
42 done
43fi
44
45# Install directories needed by smartcard reading daemon, command, and
46# key-script
47for dir in etc/opensc usr/lib/pcsc var/run tmp ; do
48 if [ ! -d ${DESTDIR}/${dir} ] ; then mkdir -p ${DESTDIR}/${dir} ; fi
49done
50
51# Install pcscd daemon, drivers, conf file, and include libgcc as well since
52# pcscd utilizes pthread_cancel
53copy_exec /usr/sbin/pcscd
54cp -r /usr/lib/pcsc ${DESTDIR}/usr/lib
55cp /etc/reader.conf ${DESTDIR}/etc
56
57# Install opensc commands and conf file
58copy_exec /usr/bin/opensc-tool
59copy_exec /usr/bin/pkcs15-crypt
60cp /etc/opensc/opensc.conf ${DESTDIR}/etc/opensc
This page took 0.071733 seconds and 4 git commands to generate.