summaryrefslogtreecommitdiff
path: root/sys-boot/os-prober/files/os-prober-1.79-use-fstab-name.patch
blob: e38d85a77feb743232add28db7c9c44ffce65c88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
For symlinks to partions in fstab, returns the partition name from fstab instead
of the name of its resolved destination, eg., for /dev/mapper/mylvmvol in fstab,
linked to /dev/dm-2, return "mylvmvol" instead of "dm-2".

Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=699839
     https://bugzilla.redhat.com/show_bug.cgi?id=893472

--- a/common.sh
+++ b/common.sh
@@ -269,7 +269,7 @@ linux_mount_boot () {
 				if [ "$bindfrom" != "$tmpmnt/boot" ]; then
 					if mount --bind "$bindfrom" "$tmpmnt/boot"; then
 						mounted=1
-						bootpart="$1"
+						bootpart="$tmppart"
 					else
 						debug "failed to bind-mount $bindfrom onto $tmpmnt/boot"
 					fi
@@ -277,6 +277,15 @@ linux_mount_boot () {
 			fi
 			if [ "$mounted" ]; then
 				:
+			elif [ -e "$tmppart" ]; then
+				bootpart="$tmppart"
+				boottomnt="$tmppart"
+			elif [ -e "$tmpmnt/$tmppart" ]; then
+				bootpart="$tmppart"
+				boottomnt="$tmpmnt/$tmppart"
+			elif [ -e "/target/$tmppart" ]; then
+				bootpart="$tmppart"
+				boottomnt="/target/$tmppart"
 			elif [ -e "$1" ]; then
 				bootpart="$1"
 				boottomnt="$1"