summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2024-06-01 16:58:59 +0100
committerLeah Rowe <leah@libreboot.org>2024-06-01 18:12:40 +0100
commitb3d58f1edc24eadd615d5e1130b6e6abd703ac33 (patch)
treeebf65362d199708b2878590364d31688211a1d07 /config
parent2ea5e61cfd834ed92cfe35a917d12808afa39253 (diff)
grub.cfg: split up try_user_config
in the next revision, i will add ESP paths Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'config')
-rw-r--r--config/grub/config/grub.cfg14
1 files changed, 9 insertions, 5 deletions
diff --git a/config/grub/config/grub.cfg b/config/grub/config/grub.cfg
index 29313cf5..acb9da2c 100644
--- a/config/grub/config/grub.cfg
+++ b/config/grub/config/grub.cfg
@@ -61,15 +61,19 @@ if [ -f (cbfsdisk)/keymap.gkb ]; then
keymap (cbfsdisk)/keymap.gkb
fi
-function try_user_config {
+function really_try_user_config {
set root="${1}"
+ if [ -f /"${2}"/grub.cfg ]; then
+ unset superusers
+ configfile /"${2}"/grub.cfg
+ fi
+}
+
+function try_user_config {
# The @/... entries are for cases where the BTRFS filesystem is being used
for dir in boot grub grub2 boot/grub boot/grub2 @/boot @/grub @/grub2 @/boot/grub @/boot/grub2; do
- if [ -f /"${dir}"/grub.cfg ]; then
- unset superusers
- configfile /"${dir}"/grub.cfg
- fi
+ really_try_user_config "${1}" "${dir}"
done
}
function search_grub {