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>
master
Leah Rowe 2025-01-12 13:45:00 +00:00
parent 5a3b0dab96
commit 66d084e7f7
3 changed files with 42 additions and 0 deletions

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
}