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

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