From e81d95efa1f87c48cf59cd1dae33062231db1cb4 Mon Sep 17 00:00:00 2001 From: Francis Rowe Date: Thu, 22 Jan 2015 20:36:48 -0500 Subject: grub.cfg: use for loop instead of search for libreboot_grub.cfg Avoids the error messages when the files don't exist. --- (limited to 'resources/grub') diff --git a/resources/grub/config/menuentries/common.cfg b/resources/grub/config/menuentries/common.cfg index 20abd54..a375315 100644 --- a/resources/grub/config/menuentries/common.cfg +++ b/resources/grub/config/menuentries/common.cfg @@ -1,14 +1,23 @@ menuentry 'Load Operating System' { - if search --file --set /boot/grub/libreboot_grub.cfg ; then - configfile /boot/grub/libreboot_grub.cfg - elif search --file --set /grub/libreboot_grub.cfg ; then - configfile /grub/libreboot_grub.cfg - else - set root='ahci0,msdos1' - linux /vmlinuz root=/dev/sda1 rw - if [ -f "/initrd.img" ] ; then - initrd /initrd.img + insmod regexp + insmod ahci + insmod part_msdos + insmod part_gpt + for x in (ahci0,*); do + if [ -f "$x/grub/libreboot_grub.cfg" ] ; then + set root=$x + configfile /grub/libreboot_grub.cfg fi + if [ -f "$x/boot/grub/libreboot_grub.cfg" ] ; then + set root=$x + configfile /boot/grub/libreboot_grub.cfg + fi + done + + set root='ahci0,1' + linux /vmlinuz root=/dev/sda1 rw + if [ -f "/initrd.img" ] ; then + initrd /initrd.img fi } menuentry 'Parse ISOLINUX menu (USB)' { -- cgit v0.9.1