From 550f4ad860e80d3952c12d8d36b3e7676d102620 Mon Sep 17 00:00:00 2001 From: Fierelier Date: Tue, 31 Oct 2023 00:14:33 +0100 Subject: [PATCH] Skip the second entry of the password by writing a key file --- mods/live-installer/data/opt/wdvn/installer/main | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mods/live-installer/data/opt/wdvn/installer/main b/mods/live-installer/data/opt/wdvn/installer/main index dae913d..052aa86 100755 --- a/mods/live-installer/data/opt/wdvn/installer/main +++ b/mods/live-installer/data/opt/wdvn/installer/main @@ -381,9 +381,17 @@ def main(): fh.write('GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX cryptdevice=UUID=' +cryptPartitionUUID+ ' root=UUID=' +installPartitionUUID+ '"\n') fh.close() + print("Writing luks auto-key ...") + key = callString(["xxd","-l","64","-c","0","-ps","/dev/random"]) + fh = open(ipth(".luks-key"),"w") + fh.write(key) + fh.close() + os.chmod(ipth(".luks-key"),600) + call(["cryptosetup","luksAddKey",cryptPartition,ipth(".luks-key")]) + print("Writing crypttab ...") fh = open(ipth("etc/crypttab"),"w") - fh.write('system UUID=' +cryptPartitionUUID+ ' none luks\n') + fh.write('system UUID=' +cryptPartitionUUID+ ' /.luks-key luks\n') fh.close() print("Writing fstab ...")