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

39700a
From 0942ce33c5b88d85a6b81f4b3dd75c32fdf21978 Mon Sep 17 00:00:00 2001
39700a
From: Colin Watson <cjwatson@ubuntu.com>
39700a
Date: Thu, 10 Apr 2014 16:54:33 +0100
39700a
Subject: [PATCH 078/143] 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
39700a
index 7f0c57d..3556468 100644
39700a
--- a/ChangeLog
39700a
+++ b/ChangeLog
39700a
@@ -1,5 +1,14 @@
39700a
 2014-04-10  Colin Watson  <cjwatson@ubuntu.com>
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
+2014-04-10  Colin Watson  <cjwatson@ubuntu.com>
39700a
+
39700a
 	* grub-core/disk/lvm.c (grub_lvm_detect): Search for
39700a
 	"logical_volumes" block a little more accurately.
39700a
 
39700a
diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in
39700a
index 7cf8487..6f38c82 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}")"
39700a
-- 
39700a
1.9.3
39700a