aboutsummaryrefslogtreecommitdiff
path: root/resources/grub/config
diff options
context:
space:
mode:
authorFrancis Rowe <info@gluglug.org.uk>2015-01-23 01:36:48 +0000
committerFrancis Rowe <info@gluglug.org.uk>2015-01-23 02:15:34 +0000
commite81d95efa1f87c48cf59cd1dae33062231db1cb4 (patch)
treef350a5163641c813c4a6437d8bb2bde89ba81824 /resources/grub/config
parent9ab4f43d845b65d6b939d2cc39f4713c9bd7a3f4 (diff)
downloadlibrebootfr-e81d95efa1f87c48cf59cd1dae33062231db1cb4.tar.gz
librebootfr-e81d95efa1f87c48cf59cd1dae33062231db1cb4.zip
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/grub/config')
-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 20abd547..a3753151 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)' {