Use 'type' rather than 'which' to test for grub-mount, as d-i doesn't have 'which...
authorColin Watson <cjwatson@debian.org>
Tue, 27 Mar 2012 14:46:12 +0000 (15:46 +0100)
committerColin Watson <cjwatson@debian.org>
Tue, 27 Mar 2012 14:46:12 +0000 (15:46 +0100)
common.sh
debian/changelog
linux-boot-probes/common/50mounted-tests
os-probes/common/50mounted-tests

index 077e711..30e245e 100644 (file)
--- a/common.sh
+++ b/common.sh
@@ -259,7 +259,7 @@ linux_mount_boot () {
                                        debug "found boot partition $1 for linux system on $partition, but cannot map to existing device"
                                else
                                        debug "found boot partition $bootpart for linux system on $partition"
-                                       if which grub-mount >/dev/null 2>&1 && \
+                                       if type grub-mount >/dev/null 2>&1 && \
                                           grub-mount "$boottomnt" "$tmpmnt/boot" 2>/dev/null; then
                                                mounted=1
                                        else
index b80ed35..c59d0e2 100644 (file)
@@ -1,8 +1,15 @@
 os-prober (1.51) UNRELEASED; urgency=low
 
+  [ Joey Hess ]
   * Relax the MS-DOS detection again now that it will not cause
     false positives for non-FAT filesystems.
 
+  [ Colin Watson ]
+  * Use 'type' rather than 'which' to test for grub-mount, as d-i doesn't
+    have 'which'.  Also test for grub-probe before using it, as that isn't
+    currently in grub-mount-udeb and I'm going to need to add it
+    (LP: #963471).
+
  -- Joey Hess <joeyh@debian.org>  Thu, 15 Mar 2012 13:46:44 -0400
 
 os-prober (1.50) unstable; urgency=low
index f812c2e..41e26e6 100755 (executable)
@@ -34,7 +34,8 @@ if [ ! -d "$tmpmnt" ]; then
 fi
 
 mounted=
-if which grub-mount >/dev/null 2>&1 && \
+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)"
index 214eca8..255540d 100755 (executable)
@@ -46,7 +46,8 @@ if [ ! -d "$tmpmnt" ]; then
 fi
 
 mounted=
-if which grub-mount >/dev/null 2>&1 && \
+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)"