summaryrefslogtreecommitdiffstats
path: root/resources/grub/config/menuentries/common.cfg
blob: e019d040ad5420ad6beaeab86cfa0b0dbcbf4063 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
menuentry 'Load Operating System' {
	insmod ahci
	insmod part_msdos
	insmod part_gpt
	for x in (ahci0,1) (ahci0,2) (ahci0,3) (ahci0,4); do
		for path in "/grub/libreboot_grub.cfg" "/boot/grub/libreboot_grub.cfg" "/grub/grub.cfg" "/boot/grub/grub.cfg"; do
			if [ -f "${x}${path}" ] ; then
				set root=${x}
				configfile ${path}
			fi
		done
	done

	set root='ahci0,1'
	for path in "" "/boot"; do
		if [ -f "${path}/vmlinuz" ]; then
			linux ${path}/vmlinuz root=/dev/sda1 rw
			if [ -f "${path}/initrd.img" ]; then
				initrd ${path}/initrd.img
			fi
		fi
	done
}
menuentry 'Parse ISOLINUX menu (ahci0)' {
	insmod ahci
	insmod part_msdos
	insmod part_gpt
	for x in (ahci0,1) (ahci0,2) (ahci0,3) (ahci0,4); do
		set root=$x
		for path in "/isolinux/isolinux.cfg" "/syslinux/syslinux.cfg" "/boot/isolinux/isolinux.cfg" "/boot/syslinux/syslinux.cfg"; do
			if [ -f "${path}" ]; then
				syslinux_configfile -i ${path}
			fi
		done
	done
}
menuentry 'Parse ISOLINUX menu (USB)' {
	insmod usbms
	insmod part_msdos
	insmod part_gpt
	for x in (usb0) (usb0,1) (usb0,2) (usb0,3) (usb0,4); do
		set root=$x
		for path in "/isolinux/isolinux.cfg" "/syslinux/syslinux.cfg" "/boot/isolinux/isolinux.cfg" "/boot/syslinux/syslinux.cfg"; do
			if [ -f "${path}" ]; then
				syslinux_configfile -i ${path}
			fi
		done
	done
}
menuentry 'Parse ISOLINUX menu (CD/DVD)' {
	insmod ahci
	insmod ata
	insmod iso9660
	for x in (ata0) (ahci1); do
		set root=$x
		for path in "/isolinux/isolinux.cfg" "/syslinux/syslinux.cfg" "/boot/isolinux/isolinux.cfg" "/boot/syslinux/syslinux.cfg"; do
			if [ -f "${path}" ]; then
				syslinux_configfile -i ${path}
			fi
		done
	done
}
menuentry 'Switch to grubtest.cfg' {
	set root='cbfsdisk'
	configfile (cbfsdisk)/grubtest.cfg
}
menuentry 'Search for GRUB configuration (grub.cfg) outside of CBFS' {
	insmod ahci
	insmod usbms
	insmod part_msdos
	insmod part_gpt
	for x in (ahci0,1) (ahci0,2) (ahci0,3) (ahci0,4) (usb0) (usb0,1) (usb0,2) (usb0,3) (usb0,4); do
		for path in "/grub/grub.cfg" "/boot/grub/grub.cfg" "/grub2/grub.cfg" "/boot/grub2/grub.cfg"; do
			if [ -f "${x}${path}" ] ; then
				submenu "Load Config from $x" $x {
					root=$2
					source ${path}
					unset superusers
				}
			fi
		done
	done
}