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

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