From 45914f9cd980f27af4dddad8a74e53c3a7f1bb836a285a01b0103285d7d24b85 Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Tue, 8 Jan 2013 07:46:22 +0000 Subject: [PATCH] Accepting request 147483 from home:arvidjaar:bnc:796919 - add grub2-add-device-to-os_prober-linux-menuentry.patch (bnc#796919) OBS-URL: https://build.opensuse.org/request/show/147483 OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=4 --- ...-device-to-os_prober-linux-menuentry.patch | 39 +++++++++++++++++++ grub2.changes | 5 +++ grub2.spec | 2 + 3 files changed, 46 insertions(+) create mode 100644 grub2-add-device-to-os_prober-linux-menuentry.patch diff --git a/grub2-add-device-to-os_prober-linux-menuentry.patch b/grub2-add-device-to-os_prober-linux-menuentry.patch new file mode 100644 index 0000000..bf921e9 --- /dev/null +++ b/grub2-add-device-to-os_prober-linux-menuentry.patch @@ -0,0 +1,39 @@ +From: Andrey Borzenkov +Subject: add "(on /dev/XXX)" to top level os-prober Linux menu entries +References: bnc#796919 + +1. It disambiguates multiple instances of the same OS if present. + +2. It allows menu entry to be skipped by another os-prober. Otherwise +it may result in endless recursion. +Index: grub-2.00/util/grub.d/30_os-prober.in +=================================================================== +--- grub-2.00.orig/util/grub.d/30_os-prober.in ++++ grub-2.00/util/grub.d/30_os-prober.in +@@ -202,7 +202,7 @@ EOF + + if [ "x$is_first_entry" = xtrue ]; then + cat << EOF +-menuentry '$(echo "$OS" | grub_quote)' --class gnu-linux --class gnu --class os \$menuentry_id_option 'osprober-gnulinux-simple-$boot_device_id' { ++menuentry '$(echo "$OS $onstr" | grub_quote)' --class gnu-linux --class gnu --class os \$menuentry_id_option 'osprober-gnulinux-simple-$boot_device_id' { + EOF + save_default_entry | sed -e "s/^/\t/" + printf '%s\n' "${prepare_boot_cache}" +@@ -217,7 +217,7 @@ EOF + cat << EOF + } + EOF +- echo "submenu '$(gettext_printf "Advanced options for %s" "${OS}" | grub_quote)' \$menuentry_id_option 'osprober-gnulinux-advanced-$boot_device_id' {" ++ echo "submenu '$(gettext_printf "Advanced options for %s" "${OS} $onstr" | grub_quote)' \$menuentry_id_option 'osprober-gnulinux-advanced-$boot_device_id' {" + is_first_entry=false + fi + title="${LLABEL} $onstr" +@@ -238,7 +238,7 @@ EOF + } + EOF + if [ x"$title" = x"$GRUB_ACTUAL_DEFAULT" ] || [ x"Previous Linux versions>$title" = x"$GRUB_ACTUAL_DEFAULT" ]; then +- replacement_title="$(echo "Advanced options for ${OS}" | sed 's,>,>>,g')>$(echo "$title" | sed 's,>,>>,g')" ++ replacement_title="$(echo "Advanced options for ${OS} $onstr" | sed 's,>,>>,g')>$(echo "$title" | sed 's,>,>>,g')" + quoted="$(echo "$GRUB_ACTUAL_DEFAULT" | grub_quote)" + title_correction_code="${title_correction_code}if [ \"x\$default\" = '$quoted' ]; then default='$(echo "$replacement_title" | grub_quote)'; fi;" + grub_warn "$(gettext_printf "Please don't use old title \`%s' for GRUB_DEFAULT, use \`%s' (for versions before 2.00) or \`%s' (for 2.00 or later)" "$GRUB_ACTUAL_DEFAULT" "$replacement_title" "gnulinux-advanced-$boot_device_id>gnulinux-$version-$type-$boot_device_id")" diff --git a/grub2.changes b/grub2.changes index aead23c..be1197b 100644 --- a/grub2.changes +++ b/grub2.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Jan 8 07:09:47 UTC 2013 - arvidjaar@gmail.com + +- add grub2-add-device-to-os_prober-linux-menuentry.patch (bnc#796919) + ------------------------------------------------------------------- Sun Jan 6 18:54:54 UTC 2013 - arvidjaar@gmail.com diff --git a/grub2.spec b/grub2.spec index 6225557..5fa49d8 100644 --- a/grub2.spec +++ b/grub2.spec @@ -133,6 +133,7 @@ Patch23: grub2-secureboot-no-insmod-on-sb.patch Patch24: grub2-secureboot-provide-linuxefi-config.patch Patch25: 30_os-prober_UEFI_support.patch Patch26: grub2-fix-enumeration-of-extended-partition.patch +Patch27: grub2-add-device-to-os_prober-linux-menuentry.patch PreReq: perl-Bootloader Requires: gettext-runtime %if 0%{?suse_version} >= 1140 @@ -246,6 +247,7 @@ mv docs/grub.texi docs/grub2.texi %patch24 -p1 %patch25 -p1 %patch26 -p1 +%patch27 -p1 cd .. # README.openSUSE