|
|
@@ -29,6 +29,7 @@ if [ ! -e /etc/initramfs-tools/files/unlock_wrapper.sh ]; then
|
|
|
|
exit 1
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Ensure directory structure in initramfs
|
|
|
|
### Ensure directory structure in initramfs
|
|
|
|
mkdir -p "${DESTDIR}/usr/bin"
|
|
|
|
mkdir -p "${DESTDIR}/usr/bin"
|
|
|
|
mkdir -p "${DESTDIR}/etc/keys"
|
|
|
|
mkdir -p "${DESTDIR}/etc/keys"
|
|
|
@@ -37,66 +38,81 @@ mkdir -p "${DESTDIR}/etc/initramfs-tools/conf.d"
|
|
|
|
mkdir -p "${DESTDIR}/etc/initramfs-tools/scripts/init-premount"
|
|
|
|
mkdir -p "${DESTDIR}/etc/initramfs-tools/scripts/init-premount"
|
|
|
|
mkdir -p "${DESTDIR}/usr/sbin"
|
|
|
|
mkdir -p "${DESTDIR}/usr/sbin"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Include bash
|
|
|
|
### Include bash
|
|
|
|
copy_exec /usr/bin/bash /usr/bin/bash
|
|
|
|
copy_exec /usr/bin/bash /usr/bin/bash
|
|
|
|
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/bash /usr/bin/bash] \n\e[0m"
|
|
|
|
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/bash /usr/bin/bash] \n\e[0m"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Include blkid
|
|
|
|
### Include blkid
|
|
|
|
copy_exec /usr/sbin/blkid /usr/sbin/blkid
|
|
|
|
copy_exec /usr/sbin/blkid /usr/sbin/blkid
|
|
|
|
printf "\e[92mSuccessfully executed: [copy_exec /usr/sbin/blkid /usr/sbin/blkid] \n\e[0m"
|
|
|
|
printf "\e[92mSuccessfully executed: [copy_exec /usr/sbin/blkid /usr/sbin/blkid] \n\e[0m"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Include busybox
|
|
|
|
### Include busybox
|
|
|
|
copy_exec /usr/bin/busybox /usr/busybox
|
|
|
|
copy_exec /usr/bin/busybox /usr/busybox
|
|
|
|
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/busybox /usr/busybox] \n\e[0m"
|
|
|
|
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/busybox /usr/busybox] \n\e[0m"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Include GNU coreutils 'sort' (has -V)
|
|
|
|
### Include GNU coreutils 'sort' (has -V)
|
|
|
|
copy_exec /usr/bin/sort /usr/bin/sort
|
|
|
|
copy_exec /usr/bin/sort /usr/bin/sort
|
|
|
|
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/sort /usr/bin/sort] \n\e[0m"
|
|
|
|
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/sort /usr/bin/sort] \n\e[0m"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Include gpgv
|
|
|
|
### Include gpgv
|
|
|
|
copy_exec /usr/bin/gpgv /usr/bin/gpgv
|
|
|
|
copy_exec /usr/bin/gpgv /usr/bin/gpgv
|
|
|
|
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/gpgv /usr/bin/gpgv] \n\e[0m"
|
|
|
|
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/gpgv /usr/bin/gpgv] \n\e[0m"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Include lsblk
|
|
|
|
### Include lsblk
|
|
|
|
copy_exec /usr/bin/lsblk /usr/bin/lsblk
|
|
|
|
copy_exec /usr/bin/lsblk /usr/bin/lsblk
|
|
|
|
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/lsblk /usr/bin/lsblk] \n\e[0m"
|
|
|
|
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/lsblk /usr/bin/lsblk] \n\e[0m"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Include mkpasswd
|
|
|
|
### Include mkpasswd
|
|
|
|
copy_exec /usr/bin/mkpasswd /usr/mkpasswd
|
|
|
|
copy_exec /usr/bin/mkpasswd /usr/mkpasswd
|
|
|
|
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/mkpasswd /usr/mkpasswd] \n\e[0m"
|
|
|
|
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/mkpasswd /usr/mkpasswd] \n\e[0m"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Include udevadm (udev management tool)
|
|
|
|
### Include udevadm (udev management tool)
|
|
|
|
copy_exec /usr/bin/udevadm /usr/bin/udevadm
|
|
|
|
copy_exec /usr/bin/udevadm /usr/bin/udevadm
|
|
|
|
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/udevadm /usr/bin/udevadm] \n\e[0m"
|
|
|
|
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/udevadm /usr/bin/udevadm] \n\e[0m"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Include sha384sum, sha512sum
|
|
|
|
### Include sha384sum, sha512sum
|
|
|
|
copy_exec /usr/bin/sha384sum /usr/bin/sha384sum
|
|
|
|
copy_exec /usr/bin/sha384sum /usr/bin/sha384sum
|
|
|
|
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/sha384sum /usr/bin/sha384sum ] \n\e[0m"
|
|
|
|
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/sha384sum /usr/bin/sha384sum ] \n\e[0m"
|
|
|
|
copy_exec /usr/bin/sha512sum /usr/bin/sha512sum
|
|
|
|
copy_exec /usr/bin/sha512sum /usr/bin/sha512sum
|
|
|
|
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/sha512sum /usr/bin/sha512sum] \n\e[0m"
|
|
|
|
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/sha512sum /usr/bin/sha512sum] \n\e[0m"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Include tree
|
|
|
|
### Include tree
|
|
|
|
copy_exec /usr/bin/tree /usr/bin/tree
|
|
|
|
copy_exec /usr/bin/tree /usr/bin/tree
|
|
|
|
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/tree /usr/bin/tree] \n\e[0m"
|
|
|
|
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/tree /usr/bin/tree] \n\e[0m"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Include whois
|
|
|
|
### Include whois
|
|
|
|
copy_exec /usr/bin/whois /usr/bin/whois
|
|
|
|
copy_exec /usr/bin/whois /usr/bin/whois
|
|
|
|
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/whois /usr/bin/whois] \n\e[0m"
|
|
|
|
printf "\e[92mSuccessfully executed: [copy_exec /usr/bin/whois /usr/bin/whois] \n\e[0m"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Link busybox applets for compatibility
|
|
|
|
### Link busybox applets for compatibility
|
|
|
|
for dir in bin usr/bin; do
|
|
|
|
for dir in bin usr/bin; do
|
|
|
|
ln -sf busybox "${DESTDIR}/${dir}/cat"
|
|
|
|
ln -sf busybox "${DESTDIR}/${dir}/cat"
|
|
|
|
ln -sf busybox "${DESTDIR}/${dir}/sleep"
|
|
|
|
ln -sf busybox "${DESTDIR}/${dir}/sleep"
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Install Dropbear firewall configuration
|
|
|
|
### Install Dropbear firewall configuration
|
|
|
|
install -m 0444 /etc/initramfs-tools/files/dropbear_fw.conf "${DESTDIR}/etc/initramfs-tools/conf.d/dropbear_fw.conf"
|
|
|
|
install -m 0444 /etc/initramfs-tools/files/dropbear_fw.conf "${DESTDIR}/etc/initramfs-tools/conf.d/dropbear_fw.conf"
|
|
|
|
printf "\e[92mSuccessfully executed: [install -m 0444 /etc/initramfs-tools/files/dropbear_fw.conf %s/etc/initramfs-tools/conf.d/dropbear_fw.conf] \n\e[0m" "${DESTDIR}"
|
|
|
|
printf "\e[92mSuccessfully executed: [install -m 0444 /etc/initramfs-tools/files/dropbear_fw.conf %s/etc/initramfs-tools/conf.d/dropbear_fw.conf] \n\e[0m" "${DESTDIR}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Install Dropbear configuration
|
|
|
|
### Install Dropbear configuration
|
|
|
|
install -m 0444 /etc/dropbear/initramfs/dropbear.conf "${DESTDIR}/etc/dropbear/dropbear.conf"
|
|
|
|
install -m 0444 /etc/dropbear/initramfs/dropbear.conf "${DESTDIR}/etc/dropbear/dropbear.conf"
|
|
|
|
printf "\e[92mSuccessfully executed: [install -m 0444 /etc/dropbear/initramfs/dropbear.conf %s/etc/dropbear/dropbear.conf] \n\e[0m" "${DESTDIR}"
|
|
|
|
printf "\e[92mSuccessfully executed: [install -m 0444 /etc/dropbear/initramfs/dropbear.conf %s/etc/dropbear/dropbear.conf] \n\e[0m" "${DESTDIR}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Install Dropbear 'cryptroot-unlock'-Wrapper
|
|
|
|
### Install Dropbear 'cryptroot-unlock'-Wrapper
|
|
|
|
install -m 0555 /etc/initramfs-tools/files/unlock_wrapper.sh "${DESTDIR}/usr/local/bin/unlock_wrapper.sh"
|
|
|
|
install -m 0555 /etc/initramfs-tools/files/unlock_wrapper.sh "${DESTDIR}/usr/local/bin/unlock_wrapper.sh"
|
|
|
|
printf "\e[92mSuccessfully executed: [install -m 0555 /etc/initramfs-tools/files/unlock_wrapper.sh %s/usr/local/bin/unlock_wrapper.sh] \n\e[0m" "${DESTDIR}"
|
|
|
|
printf "\e[92mSuccessfully executed: [install -m 0555 /etc/initramfs-tools/files/unlock_wrapper.sh %s/usr/local/bin/unlock_wrapper.sh] \n\e[0m" "${DESTDIR}"
|
|
|
@@ -107,13 +123,17 @@ printf "\e[92mSuccessfully executed: [install -m 0444 /etc/initramfs-tools/files
|
|
|
|
install -m 0444 /etc/initramfs-tools/files/unlock_wrapper.sh.sha512.sig "${DESTDIR}/usr/local/bin/unlock_wrapper.sh.sha512.sig"
|
|
|
|
install -m 0444 /etc/initramfs-tools/files/unlock_wrapper.sh.sha512.sig "${DESTDIR}/usr/local/bin/unlock_wrapper.sh.sha512.sig"
|
|
|
|
printf "\e[92mSuccessfully executed: [install -m 0444 /etc/initramfs-tools/files/unlock_wrapper.sh.sha512.sig %s/usr/local/bin/unlock_wrapper.sh.sha512.sig] \n\e[0m" "${DESTDIR}"
|
|
|
|
printf "\e[92mSuccessfully executed: [install -m 0444 /etc/initramfs-tools/files/unlock_wrapper.sh.sha512.sig %s/usr/local/bin/unlock_wrapper.sh.sha512.sig] \n\e[0m" "${DESTDIR}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Install PGP Signing Keys
|
|
|
|
### Install PGP Signing Keys
|
|
|
|
install -m 0444 /root/.ciss/keys/unlock_wrapper_pubring.pgp "${DESTDIR}/etc/keys/unlock_wrapper_pubring.gpg"
|
|
|
|
install -m 0444 /root/.ciss/cdi/keys/unlock_wrapper_pubring.pgp "${DESTDIR}/etc/keys/unlock_wrapper_pubring.gpg"
|
|
|
|
|
|
|
|
printf "\e[92mSuccessfully executed: [install -m 0444 /root/.ciss/cdi/keys/unlock_wrapper_pubring.pgp %s/etc/keys/unlock_wrapper_pubring.gpg] \n\e[0m" "${DESTDIR}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Install Dropbear Banner
|
|
|
|
### Install Dropbear Banner
|
|
|
|
install -m 0444 /etc/dropbear/initramfs/banner "${DESTDIR}/etc/dropbear/banner"
|
|
|
|
install -m 0444 /etc/dropbear/initramfs/banner "${DESTDIR}/etc/dropbear/banner"
|
|
|
|
printf "\e[92mSuccessfully executed: [install -m 0444 /etc/dropbear/initramfs/banner %s/etc/dropbear/banner] \n\e[0m" "${DESTDIR}"
|
|
|
|
printf "\e[92mSuccessfully executed: [install -m 0444 /etc/dropbear/initramfs/banner %s/etc/dropbear/banner] \n\e[0m" "${DESTDIR}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
printf "\e[92mSuccessfully executed: [/etc/initramfs-tools/hooks/9999-custom-initramfs.sh] \n\e[0m"
|
|
|
|
printf "\e[92mSuccessfully executed: [/etc/initramfs-tools/hooks/9999-custom-initramfs.sh] \n\e[0m"
|
|
|
|
|
|
|
|
|
|
|
|
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
|
|
|
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
|
|
|