diff --git a/debian/changelog b/debian/changelog index 6d2958fc4..282ffff56 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,8 @@ grub2 (2.00-7) UNRELEASED; urgency=low * Merge from Ubuntu: - Prefer translations from language packs (LP: #537998). (No-op for Debian, but harmless.) + - Avoid getting confused by inaccessible loop device backing paths + (LP: #938724). -- Colin Watson Wed, 26 Sep 2012 13:16:52 +0100 diff --git a/debian/patches/mkconfig_nonexistent_loopback.patch b/debian/patches/mkconfig_nonexistent_loopback.patch new file mode 100644 index 000000000..62c49067b --- /dev/null +++ b/debian/patches/mkconfig_nonexistent_loopback.patch @@ -0,0 +1,46 @@ +Description: Avoid getting confused by inaccessible loop device backing paths +Author: Colin Watson +Bug-Ubuntu: https://bugs.launchpad.net/bugs/938724 +Forwarded: no +Last-Update: 2012-09-07 + +Index: b/util/grub-mkconfig_lib.in +=================================================================== +--- a/util/grub-mkconfig_lib.in ++++ b/util/grub-mkconfig_lib.in +@@ -138,7 +138,7 @@ + /dev/*) ;; + *) + loop_device="${device}" +- device=`"${grub_probe}" --target=device "${loop_file}"` ++ device=`"${grub_probe}" --target=device "${loop_file}"` || return 0 + ;; + esac + ;; +Index: b/util/grub.d/30_os-prober.in +=================================================================== +--- a/util/grub.d/30_os-prober.in ++++ b/util/grub.d/30_os-prober.in +@@ -169,6 +169,11 @@ + LINITRD="${LINITRD#/boot}" + fi + ++ if [ -z "${prepare_boot_cache}" ]; then ++ prepare_boot_cache="$(prepare_grub_to_access_device ${LBOOT} | sed -e "s/^/\t/")" ++ [ "${prepare_boot_cache}" ] || continue ++ fi ++ + onstr="$(gettext_printf "(on %s)" "${DEVICE}")" + recovery_params="$(echo "${LPARAMS}" | grep 'single\|recovery')" || true + counter=1 +@@ -180,10 +185,6 @@ + fi + used_osprober_linux_ids="$used_osprober_linux_ids 'osprober-gnulinux-$LKERNEL-${recovery_params}-$counter-$boot_device_id'" + +- if [ -z "${prepare_boot_cache}" ]; then +- prepare_boot_cache="$(prepare_grub_to_access_device ${LBOOT} | sed -e "s/^/\t/")" +- fi +- + 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' { diff --git a/debian/patches/series b/debian/patches/series index ba5c86e32..63a962df7 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -26,3 +26,4 @@ emu_freebsd.patch mkconfig_stderr_handling.patch tftp_endianness.patch install_locale_langpack.patch +mkconfig_nonexistent_loopback.patch diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in index 49c6e2be9..65b10b716 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -138,7 +138,7 @@ prepare_grub_to_access_device () /dev/*) ;; *) loop_device="${device}" - device=`"${grub_probe}" --target=device "${loop_file}"` + device=`"${grub_probe}" --target=device "${loop_file}"` || return 0 ;; esac ;; diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in index f31fd8cda..8c0ab719e 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in @@ -169,6 +169,11 @@ EOF LINITRD="${LINITRD#/boot}" fi + if [ -z "${prepare_boot_cache}" ]; then + prepare_boot_cache="$(prepare_grub_to_access_device ${LBOOT} | sed -e "s/^/\t/")" + [ "${prepare_boot_cache}" ] || continue + fi + onstr="$(gettext_printf "(on %s)" "${DEVICE}")" recovery_params="$(echo "${LPARAMS}" | grep 'single\|recovery')" || true counter=1 @@ -180,10 +185,6 @@ EOF fi used_osprober_linux_ids="$used_osprober_linux_ids 'osprober-gnulinux-$LKERNEL-${recovery_params}-$counter-$boot_device_id'" - if [ -z "${prepare_boot_cache}" ]; then - prepare_boot_cache="$(prepare_grub_to_access_device ${LBOOT} | sed -e "s/^/\t/")" - fi - 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' {