core/os-prober/os-prober-util-linux-2.24.patch

59 lines
1.5 KiB
Diff
Raw Normal View History

2014-11-10 03:37:31 +08:00
--- 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
--- a/linux-boot-probes/common/50mounted-tests
+++ b/linux-boot-probes/common/50mounted-tests
@@ -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"
--- a/os-probes/common/50mounted-tests
+++ b/os-probes/common/50mounted-tests
@@ -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"