|
|
3e90b9 |
From e319f73ca691b9cc138def3a9c19f1cb6e581475 Mon Sep 17 00:00:00 2001
|
|
|
3e90b9 |
From: Gene Czarcinski <gczarcinski@gmail.com>
|
|
|
3e90b9 |
Date: Mon, 9 Jun 2014 21:11:37 -0400
|
|
|
3e90b9 |
Subject: [PATCH 4/8] Add tests for btrfs support
|
|
|
3e90b9 |
|
|
|
3e90b9 |
The tests performed are:
|
|
|
3e90b9 |
- add kernel with /boot on btrfs subvol (20)
|
|
|
3e90b9 |
- update kernel/add initrd with /boot on btrfs subvol (21)
|
|
|
3e90b9 |
- add kernel with rootfs on btrfs subvol and /boot a directory (22)
|
|
|
3e90b9 |
- update kernel/add initrd with rootfs on btrfs subvol and
|
|
|
3e90b9 |
/boot a directory (23)
|
|
|
3e90b9 |
- add kernel and initrd with /boot on btrfs subvol (24)
|
|
|
3e90b9 |
- add kernel and initrd with rootfs on btrfs subvol and /boot
|
|
|
3e90b9 |
a directory (25)
|
|
|
3e90b9 |
---
|
|
|
3e90b9 |
test.sh | 40 +++++++
|
|
|
3e90b9 |
test/grub2-support_files/g2.20-mounts | 2 +
|
|
|
3e90b9 |
test/grub2-support_files/g2.21-mounts | 1 +
|
|
|
3e90b9 |
test/grub2-support_files/g2.22-mounts | 1 +
|
|
|
3e90b9 |
test/grub2-support_files/g2.23-mounts | 1 +
|
|
|
3e90b9 |
test/grub2-support_files/g2.24-mounts | 1 +
|
|
|
3e90b9 |
test/grub2-support_files/g2.25-mounts | 1 +
|
|
|
3e90b9 |
test/grub2.20 | 126 ++++++++++++++++++++++
|
|
|
3e90b9 |
test/grub2.21 | 140 +++++++++++++++++++++++++
|
|
|
3e90b9 |
test/grub2.22 | 128 +++++++++++++++++++++++
|
|
|
3e90b9 |
test/grub2.23 | 143 +++++++++++++++++++++++++
|
|
|
3e90b9 |
test/grub2.24 | 126 ++++++++++++++++++++++
|
|
|
3e90b9 |
test/grub2.25 | 128 +++++++++++++++++++++++
|
|
|
3e90b9 |
test/results/add/g2-1.20 | 140 +++++++++++++++++++++++++
|
|
|
3e90b9 |
test/results/add/g2-1.21 | 141 +++++++++++++++++++++++++
|
|
|
3e90b9 |
test/results/add/g2-1.22 | 143 +++++++++++++++++++++++++
|
|
|
3e90b9 |
test/results/add/g2-1.23 | 144 ++++++++++++++++++++++++++
|
|
|
3e90b9 |
test/results/add/g2-1.24 | 141 +++++++++++++++++++++++++
|
|
|
3e90b9 |
test/results/add/g2-1.25 | 144 ++++++++++++++++++++++++++
|
|
|
3e90b9 |
19 files changed, 1691 insertions(+)
|
|
|
3e90b9 |
create mode 100644 test/grub2-support_files/g2.20-mounts
|
|
|
3e90b9 |
create mode 120000 test/grub2-support_files/g2.21-mounts
|
|
|
3e90b9 |
create mode 100644 test/grub2-support_files/g2.22-mounts
|
|
|
3e90b9 |
create mode 120000 test/grub2-support_files/g2.23-mounts
|
|
|
3e90b9 |
create mode 120000 test/grub2-support_files/g2.24-mounts
|
|
|
3e90b9 |
create mode 120000 test/grub2-support_files/g2.25-mounts
|
|
|
3e90b9 |
create mode 100644 test/grub2.20
|
|
|
3e90b9 |
create mode 100644 test/grub2.21
|
|
|
3e90b9 |
create mode 100644 test/grub2.22
|
|
|
3e90b9 |
create mode 100644 test/grub2.23
|
|
|
3e90b9 |
create mode 100644 test/grub2.24
|
|
|
3e90b9 |
create mode 100644 test/grub2.25
|
|
|
3e90b9 |
create mode 100644 test/results/add/g2-1.20
|
|
|
3e90b9 |
create mode 100644 test/results/add/g2-1.21
|
|
|
3e90b9 |
create mode 100644 test/results/add/g2-1.22
|
|
|
3e90b9 |
create mode 100644 test/results/add/g2-1.23
|
|
|
3e90b9 |
create mode 100644 test/results/add/g2-1.24
|
|
|
3e90b9 |
create mode 100644 test/results/add/g2-1.25
|
|
|
3e90b9 |
|
|
|
3e90b9 |
diff --git a/test.sh b/test.sh
|
|
|
3e90b9 |
index 6379698c6de..c35bfca1c89 100755
|
|
|
3e90b9 |
--- a/test.sh
|
|
|
3e90b9 |
+++ b/test.sh
|
|
|
3e90b9 |
@@ -629,6 +629,46 @@ if [ "$testgrub2" == "y" ]; then
|
|
|
3e90b9 |
--initrd /boot/initramfs-0-rescue-5a94251776a14678911d4ae0949500f5.img \
|
|
|
3e90b9 |
--copy-default --title "Fedora 21 Rescue" --args=root=/fooooo \
|
|
|
3e90b9 |
--remove-kernel=wtf --boot-filesystem=/boot/
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+ testing="GRUB2 add kernel with boot on btrfs subvol"
|
|
|
3e90b9 |
+ grub2Test grub2.20 add/g2-1.20 --add-kernel=/boot/new-kernel.img \
|
|
|
3e90b9 |
+ --title='title' \
|
|
|
3e90b9 |
+ --boot-filesystem=/boot/ \
|
|
|
3e90b9 |
+ --copy-default \
|
|
|
3e90b9 |
+ --mounts='test/grub2-support_files/g2.20-mounts'
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+ testing="GRUB2 add initrd with boot on btrfs subvol"
|
|
|
3e90b9 |
+ grub2Test grub2.21 add/g2-1.21 --update-kernel=/boot/new-kernel.img \
|
|
|
3e90b9 |
+ --initrd=/boot/new-initrd --boot-filesystem=/boot/ \
|
|
|
3e90b9 |
+ --mounts='test/grub2-support_files/g2.21-mounts'
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+ testing="GRUB2 add kernel with rootfs on btrfs subvol and boot directory"
|
|
|
3e90b9 |
+ grub2Test grub2.22 add/g2-1.22 --add-kernel=/boot/new-kernel.img \
|
|
|
3e90b9 |
+ --title='title' \
|
|
|
3e90b9 |
+ --boot-filesystem= \
|
|
|
3e90b9 |
+ --copy-default \
|
|
|
3e90b9 |
+ --mounts='test/grub2-support_files/g2.22-mounts'
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+ testing="GRUB2 add initrd with rootfs on btrfs subvol and boot directory"
|
|
|
3e90b9 |
+ grub2Test grub2.23 add/g2-1.23 --update-kernel=/boot/new-kernel.img \
|
|
|
3e90b9 |
+ --initrd=/boot/new-initrd --boot-filesystem= \
|
|
|
3e90b9 |
+ --mounts='test/grub2-support_files/g2.23-mounts'
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+ testing="GRUB2 add kernel and initrd with boot on btrfs subvol"
|
|
|
3e90b9 |
+ grub2Test grub2.24 add/g2-1.24 --add-kernel=/boot/new-kernel.img \
|
|
|
3e90b9 |
+ --title='title' \
|
|
|
3e90b9 |
+ --initrd=/boot/new-initrd \
|
|
|
3e90b9 |
+ --boot-filesystem=/boot/ \
|
|
|
3e90b9 |
+ --copy-default \
|
|
|
3e90b9 |
+ --mounts='test/grub2-support_files/g2.24-mounts'
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+ testing="GRUB2 add kernel and initrd with rootfs on btrfs subvol and boot directory"
|
|
|
3e90b9 |
+ grub2Test grub2.25 add/g2-1.25 --add-kernel=/boot/new-kernel.img \
|
|
|
3e90b9 |
+ --title='title' \
|
|
|
3e90b9 |
+ --initrd=/boot/new-initrd \
|
|
|
3e90b9 |
+ --boot-filesystem= \
|
|
|
3e90b9 |
+ --copy-default \
|
|
|
3e90b9 |
+ --mounts='test/grub2-support_files/g2.25-mounts'
|
|
|
3e90b9 |
fi
|
|
|
3e90b9 |
fi
|
|
|
3e90b9 |
|
|
|
3e90b9 |
diff --git a/test/grub2-support_files/g2.20-mounts b/test/grub2-support_files/g2.20-mounts
|
|
|
3e90b9 |
new file mode 100644
|
|
|
3e90b9 |
index 00000000000..00bdb48e4ab
|
|
|
3e90b9 |
--- /dev/null
|
|
|
3e90b9 |
+++ b/test/grub2-support_files/g2.20-mounts
|
|
|
3e90b9 |
@@ -0,0 +1,2 @@
|
|
|
3e90b9 |
+/dev/sda / btrfs subvol=/root6,defaults 0 0
|
|
|
3e90b9 |
+/dev/sda /boot btrfs subvol=/boot6,defaults 0 0
|
|
|
3e90b9 |
diff --git a/test/grub2-support_files/g2.21-mounts b/test/grub2-support_files/g2.21-mounts
|
|
|
3e90b9 |
new file mode 120000
|
|
|
3e90b9 |
index 00000000000..42ef3fd4272
|
|
|
3e90b9 |
--- /dev/null
|
|
|
3e90b9 |
+++ b/test/grub2-support_files/g2.21-mounts
|
|
|
3e90b9 |
@@ -0,0 +1 @@
|
|
|
3e90b9 |
+g2.20-mounts
|
|
|
3e90b9 |
\ No newline at end of file
|
|
|
3e90b9 |
diff --git a/test/grub2-support_files/g2.22-mounts b/test/grub2-support_files/g2.22-mounts
|
|
|
3e90b9 |
new file mode 100644
|
|
|
3e90b9 |
index 00000000000..5b664e72519
|
|
|
3e90b9 |
--- /dev/null
|
|
|
3e90b9 |
+++ b/test/grub2-support_files/g2.22-mounts
|
|
|
3e90b9 |
@@ -0,0 +1 @@
|
|
|
3e90b9 |
+/dev/sda / btrfs defaults,subvol=/root4,ro 0 0
|
|
|
3e90b9 |
diff --git a/test/grub2-support_files/g2.23-mounts b/test/grub2-support_files/g2.23-mounts
|
|
|
3e90b9 |
new file mode 120000
|
|
|
3e90b9 |
index 00000000000..74f036fc4a3
|
|
|
3e90b9 |
--- /dev/null
|
|
|
3e90b9 |
+++ b/test/grub2-support_files/g2.23-mounts
|
|
|
3e90b9 |
@@ -0,0 +1 @@
|
|
|
3e90b9 |
+g2.22-mounts
|
|
|
3e90b9 |
\ No newline at end of file
|
|
|
3e90b9 |
diff --git a/test/grub2-support_files/g2.24-mounts b/test/grub2-support_files/g2.24-mounts
|
|
|
3e90b9 |
new file mode 120000
|
|
|
3e90b9 |
index 00000000000..42ef3fd4272
|
|
|
3e90b9 |
--- /dev/null
|
|
|
3e90b9 |
+++ b/test/grub2-support_files/g2.24-mounts
|
|
|
3e90b9 |
@@ -0,0 +1 @@
|
|
|
3e90b9 |
+g2.20-mounts
|
|
|
3e90b9 |
\ No newline at end of file
|
|
|
3e90b9 |
diff --git a/test/grub2-support_files/g2.25-mounts b/test/grub2-support_files/g2.25-mounts
|
|
|
3e90b9 |
new file mode 120000
|
|
|
3e90b9 |
index 00000000000..74f036fc4a3
|
|
|
3e90b9 |
--- /dev/null
|
|
|
3e90b9 |
+++ b/test/grub2-support_files/g2.25-mounts
|
|
|
3e90b9 |
@@ -0,0 +1 @@
|
|
|
3e90b9 |
+g2.22-mounts
|
|
|
3e90b9 |
\ No newline at end of file
|
|
|
3e90b9 |
diff --git a/test/grub2.20 b/test/grub2.20
|
|
|
3e90b9 |
new file mode 100644
|
|
|
3e90b9 |
index 00000000000..23b75fa8d3c
|
|
|
3e90b9 |
--- /dev/null
|
|
|
3e90b9 |
+++ b/test/grub2.20
|
|
|
3e90b9 |
@@ -0,0 +1,126 @@
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+# DO NOT EDIT THIS FILE
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+# It is automatically generated by grub2-mkconfig using templates
|
|
|
3e90b9 |
+# from /etc/grub.d and settings from /etc/default/grub
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/00_header ###
|
|
|
3e90b9 |
+set pager=1
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ -s $prefix/grubenv ]; then
|
|
|
3e90b9 |
+ load_env
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+if [ "${next_entry}" ] ; then
|
|
|
3e90b9 |
+ set default="${next_entry}"
|
|
|
3e90b9 |
+ set next_entry=
|
|
|
3e90b9 |
+ save_env next_entry
|
|
|
3e90b9 |
+ set boot_once=true
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ set default="${saved_entry}"
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ x"${feature_menuentry_id}" = xy ]; then
|
|
|
3e90b9 |
+ menuentry_id_option="--id"
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ menuentry_id_option=""
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+export menuentry_id_option
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ "${prev_saved_entry}" ]; then
|
|
|
3e90b9 |
+ set saved_entry="${prev_saved_entry}"
|
|
|
3e90b9 |
+ save_env saved_entry
|
|
|
3e90b9 |
+ set prev_saved_entry=
|
|
|
3e90b9 |
+ save_env prev_saved_entry
|
|
|
3e90b9 |
+ set boot_once=true
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+function savedefault {
|
|
|
3e90b9 |
+ if [ -z "${boot_once}" ]; then
|
|
|
3e90b9 |
+ saved_entry="${chosen}"
|
|
|
3e90b9 |
+ save_env saved_entry
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+function load_video {
|
|
|
3e90b9 |
+ if [ x$feature_all_video_module = xy ]; then
|
|
|
3e90b9 |
+ insmod all_video
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ insmod efi_gop
|
|
|
3e90b9 |
+ insmod efi_uga
|
|
|
3e90b9 |
+ insmod ieee1275_fb
|
|
|
3e90b9 |
+ insmod vbe
|
|
|
3e90b9 |
+ insmod vga
|
|
|
3e90b9 |
+ insmod video_bochs
|
|
|
3e90b9 |
+ insmod video_cirrus
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+terminal_output console
|
|
|
3e90b9 |
+if [ x$feature_timeout_style = xy ] ; then
|
|
|
3e90b9 |
+ set timeout_style=menu
|
|
|
3e90b9 |
+ set timeout=15
|
|
|
3e90b9 |
+# Fallback normal timeout code in case the timeout_style feature is
|
|
|
3e90b9 |
+# unavailable.
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ set timeout=15
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+### END /etc/grub.d/00_header ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/10_linux ###
|
|
|
3e90b9 |
+menuentry 'Fedora, with Linux 3.15.0-0.rc7.git2.1.fc21.x86_64' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ set gfxpayload=keep
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /boot6/vmlinuz-3.15.0-0.rc7.git2.1.fc21.x86_64 root=UUID=1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ro rootflags=subvol=root6 rhgb quiet
|
|
|
3e90b9 |
+ initrd16 /boot6/initramfs-3.15.0-0.rc7.git2.1.fc21.x86_64.img
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+menuentry 'Fedora, with Linux 0-rescue-81378818f7a24478b496ebef90e1dd69' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /boot6/vmlinuz-0-rescue-81378818f7a24478b496ebef90e1dd69 root=UUID=1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ro rootflags=subvol=root6 rhgb quiet
|
|
|
3e90b9 |
+ initrd16 /boot6/initramfs-0-rescue-81378818f7a24478b496ebef90e1dd69.img
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### END /etc/grub.d/10_linux ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/20_linux_xen ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### END /etc/grub.d/20_linux_xen ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/20_ppc_terminfo ###
|
|
|
3e90b9 |
+### END /etc/grub.d/20_ppc_terminfo ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/30_os-prober ###
|
|
|
3e90b9 |
+### END /etc/grub.d/30_os-prober ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/40_custom ###
|
|
|
3e90b9 |
+# This file provides an easy way to add custom menu entries. Simply type the
|
|
|
3e90b9 |
+# menu entries you want to add after this comment. Be careful not to change
|
|
|
3e90b9 |
+# the 'exec tail' line above.
|
|
|
3e90b9 |
+### END /etc/grub.d/40_custom ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/41_custom ###
|
|
|
3e90b9 |
+if [ -f ${config_directory}/custom.cfg ]; then
|
|
|
3e90b9 |
+ source ${config_directory}/custom.cfg
|
|
|
3e90b9 |
+elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
|
|
|
3e90b9 |
+ source $prefix/custom.cfg;
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+### END /etc/grub.d/41_custom ###
|
|
|
3e90b9 |
diff --git a/test/grub2.21 b/test/grub2.21
|
|
|
3e90b9 |
new file mode 100644
|
|
|
3e90b9 |
index 00000000000..579c2f6744a
|
|
|
3e90b9 |
--- /dev/null
|
|
|
3e90b9 |
+++ b/test/grub2.21
|
|
|
3e90b9 |
@@ -0,0 +1,140 @@
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+# DO NOT EDIT THIS FILE
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+# It is automatically generated by grub2-mkconfig using templates
|
|
|
3e90b9 |
+# from /etc/grub.d and settings from /etc/default/grub
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/00_header ###
|
|
|
3e90b9 |
+set pager=1
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ -s $prefix/grubenv ]; then
|
|
|
3e90b9 |
+ load_env
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+if [ "${next_entry}" ] ; then
|
|
|
3e90b9 |
+ set default="${next_entry}"
|
|
|
3e90b9 |
+ set next_entry=
|
|
|
3e90b9 |
+ save_env next_entry
|
|
|
3e90b9 |
+ set boot_once=true
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ set default="${saved_entry}"
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ x"${feature_menuentry_id}" = xy ]; then
|
|
|
3e90b9 |
+ menuentry_id_option="--id"
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ menuentry_id_option=""
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+export menuentry_id_option
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ "${prev_saved_entry}" ]; then
|
|
|
3e90b9 |
+ set saved_entry="${prev_saved_entry}"
|
|
|
3e90b9 |
+ save_env saved_entry
|
|
|
3e90b9 |
+ set prev_saved_entry=
|
|
|
3e90b9 |
+ save_env prev_saved_entry
|
|
|
3e90b9 |
+ set boot_once=true
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+function savedefault {
|
|
|
3e90b9 |
+ if [ -z "${boot_once}" ]; then
|
|
|
3e90b9 |
+ saved_entry="${chosen}"
|
|
|
3e90b9 |
+ save_env saved_entry
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+function load_video {
|
|
|
3e90b9 |
+ if [ x$feature_all_video_module = xy ]; then
|
|
|
3e90b9 |
+ insmod all_video
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ insmod efi_gop
|
|
|
3e90b9 |
+ insmod efi_uga
|
|
|
3e90b9 |
+ insmod ieee1275_fb
|
|
|
3e90b9 |
+ insmod vbe
|
|
|
3e90b9 |
+ insmod vga
|
|
|
3e90b9 |
+ insmod video_bochs
|
|
|
3e90b9 |
+ insmod video_cirrus
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+terminal_output console
|
|
|
3e90b9 |
+if [ x$feature_timeout_style = xy ] ; then
|
|
|
3e90b9 |
+ set timeout_style=menu
|
|
|
3e90b9 |
+ set timeout=15
|
|
|
3e90b9 |
+# Fallback normal timeout code in case the timeout_style feature is
|
|
|
3e90b9 |
+# unavailable.
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ set timeout=15
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+### END /etc/grub.d/00_header ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/10_linux ###
|
|
|
3e90b9 |
+menuentry 'title' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ set gfxpayload=keep
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /boot6/new-kernel.img root=UUID=1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ro rootflags=subvol=root6 rhgb quiet
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+menuentry 'Fedora, with Linux 3.15.0-0.rc7.git2.1.fc21.x86_64' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ set gfxpayload=keep
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /boot6/vmlinuz-3.15.0-0.rc7.git2.1.fc21.x86_64 root=UUID=1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ro rootflags=subvol=root6 rhgb quiet
|
|
|
3e90b9 |
+ initrd16 /boot6/initramfs-3.15.0-0.rc7.git2.1.fc21.x86_64.img
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+menuentry 'Fedora, with Linux 0-rescue-81378818f7a24478b496ebef90e1dd69' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /boot6/vmlinuz-0-rescue-81378818f7a24478b496ebef90e1dd69 root=UUID=1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ro rootflags=subvol=root6 rhgb quiet
|
|
|
3e90b9 |
+ initrd16 /boot6/initramfs-0-rescue-81378818f7a24478b496ebef90e1dd69.img
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### END /etc/grub.d/10_linux ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/20_linux_xen ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### END /etc/grub.d/20_linux_xen ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/20_ppc_terminfo ###
|
|
|
3e90b9 |
+### END /etc/grub.d/20_ppc_terminfo ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/30_os-prober ###
|
|
|
3e90b9 |
+### END /etc/grub.d/30_os-prober ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/40_custom ###
|
|
|
3e90b9 |
+# This file provides an easy way to add custom menu entries. Simply type the
|
|
|
3e90b9 |
+# menu entries you want to add after this comment. Be careful not to change
|
|
|
3e90b9 |
+# the 'exec tail' line above.
|
|
|
3e90b9 |
+### END /etc/grub.d/40_custom ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/41_custom ###
|
|
|
3e90b9 |
+if [ -f ${config_directory}/custom.cfg ]; then
|
|
|
3e90b9 |
+ source ${config_directory}/custom.cfg
|
|
|
3e90b9 |
+elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
|
|
|
3e90b9 |
+ source $prefix/custom.cfg;
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+### END /etc/grub.d/41_custom ###
|
|
|
3e90b9 |
diff --git a/test/grub2.22 b/test/grub2.22
|
|
|
3e90b9 |
new file mode 100644
|
|
|
3e90b9 |
index 00000000000..9466bc35153
|
|
|
3e90b9 |
--- /dev/null
|
|
|
3e90b9 |
+++ b/test/grub2.22
|
|
|
3e90b9 |
@@ -0,0 +1,128 @@
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+# DO NOT EDIT THIS FILE
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+# It is automatically generated by grub2-mkconfig using templates
|
|
|
3e90b9 |
+# from /etc/grub.d and settings from /etc/default/grub
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/00_header ###
|
|
|
3e90b9 |
+set pager=1
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ -s $prefix/grubenv ]; then
|
|
|
3e90b9 |
+ load_env
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+if [ "${next_entry}" ] ; then
|
|
|
3e90b9 |
+ set default="${next_entry}"
|
|
|
3e90b9 |
+ set next_entry=
|
|
|
3e90b9 |
+ save_env next_entry
|
|
|
3e90b9 |
+ set boot_once=true
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ set default="${saved_entry}"
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ x"${feature_menuentry_id}" = xy ]; then
|
|
|
3e90b9 |
+ menuentry_id_option="--id"
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ menuentry_id_option=""
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+export menuentry_id_option
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ "${prev_saved_entry}" ]; then
|
|
|
3e90b9 |
+ set saved_entry="${prev_saved_entry}"
|
|
|
3e90b9 |
+ save_env saved_entry
|
|
|
3e90b9 |
+ set prev_saved_entry=
|
|
|
3e90b9 |
+ save_env prev_saved_entry
|
|
|
3e90b9 |
+ set boot_once=true
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+function savedefault {
|
|
|
3e90b9 |
+ if [ -z "${boot_once}" ]; then
|
|
|
3e90b9 |
+ saved_entry="${chosen}"
|
|
|
3e90b9 |
+ save_env saved_entry
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+function load_video {
|
|
|
3e90b9 |
+ if [ x$feature_all_video_module = xy ]; then
|
|
|
3e90b9 |
+ insmod all_video
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ insmod efi_gop
|
|
|
3e90b9 |
+ insmod efi_uga
|
|
|
3e90b9 |
+ insmod ieee1275_fb
|
|
|
3e90b9 |
+ insmod vbe
|
|
|
3e90b9 |
+ insmod vga
|
|
|
3e90b9 |
+ insmod video_bochs
|
|
|
3e90b9 |
+ insmod video_cirrus
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+terminal_output console
|
|
|
3e90b9 |
+if [ x$feature_timeout_style = xy ] ; then
|
|
|
3e90b9 |
+ set timeout_style=menu
|
|
|
3e90b9 |
+ set timeout=15
|
|
|
3e90b9 |
+# Fallback normal timeout code in case the timeout_style feature is
|
|
|
3e90b9 |
+# unavailable.
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ set timeout=15
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+### END /etc/grub.d/00_header ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/10_linux ###
|
|
|
3e90b9 |
+menuentry 'Fedora, with Linux 3.15.0-0.rc7.git2.1.fc21.x86_64' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ set gfxpayload=keep
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /root4/boot/vmlinuz-3.15.0-0.rc7.git2.1.fc21.x86_64 root=UUID=54c6abc2-b1e7-4987-aa73-c79927be69eb ro rootflags=subvol=root4 rhgb quiet
|
|
|
3e90b9 |
+ initrd16 /root4/boot/initramfs-3.15.0-0.rc7.git2.1.fc21.x86_64.img
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+menuentry 'Fedora, with Linux 0-rescue-20e7024f4e9c4b70b1042b91acd434c6' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /root4/boot/vmlinuz-0-rescue-20e7024f4e9c4b70b1042b91acd434c6 root=UUID=54c6abc2-b1e7-4987-aa73-c79927be69eb ro rootflags=subvol=root4 rhgb quiet
|
|
|
3e90b9 |
+ initrd16 /root4/boot/initramfs-0-rescue-20e7024f4e9c4b70b1042b91acd434c6.img
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### END /etc/grub.d/10_linux ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/20_linux_xen ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### END /etc/grub.d/20_linux_xen ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/20_ppc_terminfo ###
|
|
|
3e90b9 |
+### END /etc/grub.d/20_ppc_terminfo ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/30_os-prober ###
|
|
|
3e90b9 |
+###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/40_custom ###
|
|
|
3e90b9 |
+# This file provides an easy way to add custom menu entries. Simply type the
|
|
|
3e90b9 |
+# menu entries you want to add after this comment. Be careful not to change
|
|
|
3e90b9 |
+# the 'exec tail' line above.
|
|
|
3e90b9 |
+### END /etc/grub.d/40_custom ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/41_custom ###
|
|
|
3e90b9 |
+if [ -f ${config_directory}/custom.cfg ]; then
|
|
|
3e90b9 |
+ source ${config_directory}/custom.cfg
|
|
|
3e90b9 |
+elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
|
|
|
3e90b9 |
+ source $prefix/custom.cfg;
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+### END /etc/grub.d/41_custom ###
|
|
|
3e90b9 |
diff --git a/test/grub2.23 b/test/grub2.23
|
|
|
3e90b9 |
new file mode 100644
|
|
|
3e90b9 |
index 00000000000..5cb240fc1de
|
|
|
3e90b9 |
--- /dev/null
|
|
|
3e90b9 |
+++ b/test/grub2.23
|
|
|
3e90b9 |
@@ -0,0 +1,143 @@
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+# DO NOT EDIT THIS FILE
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+# It is automatically generated by grub2-mkconfig using templates
|
|
|
3e90b9 |
+# from /etc/grub.d and settings from /etc/default/grub
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/00_header ###
|
|
|
3e90b9 |
+set pager=1
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ -s $prefix/grubenv ]; then
|
|
|
3e90b9 |
+ load_env
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+if [ "${next_entry}" ] ; then
|
|
|
3e90b9 |
+ set default="${next_entry}"
|
|
|
3e90b9 |
+ set next_entry=
|
|
|
3e90b9 |
+ save_env next_entry
|
|
|
3e90b9 |
+ set boot_once=true
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ set default="${saved_entry}"
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ x"${feature_menuentry_id}" = xy ]; then
|
|
|
3e90b9 |
+ menuentry_id_option="--id"
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ menuentry_id_option=""
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+export menuentry_id_option
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ "${prev_saved_entry}" ]; then
|
|
|
3e90b9 |
+ set saved_entry="${prev_saved_entry}"
|
|
|
3e90b9 |
+ save_env saved_entry
|
|
|
3e90b9 |
+ set prev_saved_entry=
|
|
|
3e90b9 |
+ save_env prev_saved_entry
|
|
|
3e90b9 |
+ set boot_once=true
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+function savedefault {
|
|
|
3e90b9 |
+ if [ -z "${boot_once}" ]; then
|
|
|
3e90b9 |
+ saved_entry="${chosen}"
|
|
|
3e90b9 |
+ save_env saved_entry
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+function load_video {
|
|
|
3e90b9 |
+ if [ x$feature_all_video_module = xy ]; then
|
|
|
3e90b9 |
+ insmod all_video
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ insmod efi_gop
|
|
|
3e90b9 |
+ insmod efi_uga
|
|
|
3e90b9 |
+ insmod ieee1275_fb
|
|
|
3e90b9 |
+ insmod vbe
|
|
|
3e90b9 |
+ insmod vga
|
|
|
3e90b9 |
+ insmod video_bochs
|
|
|
3e90b9 |
+ insmod video_cirrus
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+terminal_output console
|
|
|
3e90b9 |
+if [ x$feature_timeout_style = xy ] ; then
|
|
|
3e90b9 |
+ set timeout_style=menu
|
|
|
3e90b9 |
+ set timeout=15
|
|
|
3e90b9 |
+# Fallback normal timeout code in case the timeout_style feature is
|
|
|
3e90b9 |
+# unavailable.
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ set timeout=15
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+### END /etc/grub.d/00_header ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/10_linux ###
|
|
|
3e90b9 |
+menuentry 'title' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ set gfxpayload=keep
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /root4/boot/new-kernel.img root=UUID=54c6abc2-b1e7-4987-aa73-c79927be69eb ro rootflags=subvol=root4 rhgb quiet
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+menuentry 'Fedora, with Linux 3.15.0-0.rc7.git2.1.fc21.x86_64' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ set gfxpayload=keep
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /root4/boot/vmlinuz-3.15.0-0.rc7.git2.1.fc21.x86_64 root=UUID=54c6abc2-b1e7-4987-aa73-c79927be69eb ro rootflags=subvol=root4 rhgb quiet
|
|
|
3e90b9 |
+ initrd16 /root4/boot/initramfs-3.15.0-0.rc7.git2.1.fc21.x86_64.img
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+menuentry 'Fedora, with Linux 0-rescue-20e7024f4e9c4b70b1042b91acd434c6' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /root4/boot/vmlinuz-0-rescue-20e7024f4e9c4b70b1042b91acd434c6 root=UUID=54c6abc2-b1e7-4987-aa73-c79927be69eb ro rootflags=subvol=root4 rhgb quiet
|
|
|
3e90b9 |
+ initrd16 /root4/boot/initramfs-0-rescue-20e7024f4e9c4b70b1042b91acd434c6.img
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### END /etc/grub.d/10_linux ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/20_linux_xen ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### END /etc/grub.d/20_linux_xen ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/20_ppc_terminfo ###
|
|
|
3e90b9 |
+### END /etc/grub.d/20_ppc_terminfo ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/30_os-prober ###
|
|
|
3e90b9 |
+###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/40_custom ###
|
|
|
3e90b9 |
+# This file provides an easy way to add custom menu entries. Simply type the
|
|
|
3e90b9 |
+# menu entries you want to add after this comment. Be careful not to change
|
|
|
3e90b9 |
+# the 'exec tail' line above.
|
|
|
3e90b9 |
+### END /etc/grub.d/40_custom ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/41_custom ###
|
|
|
3e90b9 |
+if [ -f ${config_directory}/custom.cfg ]; then
|
|
|
3e90b9 |
+ source ${config_directory}/custom.cfg
|
|
|
3e90b9 |
+elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
|
|
|
3e90b9 |
+ source $prefix/custom.cfg;
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+### END /etc/grub.d/41_custom ###
|
|
|
3e90b9 |
diff --git a/test/grub2.24 b/test/grub2.24
|
|
|
3e90b9 |
new file mode 100644
|
|
|
3e90b9 |
index 00000000000..23b75fa8d3c
|
|
|
3e90b9 |
--- /dev/null
|
|
|
3e90b9 |
+++ b/test/grub2.24
|
|
|
3e90b9 |
@@ -0,0 +1,126 @@
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+# DO NOT EDIT THIS FILE
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+# It is automatically generated by grub2-mkconfig using templates
|
|
|
3e90b9 |
+# from /etc/grub.d and settings from /etc/default/grub
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/00_header ###
|
|
|
3e90b9 |
+set pager=1
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ -s $prefix/grubenv ]; then
|
|
|
3e90b9 |
+ load_env
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+if [ "${next_entry}" ] ; then
|
|
|
3e90b9 |
+ set default="${next_entry}"
|
|
|
3e90b9 |
+ set next_entry=
|
|
|
3e90b9 |
+ save_env next_entry
|
|
|
3e90b9 |
+ set boot_once=true
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ set default="${saved_entry}"
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ x"${feature_menuentry_id}" = xy ]; then
|
|
|
3e90b9 |
+ menuentry_id_option="--id"
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ menuentry_id_option=""
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+export menuentry_id_option
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ "${prev_saved_entry}" ]; then
|
|
|
3e90b9 |
+ set saved_entry="${prev_saved_entry}"
|
|
|
3e90b9 |
+ save_env saved_entry
|
|
|
3e90b9 |
+ set prev_saved_entry=
|
|
|
3e90b9 |
+ save_env prev_saved_entry
|
|
|
3e90b9 |
+ set boot_once=true
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+function savedefault {
|
|
|
3e90b9 |
+ if [ -z "${boot_once}" ]; then
|
|
|
3e90b9 |
+ saved_entry="${chosen}"
|
|
|
3e90b9 |
+ save_env saved_entry
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+function load_video {
|
|
|
3e90b9 |
+ if [ x$feature_all_video_module = xy ]; then
|
|
|
3e90b9 |
+ insmod all_video
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ insmod efi_gop
|
|
|
3e90b9 |
+ insmod efi_uga
|
|
|
3e90b9 |
+ insmod ieee1275_fb
|
|
|
3e90b9 |
+ insmod vbe
|
|
|
3e90b9 |
+ insmod vga
|
|
|
3e90b9 |
+ insmod video_bochs
|
|
|
3e90b9 |
+ insmod video_cirrus
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+terminal_output console
|
|
|
3e90b9 |
+if [ x$feature_timeout_style = xy ] ; then
|
|
|
3e90b9 |
+ set timeout_style=menu
|
|
|
3e90b9 |
+ set timeout=15
|
|
|
3e90b9 |
+# Fallback normal timeout code in case the timeout_style feature is
|
|
|
3e90b9 |
+# unavailable.
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ set timeout=15
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+### END /etc/grub.d/00_header ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/10_linux ###
|
|
|
3e90b9 |
+menuentry 'Fedora, with Linux 3.15.0-0.rc7.git2.1.fc21.x86_64' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ set gfxpayload=keep
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /boot6/vmlinuz-3.15.0-0.rc7.git2.1.fc21.x86_64 root=UUID=1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ro rootflags=subvol=root6 rhgb quiet
|
|
|
3e90b9 |
+ initrd16 /boot6/initramfs-3.15.0-0.rc7.git2.1.fc21.x86_64.img
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+menuentry 'Fedora, with Linux 0-rescue-81378818f7a24478b496ebef90e1dd69' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /boot6/vmlinuz-0-rescue-81378818f7a24478b496ebef90e1dd69 root=UUID=1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ro rootflags=subvol=root6 rhgb quiet
|
|
|
3e90b9 |
+ initrd16 /boot6/initramfs-0-rescue-81378818f7a24478b496ebef90e1dd69.img
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### END /etc/grub.d/10_linux ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/20_linux_xen ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### END /etc/grub.d/20_linux_xen ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/20_ppc_terminfo ###
|
|
|
3e90b9 |
+### END /etc/grub.d/20_ppc_terminfo ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/30_os-prober ###
|
|
|
3e90b9 |
+### END /etc/grub.d/30_os-prober ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/40_custom ###
|
|
|
3e90b9 |
+# This file provides an easy way to add custom menu entries. Simply type the
|
|
|
3e90b9 |
+# menu entries you want to add after this comment. Be careful not to change
|
|
|
3e90b9 |
+# the 'exec tail' line above.
|
|
|
3e90b9 |
+### END /etc/grub.d/40_custom ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/41_custom ###
|
|
|
3e90b9 |
+if [ -f ${config_directory}/custom.cfg ]; then
|
|
|
3e90b9 |
+ source ${config_directory}/custom.cfg
|
|
|
3e90b9 |
+elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
|
|
|
3e90b9 |
+ source $prefix/custom.cfg;
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+### END /etc/grub.d/41_custom ###
|
|
|
3e90b9 |
diff --git a/test/grub2.25 b/test/grub2.25
|
|
|
3e90b9 |
new file mode 100644
|
|
|
3e90b9 |
index 00000000000..9466bc35153
|
|
|
3e90b9 |
--- /dev/null
|
|
|
3e90b9 |
+++ b/test/grub2.25
|
|
|
3e90b9 |
@@ -0,0 +1,128 @@
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+# DO NOT EDIT THIS FILE
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+# It is automatically generated by grub2-mkconfig using templates
|
|
|
3e90b9 |
+# from /etc/grub.d and settings from /etc/default/grub
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/00_header ###
|
|
|
3e90b9 |
+set pager=1
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ -s $prefix/grubenv ]; then
|
|
|
3e90b9 |
+ load_env
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+if [ "${next_entry}" ] ; then
|
|
|
3e90b9 |
+ set default="${next_entry}"
|
|
|
3e90b9 |
+ set next_entry=
|
|
|
3e90b9 |
+ save_env next_entry
|
|
|
3e90b9 |
+ set boot_once=true
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ set default="${saved_entry}"
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ x"${feature_menuentry_id}" = xy ]; then
|
|
|
3e90b9 |
+ menuentry_id_option="--id"
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ menuentry_id_option=""
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+export menuentry_id_option
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ "${prev_saved_entry}" ]; then
|
|
|
3e90b9 |
+ set saved_entry="${prev_saved_entry}"
|
|
|
3e90b9 |
+ save_env saved_entry
|
|
|
3e90b9 |
+ set prev_saved_entry=
|
|
|
3e90b9 |
+ save_env prev_saved_entry
|
|
|
3e90b9 |
+ set boot_once=true
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+function savedefault {
|
|
|
3e90b9 |
+ if [ -z "${boot_once}" ]; then
|
|
|
3e90b9 |
+ saved_entry="${chosen}"
|
|
|
3e90b9 |
+ save_env saved_entry
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+function load_video {
|
|
|
3e90b9 |
+ if [ x$feature_all_video_module = xy ]; then
|
|
|
3e90b9 |
+ insmod all_video
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ insmod efi_gop
|
|
|
3e90b9 |
+ insmod efi_uga
|
|
|
3e90b9 |
+ insmod ieee1275_fb
|
|
|
3e90b9 |
+ insmod vbe
|
|
|
3e90b9 |
+ insmod vga
|
|
|
3e90b9 |
+ insmod video_bochs
|
|
|
3e90b9 |
+ insmod video_cirrus
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+terminal_output console
|
|
|
3e90b9 |
+if [ x$feature_timeout_style = xy ] ; then
|
|
|
3e90b9 |
+ set timeout_style=menu
|
|
|
3e90b9 |
+ set timeout=15
|
|
|
3e90b9 |
+# Fallback normal timeout code in case the timeout_style feature is
|
|
|
3e90b9 |
+# unavailable.
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ set timeout=15
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+### END /etc/grub.d/00_header ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/10_linux ###
|
|
|
3e90b9 |
+menuentry 'Fedora, with Linux 3.15.0-0.rc7.git2.1.fc21.x86_64' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ set gfxpayload=keep
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /root4/boot/vmlinuz-3.15.0-0.rc7.git2.1.fc21.x86_64 root=UUID=54c6abc2-b1e7-4987-aa73-c79927be69eb ro rootflags=subvol=root4 rhgb quiet
|
|
|
3e90b9 |
+ initrd16 /root4/boot/initramfs-3.15.0-0.rc7.git2.1.fc21.x86_64.img
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+menuentry 'Fedora, with Linux 0-rescue-20e7024f4e9c4b70b1042b91acd434c6' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /root4/boot/vmlinuz-0-rescue-20e7024f4e9c4b70b1042b91acd434c6 root=UUID=54c6abc2-b1e7-4987-aa73-c79927be69eb ro rootflags=subvol=root4 rhgb quiet
|
|
|
3e90b9 |
+ initrd16 /root4/boot/initramfs-0-rescue-20e7024f4e9c4b70b1042b91acd434c6.img
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### END /etc/grub.d/10_linux ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/20_linux_xen ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### END /etc/grub.d/20_linux_xen ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/20_ppc_terminfo ###
|
|
|
3e90b9 |
+### END /etc/grub.d/20_ppc_terminfo ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/30_os-prober ###
|
|
|
3e90b9 |
+###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/40_custom ###
|
|
|
3e90b9 |
+# This file provides an easy way to add custom menu entries. Simply type the
|
|
|
3e90b9 |
+# menu entries you want to add after this comment. Be careful not to change
|
|
|
3e90b9 |
+# the 'exec tail' line above.
|
|
|
3e90b9 |
+### END /etc/grub.d/40_custom ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/41_custom ###
|
|
|
3e90b9 |
+if [ -f ${config_directory}/custom.cfg ]; then
|
|
|
3e90b9 |
+ source ${config_directory}/custom.cfg
|
|
|
3e90b9 |
+elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
|
|
|
3e90b9 |
+ source $prefix/custom.cfg;
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+### END /etc/grub.d/41_custom ###
|
|
|
3e90b9 |
diff --git a/test/results/add/g2-1.20 b/test/results/add/g2-1.20
|
|
|
3e90b9 |
new file mode 100644
|
|
|
3e90b9 |
index 00000000000..579c2f6744a
|
|
|
3e90b9 |
--- /dev/null
|
|
|
3e90b9 |
+++ b/test/results/add/g2-1.20
|
|
|
3e90b9 |
@@ -0,0 +1,140 @@
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+# DO NOT EDIT THIS FILE
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+# It is automatically generated by grub2-mkconfig using templates
|
|
|
3e90b9 |
+# from /etc/grub.d and settings from /etc/default/grub
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/00_header ###
|
|
|
3e90b9 |
+set pager=1
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ -s $prefix/grubenv ]; then
|
|
|
3e90b9 |
+ load_env
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+if [ "${next_entry}" ] ; then
|
|
|
3e90b9 |
+ set default="${next_entry}"
|
|
|
3e90b9 |
+ set next_entry=
|
|
|
3e90b9 |
+ save_env next_entry
|
|
|
3e90b9 |
+ set boot_once=true
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ set default="${saved_entry}"
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ x"${feature_menuentry_id}" = xy ]; then
|
|
|
3e90b9 |
+ menuentry_id_option="--id"
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ menuentry_id_option=""
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+export menuentry_id_option
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ "${prev_saved_entry}" ]; then
|
|
|
3e90b9 |
+ set saved_entry="${prev_saved_entry}"
|
|
|
3e90b9 |
+ save_env saved_entry
|
|
|
3e90b9 |
+ set prev_saved_entry=
|
|
|
3e90b9 |
+ save_env prev_saved_entry
|
|
|
3e90b9 |
+ set boot_once=true
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+function savedefault {
|
|
|
3e90b9 |
+ if [ -z "${boot_once}" ]; then
|
|
|
3e90b9 |
+ saved_entry="${chosen}"
|
|
|
3e90b9 |
+ save_env saved_entry
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+function load_video {
|
|
|
3e90b9 |
+ if [ x$feature_all_video_module = xy ]; then
|
|
|
3e90b9 |
+ insmod all_video
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ insmod efi_gop
|
|
|
3e90b9 |
+ insmod efi_uga
|
|
|
3e90b9 |
+ insmod ieee1275_fb
|
|
|
3e90b9 |
+ insmod vbe
|
|
|
3e90b9 |
+ insmod vga
|
|
|
3e90b9 |
+ insmod video_bochs
|
|
|
3e90b9 |
+ insmod video_cirrus
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+terminal_output console
|
|
|
3e90b9 |
+if [ x$feature_timeout_style = xy ] ; then
|
|
|
3e90b9 |
+ set timeout_style=menu
|
|
|
3e90b9 |
+ set timeout=15
|
|
|
3e90b9 |
+# Fallback normal timeout code in case the timeout_style feature is
|
|
|
3e90b9 |
+# unavailable.
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ set timeout=15
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+### END /etc/grub.d/00_header ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/10_linux ###
|
|
|
3e90b9 |
+menuentry 'title' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ set gfxpayload=keep
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /boot6/new-kernel.img root=UUID=1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ro rootflags=subvol=root6 rhgb quiet
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+menuentry 'Fedora, with Linux 3.15.0-0.rc7.git2.1.fc21.x86_64' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ set gfxpayload=keep
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /boot6/vmlinuz-3.15.0-0.rc7.git2.1.fc21.x86_64 root=UUID=1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ro rootflags=subvol=root6 rhgb quiet
|
|
|
3e90b9 |
+ initrd16 /boot6/initramfs-3.15.0-0.rc7.git2.1.fc21.x86_64.img
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+menuentry 'Fedora, with Linux 0-rescue-81378818f7a24478b496ebef90e1dd69' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /boot6/vmlinuz-0-rescue-81378818f7a24478b496ebef90e1dd69 root=UUID=1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ro rootflags=subvol=root6 rhgb quiet
|
|
|
3e90b9 |
+ initrd16 /boot6/initramfs-0-rescue-81378818f7a24478b496ebef90e1dd69.img
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### END /etc/grub.d/10_linux ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/20_linux_xen ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### END /etc/grub.d/20_linux_xen ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/20_ppc_terminfo ###
|
|
|
3e90b9 |
+### END /etc/grub.d/20_ppc_terminfo ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/30_os-prober ###
|
|
|
3e90b9 |
+### END /etc/grub.d/30_os-prober ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/40_custom ###
|
|
|
3e90b9 |
+# This file provides an easy way to add custom menu entries. Simply type the
|
|
|
3e90b9 |
+# menu entries you want to add after this comment. Be careful not to change
|
|
|
3e90b9 |
+# the 'exec tail' line above.
|
|
|
3e90b9 |
+### END /etc/grub.d/40_custom ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/41_custom ###
|
|
|
3e90b9 |
+if [ -f ${config_directory}/custom.cfg ]; then
|
|
|
3e90b9 |
+ source ${config_directory}/custom.cfg
|
|
|
3e90b9 |
+elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
|
|
|
3e90b9 |
+ source $prefix/custom.cfg;
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+### END /etc/grub.d/41_custom ###
|
|
|
3e90b9 |
diff --git a/test/results/add/g2-1.21 b/test/results/add/g2-1.21
|
|
|
3e90b9 |
new file mode 100644
|
|
|
3e90b9 |
index 00000000000..c0dded9724c
|
|
|
3e90b9 |
--- /dev/null
|
|
|
3e90b9 |
+++ b/test/results/add/g2-1.21
|
|
|
3e90b9 |
@@ -0,0 +1,141 @@
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+# DO NOT EDIT THIS FILE
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+# It is automatically generated by grub2-mkconfig using templates
|
|
|
3e90b9 |
+# from /etc/grub.d and settings from /etc/default/grub
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/00_header ###
|
|
|
3e90b9 |
+set pager=1
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ -s $prefix/grubenv ]; then
|
|
|
3e90b9 |
+ load_env
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+if [ "${next_entry}" ] ; then
|
|
|
3e90b9 |
+ set default="${next_entry}"
|
|
|
3e90b9 |
+ set next_entry=
|
|
|
3e90b9 |
+ save_env next_entry
|
|
|
3e90b9 |
+ set boot_once=true
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ set default="${saved_entry}"
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ x"${feature_menuentry_id}" = xy ]; then
|
|
|
3e90b9 |
+ menuentry_id_option="--id"
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ menuentry_id_option=""
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+export menuentry_id_option
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ "${prev_saved_entry}" ]; then
|
|
|
3e90b9 |
+ set saved_entry="${prev_saved_entry}"
|
|
|
3e90b9 |
+ save_env saved_entry
|
|
|
3e90b9 |
+ set prev_saved_entry=
|
|
|
3e90b9 |
+ save_env prev_saved_entry
|
|
|
3e90b9 |
+ set boot_once=true
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+function savedefault {
|
|
|
3e90b9 |
+ if [ -z "${boot_once}" ]; then
|
|
|
3e90b9 |
+ saved_entry="${chosen}"
|
|
|
3e90b9 |
+ save_env saved_entry
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+function load_video {
|
|
|
3e90b9 |
+ if [ x$feature_all_video_module = xy ]; then
|
|
|
3e90b9 |
+ insmod all_video
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ insmod efi_gop
|
|
|
3e90b9 |
+ insmod efi_uga
|
|
|
3e90b9 |
+ insmod ieee1275_fb
|
|
|
3e90b9 |
+ insmod vbe
|
|
|
3e90b9 |
+ insmod vga
|
|
|
3e90b9 |
+ insmod video_bochs
|
|
|
3e90b9 |
+ insmod video_cirrus
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+terminal_output console
|
|
|
3e90b9 |
+if [ x$feature_timeout_style = xy ] ; then
|
|
|
3e90b9 |
+ set timeout_style=menu
|
|
|
3e90b9 |
+ set timeout=15
|
|
|
3e90b9 |
+# Fallback normal timeout code in case the timeout_style feature is
|
|
|
3e90b9 |
+# unavailable.
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ set timeout=15
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+### END /etc/grub.d/00_header ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/10_linux ###
|
|
|
3e90b9 |
+menuentry 'title' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ set gfxpayload=keep
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /boot6/new-kernel.img root=UUID=1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ro rootflags=subvol=root6 rhgb quiet
|
|
|
3e90b9 |
+ initrd16 /boot6/new-initrd
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+menuentry 'Fedora, with Linux 3.15.0-0.rc7.git2.1.fc21.x86_64' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ set gfxpayload=keep
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /boot6/vmlinuz-3.15.0-0.rc7.git2.1.fc21.x86_64 root=UUID=1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ro rootflags=subvol=root6 rhgb quiet
|
|
|
3e90b9 |
+ initrd16 /boot6/initramfs-3.15.0-0.rc7.git2.1.fc21.x86_64.img
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+menuentry 'Fedora, with Linux 0-rescue-81378818f7a24478b496ebef90e1dd69' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /boot6/vmlinuz-0-rescue-81378818f7a24478b496ebef90e1dd69 root=UUID=1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ro rootflags=subvol=root6 rhgb quiet
|
|
|
3e90b9 |
+ initrd16 /boot6/initramfs-0-rescue-81378818f7a24478b496ebef90e1dd69.img
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### END /etc/grub.d/10_linux ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/20_linux_xen ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### END /etc/grub.d/20_linux_xen ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/20_ppc_terminfo ###
|
|
|
3e90b9 |
+### END /etc/grub.d/20_ppc_terminfo ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/30_os-prober ###
|
|
|
3e90b9 |
+### END /etc/grub.d/30_os-prober ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/40_custom ###
|
|
|
3e90b9 |
+# This file provides an easy way to add custom menu entries. Simply type the
|
|
|
3e90b9 |
+# menu entries you want to add after this comment. Be careful not to change
|
|
|
3e90b9 |
+# the 'exec tail' line above.
|
|
|
3e90b9 |
+### END /etc/grub.d/40_custom ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/41_custom ###
|
|
|
3e90b9 |
+if [ -f ${config_directory}/custom.cfg ]; then
|
|
|
3e90b9 |
+ source ${config_directory}/custom.cfg
|
|
|
3e90b9 |
+elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
|
|
|
3e90b9 |
+ source $prefix/custom.cfg;
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+### END /etc/grub.d/41_custom ###
|
|
|
3e90b9 |
diff --git a/test/results/add/g2-1.22 b/test/results/add/g2-1.22
|
|
|
3e90b9 |
new file mode 100644
|
|
|
3e90b9 |
index 00000000000..5cb240fc1de
|
|
|
3e90b9 |
--- /dev/null
|
|
|
3e90b9 |
+++ b/test/results/add/g2-1.22
|
|
|
3e90b9 |
@@ -0,0 +1,143 @@
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+# DO NOT EDIT THIS FILE
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+# It is automatically generated by grub2-mkconfig using templates
|
|
|
3e90b9 |
+# from /etc/grub.d and settings from /etc/default/grub
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/00_header ###
|
|
|
3e90b9 |
+set pager=1
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ -s $prefix/grubenv ]; then
|
|
|
3e90b9 |
+ load_env
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+if [ "${next_entry}" ] ; then
|
|
|
3e90b9 |
+ set default="${next_entry}"
|
|
|
3e90b9 |
+ set next_entry=
|
|
|
3e90b9 |
+ save_env next_entry
|
|
|
3e90b9 |
+ set boot_once=true
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ set default="${saved_entry}"
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ x"${feature_menuentry_id}" = xy ]; then
|
|
|
3e90b9 |
+ menuentry_id_option="--id"
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ menuentry_id_option=""
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+export menuentry_id_option
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ "${prev_saved_entry}" ]; then
|
|
|
3e90b9 |
+ set saved_entry="${prev_saved_entry}"
|
|
|
3e90b9 |
+ save_env saved_entry
|
|
|
3e90b9 |
+ set prev_saved_entry=
|
|
|
3e90b9 |
+ save_env prev_saved_entry
|
|
|
3e90b9 |
+ set boot_once=true
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+function savedefault {
|
|
|
3e90b9 |
+ if [ -z "${boot_once}" ]; then
|
|
|
3e90b9 |
+ saved_entry="${chosen}"
|
|
|
3e90b9 |
+ save_env saved_entry
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+function load_video {
|
|
|
3e90b9 |
+ if [ x$feature_all_video_module = xy ]; then
|
|
|
3e90b9 |
+ insmod all_video
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ insmod efi_gop
|
|
|
3e90b9 |
+ insmod efi_uga
|
|
|
3e90b9 |
+ insmod ieee1275_fb
|
|
|
3e90b9 |
+ insmod vbe
|
|
|
3e90b9 |
+ insmod vga
|
|
|
3e90b9 |
+ insmod video_bochs
|
|
|
3e90b9 |
+ insmod video_cirrus
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+terminal_output console
|
|
|
3e90b9 |
+if [ x$feature_timeout_style = xy ] ; then
|
|
|
3e90b9 |
+ set timeout_style=menu
|
|
|
3e90b9 |
+ set timeout=15
|
|
|
3e90b9 |
+# Fallback normal timeout code in case the timeout_style feature is
|
|
|
3e90b9 |
+# unavailable.
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ set timeout=15
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+### END /etc/grub.d/00_header ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/10_linux ###
|
|
|
3e90b9 |
+menuentry 'title' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ set gfxpayload=keep
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /root4/boot/new-kernel.img root=UUID=54c6abc2-b1e7-4987-aa73-c79927be69eb ro rootflags=subvol=root4 rhgb quiet
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+menuentry 'Fedora, with Linux 3.15.0-0.rc7.git2.1.fc21.x86_64' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ set gfxpayload=keep
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /root4/boot/vmlinuz-3.15.0-0.rc7.git2.1.fc21.x86_64 root=UUID=54c6abc2-b1e7-4987-aa73-c79927be69eb ro rootflags=subvol=root4 rhgb quiet
|
|
|
3e90b9 |
+ initrd16 /root4/boot/initramfs-3.15.0-0.rc7.git2.1.fc21.x86_64.img
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+menuentry 'Fedora, with Linux 0-rescue-20e7024f4e9c4b70b1042b91acd434c6' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /root4/boot/vmlinuz-0-rescue-20e7024f4e9c4b70b1042b91acd434c6 root=UUID=54c6abc2-b1e7-4987-aa73-c79927be69eb ro rootflags=subvol=root4 rhgb quiet
|
|
|
3e90b9 |
+ initrd16 /root4/boot/initramfs-0-rescue-20e7024f4e9c4b70b1042b91acd434c6.img
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### END /etc/grub.d/10_linux ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/20_linux_xen ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### END /etc/grub.d/20_linux_xen ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/20_ppc_terminfo ###
|
|
|
3e90b9 |
+### END /etc/grub.d/20_ppc_terminfo ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/30_os-prober ###
|
|
|
3e90b9 |
+###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/40_custom ###
|
|
|
3e90b9 |
+# This file provides an easy way to add custom menu entries. Simply type the
|
|
|
3e90b9 |
+# menu entries you want to add after this comment. Be careful not to change
|
|
|
3e90b9 |
+# the 'exec tail' line above.
|
|
|
3e90b9 |
+### END /etc/grub.d/40_custom ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/41_custom ###
|
|
|
3e90b9 |
+if [ -f ${config_directory}/custom.cfg ]; then
|
|
|
3e90b9 |
+ source ${config_directory}/custom.cfg
|
|
|
3e90b9 |
+elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
|
|
|
3e90b9 |
+ source $prefix/custom.cfg;
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+### END /etc/grub.d/41_custom ###
|
|
|
3e90b9 |
diff --git a/test/results/add/g2-1.23 b/test/results/add/g2-1.23
|
|
|
3e90b9 |
new file mode 100644
|
|
|
3e90b9 |
index 00000000000..c3e87cf7897
|
|
|
3e90b9 |
--- /dev/null
|
|
|
3e90b9 |
+++ b/test/results/add/g2-1.23
|
|
|
3e90b9 |
@@ -0,0 +1,144 @@
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+# DO NOT EDIT THIS FILE
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+# It is automatically generated by grub2-mkconfig using templates
|
|
|
3e90b9 |
+# from /etc/grub.d and settings from /etc/default/grub
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/00_header ###
|
|
|
3e90b9 |
+set pager=1
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ -s $prefix/grubenv ]; then
|
|
|
3e90b9 |
+ load_env
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+if [ "${next_entry}" ] ; then
|
|
|
3e90b9 |
+ set default="${next_entry}"
|
|
|
3e90b9 |
+ set next_entry=
|
|
|
3e90b9 |
+ save_env next_entry
|
|
|
3e90b9 |
+ set boot_once=true
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ set default="${saved_entry}"
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ x"${feature_menuentry_id}" = xy ]; then
|
|
|
3e90b9 |
+ menuentry_id_option="--id"
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ menuentry_id_option=""
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+export menuentry_id_option
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ "${prev_saved_entry}" ]; then
|
|
|
3e90b9 |
+ set saved_entry="${prev_saved_entry}"
|
|
|
3e90b9 |
+ save_env saved_entry
|
|
|
3e90b9 |
+ set prev_saved_entry=
|
|
|
3e90b9 |
+ save_env prev_saved_entry
|
|
|
3e90b9 |
+ set boot_once=true
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+function savedefault {
|
|
|
3e90b9 |
+ if [ -z "${boot_once}" ]; then
|
|
|
3e90b9 |
+ saved_entry="${chosen}"
|
|
|
3e90b9 |
+ save_env saved_entry
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+function load_video {
|
|
|
3e90b9 |
+ if [ x$feature_all_video_module = xy ]; then
|
|
|
3e90b9 |
+ insmod all_video
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ insmod efi_gop
|
|
|
3e90b9 |
+ insmod efi_uga
|
|
|
3e90b9 |
+ insmod ieee1275_fb
|
|
|
3e90b9 |
+ insmod vbe
|
|
|
3e90b9 |
+ insmod vga
|
|
|
3e90b9 |
+ insmod video_bochs
|
|
|
3e90b9 |
+ insmod video_cirrus
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+terminal_output console
|
|
|
3e90b9 |
+if [ x$feature_timeout_style = xy ] ; then
|
|
|
3e90b9 |
+ set timeout_style=menu
|
|
|
3e90b9 |
+ set timeout=15
|
|
|
3e90b9 |
+# Fallback normal timeout code in case the timeout_style feature is
|
|
|
3e90b9 |
+# unavailable.
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ set timeout=15
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+### END /etc/grub.d/00_header ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/10_linux ###
|
|
|
3e90b9 |
+menuentry 'title' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ set gfxpayload=keep
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /root4/boot/new-kernel.img root=UUID=54c6abc2-b1e7-4987-aa73-c79927be69eb ro rootflags=subvol=root4 rhgb quiet
|
|
|
3e90b9 |
+ initrd16 /root4/boot/new-initrd
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+menuentry 'Fedora, with Linux 3.15.0-0.rc7.git2.1.fc21.x86_64' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ set gfxpayload=keep
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /root4/boot/vmlinuz-3.15.0-0.rc7.git2.1.fc21.x86_64 root=UUID=54c6abc2-b1e7-4987-aa73-c79927be69eb ro rootflags=subvol=root4 rhgb quiet
|
|
|
3e90b9 |
+ initrd16 /root4/boot/initramfs-3.15.0-0.rc7.git2.1.fc21.x86_64.img
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+menuentry 'Fedora, with Linux 0-rescue-20e7024f4e9c4b70b1042b91acd434c6' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /root4/boot/vmlinuz-0-rescue-20e7024f4e9c4b70b1042b91acd434c6 root=UUID=54c6abc2-b1e7-4987-aa73-c79927be69eb ro rootflags=subvol=root4 rhgb quiet
|
|
|
3e90b9 |
+ initrd16 /root4/boot/initramfs-0-rescue-20e7024f4e9c4b70b1042b91acd434c6.img
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### END /etc/grub.d/10_linux ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/20_linux_xen ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### END /etc/grub.d/20_linux_xen ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/20_ppc_terminfo ###
|
|
|
3e90b9 |
+### END /etc/grub.d/20_ppc_terminfo ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/30_os-prober ###
|
|
|
3e90b9 |
+###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/40_custom ###
|
|
|
3e90b9 |
+# This file provides an easy way to add custom menu entries. Simply type the
|
|
|
3e90b9 |
+# menu entries you want to add after this comment. Be careful not to change
|
|
|
3e90b9 |
+# the 'exec tail' line above.
|
|
|
3e90b9 |
+### END /etc/grub.d/40_custom ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/41_custom ###
|
|
|
3e90b9 |
+if [ -f ${config_directory}/custom.cfg ]; then
|
|
|
3e90b9 |
+ source ${config_directory}/custom.cfg
|
|
|
3e90b9 |
+elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
|
|
|
3e90b9 |
+ source $prefix/custom.cfg;
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+### END /etc/grub.d/41_custom ###
|
|
|
3e90b9 |
diff --git a/test/results/add/g2-1.24 b/test/results/add/g2-1.24
|
|
|
3e90b9 |
new file mode 100644
|
|
|
3e90b9 |
index 00000000000..c0dded9724c
|
|
|
3e90b9 |
--- /dev/null
|
|
|
3e90b9 |
+++ b/test/results/add/g2-1.24
|
|
|
3e90b9 |
@@ -0,0 +1,141 @@
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+# DO NOT EDIT THIS FILE
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+# It is automatically generated by grub2-mkconfig using templates
|
|
|
3e90b9 |
+# from /etc/grub.d and settings from /etc/default/grub
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/00_header ###
|
|
|
3e90b9 |
+set pager=1
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ -s $prefix/grubenv ]; then
|
|
|
3e90b9 |
+ load_env
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+if [ "${next_entry}" ] ; then
|
|
|
3e90b9 |
+ set default="${next_entry}"
|
|
|
3e90b9 |
+ set next_entry=
|
|
|
3e90b9 |
+ save_env next_entry
|
|
|
3e90b9 |
+ set boot_once=true
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ set default="${saved_entry}"
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ x"${feature_menuentry_id}" = xy ]; then
|
|
|
3e90b9 |
+ menuentry_id_option="--id"
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ menuentry_id_option=""
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+export menuentry_id_option
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ "${prev_saved_entry}" ]; then
|
|
|
3e90b9 |
+ set saved_entry="${prev_saved_entry}"
|
|
|
3e90b9 |
+ save_env saved_entry
|
|
|
3e90b9 |
+ set prev_saved_entry=
|
|
|
3e90b9 |
+ save_env prev_saved_entry
|
|
|
3e90b9 |
+ set boot_once=true
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+function savedefault {
|
|
|
3e90b9 |
+ if [ -z "${boot_once}" ]; then
|
|
|
3e90b9 |
+ saved_entry="${chosen}"
|
|
|
3e90b9 |
+ save_env saved_entry
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+function load_video {
|
|
|
3e90b9 |
+ if [ x$feature_all_video_module = xy ]; then
|
|
|
3e90b9 |
+ insmod all_video
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ insmod efi_gop
|
|
|
3e90b9 |
+ insmod efi_uga
|
|
|
3e90b9 |
+ insmod ieee1275_fb
|
|
|
3e90b9 |
+ insmod vbe
|
|
|
3e90b9 |
+ insmod vga
|
|
|
3e90b9 |
+ insmod video_bochs
|
|
|
3e90b9 |
+ insmod video_cirrus
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+terminal_output console
|
|
|
3e90b9 |
+if [ x$feature_timeout_style = xy ] ; then
|
|
|
3e90b9 |
+ set timeout_style=menu
|
|
|
3e90b9 |
+ set timeout=15
|
|
|
3e90b9 |
+# Fallback normal timeout code in case the timeout_style feature is
|
|
|
3e90b9 |
+# unavailable.
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ set timeout=15
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+### END /etc/grub.d/00_header ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/10_linux ###
|
|
|
3e90b9 |
+menuentry 'title' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ set gfxpayload=keep
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /boot6/new-kernel.img root=UUID=1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ro rootflags=subvol=root6 rhgb quiet
|
|
|
3e90b9 |
+ initrd16 /boot6/new-initrd
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+menuentry 'Fedora, with Linux 3.15.0-0.rc7.git2.1.fc21.x86_64' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ set gfxpayload=keep
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /boot6/vmlinuz-3.15.0-0.rc7.git2.1.fc21.x86_64 root=UUID=1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ro rootflags=subvol=root6 rhgb quiet
|
|
|
3e90b9 |
+ initrd16 /boot6/initramfs-3.15.0-0.rc7.git2.1.fc21.x86_64.img
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+menuentry 'Fedora, with Linux 0-rescue-81378818f7a24478b496ebef90e1dd69' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /boot6/vmlinuz-0-rescue-81378818f7a24478b496ebef90e1dd69 root=UUID=1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ro rootflags=subvol=root6 rhgb quiet
|
|
|
3e90b9 |
+ initrd16 /boot6/initramfs-0-rescue-81378818f7a24478b496ebef90e1dd69.img
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### END /etc/grub.d/10_linux ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/20_linux_xen ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### END /etc/grub.d/20_linux_xen ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/20_ppc_terminfo ###
|
|
|
3e90b9 |
+### END /etc/grub.d/20_ppc_terminfo ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/30_os-prober ###
|
|
|
3e90b9 |
+### END /etc/grub.d/30_os-prober ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/40_custom ###
|
|
|
3e90b9 |
+# This file provides an easy way to add custom menu entries. Simply type the
|
|
|
3e90b9 |
+# menu entries you want to add after this comment. Be careful not to change
|
|
|
3e90b9 |
+# the 'exec tail' line above.
|
|
|
3e90b9 |
+### END /etc/grub.d/40_custom ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/41_custom ###
|
|
|
3e90b9 |
+if [ -f ${config_directory}/custom.cfg ]; then
|
|
|
3e90b9 |
+ source ${config_directory}/custom.cfg
|
|
|
3e90b9 |
+elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
|
|
|
3e90b9 |
+ source $prefix/custom.cfg;
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+### END /etc/grub.d/41_custom ###
|
|
|
3e90b9 |
diff --git a/test/results/add/g2-1.25 b/test/results/add/g2-1.25
|
|
|
3e90b9 |
new file mode 100644
|
|
|
3e90b9 |
index 00000000000..c3e87cf7897
|
|
|
3e90b9 |
--- /dev/null
|
|
|
3e90b9 |
+++ b/test/results/add/g2-1.25
|
|
|
3e90b9 |
@@ -0,0 +1,144 @@
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+# DO NOT EDIT THIS FILE
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+# It is automatically generated by grub2-mkconfig using templates
|
|
|
3e90b9 |
+# from /etc/grub.d and settings from /etc/default/grub
|
|
|
3e90b9 |
+#
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/00_header ###
|
|
|
3e90b9 |
+set pager=1
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ -s $prefix/grubenv ]; then
|
|
|
3e90b9 |
+ load_env
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+if [ "${next_entry}" ] ; then
|
|
|
3e90b9 |
+ set default="${next_entry}"
|
|
|
3e90b9 |
+ set next_entry=
|
|
|
3e90b9 |
+ save_env next_entry
|
|
|
3e90b9 |
+ set boot_once=true
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ set default="${saved_entry}"
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ x"${feature_menuentry_id}" = xy ]; then
|
|
|
3e90b9 |
+ menuentry_id_option="--id"
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ menuentry_id_option=""
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+export menuentry_id_option
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+if [ "${prev_saved_entry}" ]; then
|
|
|
3e90b9 |
+ set saved_entry="${prev_saved_entry}"
|
|
|
3e90b9 |
+ save_env saved_entry
|
|
|
3e90b9 |
+ set prev_saved_entry=
|
|
|
3e90b9 |
+ save_env prev_saved_entry
|
|
|
3e90b9 |
+ set boot_once=true
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+function savedefault {
|
|
|
3e90b9 |
+ if [ -z "${boot_once}" ]; then
|
|
|
3e90b9 |
+ saved_entry="${chosen}"
|
|
|
3e90b9 |
+ save_env saved_entry
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+function load_video {
|
|
|
3e90b9 |
+ if [ x$feature_all_video_module = xy ]; then
|
|
|
3e90b9 |
+ insmod all_video
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ insmod efi_gop
|
|
|
3e90b9 |
+ insmod efi_uga
|
|
|
3e90b9 |
+ insmod ieee1275_fb
|
|
|
3e90b9 |
+ insmod vbe
|
|
|
3e90b9 |
+ insmod vga
|
|
|
3e90b9 |
+ insmod video_bochs
|
|
|
3e90b9 |
+ insmod video_cirrus
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+terminal_output console
|
|
|
3e90b9 |
+if [ x$feature_timeout_style = xy ] ; then
|
|
|
3e90b9 |
+ set timeout_style=menu
|
|
|
3e90b9 |
+ set timeout=15
|
|
|
3e90b9 |
+# Fallback normal timeout code in case the timeout_style feature is
|
|
|
3e90b9 |
+# unavailable.
|
|
|
3e90b9 |
+else
|
|
|
3e90b9 |
+ set timeout=15
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+### END /etc/grub.d/00_header ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/10_linux ###
|
|
|
3e90b9 |
+menuentry 'title' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ set gfxpayload=keep
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /root4/boot/new-kernel.img root=UUID=54c6abc2-b1e7-4987-aa73-c79927be69eb ro rootflags=subvol=root4 rhgb quiet
|
|
|
3e90b9 |
+ initrd16 /root4/boot/new-initrd
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+menuentry 'Fedora, with Linux 3.15.0-0.rc7.git2.1.fc21.x86_64' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ set gfxpayload=keep
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /root4/boot/vmlinuz-3.15.0-0.rc7.git2.1.fc21.x86_64 root=UUID=54c6abc2-b1e7-4987-aa73-c79927be69eb ro rootflags=subvol=root4 rhgb quiet
|
|
|
3e90b9 |
+ initrd16 /root4/boot/initramfs-3.15.0-0.rc7.git2.1.fc21.x86_64.img
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+menuentry 'Fedora, with Linux 0-rescue-20e7024f4e9c4b70b1042b91acd434c6' --class gnu-linux --class gnu --class os {
|
|
|
3e90b9 |
+ load_video
|
|
|
3e90b9 |
+ insmod gzio
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod part_msdos
|
|
|
3e90b9 |
+ insmod btrfs
|
|
|
3e90b9 |
+ set root='hd0,msdos1'
|
|
|
3e90b9 |
+ if [ x$feature_platform_search_hint = xy ]; then
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ else
|
|
|
3e90b9 |
+ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb
|
|
|
3e90b9 |
+ fi
|
|
|
3e90b9 |
+ linux16 /root4/boot/vmlinuz-0-rescue-20e7024f4e9c4b70b1042b91acd434c6 root=UUID=54c6abc2-b1e7-4987-aa73-c79927be69eb ro rootflags=subvol=root4 rhgb quiet
|
|
|
3e90b9 |
+ initrd16 /root4/boot/initramfs-0-rescue-20e7024f4e9c4b70b1042b91acd434c6.img
|
|
|
3e90b9 |
+}
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### END /etc/grub.d/10_linux ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/20_linux_xen ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### END /etc/grub.d/20_linux_xen ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/20_ppc_terminfo ###
|
|
|
3e90b9 |
+### END /etc/grub.d/20_ppc_terminfo ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/30_os-prober ###
|
|
|
3e90b9 |
+###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/40_custom ###
|
|
|
3e90b9 |
+# This file provides an easy way to add custom menu entries. Simply type the
|
|
|
3e90b9 |
+# menu entries you want to add after this comment. Be careful not to change
|
|
|
3e90b9 |
+# the 'exec tail' line above.
|
|
|
3e90b9 |
+### END /etc/grub.d/40_custom ###
|
|
|
3e90b9 |
+
|
|
|
3e90b9 |
+### BEGIN /etc/grub.d/41_custom ###
|
|
|
3e90b9 |
+if [ -f ${config_directory}/custom.cfg ]; then
|
|
|
3e90b9 |
+ source ${config_directory}/custom.cfg
|
|
|
3e90b9 |
+elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
|
|
|
3e90b9 |
+ source $prefix/custom.cfg;
|
|
|
3e90b9 |
+fi
|
|
|
3e90b9 |
+### END /etc/grub.d/41_custom ###
|
|
|
3e90b9 |
--
|
|
|
3e90b9 |
2.17.1
|
|
|
3e90b9 |
|