summaryrefslogtreecommitdiff
path: root/resources/grub/config/grub.cfg
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2021-10-30 16:03:10 +0100
committerLeah Rowe <leah@libreboot.org>2021-10-30 16:03:10 +0100
commitf195282d905a378149036a01d5eeff108be5a381 (patch)
treee0527a19d0113e82f203a7e8f750b9fe9f7063aa /resources/grub/config/grub.cfg
parent777316eb4f836563ce0e4e6f9dd2fca4312e8ac1 (diff)
grub.cfg patch from shmalebx9: reverse search order for encrypted partitions
Also, when a cryptomount is successful, break from the loop and boot from that. In most cases, this will work just fine, and this change improves the boot speed in the vast majority of cases. From <https://notabug.org/libreboot/lbmk/issues/53> This is based on commit 5767489cadc4a9a1f2e7bffe03457e29e1c9a101 from https://github.com/shmalebx9/Bleeding-Libreboot/
Diffstat (limited to 'resources/grub/config/grub.cfg')
-rw-r--r--resources/grub/config/grub.cfg14
1 files changed, 10 insertions, 4 deletions
diff --git a/resources/grub/config/grub.cfg b/resources/grub/config/grub.cfg
index 7a86ded8..d56732ed 100644
--- a/resources/grub/config/grub.cfg
+++ b/resources/grub/config/grub.cfg
@@ -113,17 +113,22 @@ menuentry 'Load Operating System (incl. fully encrypted disks) [o]' --hotkey='o
# Encrypted disks and partitions
#TODO: This needs to be adjusted on each device to exclude ODD
#TODO: Usually ATA is for odd if both exist!
-#TODO: Shouldn't it stop at first successful cryptomount?
#TODO: Unset variables before use!
#TODO: Pick better variable name scheme than ${ddev}, or find way to make it local
unset ahcidev
unset atadev
unset usbdev
if [ (ahci?) != "(ahci?)" ]; then
- ahcidev=(ahci*)
+ ahcilist=(ahci*)
+ for part in ${ahcilist}; do
+ ahcidev="$part $ahcidev"
+ done
fi
if [ (ata?) != "(ata?)" ]; then
- atadev=(ata*)
+ atalist=(ata*)
+ for part in ${atalist}; do
+ atadev="$part $atadev"
+ done
fi
if [ (usb?) != "(usb?)" ]; then
usbdev=(usb*)
@@ -132,7 +137,7 @@ menuentry 'Load Operating System (incl. fully encrypted disks) [o]' --hotkey='o
echo -n "Attempting to cryptomount: "
for dev in ${usbdev} ${ahcidev} ${atadev} ${lvmvol}; do # what about raid?
echo -n "${dev} "
- cryptomount "${dev}"
+ if cryptomount "${dev}" ; then break ; fi
done
set pager=1
echo # Insert newline
@@ -179,6 +184,7 @@ menuentry 'Load Operating System (incl. fully encrypted disks) [o]' --hotkey='o
true # Prevent pager requiring to accept each line instead of whole screen
}
+
menuentry 'Search ISOLINUX menu (AHCI) [a]' --hotkey='a' {
search_isolinux ahci
}