summaryrefslogtreecommitdiffstats
path: root/resources
diff options
context:
space:
mode:
authorFrancis Rowe <info@gluglug.org.uk>2015-01-22 20:36:48 (EST)
committer Francis Rowe <info@gluglug.org.uk>2015-01-22 21:15:34 (EST)
commite81d95efa1f87c48cf59cd1dae33062231db1cb4 (patch)
treef350a5163641c813c4a6437d8bb2bde89ba81824 /resources
parent9ab4f43d845b65d6b939d2cc39f4713c9bd7a3f4 (diff)
downloadlibreboot-e81d95efa1f87c48cf59cd1dae33062231db1cb4.zip
libreboot-e81d95efa1f87c48cf59cd1dae33062231db1cb4.tar.gz
libreboot-e81d95efa1f87c48cf59cd1dae33062231db1cb4.tar.bz2
grub.cfg: use for loop instead of search for libreboot_grub.cfg
Avoids the error messages when the files don't exist.
Diffstat (limited to 'resources')
-rw-r--r--resources/grub/config/menuentries/common.cfg27
1 files changed, 18 insertions, 9 deletions
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)' {