From ac9f94aab6e3082977ac7e752c834fcd52178ab2 Mon Sep 17 00:00:00 2001 From: Francis Rowe Date: Mon, 26 Jan 2015 11:03:56 +0000 Subject: grub.cfg: hardcode the list of partitions to search For libreboot_grub.cfg or ISOLINUX parsing, the old grub.cfg was using regexp to automatically search all partitions. For example, it was using (ahci0,*). This, and the ls, is extremely slow on some machines. Partition/file access is itself fast, but producing the list can be slow. Therefore, use hardcoded entries like ahci0,1-4 (up to 4) or usb0,1-4 instead of *. This is less flexible, but much faster and it should still work for most people. --- resources/grub/config/menuentries/common.cfg | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'resources/grub/config/menuentries') diff --git a/resources/grub/config/menuentries/common.cfg b/resources/grub/config/menuentries/common.cfg index b0a420c2..da6968c1 100644 --- a/resources/grub/config/menuentries/common.cfg +++ b/resources/grub/config/menuentries/common.cfg @@ -1,9 +1,8 @@ menuentry 'Load Operating System' { - insmod regexp insmod ahci insmod part_msdos insmod part_gpt - for x in (ahci0,*); do + for x in (ahci0,1) (ahci0,2) (ahci0,3) (ahci0,4); do if [ -f "$x/grub/libreboot_grub.cfg" ] ; then set root=$x configfile /grub/libreboot_grub.cfg @@ -21,11 +20,10 @@ menuentry 'Load Operating System' { fi } menuentry 'Parse ISOLINUX menu (USB)' { - insmod regexp insmod usbms insmod part_msdos insmod part_gpt - for x in (usb0) (usb0,*); do + for x in (usb0) (usb0,1) (usb0,2) (usb0,3) (usb0,4); do set root=$x if [ -f "/isolinux/isolinux.cfg" ] ; then syslinux_configfile -i /isolinux/isolinux.cfg @@ -56,12 +54,11 @@ menuentry 'Switch to grubtest.cfg' { configfile (cbfsdisk)/grubtest.cfg } menuentry 'Search for GRUB configuration (grub.cfg) outside of CBFS' { - insmod regexp insmod ahci insmod usbms insmod part_msdos insmod part_gpt - for x in (ahci0,*) (usb0) (usb0,*); do + for x in (ahci0,1) (ahci0,2) (ahci0,3) (ahci0,4) (usb0) (usb0,1) (usb0,2) (usb0,3) (usb0,4); do if [ -f "$x/grub/grub.cfg" ] ; then submenu "Load Config from $x" $x { root=$2 -- cgit v1.2.3-70-g09d2