tinyramfs/hooks/luks/luks
2021-05-10 14:30:22 +03:00

37 lines
891 B
Bash

# vim: set ft=sh:
# shellcheck shell=sh
#
# https://www.shellcheck.net/wiki/SC2154
# shellcheck disable=2154
[ "$luks_key" ] && {
copy_file "${luks_key#*=}" /root/key 400 0
sed "s|${luks_key#*=}|/root/key|" \
"${tmpdir}/etc/tinyramfs/config" > "${tmpdir}/_"
mv "${tmpdir}/_" "${tmpdir}/etc/tinyramfs/config"
}
[ "$luks_header" ] && {
copy_file "${luks_header#*=}" /root/header 400 0
sed "s|${luks_header#*=}|/root/header|" \
"${tmpdir}/etc/tinyramfs/config" > "${tmpdir}/_"
mv "${tmpdir}/_" "${tmpdir}/etc/tinyramfs/config"
}
[ "$hostonly" = 1 ] &&
for _module in \
aes ecb xts lrw wp512 sha256 \
sha512 twofish serpent dm-crypt
do
copy_module "$_module"
done
# https://bugs.archlinux.org/task/56771
[ -e /lib/libgcc_s.so.1 ] && copy_file /lib/libgcc_s.so.1 /lib/libgcc_s.so.1 755 1
copy_binary cryptsetup