blob: bce6b74a5989ec3919e524334b4265997c4a28ff (
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
# Harmonic Flow's GRUB Configuration
# Prefix --- The location of the "/boot/grub" directory as an absolute file name.
set prefix=(memdisk)/boot/grub
# Load Modules --- Load selected modules which are not loaded due
# to dependencies and which have probably not been pre-loaded.
insmod nativedisk
insmod luks
insmod lvm
insmod ahci
insmod ohci
insmod uhci
insmod ehci
insmod part_msdos
insmod part_gpt
insmod fat
insmod ext2
insmod usbms
insmod usb_keyboard
insmod usbserial_usbdebug
insmod syslinuxcfg
insmod cryptodisk
# Desktop Boards --- Let's load additional modules:
insmod at_keyboard
insmod pata
# Set Environment
set gfxpayload=keep
set pager=1
set default=0
set timeout_style="menu"
set timeout=5
# Terminal Settings
terminal_input --append at_keyboard
terminal_output --append cbmemc
terminal_output --append gfxterm
# GRUB Functions and Menu Options --- borrowed from the Libreboot Project
function try_user_config {
set root="${1}"
for dir in boot grub grub2 boot/grub boot/grub2; do
for name in '' autoboot_ libreboot_ coreboot_; do
if [ -f /"${dir}"/"${name}"grub.cfg ]; then
unset superusers
configfile /"${dir}"/"${name}"grub.cfg
fi
done
done
}
function search_grub {
for i in 0 1; do
# raw devices
try_user_config "(${1}${i})"
for part in 1 2 3 4 5; do
# MBR/GPT partitions
try_user_config "(${1}${i},${part})"
done
done
}
function try_isolinux_config {
set root="${1}"
for dir in '' /boot; do
if [ -f "${dir}"/isolinux/isolinux.cfg ]; then
syslinux_configfile -i "${dir}"/isolinux/isolinux.cfg
elif [ -f "${dir}"/syslinux/syslinux.cfg ]; then
syslinux_configfile -s "${dir}"/syslinux/syslinux.cfg
fi
done
}
function search_isolinux {
for i in 0 1; do
# raw devices
try_isolinux_config "(${1}${i})"
for part in 1 2 3 4 5; do
# MBR/GPT partitions
try_isolinux_config "(${1}${i},${part})"
done
done
}
menuentry '[g] Search GRUB2 Configuration (AHCI)' --hotkey='g' {
search_grub ahci
}
menuentry '[o] Load OS Encrypted /boot.. (default settings)' --hotkey='o' {
cryptomount -a
set root='lvm/matrix-rootvol'
linux /vmlinuz root=/dev/mapper/matrix-rootvol cryptdevice=/dev/mapper/matrix-rootvol:root
initrd /initrd.img
}
menuentry '[i] Load OS Encrypted /boot.. (with iomem=relaxed) ' --hotkey='i' {
cryptomount -a
set root='lvm/matrix-rootvol'
linux /vmlinuz root=/dev/mapper/matrix-rootvol cryptdevice=/dev/mapper/matrix-rootvol:root iomem=relaxed
initrd /initrd.img
}
menuentry '[s] Search GRUB2 Configuration (USB)' --hotkey='s' {
search_grub usb
}
menuentry '[u] Search ISOLINUX Menu (USB)' --hotkey='u' {
search_isolinux usb
}
menuentry '[a] Search ISOLINUX Menu (AHCI)' --hotkey='a' {
search_isolinux ahci
}
menuentry '[d] Search ISOLINUX Menu (CD/DVD)' --hotkey='d' {
try_isolinux_config ahci1
}
menuentry '[p] Poweroff' --hotkey='p' {
halt --no-apm
}
menuentry '[r] Reboot' --hotkey='r' {
reboot
}
|