grub.cfg: scan luks *inside lvm*

the user might have boot their kernel inside luks
inside lvm for some dumb reason

it's theoretically possible that the user would be
so silly indeed

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe 2025-01-12 13:45:00 +00:00
parent d74e906652
commit 1a3c74a974
3 changed files with 42 additions and 0 deletions
config/grub
default/config
nvme/config
xhci/config

View file

@ -178,15 +178,29 @@ menuentry 'Load Operating System (incl. fully encrypted disks) [o]' --hotkey='o
search_bootcfg crypto
lvmvol=""
# after cryptomount, lvm volumes might be available
# using * is slow on some machines, but we use it here,
# just once. in so doing, we find every lvm volume
for vol in (*); do
if regexp ^lvm/ $vol; then
lvmvol="${lvmvol} ${vol}"
try_bootcfg "${vol}"
fi
done
# user might have put luks inside lvm
set pager=0
echo "Attempting to unlock encrypted LVMs"
for vol in ${lvmvol}; do
cryptomount "$vol"
done
set pager=1
echo
search_bootcfg crypto
true # Prevent pager requiring to accept each line instead of whole screen
}

View file

@ -190,15 +190,29 @@ menuentry 'Load Operating System (incl. fully encrypted disks) [o]' --hotkey='o
search_bootcfg crypto
lvmvol=""
# after cryptomount, lvm volumes might be available
# using * is slow on some machines, but we use it here,
# just once. in so doing, we find every lvm volume
for vol in (*); do
if regexp ^lvm/ $vol; then
lvmvol="${lvmvol} ${vol}"
try_bootcfg "${vol}"
fi
done
# user might have put luks inside lvm
set pager=0
echo "Attempting to unlock encrypted LVMs"
for vol in ${lvmvol}; do
cryptomount "$vol"
done
set pager=1
echo
search_bootcfg crypto
true # Prevent pager requiring to accept each line instead of whole screen
}

View file

@ -191,15 +191,29 @@ menuentry 'Load Operating System (incl. fully encrypted disks) [o]' --hotkey='o
search_bootcfg crypto
lvmvol=""
# after cryptomount, lvm volumes might be available
# using * is slow on some machines, but we use it here,
# just once. in so doing, we find every lvm volume
for vol in (*); do
if regexp ^lvm/ $vol; then
lvmvol="${lvmvol} ${vol}"
try_bootcfg "${vol}"
fi
done
# user might have put luks inside lvm
set pager=0
echo "Attempting to unlock encrypted LVMs"
for vol in ${lvmvol}; do
cryptomount "$vol"
done
set pager=1
echo
search_bootcfg crypto
true # Prevent pager requiring to accept each line instead of whole screen
}