move luks header and keyfile handling to init

This commit is contained in:
illiliti
2020-03-08 04:46:43 +03:00
parent 5413ec2f38
commit 15457b48be
2 changed files with 9 additions and 10 deletions

View File

@@ -89,7 +89,9 @@ findfs_sh() {
}
unlock_luks() {
[ "$luks_discard" = 1 ] && luks_args="--allow-discards $luks_args"
[ "$luks_discard" = 1 ] && luks_args="--allow-discards $luks_args"
[ -f /root/luks_header ] && luks_args="--header=/root/luks_header $luks_args"
[ -f /root/luks_keyfile ] && luks_args="--key-file=/root/luks_keyfile $luks_args"
cryptsetup $luks_args \
luksOpen \
@@ -127,9 +129,10 @@ cleanup() {
}
boot_system() {
exec switch_root /mnt/root \
${init:-/sbin/init} ||
panic "failed to boot system"
exec switch_root \
/mnt/root \
${init:-/sbin/init} ||
panic "failed to boot system"
}
/sbin/busybox --install -s