Blame SOURCES/0078-Tolerate-devices-with-no-filesystem-UUID-returned-by.patch

6b3c76
From 6eb6afd8f913c6e2da737d42c6561aacc3873c84 Mon Sep 17 00:00:00 2001
a85e8e
From: Colin Watson <cjwatson@ubuntu.com>
a85e8e
Date: Thu, 10 Apr 2014 16:54:33 +0100
6b3c76
Subject: [PATCH 078/261] Tolerate devices with no filesystem UUID returned by
a85e8e
 os-prober
a85e8e
a85e8e
* util/grub.d/30_os-prober.in: Tolerate devices with no filesystem
a85e8e
UUID.  Other parts of grub-mkconfig tolerate these, they were
a85e8e
previously allowed here up to commit
a85e8e
55e706c918922def17f5012c23cfe88c4c645208, and they can arise in
a85e8e
practice when the system has active LVM snapshots.
a85e8e
Fixes Ubuntu bug #1287436.
a85e8e
---
a85e8e
 ChangeLog                   |  9 +++++++++
a85e8e
 util/grub.d/30_os-prober.in | 23 +++++++++++++----------
a85e8e
 2 files changed, 22 insertions(+), 10 deletions(-)
a85e8e
a85e8e
diff --git a/ChangeLog b/ChangeLog
6b3c76
index 7f0c57dc0..35564681a 100644
a85e8e
--- a/ChangeLog
a85e8e
+++ b/ChangeLog
6b3c76
@@ -1,5 +1,14 @@
6b3c76
 2014-04-10  Colin Watson  <cjwatson@ubuntu.com>
6b3c76
 
a85e8e
+	* util/grub.d/30_os-prober.in: Tolerate devices with no filesystem
a85e8e
+	UUID.  Other parts of grub-mkconfig tolerate these, they were
a85e8e
+	previously allowed here up to commit
a85e8e
+	55e706c918922def17f5012c23cfe88c4c645208, and they can arise in
a85e8e
+	practice when the system has active LVM snapshots.
a85e8e
+	Fixes Ubuntu bug #1287436.
a85e8e
+
6b3c76
+2014-04-10  Colin Watson  <cjwatson@ubuntu.com>
6b3c76
+
d41074
 	* grub-core/disk/lvm.c (grub_lvm_detect): Search for
6b3c76
 	"logical_volumes" block a little more accurately.
6b3c76
 
a85e8e
diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in
6b3c76
index 7cf8487d6..6f38c82a5 100644
a85e8e
--- a/util/grub.d/30_os-prober.in
a85e8e
+++ b/util/grub.d/30_os-prober.in
a85e8e
@@ -112,16 +112,17 @@ for OS in ${OSPROBED} ; do
a85e8e
   LONGNAME="`echo ${OS} | cut -d ':' -f 2 | tr '^' ' '`"
a85e8e
   LABEL="`echo ${OS} | cut -d ':' -f 3 | tr '^' ' '`"
a85e8e
   BOOT="`echo ${OS} | cut -d ':' -f 4`"
a85e8e
-  UUID="`${grub_probe} --target=fs_uuid --device ${DEVICE%@*}`"
a85e8e
-  EXPUUID="$UUID"
a85e8e
+  if UUID="`${grub_probe} --target=fs_uuid --device ${DEVICE%@*}`"; then
a85e8e
+    EXPUUID="$UUID"
a85e8e
 
a85e8e
-  if [ x"${DEVICE#*@}" != x ] ; then
a85e8e
+    if [ x"${DEVICE#*@}" != x ] ; then
a85e8e
       EXPUUID="${EXPUUID}@${DEVICE#*@}"
a85e8e
-  fi
a85e8e
+    fi
a85e8e
 
a85e8e
-  if [ "x${GRUB_OS_PROBER_SKIP_LIST}" != "x" ] && [ "x`echo ${GRUB_OS_PROBER_SKIP_LIST} | grep -i -e '\b'${EXPUUID}'\b'`" != "x" ] ; then
a85e8e
-    echo "Skipped ${LONGNAME} on ${DEVICE} by user request." >&2
a85e8e
-    continue
a85e8e
+    if [ "x${GRUB_OS_PROBER_SKIP_LIST}" != "x" ] && [ "x`echo ${GRUB_OS_PROBER_SKIP_LIST} | grep -i -e '\b'${EXPUUID}'\b'`" != "x" ] ; then
a85e8e
+      echo "Skipped ${LONGNAME} on ${DEVICE} by user request." >&2
a85e8e
+      continue
a85e8e
+    fi
a85e8e
   fi
a85e8e
 
a85e8e
   BTRFS="`echo ${OS} | cut -d ':' -f 5`"
a85e8e
@@ -277,9 +278,11 @@ EOF
a85e8e
       echo "$title_correction_code"
a85e8e
     ;;
a85e8e
     macosx)
a85e8e
-      OSXUUID="${UUID}"
a85e8e
-      osx_entry xnu_kernel 32
a85e8e
-      osx_entry xnu_kernel64 64
a85e8e
+      if [ "${UUID}" ]; then
a85e8e
+	OSXUUID="${UUID}"
a85e8e
+	osx_entry xnu_kernel 32
a85e8e
+	osx_entry xnu_kernel64 64
a85e8e
+      fi
a85e8e
     ;;
a85e8e
     hurd)
a85e8e
       onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
6b3c76
-- 
6b3c76
2.13.5
6b3c76