From 5edd892f48c2c0a251248a1506ce5e71dbca48ce Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Sat, 4 Dec 2021 16:57:25 +0100 Subject: [PATCH] Add prompt for external keyfile in initcpio --- root/etc/initcpio/hooks/lukskeyfile | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/root/etc/initcpio/hooks/lukskeyfile b/root/etc/initcpio/hooks/lukskeyfile index fce69a5..4189ede 100644 --- a/root/etc/initcpio/hooks/lukskeyfile +++ b/root/etc/initcpio/hooks/lukskeyfile @@ -1,8 +1,8 @@ #!/bin/ash run_hook() { + # This is a needed kernel parameter for this hook if [ -n "$lukskeyfile" ]; then - # This is a needed kernel parameter for this hook modprobe -a -q loop dm-crypt >/dev/null 2>&1 # Refer to help from `mkinitcpio -H lukskeyfile`. IFS=: read rootKeyDev rootKey cryptkeyLoc </dev/null 2>&1; then + # Copy the keyfile present in the device into the + # ramfs filesystem to be read by dm-crypt cat "/mnt/${rootKey}" > "${cryptkeyLoc}" else echo "Failed to mount ${rootKeyDev} on /mnt"