commit:     45a0db318d24761296ad6c369202f1c1d07e3443
Author:     Peter Levine <plevine457 <AT> gmail <DOT> com>
AuthorDate: Fri Oct  8 01:25:58 2021 +0000
Commit:     Ben Kohler <bkohler <AT> gentoo <DOT> org>
CommitDate: Fri Oct  8 11:12:17 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=45a0db31

sys-boot/os-prober: use the name in fstab for devmapper partitions

For /dev/mapper/gentoo linked to /dev/dm-1, use "gentoo" instead of
"dm-1" as the patition name.

Package-Manager: Portage-3.0.26, Repoman-3.0.3
Signed-off-by: Peter Levine <plevine457 <AT> gmail.com>
Signed-off-by: Ben Kohler <bkohler <AT> gentoo.org>

 .../files/os-prober-1.79-use-fstab-name.patch      | 34 ++++++++++++++++++++++
 sys-boot/os-prober/os-prober-9999.ebuild           |  1 +
 2 files changed, 35 insertions(+)

diff --git a/sys-boot/os-prober/files/os-prober-1.79-use-fstab-name.patch 
b/sys-boot/os-prober/files/os-prober-1.79-use-fstab-name.patch
new file mode 100644
index 00000000000..e38d85a77fe
--- /dev/null
+++ b/sys-boot/os-prober/files/os-prober-1.79-use-fstab-name.patch
@@ -0,0 +1,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"

diff --git a/sys-boot/os-prober/os-prober-9999.ebuild 
b/sys-boot/os-prober/os-prober-9999.ebuild
index 5bd9e3b714c..392bf080566 100644
--- a/sys-boot/os-prober/os-prober-9999.ebuild
+++ b/sys-boot/os-prober/os-prober-9999.ebuild
@@ -28,6 +28,7 @@ QA_MULTILIB_PATHS="usr/lib/os-prober/.*"
 PATCHES=(
        "${FILESDIR}"/${PN}-1.79-mdraid-detection.patch
        "${FILESDIR}"/${PN}-1.79-btrfs-subvolume-detection.patch
+       "${FILESDIR}"/${PN}-1.79-use-fstab-name.patch
 )
 
 DOC_CONTENTS="

Reply via email to