Package: os-prober
Version: 1.57
Tags: patch

linux-boot-prober returns root partition instead of /boot partition when both / and /boot are already mounted somewhere when it is called. The attached patch fixes this problem. Additionally, it returns the original name rather than the mapped one, which is in line with the fix provided in bug #699839.

diff -up os-prober-1.57/common.sh.mounted-partitions-fix os-prober-1.57/common.sh
--- os-prober-1.57/common.sh.mounted-partitions-fix	2013-02-05 20:58:03.041289214 +0330
+++ os-prober-1.57/common.sh	2013-02-05 20:58:03.044289177 +0330
@@ -123,7 +123,7 @@ parse_proc_mounts () {
 		set -f
 		set -- $line
 		set +f
-		printf '%s %s %s\n' "$(mapdevfs "$1")" "$2" "$3"
+		printf '%s %s %s %s\n' "$(mapdevfs "$1")" "$2" "$3" "$1"
 	done
 }
 
diff -up os-prober-1.57/linux-boot-prober.mounted-partitions-fix os-prober-1.57/linux-boot-prober
--- os-prober-1.57/linux-boot-prober.mounted-partitions-fix	2013-02-05 20:58:03.000000000 +0330
+++ os-prober-1.57/linux-boot-prober	2013-02-05 20:58:54.364647584 +0330
@@ -167,7 +167,7 @@ else
 			bootpart="${mountboot%% *}"
 			bootmounted="${mountboot#* }"
 		else
-			bootpart="$partition"
+			bootpart="$(grep " $mpoint/boot " "$OS_PROBER_TMP/mounted-map" | head -n1 | cut -d " " -f 4)"
 			bootmounted=0
 		fi
 		for test in /usr/lib/linux-boot-probes/mounted/*; do

Reply via email to