[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#671881: Don't abort on grub-probe failures



Source: os-prober
Version: 1.52
Tags: patch

I've a dual boot sid/Ubuntu setup using LVM, and at some point
update-grub had stopped adding a boot entry for the Ubuntu volume. I
traced this down to a failing grub-probe call:

dannf@fluid:~$ sudo grub-probe -d /dev/mapper/fluid-ubuntu -t fs
grub-probe: error: no such disk.
dannf@fluid:~$ echo $?
1

Because this is called w/ set -e, os-prober aborts here leaving a
stale fuse mount on /var/lib/os-prober/mount, and doesn't execute the
subsequent calls that otherwise would've added the appropriate boot
entries.

I don't know if this is a regression w/ grub-probe or not, but seems
like a good change either way. Please review :)

commit 12acca65e63727fd678494fd1685e77045112b5b
Author: dann frazier <dannf@debian.org>
Date:   Mon May 7 12:30:10 2012 -0700

    Don't abort due to set -e on grub-probe errors

diff --git a/debian/changelog b/debian/changelog
index 03f2b49..0f75367 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+os-prober (1.53) UNRELEASED; urgency=low
+
+  * Don't abort due to set -e on grub-probe errors
+
+ -- dann frazier <dannf@debian.org>  Mon, 07 May 2012 12:26:55 -0700
+
 os-prober (1.52) unstable; urgency=low
 
   [ Stéphane Graber ]
diff --git a/linux-boot-probes/common/50mounted-tests b/linux-boot-probes/common/50mounted-tests
index 41e26e6..6b99cf7 100755
--- a/linux-boot-probes/common/50mounted-tests
+++ b/linux-boot-probes/common/50mounted-tests
@@ -38,8 +38,7 @@ if type grub-mount >/dev/null 2>&1 && \
    type grub-probe >/dev/null 2>&1 && \
    grub-mount "$partition" "$tmpmnt" 2>/dev/null; then
 	mounted=1
-	type="$(grub-probe -d "$partition" -t fs)"
-	[ "$type" ] || type=fuseblk
+	type="$(grub-probe -d "$partition" -t fs)" && [ "$type" ] || type=fuseblk
 else
 	ro_partition "$partition"
 	for type in $types; do
diff --git a/os-probes/common/50mounted-tests b/os-probes/common/50mounted-tests
index 45b4b53..1498963 100755
--- a/os-probes/common/50mounted-tests
+++ b/os-probes/common/50mounted-tests
@@ -50,8 +50,7 @@ if type grub-mount >/dev/null 2>&1 && \
    type grub-probe >/dev/null 2>&1 && \
    grub-mount "$partition" "$tmpmnt" 2>/dev/null; then
 	mounted=1
-	type="$(grub-probe -d "$partition" -t fs)"
-	if [ "$type" ]; then
+	if type="$(grub-probe -d "$partition" -t fs)" && [ "$type" ]; then
 		debug "mounted using GRUB $type filesystem driver"
 	else
 		debug "mounted using GRUB, but unknown filesystem?"





Reply to: