Tolerate devices with no filesystem UUID returned by os-prober

* util/grub.d/30_os-prober.in: Tolerate devices with no filesystem
UUID.  Other parts of grub-mkconfig tolerate these, they were
previously allowed here up to commit
55e706c918, and they can arise in
practice when the system has active LVM snapshots.
Fixes Ubuntu bug #1287436.
This commit is contained in:
Colin Watson 2014-04-10 16:54:33 +01:00
parent c4badfe836
commit 3a310e842f
2 changed files with 22 additions and 10 deletions

View file

@ -1,3 +1,12 @@
2014-04-10 Colin Watson <cjwatson@ubuntu.com>
* util/grub.d/30_os-prober.in: Tolerate devices with no filesystem
UUID. Other parts of grub-mkconfig tolerate these, they were
previously allowed here up to commit
55e706c918922def17f5012c23cfe88c4c645208, and they can arise in
practice when the system has active LVM snapshots.
Fixes Ubuntu bug #1287436.
2014-04-10 Colin Watson <cjwatson@ubuntu.com> 2014-04-10 Colin Watson <cjwatson@ubuntu.com>
* grub-core/disk/lvm.c (grub_lvm_detect): Search for * grub-core/disk/lvm.c (grub_lvm_detect): Search for

View file

@ -112,16 +112,17 @@ for OS in ${OSPROBED} ; do
LONGNAME="`echo ${OS} | cut -d ':' -f 2 | tr '^' ' '`" LONGNAME="`echo ${OS} | cut -d ':' -f 2 | tr '^' ' '`"
LABEL="`echo ${OS} | cut -d ':' -f 3 | tr '^' ' '`" LABEL="`echo ${OS} | cut -d ':' -f 3 | tr '^' ' '`"
BOOT="`echo ${OS} | cut -d ':' -f 4`" BOOT="`echo ${OS} | cut -d ':' -f 4`"
UUID="`${grub_probe} --target=fs_uuid --device ${DEVICE%@*}`" if UUID="`${grub_probe} --target=fs_uuid --device ${DEVICE%@*}`"; then
EXPUUID="$UUID" EXPUUID="$UUID"
if [ x"${DEVICE#*@}" != x ] ; then if [ x"${DEVICE#*@}" != x ] ; then
EXPUUID="${EXPUUID}@${DEVICE#*@}" EXPUUID="${EXPUUID}@${DEVICE#*@}"
fi fi
if [ "x${GRUB_OS_PROBER_SKIP_LIST}" != "x" ] && [ "x`echo ${GRUB_OS_PROBER_SKIP_LIST} | grep -i -e '\b'${EXPUUID}'\b'`" != "x" ] ; then if [ "x${GRUB_OS_PROBER_SKIP_LIST}" != "x" ] && [ "x`echo ${GRUB_OS_PROBER_SKIP_LIST} | grep -i -e '\b'${EXPUUID}'\b'`" != "x" ] ; then
echo "Skipped ${LONGNAME} on ${DEVICE} by user request." >&2 echo "Skipped ${LONGNAME} on ${DEVICE} by user request." >&2
continue continue
fi
fi fi
BTRFS="`echo ${OS} | cut -d ':' -f 5`" BTRFS="`echo ${OS} | cut -d ':' -f 5`"
@ -277,9 +278,11 @@ EOF
echo "$title_correction_code" echo "$title_correction_code"
;; ;;
macosx) macosx)
OSXUUID="${UUID}" if [ "${UUID}" ]; then
osx_entry xnu_kernel 32 OSXUUID="${UUID}"
osx_entry xnu_kernel64 64 osx_entry xnu_kernel 32
osx_entry xnu_kernel64 64
fi
;; ;;
hurd) hurd)
onstr="$(gettext_printf "(on %s)" "${DEVICE}")" onstr="$(gettext_printf "(on %s)" "${DEVICE}")"