summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2021-12-29 02:37:05 +0000
committerLeah Rowe <leah@libreboot.org>2021-12-29 02:37:05 +0000
commit0ea263129a92384b6d3e8b114d10e2bf200b9100 (patch)
treee88c8f8798060f137969354c3bbaa134500bc284
parent56698000fa7a5ea48281192c1e67c833d2735cb1 (diff)
grub.cfg: optimize search_isolinux
GRUB is slow at device enumeration. This patch works around it in the same way as vitali64's recent patch.
-rw-r--r--resources/grub/config/grub.cfg23
1 files changed, 14 insertions, 9 deletions
diff --git a/resources/grub/config/grub.cfg b/resources/grub/config/grub.cfg
index 5cda2329..93cc9e2c 100644
--- a/resources/grub/config/grub.cfg
+++ b/resources/grub/config/grub.cfg
@@ -77,16 +77,21 @@ function try_isolinux_config {
done
}
function search_isolinux {
- unset ddev
- if [ (${1}?) != "(${1}?)" ]; then
- ddev=(${1}*) # Both raw and partitioned devices.
- echo -n "Attempting to parse isolinux menu from: "
- fi
- for i in ${ddev}; do
- echo -n "${i} "
- try_isolinux_config "${i}"
+ for i in 0 1 2 3 4 5 6 7 8 9 10 11; do
+ # TODO : Find a better way to detect how many partitions
+ # : are on the disk instead of hardcoding.
+ echo "\nAttempting to parse isolinux menu from ${1}${i}"
+ for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do
+ # MBR/GPT partitions
+ echo "\nTrying partiton ${part}"
+ try_isolinux_config "(${1}${i},${part})"
+ done
+ # raw devices
+ echo "\nTrying raw usb device ..."
+ try_isolinux_config "(${1}${i})"
+ echo # Insert newline
done
- echo # Insert newline
+
}
menuentry 'Load Operating System (incl. fully encrypted disks) [o]' --hotkey='o' {
# GRUB2 handles (almost) every possible disk setup, but only the location of