GRUB: config from HDD/SSD: Add support for gnuboot_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.

For consistency we at least need to make it search for the
gnuboot_grub.cfg in these directories as well. Since this is GNU Boot,
the gnuboot_grub.cfg takes precedence over files made for other boot
software distributions.

For libreboot_grub.cfg, it was not replaced because it is still
mentioned in the documentation.

Signed-off-by: Adrien 'neox' Bourmault <neox@gnu.org>
GNUtoo: reworked code and commit message.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
This commit is contained in:
Adrien Bourmault 2023-08-08 12:58:02 +02:00
parent ce13d22c07
commit 0df4fe5fad
No known key found for this signature in database
GPG Key ID: 6EB408FE0ACEC664
2 changed files with 2 additions and 1 deletions

View File

@ -1,2 +1,3 @@
Copyright (C) 2014, 2015, 2016, 2020, 2021 Leah Rowe <info@minifree.org> Copyright (C) 2014, 2015, 2016, 2020, 2021 Leah Rowe <info@minifree.org>
Copyright (C) 2015 Klemens Nanni <contact@autoboot.org> Copyright (C) 2015 Klemens Nanni <contact@autoboot.org>
Copyright (C) 2023 Adrien 'neox' Bourmault <neox@gnu.org>

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 '' osboot_ autoboot_ libreboot_ 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