diff --git a/config/grub/config/grub.cfg b/config/grub/config/grub.cfg index d4c0677eb208bd9c36e2cf594db69e06e4845d07..6c2e2fc800e47d4b5fe9db2893bec4bcad919a74 100644 --- a/config/grub/config/grub.cfg +++ b/config/grub/config/grub.cfg @@ -136,12 +136,24 @@ menuentry "List all bootable medias" { scan_l_media_menus } -# FIXME Make an automatic override for BTRFS directories instead of copypasting with a "@/" in front of every element - # 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" +set grub_dirs="" # Complete list of every possible grub directory, automatically filled later +set grub_dir_super="@" # Possible list of superdirectories (BTRFS can have those) +set grub_dir="boot grub grub2" # First level directories list +set grub_dir_sub="grub grub2" # Second level directories list + +for i in '' ${grub_dir_super}; do + grub_dirs="${grub_dirs} ${i}" + for j in ${grub_dir}; do + grub_dirs="${grub_dirs} ${i}/${j}" + for k in ${grub_dir_sub}; do + grub_dirs="${grub_dirs} ${i}/${j}/${k}" + done + done +done + # Default list of GRUB possible config files prefixes -set grub_conf_names="'' osboot_ autoboot_ libreboot_ coreboot_" +set grub_conf_names="osboot_ autoboot_ libreboot_ coreboot_" # Creates a menuentry for GRUB. First argument is menu text without spaces then root and configfile function grub_menuentry {