From 03196594ba97c9b3a29e3ebf4f0ce1af218b80ee Mon Sep 17 00:00:00 2001 From: Klemens Nanni Date: Thu, 5 Nov 2015 17:39:47 +0100 Subject: grub.cfg: Search for keyfile only once --- resources/grub/config/menuentries/common.cfg | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'resources/grub/config/menuentries') diff --git a/resources/grub/config/menuentries/common.cfg b/resources/grub/config/menuentries/common.cfg index c7a1bf77..4cebb390 100644 --- a/resources/grub/config/menuentries/common.cfg +++ b/resources/grub/config/menuentries/common.cfg @@ -34,14 +34,14 @@ menuentry 'Load Operating System (incl. fully encrypted disks) [O]' --hotkey='o fi done done + # prompt user for passphrase if LUKS header is found but try using external keyfiles first + search -n -f /keyfile --set=kf --hint usb0, --hint usb1, + if [ $? = 0 ]; then + kf="-k (${kf})/keyfile ${d}" + fi # (This way, we only need to scan for encrypted data once while covering every possible disk setup, # be it LVM/BTRFS/ZFS/ext4/etc. (on LUKS) (on RAID) on/across raw devices/MBR/GPT for d in ${devs}; do - # prompt user for passphrase if LUKS header is found but try using external keyfiles first - search -n -f /keyfile --set=kf --hint usb0, --hint usb1, - if [ $? = 0 ]; then - kf="-k (${kf})/keyfile ${d}" - fi cryptomount ${kf} ${d} done # 3. Do the same routine again, but for possibly decrypted data this time. There might be an LVM -- cgit v1.2.3-70-g09d2