summaryrefslogtreecommitdiff
path: root/config/grub
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2024-05-28 23:08:20 +0100
committerLeah Rowe <leah@libreboot.org>2024-05-28 23:19:23 +0100
commitb00800a7cceb3a6fe15837266b671e87392154c0 (patch)
tree9657a51505a501e1bc9e8b6734ac7f3be52bbd8a /config/grub
parent4488745cb698781c9770a2db8bc71bb74d84f29a (diff)
grub.cfg: actually support setting boot order
replace variables ahcidev/atadev/nvmedev with a single one named bootdev the for loop goes through grub_scan_disk, so now it is effectively a bootorder configuration Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'config/grub')
-rw-r--r--config/grub/config/grub.cfg18
1 files changed, 8 insertions, 10 deletions
diff --git a/config/grub/config/grub.cfg b/config/grub/config/grub.cfg
index 9266dc23..52ebe9bc 100644
--- a/config/grub/config/grub.cfg
+++ b/config/grub/config/grub.cfg
@@ -160,19 +160,17 @@ menuentry 'Load Operating System (incl. fully encrypted disks) [o]' --hotkey='o
try_bootcfg "${vol}"
done
- unset ahcidev
- unset atadev
- unset nvmedev
- for i in 11 10 9 8 7 6 5 4 3 2 1 0; do
- for part in 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1; do
- for grub_disk in ${grub_scan_disk}; do
+ 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
if [ "${grub_disk}" = "ahci" ]; then
- ahcidev="(ahci${i},${part}) ${ahcidev}"
+ bootdev="${bootdev} (ahci${i},${part})"
elif [ "${grub_disk}" = "ata" ]; then
- atadev="(ata${i},${part}) ${atadev}"
+ bootdev="${bootdev} (ata${i},${part})"
elif [ "${grub_disk}" = "nvme" ]; then
# TODO: do we care about other namesapces
- nvmedev="(nvme${i}n1,${part}) ${nvmedev}"
+ bootdev="${bootdev} (nvme${i}n1,${part})"
fi
done
done
@@ -180,7 +178,7 @@ menuentry 'Load Operating System (incl. fully encrypted disks) [o]' --hotkey='o
set pager=0
echo -n "Attempting to unlock encrypted volumes"
- for dev in ${nvmedev} ${ahcidev} ${atadev} ${lvmvol} ${raidvol}; do
+ for dev in ${bootdev} ${lvmvol} ${raidvol}; do
if cryptomount "${dev}" ; then break ; fi
done
set pager=1