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

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