From 1a4a21957c913ff26f0ee218e21d0b4d5265366e Mon Sep 17 00:00:00 2001 From: livio <livio@codeberg.org> Date: Sun, 24 Mar 2024 20:07:44 +0100 Subject: [PATCH] Changed GRUB config detection function to load from a list inside a variable --- config/grub/config/grub.cfg | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/config/grub/config/grub.cfg b/config/grub/config/grub.cfg index 018e3847..745cde8b 100644 --- a/config/grub/config/grub.cfg +++ b/config/grub/config/grub.cfg @@ -80,13 +80,17 @@ set pager=1 read } +# Default list of GRUB possible directories. The @/... entries are for cases where the BTRFS filesystem is being used +set grub_dirs="boot grub grub2 boot/grub boot/grub2 @/boot @/grub @/grub2 @/boot/grub @/boot/grub2" +# Default list of GRUB possible config files prefixes +set grub_conf_names="'' osboot_ autoboot_ libreboot_ coreboot_" + function try_user_grub_config { set root="${1}" - # 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 + for dir in ${grub_dirs}; do # In order to save time, we do not attempt anything on non existing directory. if [ -d /"${dir}"/ ]; then - for name in '' osboot_ autoboot_ libreboot_ coreboot_; do + for name in ${grub_conf_names}; do if [ -f /"${dir}"/"${name}"grub.cfg ]; then unset superusers configfile /"${dir}"/"${name}"grub.cfg -- GitLab