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

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