forked from biosbits/bits
-
Notifications
You must be signed in to change notification settings - Fork 0
/
boot_ext.cfg
96 lines (84 loc) · 2.51 KB
/
boot_ext.cfg
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
if [ "${grub_platform}" == "pc" ]; then
default="Boot first drive MBR"
fi
timeout=1
timeout_style=hidden
menuentry "Boot first drive MBR, Extended partition" {
set root=(hd1,msdos5)
drivemap (hd1,msdos5) (hd0)
chainloader +1
}
if [ "${grub_platform}" == "pc" ]; then
menuentry 'Linux (autodetect: /etc/passwd)' {
search --set rtmp --file /boot/grub/grubenv
if [ -n "$rtmp" -a -f "($rtmp)/boot/grub/grubenv" ]; then
set root=($rtmp)
else
search --set root --file /grub/grubenv
fi
for i in /boot/vmlinuz-* /vmlinuz-*; do
if [ -f "$i" ]; then
if [ "$i" -nt "$p" ]; then n="$i"; fi
p="$i"
fi
done
regexp -s kver '.*/vmlinuz-(.*)' $n
search --set os --file /etc/passwd
probe --set uuid --fs-uuid $os
linux /vmlinuz-$kver root=UUID=$uuid ro linux quiet splash
initrd /initrd.img-$kver
}
fi
if [ "${grub_platform}" == "pc" ]; then
menuentry 'Linux (seperate "/boot" on Extended partition)' {
search --set os --file /etc/passwd
probe --set uuid --fs-uuid $os
set root=(hd1,msdos5)
for i in /vmlinuz-*; do regexp -s kver '/vmlinuz-(.*)' $i; done
#linux /vmlinuz-$kver root=UUID=$uuid ro linux quiet splash
linux /vmlinuz-$kver root=UUID=$uuid ro linux quiet splash libata.noacpi=1
initrd /initrd.img-$kver
}
fi
menuentry 'Load another configfile (autodetect: grub.cfg)' {
search --set rtmp --file /boot/grub/grubenv
if [ -n "$rtmp" -a -f "($rtmp)/boot/grub/grub.cfg" ]; then
set root=($rtmp)
configfile /boot/grub/grub.cfg
else
search --set rtmp --file /grub/grubenv
if [ -n "$rtmp" -a -f "($rtmp)/grub/grub.cfg" ]; then
set root=($rtmp)
configfile /grub/grub.cfg
fi
fi
}
menuentry 'Chainload MBR from file "linux.bin"' {
search --set root --file /linux.bin
drivemap ($root) (hd0)
chainloader /linux.bin
}
if [ "${grub_platform}" == "pc" ]; then
menuentry "Microsoft Windows Vista/7/8/10 bootmgr (MBR)" {
search --set root --file /Boot/BCD
ntldr /bootmgr
boot
}
fi
if [ "${grub_platform}" == "pc" ]; then
menuentry "Microsoft Windows NT/2000/XP ntldr (MBR)" {
search --s root --file /NTDETECT.COM
drivemap -s hd0 $root
ntldr /ntldr
boot
}
fi
if [ "${grub_platform}" == "efi" ]; then
menuentry "Microsoft Windows UEFI" {
search -s root -f /EFI/Microsoft/Boot/BCD
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
boot
}
fi
if [ -e /boot/cfg/aioboot.cfg ]; then source /boot/cfg/aioboot.cfg; fi
if [ -e /boot/cfg/osdetect.cfg ]; then source /boot/cfg/osdetect.cfg; fi