summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2024-06-01 17:04:31 +0100
committerLeah Rowe <leah@libreboot.org>2024-06-01 18:12:40 +0100
commitcfc5265f5b3e0c1202606be3bcaece0010dd208d (patch)
tree061bffa8c54bb1cc57ca9f25775f3ff38a3d4bad /config
parent42b5b58d36e087fc8e66a0e9d14bf656a8363f54 (diff)
grub.cfg: search a reduced list of devs/partitions
in practise, the machines we support don't have the option of including so many disks; 8 seems like the most reasonable default. additionally, it's unreasonable to expect *20 partitions* this hardcoding is done to avoid using *, which is slow in grub on some machines (the grub kernel always re-enumerates the devices during every operation, without caching any of it) yet, the hardcoding is also slow; balance it a bit better by searching fewer permutations, but not so few that it would likely break a lot of setups Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'config')
-rw-r--r--config/grub/config/grub.cfg12
1 files changed, 6 insertions, 6 deletions
diff --git a/config/grub/config/grub.cfg b/config/grub/config/grub.cfg
index 66642711..5b67d113 100644
--- a/config/grub/config/grub.cfg
+++ b/config/grub/config/grub.cfg
@@ -81,8 +81,8 @@ function try_user_config {
}
function search_grub {
echo -n "Attempting to load grub.cfg from '${1}' devices"
- for i in 0 1 2 3 4 5 6 7 8 9 10 11; do
- for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do
+ for i in 0 1 2 3 4 5 6 7 8; do
+ for part in 1 2 3 4 5 6 7 8 9 10 11 12; do
if [ "${1}" != "nvme" ]; then
try_user_config "(${1}${i},${part})"
else
@@ -117,8 +117,8 @@ function try_isolinux_config {
}
function search_isolinux {
echo "\nAttempting to parse iso/sys/extlinux config from '${1}' devices"
- for i in 0 1 2 3 4 5 6 7 8 9 10 11; do
- for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do
+ for i in 0 1 2 3 4 5 6 7 8; do
+ for part in 1 2 3 4 5 6 7 8 9 10 11 12; do
if [ "${1}" != "nvme" ]; then
try_isolinux_config "(${1}${i},${part})"
else
@@ -167,8 +167,8 @@ menuentry 'Load Operating System (incl. fully encrypted disks) [o]' --hotkey='o
unset bootdev
for grub_disk in ${grub_scan_disk}; do
- for i in 0 1 2 3 4 5 6 7 8 9 10 11; do
- for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do
+ for i in 0 1 2 3 4 5 6 7 8; do
+ for part in 1 2 3 4 5 6 7 8 9 10 11 12; do
if [ "${grub_disk}" = "ahci" ]; then
bootdev="${bootdev} (ahci${i},${part})"
elif [ "${grub_disk}" = "ata" ]; then