Adjust extended dos support for blkid/util-linux 2.24+ (Closes: #735169).
authorAndreas Henriksson <andreas@fatal.se>
Thu, 8 Oct 2015 00:29:46 +0000 (02:29 +0200)
committerCyril Brulebois <kibi@debian.org>
Thu, 8 Oct 2015 00:33:23 +0000 (02:33 +0200)
Signed-off-by: Cyril Brulebois <kibi@debian.org>
common.sh
debian/changelog
linux-boot-probes/common/50mounted-tests

index 30e245e..8734b62 100644 (file)
--- a/common.sh
+++ b/common.sh
@@ -116,6 +116,29 @@ fs_type () {
        fi
 }
 
+is_dos_extended_partition() {
+       if type blkid >/dev/null 2>&1; then
+               local output
+
+               output="$(blkid -o export $1)"
+
+               # old blkid (util-linux << 2.24) errors out on extended p.
+               if [ "$?" = "2" ]; then
+                       return 0
+               fi
+
+               # dos partition type and no filesystem type?...
+               if echo $output | grep -q ' PTTYPE=dos ' &&
+                               ! echo $output | grep -q ' TYPE='; then
+                       return 0
+               else
+                       return 1
+               fi
+       fi
+
+       return 1
+}
+
 parse_proc_mounts () {
        while read -r line; do
                set -f
index 179da30..055093c 100644 (file)
@@ -1,3 +1,10 @@
+os-prober (1.68) UNRELEASED; urgency=medium
+
+  * Adjust extended dos partition support for blkid/util-linux 2.24+,
+    thanks to Andreas Henriksson (Closes: #735169).
+
+ -- Cyril Brulebois <kibi@debian.org>  Thu, 08 Oct 2015 02:30:41 +0200
+
 os-prober (1.67) unstable; urgency=medium
 
   [ James Clarke ]
index 41e26e6..91b6dd9 100755 (executable)
@@ -20,6 +20,10 @@ elif [ "$types" = ntfs ]; then
                types='ntfs-3g ntfs'
        fi
 elif [ -z "$types" ]; then
+       if is_dos_extended_partition "$partition"; then
+               debug "$1 looks like an extended dos partition; skipping"
+               exit 0
+       fi
        if type cryptsetup >/dev/null 2>&1 && \
           cryptsetup luksDump "$partition" >/dev/null 2>&1; then
                debug "$1 is a LUKS partition; skipping"