grub2/debian/patches/mkconfig_nonexistent_loopback.patch
2013-12-20 11:09:12 +00:00

47 lines
1.7 KiB
Diff

Description: Avoid getting confused by inaccessible loop device backing paths
Author: Colin Watson <cjwatson@ubuntu.com>
Bug-Ubuntu: https://bugs.launchpad.net/bugs/938724
Forwarded: no
Last-Update: 2013-12-20
Index: b/util/grub-mkconfig_lib.in
===================================================================
--- a/util/grub-mkconfig_lib.in
+++ b/util/grub-mkconfig_lib.in
@@ -142,7 +142,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
@@ -212,6 +212,11 @@
LINITRD="${LINITRD#/boot}"
fi
+ if [ -z "${prepare_boot_cache}" ]; then
+ prepare_boot_cache="$(prepare_grub_to_access_device ${LBOOT} | grub_add_tab)"
+ [ "${prepare_boot_cache}" ] || continue
+ fi
+
onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
recovery_params="$(echo "${LPARAMS}" | grep 'single\|recovery')" || true
counter=1
@@ -223,10 +228,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} | grub_add_tab)"
- fi
-
if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then
cat << EOF
menuentry '$(echo "$OS $onstr" | grub_quote)' --class gnu-linux --class gnu --class os \$menuentry_id_option 'osprober-gnulinux-simple-$boot_device_id' {