summaryrefslogtreecommitdiffstats
path: root/test/parser
diff options
context:
space:
mode:
authorGeoff Levand <geoff@infradead.org>2012-03-18 22:58:29 -0700
committerGeoff Levand <geoff@infradead.org>2012-03-18 22:58:29 -0700
commitb49b9c92416ce4b65642dd3395becb4ea083dc2b (patch)
tree692b8e465246ea259603c3cf82859a485b36a6bf /test/parser
parent8bd85461621fb0ff18059305a6c1aecdbc18016c (diff)
downloadtalos-petitboot-b49b9c92416ce4b65642dd3395becb4ea083dc2b.tar.gz
talos-petitboot-b49b9c92416ce4b65642dd3395becb4ea083dc2b.zip
Add grub2 conf file parser
Add grub2 parser and sample config file. Reorder parser priorities: From (yaboot -> kboot) to (kboot -> grub2 -> yaboot). Signed-off-by: Geoff Levand <geoff@infradead.org>
Diffstat (limited to 'test/parser')
-rw-r--r--test/parser/Makefile.am1
-rw-r--r--test/parser/data/grub-01/grub.cfg300
2 files changed, 301 insertions, 0 deletions
diff --git a/test/parser/Makefile.am b/test/parser/Makefile.am
index 107e8f1..e863773 100644
--- a/test/parser/Makefile.am
+++ b/test/parser/Makefile.am
@@ -31,6 +31,7 @@ parser_test_SOURCES = parser-test.c
parser_test_LDADD = $(common_libs)
noinst_DATA = \
+ data/grub-01/grub.cfg \
data/kboot-01/expected-output \
data/kboot-01/etc/kboot.conf \
data/kboot-02/expected-output \
diff --git a/test/parser/data/grub-01/grub.cfg b/test/parser/data/grub-01/grub.cfg
new file mode 100644
index 0000000..57d6a8b
--- /dev/null
+++ b/test/parser/data/grub-01/grub.cfg
@@ -0,0 +1,300 @@
+#
+# DO NOT EDIT THIS FILE
+#
+# It is automatically generated by grub-mkconfig using templates
+# from /etc/grub.d and settings from /etc/default/grub
+#
+
+### BEGIN /etc/grub.d/00_header ###
+if [ -s $prefix/grubenv ]; then
+ set have_grubenv=true
+ load_env
+fi
+set default="0"
+if [ "${prev_saved_entry}" ]; then
+ set saved_entry="${prev_saved_entry}"
+ save_env saved_entry
+ set prev_saved_entry=
+ save_env prev_saved_entry
+ set boot_once=true
+fi
+
+function savedefault {
+ if [ -z "${boot_once}" ]; then
+ saved_entry="${chosen}"
+ save_env saved_entry
+ fi
+}
+
+function recordfail {
+ set recordfail=1
+ if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
+}
+
+function load_video {
+ insmod vbe
+ insmod vga
+ insmod video_bochs
+ insmod video_cirrus
+}
+
+terminal_input console
+terminal_output console
+if [ "${recordfail}" = 1 ]; then
+ set timeout=-1
+else
+ set timeout=30
+fi
+play 480 440 1
+### END /etc/grub.d/00_header ###
+
+### BEGIN /etc/grub.d/05_debian_theme ###
+set menu_color_normal=white/black
+set menu_color_highlight=black/light-gray
+if background_color 0,71,115; then
+ clear
+fi
+### END /etc/grub.d/05_debian_theme ###
+
+### BEGIN /etc/grub.d/10_linux ###
+if [ ${recordfail} != 1 ]; then
+ if [ -e ${prefix}/gfxblacklist.txt ]; then
+ if hwmatch ${prefix}/gfxblacklist.txt 3; then
+ if [ ${match} = 0 ]; then
+ set linux_gfx_mode=keep
+ else
+ set linux_gfx_mode=text
+ fi
+ else
+ set linux_gfx_mode=text
+ fi
+ else
+ set linux_gfx_mode=keep
+ fi
+else
+ set linux_gfx_mode=text
+fi
+export linux_gfx_mode
+if [ "$linux_gfx_mode" != "text" ]; then load_video; fi
+menuentry 'Ubuntu, with Linux 3.2.0-18-generic' --class ubuntu --class gnu-linux --class gnu --class os {
+ recordfail
+ set gfxpayload=$linux_gfx_mode
+ insmod gzio
+ insmod part_gpt
+ insmod ext2
+ set root='(hd0,gpt2)'
+ search --no-floppy --fs-uuid --set=root 2ceaeb4b-f75d-431c-bcde-210f83d7c1e1
+ linux /boot/vmlinuz-3.2.0-18-generic root=UUID=2ceaeb4b-f75d-431c-bcde-210f83d7c1e1 ro
+ initrd /boot/initrd.img-3.2.0-18-generic
+}
+menuentry 'Ubuntu, with Linux 3.2.0-18-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
+ recordfail
+ insmod gzio
+ insmod part_gpt
+ insmod ext2
+ set root='(hd0,gpt2)'
+ search --no-floppy --fs-uuid --set=root 2ceaeb4b-f75d-431c-bcde-210f83d7c1e1
+ echo 'Loading Linux 3.2.0-18-generic ...'
+ linux /boot/vmlinuz-3.2.0-18-generic root=UUID=2ceaeb4b-f75d-431c-bcde-210f83d7c1e1 ro recovery nomodeset
+ echo 'Loading initial ramdisk ...'
+ initrd /boot/initrd.img-3.2.0-18-generic
+}
+submenu "Previous Linux versions" {
+menuentry 'Ubuntu, with Linux 3.2.0-17-generic' --class ubuntu --class gnu-linux --class gnu --class os {
+ recordfail
+ set gfxpayload=$linux_gfx_mode
+ insmod gzio
+ insmod part_gpt
+ insmod ext2
+ set root='(hd0,gpt2)'
+ search --no-floppy --fs-uuid --set=root 2ceaeb4b-f75d-431c-bcde-210f83d7c1e1
+ linux /boot/vmlinuz-3.2.0-17-generic root=UUID=2ceaeb4b-f75d-431c-bcde-210f83d7c1e1 ro
+ initrd /boot/initrd.img-3.2.0-17-generic
+}
+menuentry 'Ubuntu, with Linux 3.2.0-17-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
+ recordfail
+ insmod gzio
+ insmod part_gpt
+ insmod ext2
+ set root='(hd0,gpt2)'
+ search --no-floppy --fs-uuid --set=root 2ceaeb4b-f75d-431c-bcde-210f83d7c1e1
+ echo 'Loading Linux 3.2.0-17-generic ...'
+ linux /boot/vmlinuz-3.2.0-17-generic root=UUID=2ceaeb4b-f75d-431c-bcde-210f83d7c1e1 ro recovery nomodeset
+ echo 'Loading initial ramdisk ...'
+ initrd /boot/initrd.img-3.2.0-17-generic
+}
+menuentry 'Ubuntu, with Linux 3.2.0-16-generic' --class ubuntu --class gnu-linux --class gnu --class os {
+ recordfail
+ set gfxpayload=$linux_gfx_mode
+ insmod gzio
+ insmod part_gpt
+ insmod ext2
+ set root='(hd0,gpt2)'
+ search --no-floppy --fs-uuid --set=root 2ceaeb4b-f75d-431c-bcde-210f83d7c1e1
+ linux /boot/vmlinuz-3.2.0-16-generic root=UUID=2ceaeb4b-f75d-431c-bcde-210f83d7c1e1 ro
+ initrd /boot/initrd.img-3.2.0-16-generic
+}
+menuentry 'Ubuntu, with Linux 3.2.0-16-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
+ recordfail
+ insmod gzio
+ insmod part_gpt
+ insmod ext2
+ set root='(hd0,gpt2)'
+ search --no-floppy --fs-uuid --set=root 2ceaeb4b-f75d-431c-bcde-210f83d7c1e1
+ echo 'Loading Linux 3.2.0-16-generic ...'
+ linux /boot/vmlinuz-3.2.0-16-generic root=UUID=2ceaeb4b-f75d-431c-bcde-210f83d7c1e1 ro recovery nomodeset
+ echo 'Loading initial ramdisk ...'
+ initrd /boot/initrd.img-3.2.0-16-generic
+}
+menuentry 'Ubuntu, with Linux 3.2.0-15-generic' --class ubuntu --class gnu-linux --class gnu --class os {
+ recordfail
+ set gfxpayload=$linux_gfx_mode
+ insmod gzio
+ insmod part_gpt
+ insmod ext2
+ set root='(hd0,gpt2)'
+ search --no-floppy --fs-uuid --set=root 2ceaeb4b-f75d-431c-bcde-210f83d7c1e1
+ linux /boot/vmlinuz-3.2.0-15-generic root=UUID=2ceaeb4b-f75d-431c-bcde-210f83d7c1e1 ro
+ initrd /boot/initrd.img-3.2.0-15-generic
+}
+menuentry 'Ubuntu, with Linux 3.2.0-15-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
+ recordfail
+ insmod gzio
+ insmod part_gpt
+ insmod ext2
+ set root='(hd0,gpt2)'
+ search --no-floppy --fs-uuid --set=root 2ceaeb4b-f75d-431c-bcde-210f83d7c1e1
+ echo 'Loading Linux 3.2.0-15-generic ...'
+ linux /boot/vmlinuz-3.2.0-15-generic root=UUID=2ceaeb4b-f75d-431c-bcde-210f83d7c1e1 ro recovery nomodeset
+ echo 'Loading initial ramdisk ...'
+ initrd /boot/initrd.img-3.2.0-15-generic
+}
+menuentry 'Ubuntu, with Linux 3.2.0-12-generic' --class ubuntu --class gnu-linux --class gnu --class os {
+ recordfail
+ set gfxpayload=$linux_gfx_mode
+ insmod gzio
+ insmod part_gpt
+ insmod ext2
+ set root='(hd0,gpt2)'
+ search --no-floppy --fs-uuid --set=root 2ceaeb4b-f75d-431c-bcde-210f83d7c1e1
+ linux /boot/vmlinuz-3.2.0-12-generic root=UUID=2ceaeb4b-f75d-431c-bcde-210f83d7c1e1 ro
+ initrd /boot/initrd.img-3.2.0-12-generic
+}
+menuentry 'Ubuntu, with Linux 3.2.0-12-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
+ recordfail
+ insmod gzio
+ insmod part_gpt
+ insmod ext2
+ set root='(hd0,gpt2)'
+ search --no-floppy --fs-uuid --set=root 2ceaeb4b-f75d-431c-bcde-210f83d7c1e1
+ echo 'Loading Linux 3.2.0-12-generic ...'
+ linux /boot/vmlinuz-3.2.0-12-generic root=UUID=2ceaeb4b-f75d-431c-bcde-210f83d7c1e1 ro recovery nomodeset
+ echo 'Loading initial ramdisk ...'
+ initrd /boot/initrd.img-3.2.0-12-generic
+}
+menuentry 'Ubuntu, with Linux 3.2.0-11-generic' --class ubuntu --class gnu-linux --class gnu --class os {
+ recordfail
+ set gfxpayload=$linux_gfx_mode
+ insmod gzio
+ insmod part_gpt
+ insmod ext2
+ set root='(hd0,gpt2)'
+ search --no-floppy --fs-uuid --set=root 2ceaeb4b-f75d-431c-bcde-210f83d7c1e1
+ linux /boot/vmlinuz-3.2.0-11-generic root=UUID=2ceaeb4b-f75d-431c-bcde-210f83d7c1e1 ro
+ initrd /boot/initrd.img-3.2.0-11-generic
+}
+menuentry 'Ubuntu, with Linux 3.2.0-11-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
+ recordfail
+ insmod gzio
+ insmod part_gpt
+ insmod ext2
+ set root='(hd0,gpt2)'
+ search --no-floppy --fs-uuid --set=root 2ceaeb4b-f75d-431c-bcde-210f83d7c1e1
+ echo 'Loading Linux 3.2.0-11-generic ...'
+ linux /boot/vmlinuz-3.2.0-11-generic root=UUID=2ceaeb4b-f75d-431c-bcde-210f83d7c1e1 ro recovery nomodeset
+ echo 'Loading initial ramdisk ...'
+ initrd /boot/initrd.img-3.2.0-11-generic
+}
+menuentry 'Ubuntu, with Linux 3.2.0-10-generic' --class ubuntu --class gnu-linux --class gnu --class os {
+ recordfail
+ set gfxpayload=$linux_gfx_mode
+ insmod gzio
+ insmod part_gpt
+ insmod ext2
+ set root='(hd0,gpt2)'
+ search --no-floppy --fs-uuid --set=root 2ceaeb4b-f75d-431c-bcde-210f83d7c1e1
+ linux /boot/vmlinuz-3.2.0-10-generic root=UUID=2ceaeb4b-f75d-431c-bcde-210f83d7c1e1 ro
+ initrd /boot/initrd.img-3.2.0-10-generic
+}
+menuentry 'Ubuntu, with Linux 3.2.0-10-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
+ recordfail
+ insmod gzio
+ insmod part_gpt
+ insmod ext2
+ set root='(hd0,gpt2)'
+ search --no-floppy --fs-uuid --set=root 2ceaeb4b-f75d-431c-bcde-210f83d7c1e1
+ echo 'Loading Linux 3.2.0-10-generic ...'
+ linux /boot/vmlinuz-3.2.0-10-generic root=UUID=2ceaeb4b-f75d-431c-bcde-210f83d7c1e1 ro recovery nomodeset
+ echo 'Loading initial ramdisk ...'
+ initrd /boot/initrd.img-3.2.0-10-generic
+}
+menuentry 'Ubuntu, with Linux 3.2.0-9-generic' --class ubuntu --class gnu-linux --class gnu --class os {
+ recordfail
+ set gfxpayload=$linux_gfx_mode
+ insmod gzio
+ insmod part_gpt
+ insmod ext2
+ set root='(hd0,gpt2)'
+ search --no-floppy --fs-uuid --set=root 2ceaeb4b-f75d-431c-bcde-210f83d7c1e1
+ linux /boot/vmlinuz-3.2.0-9-generic root=UUID=2ceaeb4b-f75d-431c-bcde-210f83d7c1e1 ro
+ initrd /boot/initrd.img-3.2.0-9-generic
+}
+menuentry 'Ubuntu, with Linux 3.2.0-9-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
+ recordfail
+ insmod gzio
+ insmod part_gpt
+ insmod ext2
+ set root='(hd0,gpt2)'
+ search --no-floppy --fs-uuid --set=root 2ceaeb4b-f75d-431c-bcde-210f83d7c1e1
+ echo 'Loading Linux 3.2.0-9-generic ...'
+ linux /boot/vmlinuz-3.2.0-9-generic root=UUID=2ceaeb4b-f75d-431c-bcde-210f83d7c1e1 ro recovery nomodeset
+ echo 'Loading initial ramdisk ...'
+ initrd /boot/initrd.img-3.2.0-9-generic
+}
+}
+### END /etc/grub.d/10_linux ###
+
+### BEGIN /etc/grub.d/20_linux_xen ###
+### END /etc/grub.d/20_linux_xen ###
+
+### BEGIN /etc/grub.d/20_memtest86+ ###
+menuentry "Memory test (memtest86+)" {
+ insmod part_gpt
+ insmod ext2
+ set root='(hd0,gpt2)'
+ search --no-floppy --fs-uuid --set=root 2ceaeb4b-f75d-431c-bcde-210f83d7c1e1
+ linux16 /boot/memtest86+.bin
+}
+menuentry "Memory test (memtest86+, serial console 115200)" {
+ insmod part_gpt
+ insmod ext2
+ set root='(hd0,gpt2)'
+ search --no-floppy --fs-uuid --set=root 2ceaeb4b-f75d-431c-bcde-210f83d7c1e1
+ linux16 /boot/memtest86+.bin console=ttyS0,115200n8
+}
+### END /etc/grub.d/20_memtest86+ ###
+
+### BEGIN /etc/grub.d/30_os-prober ###
+### END /etc/grub.d/30_os-prober ###
+
+### BEGIN /etc/grub.d/40_custom ###
+# This file provides an easy way to add custom menu entries. Simply type the
+# menu entries you want to add after this comment. Be careful not to change
+# the 'exec tail' line above.
+### END /etc/grub.d/40_custom ###
+
+### BEGIN /etc/grub.d/41_custom ###
+if [ -f $prefix/custom.cfg ]; then
+ source $prefix/custom.cfg;
+fi
+### END /etc/grub.d/41_custom ###
OpenPOWER on IntegriCloud