From 3f550778dadbc1fe7e78673cb726ebd7ed85ebf6 Mon Sep 17 00:00:00 2001 From: illiliti Date: Thu, 6 Feb 2020 01:29:59 +0300 Subject: [PATCH] LUKS header and keyfile --- generate | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/generate b/generate index 3e725c9..e737f92 100755 --- a/generate +++ b/generate @@ -113,10 +113,20 @@ install_luks() { # workaround for luks2 install -s -m755 /usr/lib/libgcc_s.so.1 -t "${tmpdir}/usr/lib" + # block discard support [ "$luks_discard" = 1 ] && luks_args="--allow-discards $luks_args" - # TODO detached header - # TODO keyfile + # copy luks header + [ -f "$luks_header" ] && { + install -m600 "$luks_header" "${tmpdir}/root/luks_header" + luks_args="--header=/root/luks_header $luks_args" + } + + # copy luks keyfile + [ -f "$luks_keyfile" ] && { + install -m600 "$luks_keyfile" "${tmpdir}/root/luks_keyfile" + luks_args="--key-file=/root/luks_keyfile $luks_args" + } } # install drivers