3 let conf = "# grub.conf generated by anaconda
5 # Note that you do not have to rerun grub after making changes to this file
6 # NOTICE: You have a /boot partition. This means that
7 # all kernel and initrd paths are relative to /boot/, eg.
9 # kernel /vmlinuz-version ro root=/dev/vg00/lv00
10 # initrd /initrd-version.img
12 device (hd0) HD(1,800,64000,9895c137-d4b2-4e3b-a93b-dc9ac4)
13 password --md5 $1$M9NLj$p2gs87vwNv48BUu.wAfVw0
19 splashimage=(hd0,0)/grub/splash.xpm.gz
20 gfxmenu=(hd0,0)/boot/message
23 title Fedora (2.6.24.4-64.fc8)
25 kernel /vmlinuz-2.6.24.4-64.fc8 ro root=/dev/vg00/lv00 crashkernel=
26 initrd /initrd-2.6.24.4-64.fc8.img
27 title=Fedora (2.6.24.3-50.fc8)
29 kernel /vmlinuz-2.6.24.3-50.fc8 ro root=/dev/vg00/lv00
30 initrd /initrd-2.6.24.3-50.fc8.img
31 title Fedora (2.6.21.7-3.fc8xen)
33 kernel /xen.gz-2.6.21.7-3.fc8
34 module /vmlinuz-2.6.21.7-3.fc8xen ro root=/dev/vg00/lv00
35 module /initrd-2.6.21.7-3.fc8xen.img
36 title Fedora (2.6.24.3-34.fc8)
38 kernel /vmlinuz-2.6.24.3-34.fc8 ro root=/dev/vg00/lv00
39 initrd /initrd-2.6.24.3-34.fc8.img
44 configfile /boot/grub/othergrub.conf
47 test Grub.lns get conf =
48 { "#comment" = "grub.conf generated by anaconda" }
50 { "#comment" = "Note that you do not have to rerun grub after making changes to this file" }
51 { "#comment" = "NOTICE: You have a /boot partition. This means that" }
52 { "#comment" = "all kernel and initrd paths are relative to /boot/, eg." }
53 { "#comment" = "root (hd0,0)" }
54 { "#comment" = "kernel /vmlinuz-version ro root=/dev/vg00/lv00" }
55 { "#comment" = "initrd /initrd-version.img" }
56 { "boot" = "/dev/sda" }
58 { "file" = "HD(1,800,64000,9895c137-d4b2-4e3b-a93b-dc9ac4)" } }
59 { "password" = "$1$M9NLj$p2gs87vwNv48BUu.wAfVw0"
65 { "from" = "backquote" } }
66 { "background" = "103332" }
68 { "splashimage" = "(hd0,0)/grub/splash.xpm.gz" }
69 { "gfxmenu" = "(hd0,0)/boot/message" }
72 { "title" = "Fedora (2.6.24.4-64.fc8)"
73 { "root" = "(hd0,0)" }
74 { "kernel" = "/vmlinuz-2.6.24.4-64.fc8"
75 { "ro" } { "root" = "/dev/vg00/lv00" } {"crashkernel" = ""} }
76 { "initrd" = "/initrd-2.6.24.4-64.fc8.img" } }
77 { "title" = "Fedora (2.6.24.3-50.fc8)"
78 { "root" = "(hd0,0)" }
79 { "kernel" = "/vmlinuz-2.6.24.3-50.fc8"
80 { "ro" } { "root" = "/dev/vg00/lv00" } }
81 { "initrd" = "/initrd-2.6.24.3-50.fc8.img" } }
82 { "title" = "Fedora (2.6.21.7-3.fc8xen)"
83 { "root" = "(hd0,0)" }
84 { "kernel" = "/xen.gz-2.6.21.7-3.fc8" }
85 { "module" = "/vmlinuz-2.6.21.7-3.fc8xen"
86 { "ro" } { "root" = "/dev/vg00/lv00" } }
87 { "module" = "/initrd-2.6.21.7-3.fc8xen.img" } }
88 { "title" = "Fedora (2.6.24.3-34.fc8)"
89 { "root" = "(hd0,0)" }
90 { "kernel" = "/vmlinuz-2.6.24.3-34.fc8"
91 { "ro" } { "root" = "/dev/vg00/lv00" } }
92 { "initrd" = "/initrd-2.6.24.3-34.fc8.img" }
93 { "map" { "from" = "(hd0)" } { "to" = "(hd1)" } } }
94 { "title" = "othermenu"
97 { "configfile" = "/boot/grub/othergrub.conf" } }
100 test Grub.lns put conf after set "default" "0" = conf
102 test Grub.lns get "# menu.lst - See: grub(8), info grub, update-grub(8)
105 { "#comment" = "menu.lst - See: grub(8), info grub, update-grub(8)" }
107 { "#comment" = "# default num" }
109 (* Color directive *)
110 test Grub.lns get "color cyan/blue white/blue\n" =
112 { "normal" { "foreground" = "cyan" }
113 { "background" = "blue" } }
114 { "highlight" { "foreground" = "white" }
115 { "background" = "blue" } } }
117 test Grub.lns get "\tcolor cyan/light-blue\n" =
119 { "normal" { "foreground" = "cyan" }
120 { "background" = "light-blue" } } }
122 test Grub.lns put "color cyan/light-blue\n" after
123 set "/color/highlight/foreground" "white";
124 set "/color/highlight/background" "black" =
125 "color cyan/light-blue white/black\n"
127 (* Boot stanza with savedefault *)
128 let boot_savedefault =
129 "title\t\tDebian GNU/Linux, kernel 2.6.18-6-vserver-686
131 kernel\t\t/boot/vmlinuz-2.6.18-6-vserver-686 root=/dev/md0 ro
132 initrd\t\t/boot/initrd.img-2.6.18-6-vserver-686
135 test Grub.lns get boot_savedefault =
136 { "title" = "Debian GNU/Linux, kernel 2.6.18-6-vserver-686"
137 { "root" = "(hd0,0)" }
138 { "kernel" = "/boot/vmlinuz-2.6.18-6-vserver-686"
139 { "root" = "/dev/md0" } { "ro" } }
140 { "initrd" = "/boot/initrd.img-2.6.18-6-vserver-686" }
144 "serial --unit=0 --speed=9600 --word=8 --parity=no --stop=1\n"
154 "terminal --timeout=10 serial console\n" =
160 test Grub.boot_setting get
161 "chainloader --force +1 \n" = { "chainloader" = "+1" { "force" } }
163 test Grub.savedefault put "savedefault\n" after
164 set "/savedefault" "3" = "savedefault 3\n"
168 password foo /boot/grub/custom.lst
169 password --md5 $1$Ahx/T0$Sgcp7Z0xgGlyANIJCdESi.
170 password --encrypted ^9^32kwzzX./3WISQ0C
171 password --encrypted ^9^32kwzzX./3WISQ0C /boot/grub/custom.lst
173 { "password" = "foo" }
175 { "file" = "/boot/grub/custom.lst" } }
176 { "password" = "$1$Ahx/T0$Sgcp7Z0xgGlyANIJCdESi."
178 { "password" = "^9^32kwzzX./3WISQ0C"
180 { "password" = "^9^32kwzzX./3WISQ0C"
182 { "file" = "/boot/grub/custom.lst" } }
184 (* BZ 590067 - handle comments in a title section *)
185 (* Comments within a boot stanza belong to that boot stanza *)
186 test Grub.lns get "title Red Hat Enterprise Linux AS (2.4.21-63.ELsmp)
188 kernel /vmlinuz-2.4.21-63.ELsmp ro root=LABEL=/
189 #initrd /initrd-2.4.21-63.ELsmp.img
190 initrd /initrd-2.4.21-63.EL.img.e1000.8139\n" =
191 { "title" = "Red Hat Enterprise Linux AS (2.4.21-63.ELsmp)"
192 { "root" = "(hd0,0)" }
193 { "kernel" = "/vmlinuz-2.4.21-63.ELsmp" { "ro" } { "root" = "LABEL=/" } }
194 { "#comment" = "initrd /initrd-2.4.21-63.ELsmp.img" }
195 { "initrd" = "/initrd-2.4.21-63.EL.img.e1000.8139" } }
197 (* Comments at the end of a boot stanza go into the top level *)
198 test Grub.lns get "title Red Hat Enterprise Linux AS (2.4.21-63.ELsmp)
200 kernel /vmlinuz-2.4.21-63.ELsmp ro root=LABEL=/
201 initrd /initrd-2.4.21-63.EL.img.e1000.8139
202 # Now for something completely different\n" =
203 { "title" = "Red Hat Enterprise Linux AS (2.4.21-63.ELsmp)"
204 { "root" = "(hd0,0)" }
205 { "kernel" = "/vmlinuz-2.4.21-63.ELsmp" { "ro" } { "root" = "LABEL=/" } }
206 { "initrd" = "/initrd-2.4.21-63.EL.img.e1000.8139" } }
207 { "#comment" = "Now for something completely different" }
209 (* Solaris 10 extensions: kernel$ and module$ are permitted and enable *)
210 (* variable expansion. findroot (similar to root) and bootfs added *)
211 test Grub.lns get "title Solaris 10 10/09 s10x_u8wos_08a X86
212 findroot (pool_rpool,0,a)
213 bootfs rpool/mybootenv-alt
214 kernel$ /platform/i86pc/multiboot -B $ZFS-BOOTFS
215 module$ /platform/i86pc/boot_archive\n" =
216 { "title" = "Solaris 10 10/09 s10x_u8wos_08a X86"
217 { "findroot" = "(pool_rpool,0,a)" }
218 { "bootfs" = "rpool/mybootenv-alt" }
219 { "kernel$" = "/platform/i86pc/multiboot" { "-B" } { "$ZFS-BOOTFS" } }
220 { "module$" = "/platform/i86pc/boot_archive" } }
222 (* Solaris 10 extension: multiboot kernel may take a path as its first *)
224 test Grub.lns get "title Solaris failsafe
225 findroot (pool_rpool,0,a)
226 kernel /boot/multiboot kernel/unix -s
227 module /boot/x86.miniroot-safe\n" =
228 { "title" = "Solaris failsafe"
229 { "findroot" = "(pool_rpool,0,a)" }
230 { "kernel" = "/boot/multiboot" { "@path" = "kernel/unix" } { "-s" } }
231 { "module" = "/boot/x86.miniroot-safe" } }
233 test Grub.lns get "title SUSE Linux Enterprise Server 11 SP1 - 2.6.32.27-0.2
234 kernel (hd0,0)/vmlinuz root=/dev/vg_root/lv_root resume=/dev/vg_root/lv_swap splash=silent showopts
235 initrd (hd0,0)/initrd\n" =
236 { "title" = "SUSE Linux Enterprise Server 11 SP1 - 2.6.32.27-0.2"
237 { "kernel" = "(hd0,0)/vmlinuz"
238 { "root" = "/dev/vg_root/lv_root" }
239 { "resume" = "/dev/vg_root/lv_swap" }
240 { "splash" = "silent" }
242 { "initrd" = "(hd0,0)/initrd" } }
244 (* Password protected kernel, issue #229 *)
245 test Grub.lns get "title Password Protected Kernel
247 kernel /vmlinuz ro root=/dev/mapper/root
249 password --md5 secret\n" =
250 { "title" = "Password Protected Kernel"
251 { "root" = "(hd0,0)" }
252 { "kernel" = "/vmlinuz"
254 { "root" = "/dev/mapper/root" }
256 { "initrd" = "/initramfs" }
257 { "password" = "secret"
261 (* Test kernel options with different special characters. *)
262 test Grub.lns get "title Fedora (2.6.24.4-64.fc8)
264 kernel /vmlinuz-2.6.24.4-64.fc8 ro root=/dev/vg00/lv00 with.dot=1 with-dash=1 with_underscore=1 with+plus=1
265 initrd /initrd-2.6.24.4-64.fc8.img\n" =
266 { "title" = "Fedora (2.6.24.4-64.fc8)"
267 { "root" = "(hd0,0)" }
268 { "kernel" = "/vmlinuz-2.6.24.4-64.fc8"
270 { "root" = "/dev/vg00/lv00" }
272 { "with-dash" = "1" }
273 { "with_underscore" = "1" }
274 { "with+plus" = "1" }
276 { "initrd" = "/initrd-2.6.24.4-64.fc8.img" } }
278 (* Test parsing of invalid entries via menu_error *)
279 test Grub.lns get "default=0\ncrud=no\n" =
281 { "#error" = "crud=no" }
283 (* We handle some pretty bizarre bad syntax *)
284 test Grub.lns get "default=0
288 bad arg1 arg2 arg3=v\n" =
290 { "#error" = "crud no" }
291 { "#error" = "valid:nope" }
292 { "#error" = "nonsense = yes" }
293 { "#error" = "bad arg1 arg2 arg3=v" }
295 (* Test parsing of invalid entries via boot_error *)
296 test Grub.lns get "title test
300 { "root" = "(hd0,0)" }
301 { "#error" = "crud foo" } }