diff --git a/0001-Change-return-type-in-getRootSpecifier.patch b/0001-Change-return-type-in-getRootSpecifier.patch new file mode 100644 index 0000000..0a6808b --- /dev/null +++ b/0001-Change-return-type-in-getRootSpecifier.patch @@ -0,0 +1,143 @@ +From c1c46d21182974181f5b4c2ed0a02288b4bfd880 Mon Sep 17 00:00:00 2001 +From: Nathaniel McCallum +Date: Fri, 2 Mar 2018 14:59:32 -0500 +Subject: [PATCH 1/3] Change return type in getRootSpecifier() + +Rather than returning a new allocation of the prefix, just return the +length of the prefix. This change accomplishes a couple things. First, +it reduces some memory leaks since the return value was often never +freed. Second, it simplifies the caller who is usually only interested +in the length of the prefix. +--- + grubby.c | 54 +++++++++++++++++++++++++++--------------------------- + 1 file changed, 27 insertions(+), 27 deletions(-) + +diff --git a/grubby.c b/grubby.c +index d4ebb86..a062ef8 100644 +--- a/grubby.c ++++ b/grubby.c +@@ -675,7 +675,7 @@ static int lineWrite(FILE * out, struct singleLine * line, + struct configFileInfo * cfi); + static int getNextLine(char ** bufPtr, struct singleLine * line, + struct configFileInfo * cfi); +-static char * getRootSpecifier(char * str); ++static size_t getRootSpecifier(const char *str); + static void requote(struct singleLine *line, struct configFileInfo * cfi); + static void insertElement(struct singleLine * line, + const char * item, int insertHere, +@@ -1840,7 +1840,7 @@ int suitableImage(struct singleEntry * entry, const char * bootPrefix, + char * fullName; + int i; + char * dev; +- char * rootspec; ++ size_t rs; + char * rootdev; + + if (skipRemoved && entry->skip) { +@@ -1866,12 +1866,11 @@ int suitableImage(struct singleEntry * entry, const char * bootPrefix, + + fullName = alloca(strlen(bootPrefix) + + strlen(line->elements[1].item) + 1); +- rootspec = getRootSpecifier(line->elements[1].item); +- int rootspec_offset = rootspec ? strlen(rootspec) : 0; ++ rs = getRootSpecifier(line->elements[1].item); + int hasslash = endswith(bootPrefix, '/') || +- beginswith(line->elements[1].item + rootspec_offset, '/'); ++ beginswith(line->elements[1].item + rs, '/'); + sprintf(fullName, "%s%s%s", bootPrefix, hasslash ? "" : "/", +- line->elements[1].item + rootspec_offset); ++ line->elements[1].item + rs); + if (access(fullName, R_OK)) { + notSuitablePrintf(entry, 0, "access to %s failed\n", fullName); + return 0; +@@ -1952,7 +1951,6 @@ struct singleEntry * findEntryByPath(struct grubConfig * config, + struct singleLine * line; + int i; + char * chptr; +- char * rootspec = NULL; + enum lineType_e checkType = LT_KERNEL; + + if (isdigit(*kernel)) { +@@ -2044,11 +2042,10 @@ struct singleEntry * findEntryByPath(struct grubConfig * config, + + if (line && line->type != LT_MENUENTRY && + line->numElements >= 2) { +- rootspec = getRootSpecifier(line->elements[1].item); +- if (!strcmp(line->elements[1].item + +- ((rootspec != NULL) ? strlen(rootspec) : 0), +- kernel + strlen(prefix))) +- break; ++ if (!strcmp(line->elements[1].item + ++ getRootSpecifier(line->elements[1].item), ++ kernel + strlen(prefix))) ++ break; + } + if(line->type == LT_MENUENTRY && + !strcmp(line->elements[1].item, kernel)) +@@ -2797,11 +2794,11 @@ struct singleLine * addLineTmpl(struct singleEntry * entry, + + /* but try to keep the rootspec from the template... sigh */ + if (tmplLine->type & (LT_HYPER|LT_KERNEL|LT_MBMODULE|LT_INITRD|LT_KERNEL_EFI|LT_INITRD_EFI|LT_KERNEL_16|LT_INITRD_16)) { +- char * rootspec = getRootSpecifier(tmplLine->elements[1].item); +- if (rootspec != NULL) { +- free(newLine->elements[1].item); +- newLine->elements[1].item = +- sdupprintf("%s%s", rootspec, val); ++ size_t rs = getRootSpecifier(tmplLine->elements[1].item); ++ if (rs > 0) { ++ free(newLine->elements[1].item); ++ newLine->elements[1].item = sdupprintf("%.*s%s", (int) rs, ++ tmplLine->elements[1].item, val); + } + } + } +@@ -3729,15 +3726,19 @@ int checkForElilo(struct grubConfig * config) { + return 1; + } + +-static char * getRootSpecifier(char * str) { +- char * idx, * rootspec = NULL; ++static size_t getRootSpecifier(const char *str) ++{ ++ size_t rs = 0; + + if (*str == '(') { +- idx = rootspec = strdup(str); +- while(*idx && (*idx != ')') && (!isspace(*idx))) idx++; +- *(++idx) = '\0'; ++ for (; str[rs] != ')' && !isspace(str[rs]); rs++) { ++ if (!str[rs]) ++ return rs; ++ } ++ rs++; + } +- return rootspec; ++ ++ return rs; + } + + static char * getInitrdVal(struct grubConfig * config, +@@ -4616,7 +4617,7 @@ int main(int argc, const char ** argv) { + if (displayDefault) { + struct singleLine * line; + struct singleEntry * entry; +- char * rootspec; ++ size_t rs; + + if (config->defaultImage == -1) return 0; + if (config->defaultImage == DEFAULT_SAVED_GRUB2 && +@@ -4629,9 +4630,8 @@ int main(int argc, const char ** argv) { + line = getLineByType(LT_KERNEL|LT_HYPER|LT_KERNEL_EFI|LT_KERNEL_16, entry->lines); + if (!line) return 0; + +- rootspec = getRootSpecifier(line->elements[1].item); +- printf("%s%s\n", bootPrefix, line->elements[1].item + +- ((rootspec != NULL) ? strlen(rootspec) : 0)); ++ rs = getRootSpecifier(line->elements[1].item); ++ printf("%s%s\n", bootPrefix, line->elements[1].item + rs); + + return 0; + +-- +2.14.3 + diff --git a/0002-Add-btrfs-subvolume-support-for-grub2.patch b/0002-Add-btrfs-subvolume-support-for-grub2.patch new file mode 100644 index 0000000..d460c5d --- /dev/null +++ b/0002-Add-btrfs-subvolume-support-for-grub2.patch @@ -0,0 +1,209 @@ +From 5dec033b19bb5b07a0a136a7357e16c8ca9f5dd6 Mon Sep 17 00:00:00 2001 +From: Nathaniel McCallum +Date: Fri, 2 Mar 2018 08:40:18 -0500 +Subject: [PATCH 2/3] Add btrfs subvolume support for grub2 + +In order to find the subvolume prefix from a given path, we parse +/proc/mounts. In cases where /proc/mounts doesn't contain the +filesystem, the caller can use the --mounts option to specify his own +mounts file. + +Btrfs subvolumes are already supported by grub2 and by grub2-mkconfig. + +Fixes #22 +--- + grubby.c | 148 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 143 insertions(+), 5 deletions(-) + +diff --git a/grubby.c b/grubby.c +index a062ef8..96d252a 100644 +--- a/grubby.c ++++ b/grubby.c +@@ -68,6 +68,8 @@ int isEfi = 0; + + char *saved_command_line = NULL; + ++const char *mounts = "/proc/mounts"; ++ + /* comments get lumped in with indention */ + struct lineElement { + char * item; +@@ -1834,6 +1836,129 @@ static int endswith(const char *s, char c) + return s[slen] == c; + } + ++typedef struct { ++ const char *start; ++ size_t chars; ++} field; ++ ++static int iscomma(int c) ++{ ++ return c == ','; ++} ++ ++static int isequal(int c) ++{ ++ return c == '='; ++} ++ ++static field findField(const field *in, typeof(isspace) *isdelim, field *out) ++{ ++ field nxt = {}; ++ size_t off = 0; ++ ++ while (off < in->chars && isdelim(in->start[off])) ++ off++; ++ ++ if (off == in->chars) ++ return nxt; ++ ++ out->start = &in->start[off]; ++ out->chars = 0; ++ ++ while (off + out->chars < in->chars && !isdelim(out->start[out->chars])) ++ out->chars++; ++ ++ nxt.start = out->start + out->chars; ++ nxt.chars = in->chars - off - out->chars; ++ return nxt; ++} ++ ++static int fieldEquals(const field *in, const char *str) ++{ ++ return in->chars == strlen(str) && ++ strncmp(in->start, str, in->chars) == 0; ++} ++ ++/* Parse /proc/mounts to determine the subvolume prefix. */ ++static size_t subvolPrefix(const char *str) ++{ ++ FILE *file = NULL; ++ char *line = NULL; ++ size_t prfx = 0; ++ size_t size = 0; ++ ++ file = fopen(mounts, "r"); ++ if (!file) ++ return 0; ++ ++ for (ssize_t s; (s = getline(&line, &size, file)) >= 0; ) { ++ field nxt = { line, s }; ++ field dev = {}; ++ field path = {}; ++ field type = {}; ++ field opts = {}; ++ field opt = {}; ++ ++ nxt = findField(&nxt, isspace, &dev); ++ if (!nxt.start) ++ continue; ++ ++ nxt = findField(&nxt, isspace, &path); ++ if (!nxt.start) ++ continue; ++ ++ nxt = findField(&nxt, isspace, &type); ++ if (!nxt.start) ++ continue; ++ ++ nxt = findField(&nxt, isspace, &opts); ++ if (!nxt.start) ++ continue; ++ ++ if (!fieldEquals(&type, "btrfs")) ++ continue; ++ ++ /* We have found a btrfs mount point. */ ++ ++ nxt = opts; ++ while ((nxt = findField(&nxt, iscomma, &opt)).start) { ++ field key = {}; ++ field val = {}; ++ ++ opt = findField(&opt, isequal, &key); ++ if (!opt.start) ++ continue; ++ ++ opt = findField(&opt, isequal, &val); ++ if (!opt.start) ++ continue; ++ ++ if (!fieldEquals(&key, "subvol")) ++ continue; ++ ++ /* We have found a btrfs subvolume mount point. */ ++ ++ if (strncmp(val.start, str, val.chars)) ++ continue; ++ ++ if (val.start[val.chars - 1] != '/' && ++ str[val.chars] != '/') ++ continue; ++ ++ /* The subvolume mount point matches our input. */ ++ ++ if (prfx < val.chars) ++ prfx = val.chars; ++ } ++ } ++ ++ dbgPrintf("%s(): str: '%s', prfx: '%s'\n", __FUNCTION__, str, prfx); ++ ++ fclose(file); ++ free(line); ++ return prfx; ++} ++ + int suitableImage(struct singleEntry * entry, const char * bootPrefix, + int skipRemoved, int flags) { + struct singleLine * line; +@@ -2794,12 +2919,22 @@ struct singleLine * addLineTmpl(struct singleEntry * entry, + + /* but try to keep the rootspec from the template... sigh */ + if (tmplLine->type & (LT_HYPER|LT_KERNEL|LT_MBMODULE|LT_INITRD|LT_KERNEL_EFI|LT_INITRD_EFI|LT_KERNEL_16|LT_INITRD_16)) { +- size_t rs = getRootSpecifier(tmplLine->elements[1].item); ++ const char *prfx = tmplLine->elements[1].item; ++ size_t rs = getRootSpecifier(prfx); ++ if (isinitrd(tmplLine->type)) { ++ for (struct singleLine *l = entry->lines; ++ rs == 0 && l; l = l->next) { ++ if (iskernel(l->type)) { ++ prfx = l->elements[1].item; ++ rs = getRootSpecifier(prfx); ++ } ++ } ++ } + if (rs > 0) { + free(newLine->elements[1].item); +- newLine->elements[1].item = sdupprintf("%.*s%s", (int) rs, +- tmplLine->elements[1].item, val); +- } ++ newLine->elements[1].item = sdupprintf("%.*s%s", ++ (int) rs, prfx, val); ++ } + } + } + +@@ -3738,7 +3873,7 @@ static size_t getRootSpecifier(const char *str) + rs++; + } + +- return rs; ++ return rs + subvolPrefix(str + rs); + } + + static char * getInitrdVal(struct grubConfig * config, +@@ -4253,6 +4388,9 @@ int main(int argc, const char ** argv) { + { "mbargs", 0, POPT_ARG_STRING, &newMBKernelArgs, 0, + _("default arguments for the new multiboot kernel or " + "new arguments for multiboot kernel being updated"), NULL }, ++ { "mounts", 0, POPT_ARG_STRING, &mounts, 0, ++ _("path to fake /proc/mounts file (for testing only)"), ++ _("mounts") }, + { "bad-image-okay", 0, 0, &badImageOkay, 0, + _("don't sanity check images in boot entries (for testing only)"), + NULL }, +-- +2.14.3 + diff --git a/0003-Add-tests-for-btrfs-support.patch b/0003-Add-tests-for-btrfs-support.patch new file mode 100644 index 0000000..d274bb9 --- /dev/null +++ b/0003-Add-tests-for-btrfs-support.patch @@ -0,0 +1,1871 @@ +From 20d92194d03750d5d839c501d0539f9258614aae Mon Sep 17 00:00:00 2001 +From: Gene Czarcinski +Date: Mon, 9 Jun 2014 21:11:37 -0400 +Subject: [PATCH 3/3] Add tests for btrfs support + +The tests performed are: +- add kernel with /boot on btrfs subvol (20) +- update kernel/add initrd with /boot on btrfs subvol (21) +- add kernel with rootfs on btrfs subvol and /boot a directory (22) +- update kernel/add initrd with rootfs on btrfs subvol and + /boot a directory (23) +- add kernel and initrd with /boot on btrfs subvol (24) +- add kernel and initrd with rootfs on btrfs subvol and /boot + a directory (25) +--- + test.sh | 40 ++++++++++ + test/grub2-support_files/g2.20-mounts | 2 + + test/grub2-support_files/g2.21-mounts | 1 + + test/grub2-support_files/g2.22-mounts | 1 + + test/grub2-support_files/g2.23-mounts | 1 + + test/grub2-support_files/g2.24-mounts | 1 + + test/grub2-support_files/g2.25-mounts | 1 + + test/grub2.20 | 126 +++++++++++++++++++++++++++++ + test/grub2.21 | 140 +++++++++++++++++++++++++++++++++ + test/grub2.22 | 128 ++++++++++++++++++++++++++++++ + test/grub2.23 | 143 +++++++++++++++++++++++++++++++++ + test/grub2.24 | 126 +++++++++++++++++++++++++++++ + test/grub2.25 | 128 ++++++++++++++++++++++++++++++ + test/results/add/g2-1.20 | 140 +++++++++++++++++++++++++++++++++ + test/results/add/g2-1.21 | 141 +++++++++++++++++++++++++++++++++ + test/results/add/g2-1.22 | 143 +++++++++++++++++++++++++++++++++ + test/results/add/g2-1.23 | 144 ++++++++++++++++++++++++++++++++++ + test/results/add/g2-1.24 | 141 +++++++++++++++++++++++++++++++++ + test/results/add/g2-1.25 | 144 ++++++++++++++++++++++++++++++++++ + 19 files changed, 1691 insertions(+) + create mode 100644 test/grub2-support_files/g2.20-mounts + create mode 120000 test/grub2-support_files/g2.21-mounts + create mode 100644 test/grub2-support_files/g2.22-mounts + create mode 120000 test/grub2-support_files/g2.23-mounts + create mode 120000 test/grub2-support_files/g2.24-mounts + create mode 120000 test/grub2-support_files/g2.25-mounts + create mode 100644 test/grub2.20 + create mode 100644 test/grub2.21 + create mode 100644 test/grub2.22 + create mode 100644 test/grub2.23 + create mode 100644 test/grub2.24 + create mode 100644 test/grub2.25 + create mode 100644 test/results/add/g2-1.20 + create mode 100644 test/results/add/g2-1.21 + create mode 100644 test/results/add/g2-1.22 + create mode 100644 test/results/add/g2-1.23 + create mode 100644 test/results/add/g2-1.24 + create mode 100644 test/results/add/g2-1.25 + +diff --git a/test.sh b/test.sh +index 6379698..c35bfca 100755 +--- a/test.sh ++++ b/test.sh +@@ -629,6 +629,46 @@ if [ "$testgrub2" == "y" ]; then + --initrd /boot/initramfs-0-rescue-5a94251776a14678911d4ae0949500f5.img \ + --copy-default --title "Fedora 21 Rescue" --args=root=/fooooo \ + --remove-kernel=wtf --boot-filesystem=/boot/ ++ ++ testing="GRUB2 add kernel with boot on btrfs subvol" ++ grub2Test grub2.20 add/g2-1.20 --add-kernel=/boot/new-kernel.img \ ++ --title='title' \ ++ --boot-filesystem=/boot/ \ ++ --copy-default \ ++ --mounts='test/grub2-support_files/g2.20-mounts' ++ ++ testing="GRUB2 add initrd with boot on btrfs subvol" ++ grub2Test grub2.21 add/g2-1.21 --update-kernel=/boot/new-kernel.img \ ++ --initrd=/boot/new-initrd --boot-filesystem=/boot/ \ ++ --mounts='test/grub2-support_files/g2.21-mounts' ++ ++ testing="GRUB2 add kernel with rootfs on btrfs subvol and boot directory" ++ grub2Test grub2.22 add/g2-1.22 --add-kernel=/boot/new-kernel.img \ ++ --title='title' \ ++ --boot-filesystem= \ ++ --copy-default \ ++ --mounts='test/grub2-support_files/g2.22-mounts' ++ ++ testing="GRUB2 add initrd with rootfs on btrfs subvol and boot directory" ++ grub2Test grub2.23 add/g2-1.23 --update-kernel=/boot/new-kernel.img \ ++ --initrd=/boot/new-initrd --boot-filesystem= \ ++ --mounts='test/grub2-support_files/g2.23-mounts' ++ ++ testing="GRUB2 add kernel and initrd with boot on btrfs subvol" ++ grub2Test grub2.24 add/g2-1.24 --add-kernel=/boot/new-kernel.img \ ++ --title='title' \ ++ --initrd=/boot/new-initrd \ ++ --boot-filesystem=/boot/ \ ++ --copy-default \ ++ --mounts='test/grub2-support_files/g2.24-mounts' ++ ++ testing="GRUB2 add kernel and initrd with rootfs on btrfs subvol and boot directory" ++ grub2Test grub2.25 add/g2-1.25 --add-kernel=/boot/new-kernel.img \ ++ --title='title' \ ++ --initrd=/boot/new-initrd \ ++ --boot-filesystem= \ ++ --copy-default \ ++ --mounts='test/grub2-support_files/g2.25-mounts' + fi + fi + +diff --git a/test/grub2-support_files/g2.20-mounts b/test/grub2-support_files/g2.20-mounts +new file mode 100644 +index 0000000..00bdb48 +--- /dev/null ++++ b/test/grub2-support_files/g2.20-mounts +@@ -0,0 +1,2 @@ ++/dev/sda / btrfs subvol=/root6,defaults 0 0 ++/dev/sda /boot btrfs subvol=/boot6,defaults 0 0 +diff --git a/test/grub2-support_files/g2.21-mounts b/test/grub2-support_files/g2.21-mounts +new file mode 120000 +index 0000000..42ef3fd +--- /dev/null ++++ b/test/grub2-support_files/g2.21-mounts +@@ -0,0 +1 @@ ++g2.20-mounts +\ No newline at end of file +diff --git a/test/grub2-support_files/g2.22-mounts b/test/grub2-support_files/g2.22-mounts +new file mode 100644 +index 0000000..5b664e7 +--- /dev/null ++++ b/test/grub2-support_files/g2.22-mounts +@@ -0,0 +1 @@ ++/dev/sda / btrfs defaults,subvol=/root4,ro 0 0 +diff --git a/test/grub2-support_files/g2.23-mounts b/test/grub2-support_files/g2.23-mounts +new file mode 120000 +index 0000000..74f036f +--- /dev/null ++++ b/test/grub2-support_files/g2.23-mounts +@@ -0,0 +1 @@ ++g2.22-mounts +\ No newline at end of file +diff --git a/test/grub2-support_files/g2.24-mounts b/test/grub2-support_files/g2.24-mounts +new file mode 120000 +index 0000000..42ef3fd +--- /dev/null ++++ b/test/grub2-support_files/g2.24-mounts +@@ -0,0 +1 @@ ++g2.20-mounts +\ No newline at end of file +diff --git a/test/grub2-support_files/g2.25-mounts b/test/grub2-support_files/g2.25-mounts +new file mode 120000 +index 0000000..74f036f +--- /dev/null ++++ b/test/grub2-support_files/g2.25-mounts +@@ -0,0 +1 @@ ++g2.22-mounts +\ No newline at end of file +diff --git a/test/grub2.20 b/test/grub2.20 +new file mode 100644 +index 0000000..23b75fa +--- /dev/null ++++ b/test/grub2.20 +@@ -0,0 +1,126 @@ ++# ++# DO NOT EDIT THIS FILE ++# ++# It is automatically generated by grub2-mkconfig using templates ++# from /etc/grub.d and settings from /etc/default/grub ++# ++ ++### BEGIN /etc/grub.d/00_header ### ++set pager=1 ++ ++if [ -s $prefix/grubenv ]; then ++ load_env ++fi ++if [ "${next_entry}" ] ; then ++ set default="${next_entry}" ++ set next_entry= ++ save_env next_entry ++ set boot_once=true ++else ++ set default="${saved_entry}" ++fi ++ ++if [ x"${feature_menuentry_id}" = xy ]; then ++ menuentry_id_option="--id" ++else ++ menuentry_id_option="" ++fi ++ ++export menuentry_id_option ++ ++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 load_video { ++ if [ x$feature_all_video_module = xy ]; then ++ insmod all_video ++ else ++ insmod efi_gop ++ insmod efi_uga ++ insmod ieee1275_fb ++ insmod vbe ++ insmod vga ++ insmod video_bochs ++ insmod video_cirrus ++ fi ++} ++ ++terminal_output console ++if [ x$feature_timeout_style = xy ] ; then ++ set timeout_style=menu ++ set timeout=15 ++# Fallback normal timeout code in case the timeout_style feature is ++# unavailable. ++else ++ set timeout=15 ++fi ++### END /etc/grub.d/00_header ### ++ ++### BEGIN /etc/grub.d/10_linux ### ++menuentry 'Fedora, with Linux 3.15.0-0.rc7.git2.1.fc21.x86_64' --class gnu-linux --class gnu --class os { ++ load_video ++ set gfxpayload=keep ++ insmod gzio ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ else ++ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ fi ++ 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 ++ initrd16 /boot6/initramfs-3.15.0-0.rc7.git2.1.fc21.x86_64.img ++} ++menuentry 'Fedora, with Linux 0-rescue-81378818f7a24478b496ebef90e1dd69' --class gnu-linux --class gnu --class os { ++ load_video ++ insmod gzio ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ else ++ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ fi ++ linux16 /boot6/vmlinuz-0-rescue-81378818f7a24478b496ebef90e1dd69 root=UUID=1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ro rootflags=subvol=root6 rhgb quiet ++ initrd16 /boot6/initramfs-0-rescue-81378818f7a24478b496ebef90e1dd69.img ++} ++ ++### 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_ppc_terminfo ### ++### END /etc/grub.d/20_ppc_terminfo ### ++ ++### 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 ${config_directory}/custom.cfg ]; then ++ source ${config_directory}/custom.cfg ++elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then ++ source $prefix/custom.cfg; ++fi ++### END /etc/grub.d/41_custom ### +diff --git a/test/grub2.21 b/test/grub2.21 +new file mode 100644 +index 0000000..579c2f6 +--- /dev/null ++++ b/test/grub2.21 +@@ -0,0 +1,140 @@ ++# ++# DO NOT EDIT THIS FILE ++# ++# It is automatically generated by grub2-mkconfig using templates ++# from /etc/grub.d and settings from /etc/default/grub ++# ++ ++### BEGIN /etc/grub.d/00_header ### ++set pager=1 ++ ++if [ -s $prefix/grubenv ]; then ++ load_env ++fi ++if [ "${next_entry}" ] ; then ++ set default="${next_entry}" ++ set next_entry= ++ save_env next_entry ++ set boot_once=true ++else ++ set default="${saved_entry}" ++fi ++ ++if [ x"${feature_menuentry_id}" = xy ]; then ++ menuentry_id_option="--id" ++else ++ menuentry_id_option="" ++fi ++ ++export menuentry_id_option ++ ++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 load_video { ++ if [ x$feature_all_video_module = xy ]; then ++ insmod all_video ++ else ++ insmod efi_gop ++ insmod efi_uga ++ insmod ieee1275_fb ++ insmod vbe ++ insmod vga ++ insmod video_bochs ++ insmod video_cirrus ++ fi ++} ++ ++terminal_output console ++if [ x$feature_timeout_style = xy ] ; then ++ set timeout_style=menu ++ set timeout=15 ++# Fallback normal timeout code in case the timeout_style feature is ++# unavailable. ++else ++ set timeout=15 ++fi ++### END /etc/grub.d/00_header ### ++ ++### BEGIN /etc/grub.d/10_linux ### ++menuentry 'title' --class gnu-linux --class gnu --class os { ++ load_video ++ set gfxpayload=keep ++ insmod gzio ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ else ++ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ fi ++ linux16 /boot6/new-kernel.img root=UUID=1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ro rootflags=subvol=root6 rhgb quiet ++} ++menuentry 'Fedora, with Linux 3.15.0-0.rc7.git2.1.fc21.x86_64' --class gnu-linux --class gnu --class os { ++ load_video ++ set gfxpayload=keep ++ insmod gzio ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ else ++ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ fi ++ 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 ++ initrd16 /boot6/initramfs-3.15.0-0.rc7.git2.1.fc21.x86_64.img ++} ++menuentry 'Fedora, with Linux 0-rescue-81378818f7a24478b496ebef90e1dd69' --class gnu-linux --class gnu --class os { ++ load_video ++ insmod gzio ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ else ++ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ fi ++ linux16 /boot6/vmlinuz-0-rescue-81378818f7a24478b496ebef90e1dd69 root=UUID=1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ro rootflags=subvol=root6 rhgb quiet ++ initrd16 /boot6/initramfs-0-rescue-81378818f7a24478b496ebef90e1dd69.img ++} ++ ++### 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_ppc_terminfo ### ++### END /etc/grub.d/20_ppc_terminfo ### ++ ++### 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 ${config_directory}/custom.cfg ]; then ++ source ${config_directory}/custom.cfg ++elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then ++ source $prefix/custom.cfg; ++fi ++### END /etc/grub.d/41_custom ### +diff --git a/test/grub2.22 b/test/grub2.22 +new file mode 100644 +index 0000000..9466bc3 +--- /dev/null ++++ b/test/grub2.22 +@@ -0,0 +1,128 @@ ++# ++# DO NOT EDIT THIS FILE ++# ++# It is automatically generated by grub2-mkconfig using templates ++# from /etc/grub.d and settings from /etc/default/grub ++# ++ ++### BEGIN /etc/grub.d/00_header ### ++set pager=1 ++ ++if [ -s $prefix/grubenv ]; then ++ load_env ++fi ++if [ "${next_entry}" ] ; then ++ set default="${next_entry}" ++ set next_entry= ++ save_env next_entry ++ set boot_once=true ++else ++ set default="${saved_entry}" ++fi ++ ++if [ x"${feature_menuentry_id}" = xy ]; then ++ menuentry_id_option="--id" ++else ++ menuentry_id_option="" ++fi ++ ++export menuentry_id_option ++ ++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 load_video { ++ if [ x$feature_all_video_module = xy ]; then ++ insmod all_video ++ else ++ insmod efi_gop ++ insmod efi_uga ++ insmod ieee1275_fb ++ insmod vbe ++ insmod vga ++ insmod video_bochs ++ insmod video_cirrus ++ fi ++} ++ ++terminal_output console ++if [ x$feature_timeout_style = xy ] ; then ++ set timeout_style=menu ++ set timeout=15 ++# Fallback normal timeout code in case the timeout_style feature is ++# unavailable. ++else ++ set timeout=15 ++fi ++### END /etc/grub.d/00_header ### ++ ++### BEGIN /etc/grub.d/10_linux ### ++menuentry 'Fedora, with Linux 3.15.0-0.rc7.git2.1.fc21.x86_64' --class gnu-linux --class gnu --class os { ++ load_video ++ set gfxpayload=keep ++ insmod gzio ++ insmod part_msdos ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ else ++ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ fi ++ 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 ++ initrd16 /root4/boot/initramfs-3.15.0-0.rc7.git2.1.fc21.x86_64.img ++} ++menuentry 'Fedora, with Linux 0-rescue-20e7024f4e9c4b70b1042b91acd434c6' --class gnu-linux --class gnu --class os { ++ load_video ++ insmod gzio ++ insmod part_msdos ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ else ++ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ fi ++ linux16 /root4/boot/vmlinuz-0-rescue-20e7024f4e9c4b70b1042b91acd434c6 root=UUID=54c6abc2-b1e7-4987-aa73-c79927be69eb ro rootflags=subvol=root4 rhgb quiet ++ initrd16 /root4/boot/initramfs-0-rescue-20e7024f4e9c4b70b1042b91acd434c6.img ++} ++ ++### 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_ppc_terminfo ### ++### END /etc/grub.d/20_ppc_terminfo ### ++ ++### BEGIN /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 ${config_directory}/custom.cfg ]; then ++ source ${config_directory}/custom.cfg ++elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then ++ source $prefix/custom.cfg; ++fi ++### END /etc/grub.d/41_custom ### +diff --git a/test/grub2.23 b/test/grub2.23 +new file mode 100644 +index 0000000..5cb240f +--- /dev/null ++++ b/test/grub2.23 +@@ -0,0 +1,143 @@ ++# ++# DO NOT EDIT THIS FILE ++# ++# It is automatically generated by grub2-mkconfig using templates ++# from /etc/grub.d and settings from /etc/default/grub ++# ++ ++### BEGIN /etc/grub.d/00_header ### ++set pager=1 ++ ++if [ -s $prefix/grubenv ]; then ++ load_env ++fi ++if [ "${next_entry}" ] ; then ++ set default="${next_entry}" ++ set next_entry= ++ save_env next_entry ++ set boot_once=true ++else ++ set default="${saved_entry}" ++fi ++ ++if [ x"${feature_menuentry_id}" = xy ]; then ++ menuentry_id_option="--id" ++else ++ menuentry_id_option="" ++fi ++ ++export menuentry_id_option ++ ++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 load_video { ++ if [ x$feature_all_video_module = xy ]; then ++ insmod all_video ++ else ++ insmod efi_gop ++ insmod efi_uga ++ insmod ieee1275_fb ++ insmod vbe ++ insmod vga ++ insmod video_bochs ++ insmod video_cirrus ++ fi ++} ++ ++terminal_output console ++if [ x$feature_timeout_style = xy ] ; then ++ set timeout_style=menu ++ set timeout=15 ++# Fallback normal timeout code in case the timeout_style feature is ++# unavailable. ++else ++ set timeout=15 ++fi ++### END /etc/grub.d/00_header ### ++ ++### BEGIN /etc/grub.d/10_linux ### ++menuentry 'title' --class gnu-linux --class gnu --class os { ++ load_video ++ set gfxpayload=keep ++ insmod gzio ++ insmod part_msdos ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ else ++ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ fi ++ linux16 /root4/boot/new-kernel.img root=UUID=54c6abc2-b1e7-4987-aa73-c79927be69eb ro rootflags=subvol=root4 rhgb quiet ++} ++menuentry 'Fedora, with Linux 3.15.0-0.rc7.git2.1.fc21.x86_64' --class gnu-linux --class gnu --class os { ++ load_video ++ set gfxpayload=keep ++ insmod gzio ++ insmod part_msdos ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ else ++ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ fi ++ 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 ++ initrd16 /root4/boot/initramfs-3.15.0-0.rc7.git2.1.fc21.x86_64.img ++} ++menuentry 'Fedora, with Linux 0-rescue-20e7024f4e9c4b70b1042b91acd434c6' --class gnu-linux --class gnu --class os { ++ load_video ++ insmod gzio ++ insmod part_msdos ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ else ++ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ fi ++ linux16 /root4/boot/vmlinuz-0-rescue-20e7024f4e9c4b70b1042b91acd434c6 root=UUID=54c6abc2-b1e7-4987-aa73-c79927be69eb ro rootflags=subvol=root4 rhgb quiet ++ initrd16 /root4/boot/initramfs-0-rescue-20e7024f4e9c4b70b1042b91acd434c6.img ++} ++ ++### 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_ppc_terminfo ### ++### END /etc/grub.d/20_ppc_terminfo ### ++ ++### BEGIN /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 ${config_directory}/custom.cfg ]; then ++ source ${config_directory}/custom.cfg ++elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then ++ source $prefix/custom.cfg; ++fi ++### END /etc/grub.d/41_custom ### +diff --git a/test/grub2.24 b/test/grub2.24 +new file mode 100644 +index 0000000..23b75fa +--- /dev/null ++++ b/test/grub2.24 +@@ -0,0 +1,126 @@ ++# ++# DO NOT EDIT THIS FILE ++# ++# It is automatically generated by grub2-mkconfig using templates ++# from /etc/grub.d and settings from /etc/default/grub ++# ++ ++### BEGIN /etc/grub.d/00_header ### ++set pager=1 ++ ++if [ -s $prefix/grubenv ]; then ++ load_env ++fi ++if [ "${next_entry}" ] ; then ++ set default="${next_entry}" ++ set next_entry= ++ save_env next_entry ++ set boot_once=true ++else ++ set default="${saved_entry}" ++fi ++ ++if [ x"${feature_menuentry_id}" = xy ]; then ++ menuentry_id_option="--id" ++else ++ menuentry_id_option="" ++fi ++ ++export menuentry_id_option ++ ++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 load_video { ++ if [ x$feature_all_video_module = xy ]; then ++ insmod all_video ++ else ++ insmod efi_gop ++ insmod efi_uga ++ insmod ieee1275_fb ++ insmod vbe ++ insmod vga ++ insmod video_bochs ++ insmod video_cirrus ++ fi ++} ++ ++terminal_output console ++if [ x$feature_timeout_style = xy ] ; then ++ set timeout_style=menu ++ set timeout=15 ++# Fallback normal timeout code in case the timeout_style feature is ++# unavailable. ++else ++ set timeout=15 ++fi ++### END /etc/grub.d/00_header ### ++ ++### BEGIN /etc/grub.d/10_linux ### ++menuentry 'Fedora, with Linux 3.15.0-0.rc7.git2.1.fc21.x86_64' --class gnu-linux --class gnu --class os { ++ load_video ++ set gfxpayload=keep ++ insmod gzio ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ else ++ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ fi ++ 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 ++ initrd16 /boot6/initramfs-3.15.0-0.rc7.git2.1.fc21.x86_64.img ++} ++menuentry 'Fedora, with Linux 0-rescue-81378818f7a24478b496ebef90e1dd69' --class gnu-linux --class gnu --class os { ++ load_video ++ insmod gzio ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ else ++ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ fi ++ linux16 /boot6/vmlinuz-0-rescue-81378818f7a24478b496ebef90e1dd69 root=UUID=1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ro rootflags=subvol=root6 rhgb quiet ++ initrd16 /boot6/initramfs-0-rescue-81378818f7a24478b496ebef90e1dd69.img ++} ++ ++### 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_ppc_terminfo ### ++### END /etc/grub.d/20_ppc_terminfo ### ++ ++### 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 ${config_directory}/custom.cfg ]; then ++ source ${config_directory}/custom.cfg ++elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then ++ source $prefix/custom.cfg; ++fi ++### END /etc/grub.d/41_custom ### +diff --git a/test/grub2.25 b/test/grub2.25 +new file mode 100644 +index 0000000..9466bc3 +--- /dev/null ++++ b/test/grub2.25 +@@ -0,0 +1,128 @@ ++# ++# DO NOT EDIT THIS FILE ++# ++# It is automatically generated by grub2-mkconfig using templates ++# from /etc/grub.d and settings from /etc/default/grub ++# ++ ++### BEGIN /etc/grub.d/00_header ### ++set pager=1 ++ ++if [ -s $prefix/grubenv ]; then ++ load_env ++fi ++if [ "${next_entry}" ] ; then ++ set default="${next_entry}" ++ set next_entry= ++ save_env next_entry ++ set boot_once=true ++else ++ set default="${saved_entry}" ++fi ++ ++if [ x"${feature_menuentry_id}" = xy ]; then ++ menuentry_id_option="--id" ++else ++ menuentry_id_option="" ++fi ++ ++export menuentry_id_option ++ ++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 load_video { ++ if [ x$feature_all_video_module = xy ]; then ++ insmod all_video ++ else ++ insmod efi_gop ++ insmod efi_uga ++ insmod ieee1275_fb ++ insmod vbe ++ insmod vga ++ insmod video_bochs ++ insmod video_cirrus ++ fi ++} ++ ++terminal_output console ++if [ x$feature_timeout_style = xy ] ; then ++ set timeout_style=menu ++ set timeout=15 ++# Fallback normal timeout code in case the timeout_style feature is ++# unavailable. ++else ++ set timeout=15 ++fi ++### END /etc/grub.d/00_header ### ++ ++### BEGIN /etc/grub.d/10_linux ### ++menuentry 'Fedora, with Linux 3.15.0-0.rc7.git2.1.fc21.x86_64' --class gnu-linux --class gnu --class os { ++ load_video ++ set gfxpayload=keep ++ insmod gzio ++ insmod part_msdos ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ else ++ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ fi ++ 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 ++ initrd16 /root4/boot/initramfs-3.15.0-0.rc7.git2.1.fc21.x86_64.img ++} ++menuentry 'Fedora, with Linux 0-rescue-20e7024f4e9c4b70b1042b91acd434c6' --class gnu-linux --class gnu --class os { ++ load_video ++ insmod gzio ++ insmod part_msdos ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ else ++ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ fi ++ linux16 /root4/boot/vmlinuz-0-rescue-20e7024f4e9c4b70b1042b91acd434c6 root=UUID=54c6abc2-b1e7-4987-aa73-c79927be69eb ro rootflags=subvol=root4 rhgb quiet ++ initrd16 /root4/boot/initramfs-0-rescue-20e7024f4e9c4b70b1042b91acd434c6.img ++} ++ ++### 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_ppc_terminfo ### ++### END /etc/grub.d/20_ppc_terminfo ### ++ ++### BEGIN /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 ${config_directory}/custom.cfg ]; then ++ source ${config_directory}/custom.cfg ++elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then ++ source $prefix/custom.cfg; ++fi ++### END /etc/grub.d/41_custom ### +diff --git a/test/results/add/g2-1.20 b/test/results/add/g2-1.20 +new file mode 100644 +index 0000000..579c2f6 +--- /dev/null ++++ b/test/results/add/g2-1.20 +@@ -0,0 +1,140 @@ ++# ++# DO NOT EDIT THIS FILE ++# ++# It is automatically generated by grub2-mkconfig using templates ++# from /etc/grub.d and settings from /etc/default/grub ++# ++ ++### BEGIN /etc/grub.d/00_header ### ++set pager=1 ++ ++if [ -s $prefix/grubenv ]; then ++ load_env ++fi ++if [ "${next_entry}" ] ; then ++ set default="${next_entry}" ++ set next_entry= ++ save_env next_entry ++ set boot_once=true ++else ++ set default="${saved_entry}" ++fi ++ ++if [ x"${feature_menuentry_id}" = xy ]; then ++ menuentry_id_option="--id" ++else ++ menuentry_id_option="" ++fi ++ ++export menuentry_id_option ++ ++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 load_video { ++ if [ x$feature_all_video_module = xy ]; then ++ insmod all_video ++ else ++ insmod efi_gop ++ insmod efi_uga ++ insmod ieee1275_fb ++ insmod vbe ++ insmod vga ++ insmod video_bochs ++ insmod video_cirrus ++ fi ++} ++ ++terminal_output console ++if [ x$feature_timeout_style = xy ] ; then ++ set timeout_style=menu ++ set timeout=15 ++# Fallback normal timeout code in case the timeout_style feature is ++# unavailable. ++else ++ set timeout=15 ++fi ++### END /etc/grub.d/00_header ### ++ ++### BEGIN /etc/grub.d/10_linux ### ++menuentry 'title' --class gnu-linux --class gnu --class os { ++ load_video ++ set gfxpayload=keep ++ insmod gzio ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ else ++ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ fi ++ linux16 /boot6/new-kernel.img root=UUID=1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ro rootflags=subvol=root6 rhgb quiet ++} ++menuentry 'Fedora, with Linux 3.15.0-0.rc7.git2.1.fc21.x86_64' --class gnu-linux --class gnu --class os { ++ load_video ++ set gfxpayload=keep ++ insmod gzio ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ else ++ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ fi ++ 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 ++ initrd16 /boot6/initramfs-3.15.0-0.rc7.git2.1.fc21.x86_64.img ++} ++menuentry 'Fedora, with Linux 0-rescue-81378818f7a24478b496ebef90e1dd69' --class gnu-linux --class gnu --class os { ++ load_video ++ insmod gzio ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ else ++ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ fi ++ linux16 /boot6/vmlinuz-0-rescue-81378818f7a24478b496ebef90e1dd69 root=UUID=1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ro rootflags=subvol=root6 rhgb quiet ++ initrd16 /boot6/initramfs-0-rescue-81378818f7a24478b496ebef90e1dd69.img ++} ++ ++### 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_ppc_terminfo ### ++### END /etc/grub.d/20_ppc_terminfo ### ++ ++### 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 ${config_directory}/custom.cfg ]; then ++ source ${config_directory}/custom.cfg ++elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then ++ source $prefix/custom.cfg; ++fi ++### END /etc/grub.d/41_custom ### +diff --git a/test/results/add/g2-1.21 b/test/results/add/g2-1.21 +new file mode 100644 +index 0000000..c0dded9 +--- /dev/null ++++ b/test/results/add/g2-1.21 +@@ -0,0 +1,141 @@ ++# ++# DO NOT EDIT THIS FILE ++# ++# It is automatically generated by grub2-mkconfig using templates ++# from /etc/grub.d and settings from /etc/default/grub ++# ++ ++### BEGIN /etc/grub.d/00_header ### ++set pager=1 ++ ++if [ -s $prefix/grubenv ]; then ++ load_env ++fi ++if [ "${next_entry}" ] ; then ++ set default="${next_entry}" ++ set next_entry= ++ save_env next_entry ++ set boot_once=true ++else ++ set default="${saved_entry}" ++fi ++ ++if [ x"${feature_menuentry_id}" = xy ]; then ++ menuentry_id_option="--id" ++else ++ menuentry_id_option="" ++fi ++ ++export menuentry_id_option ++ ++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 load_video { ++ if [ x$feature_all_video_module = xy ]; then ++ insmod all_video ++ else ++ insmod efi_gop ++ insmod efi_uga ++ insmod ieee1275_fb ++ insmod vbe ++ insmod vga ++ insmod video_bochs ++ insmod video_cirrus ++ fi ++} ++ ++terminal_output console ++if [ x$feature_timeout_style = xy ] ; then ++ set timeout_style=menu ++ set timeout=15 ++# Fallback normal timeout code in case the timeout_style feature is ++# unavailable. ++else ++ set timeout=15 ++fi ++### END /etc/grub.d/00_header ### ++ ++### BEGIN /etc/grub.d/10_linux ### ++menuentry 'title' --class gnu-linux --class gnu --class os { ++ load_video ++ set gfxpayload=keep ++ insmod gzio ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ else ++ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ fi ++ linux16 /boot6/new-kernel.img root=UUID=1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ro rootflags=subvol=root6 rhgb quiet ++ initrd16 /boot6/new-initrd ++} ++menuentry 'Fedora, with Linux 3.15.0-0.rc7.git2.1.fc21.x86_64' --class gnu-linux --class gnu --class os { ++ load_video ++ set gfxpayload=keep ++ insmod gzio ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ else ++ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ fi ++ 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 ++ initrd16 /boot6/initramfs-3.15.0-0.rc7.git2.1.fc21.x86_64.img ++} ++menuentry 'Fedora, with Linux 0-rescue-81378818f7a24478b496ebef90e1dd69' --class gnu-linux --class gnu --class os { ++ load_video ++ insmod gzio ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ else ++ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ fi ++ linux16 /boot6/vmlinuz-0-rescue-81378818f7a24478b496ebef90e1dd69 root=UUID=1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ro rootflags=subvol=root6 rhgb quiet ++ initrd16 /boot6/initramfs-0-rescue-81378818f7a24478b496ebef90e1dd69.img ++} ++ ++### 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_ppc_terminfo ### ++### END /etc/grub.d/20_ppc_terminfo ### ++ ++### 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 ${config_directory}/custom.cfg ]; then ++ source ${config_directory}/custom.cfg ++elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then ++ source $prefix/custom.cfg; ++fi ++### END /etc/grub.d/41_custom ### +diff --git a/test/results/add/g2-1.22 b/test/results/add/g2-1.22 +new file mode 100644 +index 0000000..5cb240f +--- /dev/null ++++ b/test/results/add/g2-1.22 +@@ -0,0 +1,143 @@ ++# ++# DO NOT EDIT THIS FILE ++# ++# It is automatically generated by grub2-mkconfig using templates ++# from /etc/grub.d and settings from /etc/default/grub ++# ++ ++### BEGIN /etc/grub.d/00_header ### ++set pager=1 ++ ++if [ -s $prefix/grubenv ]; then ++ load_env ++fi ++if [ "${next_entry}" ] ; then ++ set default="${next_entry}" ++ set next_entry= ++ save_env next_entry ++ set boot_once=true ++else ++ set default="${saved_entry}" ++fi ++ ++if [ x"${feature_menuentry_id}" = xy ]; then ++ menuentry_id_option="--id" ++else ++ menuentry_id_option="" ++fi ++ ++export menuentry_id_option ++ ++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 load_video { ++ if [ x$feature_all_video_module = xy ]; then ++ insmod all_video ++ else ++ insmod efi_gop ++ insmod efi_uga ++ insmod ieee1275_fb ++ insmod vbe ++ insmod vga ++ insmod video_bochs ++ insmod video_cirrus ++ fi ++} ++ ++terminal_output console ++if [ x$feature_timeout_style = xy ] ; then ++ set timeout_style=menu ++ set timeout=15 ++# Fallback normal timeout code in case the timeout_style feature is ++# unavailable. ++else ++ set timeout=15 ++fi ++### END /etc/grub.d/00_header ### ++ ++### BEGIN /etc/grub.d/10_linux ### ++menuentry 'title' --class gnu-linux --class gnu --class os { ++ load_video ++ set gfxpayload=keep ++ insmod gzio ++ insmod part_msdos ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ else ++ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ fi ++ linux16 /root4/boot/new-kernel.img root=UUID=54c6abc2-b1e7-4987-aa73-c79927be69eb ro rootflags=subvol=root4 rhgb quiet ++} ++menuentry 'Fedora, with Linux 3.15.0-0.rc7.git2.1.fc21.x86_64' --class gnu-linux --class gnu --class os { ++ load_video ++ set gfxpayload=keep ++ insmod gzio ++ insmod part_msdos ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ else ++ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ fi ++ 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 ++ initrd16 /root4/boot/initramfs-3.15.0-0.rc7.git2.1.fc21.x86_64.img ++} ++menuentry 'Fedora, with Linux 0-rescue-20e7024f4e9c4b70b1042b91acd434c6' --class gnu-linux --class gnu --class os { ++ load_video ++ insmod gzio ++ insmod part_msdos ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ else ++ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ fi ++ linux16 /root4/boot/vmlinuz-0-rescue-20e7024f4e9c4b70b1042b91acd434c6 root=UUID=54c6abc2-b1e7-4987-aa73-c79927be69eb ro rootflags=subvol=root4 rhgb quiet ++ initrd16 /root4/boot/initramfs-0-rescue-20e7024f4e9c4b70b1042b91acd434c6.img ++} ++ ++### 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_ppc_terminfo ### ++### END /etc/grub.d/20_ppc_terminfo ### ++ ++### BEGIN /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 ${config_directory}/custom.cfg ]; then ++ source ${config_directory}/custom.cfg ++elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then ++ source $prefix/custom.cfg; ++fi ++### END /etc/grub.d/41_custom ### +diff --git a/test/results/add/g2-1.23 b/test/results/add/g2-1.23 +new file mode 100644 +index 0000000..c3e87cf +--- /dev/null ++++ b/test/results/add/g2-1.23 +@@ -0,0 +1,144 @@ ++# ++# DO NOT EDIT THIS FILE ++# ++# It is automatically generated by grub2-mkconfig using templates ++# from /etc/grub.d and settings from /etc/default/grub ++# ++ ++### BEGIN /etc/grub.d/00_header ### ++set pager=1 ++ ++if [ -s $prefix/grubenv ]; then ++ load_env ++fi ++if [ "${next_entry}" ] ; then ++ set default="${next_entry}" ++ set next_entry= ++ save_env next_entry ++ set boot_once=true ++else ++ set default="${saved_entry}" ++fi ++ ++if [ x"${feature_menuentry_id}" = xy ]; then ++ menuentry_id_option="--id" ++else ++ menuentry_id_option="" ++fi ++ ++export menuentry_id_option ++ ++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 load_video { ++ if [ x$feature_all_video_module = xy ]; then ++ insmod all_video ++ else ++ insmod efi_gop ++ insmod efi_uga ++ insmod ieee1275_fb ++ insmod vbe ++ insmod vga ++ insmod video_bochs ++ insmod video_cirrus ++ fi ++} ++ ++terminal_output console ++if [ x$feature_timeout_style = xy ] ; then ++ set timeout_style=menu ++ set timeout=15 ++# Fallback normal timeout code in case the timeout_style feature is ++# unavailable. ++else ++ set timeout=15 ++fi ++### END /etc/grub.d/00_header ### ++ ++### BEGIN /etc/grub.d/10_linux ### ++menuentry 'title' --class gnu-linux --class gnu --class os { ++ load_video ++ set gfxpayload=keep ++ insmod gzio ++ insmod part_msdos ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ else ++ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ fi ++ linux16 /root4/boot/new-kernel.img root=UUID=54c6abc2-b1e7-4987-aa73-c79927be69eb ro rootflags=subvol=root4 rhgb quiet ++ initrd16 /root4/boot/new-initrd ++} ++menuentry 'Fedora, with Linux 3.15.0-0.rc7.git2.1.fc21.x86_64' --class gnu-linux --class gnu --class os { ++ load_video ++ set gfxpayload=keep ++ insmod gzio ++ insmod part_msdos ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ else ++ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ fi ++ 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 ++ initrd16 /root4/boot/initramfs-3.15.0-0.rc7.git2.1.fc21.x86_64.img ++} ++menuentry 'Fedora, with Linux 0-rescue-20e7024f4e9c4b70b1042b91acd434c6' --class gnu-linux --class gnu --class os { ++ load_video ++ insmod gzio ++ insmod part_msdos ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ else ++ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ fi ++ linux16 /root4/boot/vmlinuz-0-rescue-20e7024f4e9c4b70b1042b91acd434c6 root=UUID=54c6abc2-b1e7-4987-aa73-c79927be69eb ro rootflags=subvol=root4 rhgb quiet ++ initrd16 /root4/boot/initramfs-0-rescue-20e7024f4e9c4b70b1042b91acd434c6.img ++} ++ ++### 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_ppc_terminfo ### ++### END /etc/grub.d/20_ppc_terminfo ### ++ ++### BEGIN /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 ${config_directory}/custom.cfg ]; then ++ source ${config_directory}/custom.cfg ++elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then ++ source $prefix/custom.cfg; ++fi ++### END /etc/grub.d/41_custom ### +diff --git a/test/results/add/g2-1.24 b/test/results/add/g2-1.24 +new file mode 100644 +index 0000000..c0dded9 +--- /dev/null ++++ b/test/results/add/g2-1.24 +@@ -0,0 +1,141 @@ ++# ++# DO NOT EDIT THIS FILE ++# ++# It is automatically generated by grub2-mkconfig using templates ++# from /etc/grub.d and settings from /etc/default/grub ++# ++ ++### BEGIN /etc/grub.d/00_header ### ++set pager=1 ++ ++if [ -s $prefix/grubenv ]; then ++ load_env ++fi ++if [ "${next_entry}" ] ; then ++ set default="${next_entry}" ++ set next_entry= ++ save_env next_entry ++ set boot_once=true ++else ++ set default="${saved_entry}" ++fi ++ ++if [ x"${feature_menuentry_id}" = xy ]; then ++ menuentry_id_option="--id" ++else ++ menuentry_id_option="" ++fi ++ ++export menuentry_id_option ++ ++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 load_video { ++ if [ x$feature_all_video_module = xy ]; then ++ insmod all_video ++ else ++ insmod efi_gop ++ insmod efi_uga ++ insmod ieee1275_fb ++ insmod vbe ++ insmod vga ++ insmod video_bochs ++ insmod video_cirrus ++ fi ++} ++ ++terminal_output console ++if [ x$feature_timeout_style = xy ] ; then ++ set timeout_style=menu ++ set timeout=15 ++# Fallback normal timeout code in case the timeout_style feature is ++# unavailable. ++else ++ set timeout=15 ++fi ++### END /etc/grub.d/00_header ### ++ ++### BEGIN /etc/grub.d/10_linux ### ++menuentry 'title' --class gnu-linux --class gnu --class os { ++ load_video ++ set gfxpayload=keep ++ insmod gzio ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ else ++ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ fi ++ linux16 /boot6/new-kernel.img root=UUID=1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ro rootflags=subvol=root6 rhgb quiet ++ initrd16 /boot6/new-initrd ++} ++menuentry 'Fedora, with Linux 3.15.0-0.rc7.git2.1.fc21.x86_64' --class gnu-linux --class gnu --class os { ++ load_video ++ set gfxpayload=keep ++ insmod gzio ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ else ++ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ fi ++ 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 ++ initrd16 /boot6/initramfs-3.15.0-0.rc7.git2.1.fc21.x86_64.img ++} ++menuentry 'Fedora, with Linux 0-rescue-81378818f7a24478b496ebef90e1dd69' --class gnu-linux --class gnu --class os { ++ load_video ++ insmod gzio ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ else ++ search --no-floppy --fs-uuid --set=root 1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ++ fi ++ linux16 /boot6/vmlinuz-0-rescue-81378818f7a24478b496ebef90e1dd69 root=UUID=1bab15a4-93ce-4373-8d7d-b77f907fd0c6 ro rootflags=subvol=root6 rhgb quiet ++ initrd16 /boot6/initramfs-0-rescue-81378818f7a24478b496ebef90e1dd69.img ++} ++ ++### 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_ppc_terminfo ### ++### END /etc/grub.d/20_ppc_terminfo ### ++ ++### 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 ${config_directory}/custom.cfg ]; then ++ source ${config_directory}/custom.cfg ++elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then ++ source $prefix/custom.cfg; ++fi ++### END /etc/grub.d/41_custom ### +diff --git a/test/results/add/g2-1.25 b/test/results/add/g2-1.25 +new file mode 100644 +index 0000000..c3e87cf +--- /dev/null ++++ b/test/results/add/g2-1.25 +@@ -0,0 +1,144 @@ ++# ++# DO NOT EDIT THIS FILE ++# ++# It is automatically generated by grub2-mkconfig using templates ++# from /etc/grub.d and settings from /etc/default/grub ++# ++ ++### BEGIN /etc/grub.d/00_header ### ++set pager=1 ++ ++if [ -s $prefix/grubenv ]; then ++ load_env ++fi ++if [ "${next_entry}" ] ; then ++ set default="${next_entry}" ++ set next_entry= ++ save_env next_entry ++ set boot_once=true ++else ++ set default="${saved_entry}" ++fi ++ ++if [ x"${feature_menuentry_id}" = xy ]; then ++ menuentry_id_option="--id" ++else ++ menuentry_id_option="" ++fi ++ ++export menuentry_id_option ++ ++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 load_video { ++ if [ x$feature_all_video_module = xy ]; then ++ insmod all_video ++ else ++ insmod efi_gop ++ insmod efi_uga ++ insmod ieee1275_fb ++ insmod vbe ++ insmod vga ++ insmod video_bochs ++ insmod video_cirrus ++ fi ++} ++ ++terminal_output console ++if [ x$feature_timeout_style = xy ] ; then ++ set timeout_style=menu ++ set timeout=15 ++# Fallback normal timeout code in case the timeout_style feature is ++# unavailable. ++else ++ set timeout=15 ++fi ++### END /etc/grub.d/00_header ### ++ ++### BEGIN /etc/grub.d/10_linux ### ++menuentry 'title' --class gnu-linux --class gnu --class os { ++ load_video ++ set gfxpayload=keep ++ insmod gzio ++ insmod part_msdos ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ else ++ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ fi ++ linux16 /root4/boot/new-kernel.img root=UUID=54c6abc2-b1e7-4987-aa73-c79927be69eb ro rootflags=subvol=root4 rhgb quiet ++ initrd16 /root4/boot/new-initrd ++} ++menuentry 'Fedora, with Linux 3.15.0-0.rc7.git2.1.fc21.x86_64' --class gnu-linux --class gnu --class os { ++ load_video ++ set gfxpayload=keep ++ insmod gzio ++ insmod part_msdos ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ else ++ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ fi ++ 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 ++ initrd16 /root4/boot/initramfs-3.15.0-0.rc7.git2.1.fc21.x86_64.img ++} ++menuentry 'Fedora, with Linux 0-rescue-20e7024f4e9c4b70b1042b91acd434c6' --class gnu-linux --class gnu --class os { ++ load_video ++ insmod gzio ++ insmod part_msdos ++ insmod part_msdos ++ insmod btrfs ++ set root='hd0,msdos1' ++ if [ x$feature_platform_search_hint = xy ]; then ++ search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1' --hint='hd1,msdos3' 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ else ++ search --no-floppy --fs-uuid --set=root 54c6abc2-b1e7-4987-aa73-c79927be69eb ++ fi ++ linux16 /root4/boot/vmlinuz-0-rescue-20e7024f4e9c4b70b1042b91acd434c6 root=UUID=54c6abc2-b1e7-4987-aa73-c79927be69eb ro rootflags=subvol=root4 rhgb quiet ++ initrd16 /root4/boot/initramfs-0-rescue-20e7024f4e9c4b70b1042b91acd434c6.img ++} ++ ++### 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_ppc_terminfo ### ++### END /etc/grub.d/20_ppc_terminfo ### ++ ++### BEGIN /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 ${config_directory}/custom.cfg ]; then ++ source ${config_directory}/custom.cfg ++elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then ++ source $prefix/custom.cfg; ++fi ++### END /etc/grub.d/41_custom ### +-- +2.14.3 + diff --git a/grubby.spec b/grubby.spec index 924eacd..5807167 100644 --- a/grubby.spec +++ b/grubby.spec @@ -1,6 +1,6 @@ Name: grubby Version: 8.40 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Command line tool for updating bootloader configs Group: System Environment/Base License: GPLv2+ @@ -10,6 +10,9 @@ URL: https://github.com/rhinstaller/grubby # git archive --format=tar --prefix=grubby-%%{version}/ HEAD |bzip2 > grubby-%%{version}.tar.bz2 # Source0: %%{name}-%%{version}.tar.bz2 Source0: https://github.com/rhboot/grubby/archive/%{version}-1.tar.gz +Patch2: 0001-Change-return-type-in-getRootSpecifier.patch +Patch3: 0002-Add-btrfs-subvolume-support-for-grub2.patch +Patch4: 0003-Add-tests-for-btrfs-support.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: pkgconfig glib2-devel popt-devel @@ -81,6 +84,9 @@ rm -rf $RPM_BUILD_ROOT %endif %changelog +* Wed Mar 21 2018 Nathaniel McCallum - 8.40-8 +- Add support for /boot on btrfs subvolumes + * Tue Sep 12 2017 Peter Jones - 8.40-7 - Explicitly require grub2-tools on platforms that need grub2-editenv - Minor packaging cleanups