blob: aaf6e7b878d8c6c1a177307c1d06209612ddeab0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
#!/bin/sh
PREREQ="cryptroot"
prereqs () {
echo "$PREREQ"
}
case "$1" in
prereqs)
prereqs
exit 0
;;
esac
. /usr/share/initramfs-tools/hook-functions
copy_exec /lib/cryptsetup/naskpass /lib/cryptsetup
copy_exec /lib/cryptsetup/naskshell /bin
copy_exec /lib/cryptsetup/naskpass_check /lib/cryptsetup
copy_exec /usr/share/naskpass/naskpass.pre /lib/cryptsetup
copy_exec /usr/share/naskpass/naskpass.post /lib/cryptsetup
dash -n /usr/share/naskpass/naskpass.initconf
copy_exec /usr/share/naskpass/naskpass.initconf /etc/naskpass.conf
copy_exec /usr/sbin/sshd /sbin/sshd
cp -R /etc/initramfs-tools/etc/ssh "${DESTDIR}/etc/"
copy_exec /usr/lib/$(dpkg-architecture -q DEB_HOST_MULTIARCH)/libnss_compat.so /usr/lib/$(dpkg-architecture -q DEB_HOST_MULTIARCH)/
if [ -r "${DESTDIR}/etc/nsswitch.conf" ]; then
echo "passwd: compat" > "${DESTDIR}/etc/nsswitch.conf"
echo "group: compat" >>"${DESTDIR}/etc/nsswitch.conf"
echo "shadow: compat" >>"${DESTDIR}/etc/nsswitch.conf"
fi
[ -r "${DESTDIR}/etc/passwd" ] || echo 'root:x:0:0:root:/root:/bin/naskshell' >"${DESTDIR}/etc/passwd"
[ -r "${DESTDIR}/etc/group" ] || echo 'root:x:0:' >"${DESTDIR}/etc/group"
[ -r "${DESTDIR}/etc/shadow" ] || echo 'root:*:15446:0:99999:7:::' >"${DESTDIR}/etc/shadow"
mkdir -p ${DESTDIR}/lib/terminfo/l
cp /lib/terminfo/l/linux ${DESTDIR}/lib/terminfo/l/
exit 0
|