GRUB: config from HDD/SSD: try grub.cfg after *_grub.cfg

The "Load Operating System (incl. fully encrypted disks) [o]" GRUB
entry tries to load grub configuration files from the hard disk or SSD
partitions. It tries various files in /boot, /grub, /grub2,
/boot/grub, /boot/grub2.

Before it tried 'grub.cfg' before other more specific files, and if
users created a file like that, they more likely want it to override
the distribution's grub.cfg, especially because by default, some
GNU/Linux distributions handle the creation of /boot/grub/grub.cfg
automatically.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
This commit is contained in:
Denis 'GNUtoo' Carikli 2023-08-21 18:02:06 +02:00
parent 81ad84d72c
commit 5dec35648a
Signed by: GNUtoo
GPG Key ID: 5F5DFCC14177E263
1 changed files with 1 additions and 1 deletions

View File

@ -34,7 +34,7 @@ keymap usqwerty
function try_user_config { function try_user_config {
set root="${1}" set root="${1}"
for dir in boot grub grub2 boot/grub boot/grub2; do for dir in boot grub grub2 boot/grub boot/grub2; do
for name in '' gnuboot_ osboot_ autoboot_ coreboot_; do for name in gnuboot_ osboot_ autoboot_ coreboot_ '' ; do
if [ -f /"${dir}"/"${name}"grub.cfg ]; then if [ -f /"${dir}"/"${name}"grub.cfg ]; then
unset superusers unset superusers
configfile /"${dir}"/"${name}"grub.cfg configfile /"${dir}"/"${name}"grub.cfg