commit:     5023585e4f13834627b835125d7c6f9dee62f21a
Author:     Peter Levine <plevine457 <AT> gmail <DOT> com>
AuthorDate: Fri Oct  8 01:31:47 2021 +0000
Commit:     Ben Kohler <bkohler <AT> gentoo <DOT> org>
CommitDate: Fri Oct  8 11:12:19 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5023585e

sys-boot/os-prober: return boot instead of root if both are mounted

Fixes a corner-case in which the root partition is returned instead of
the boot partition, when both are mounted.

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>

 .../os-prober-1.79-mounted-boot-partition-fix.patch     | 17 +++++++++++++++++
 sys-boot/os-prober/os-prober-9999.ebuild                |  1 +
 2 files changed, 18 insertions(+)

diff --git 
a/sys-boot/os-prober/files/os-prober-1.79-mounted-boot-partition-fix.patch 
b/sys-boot/os-prober/files/os-prober-1.79-mounted-boot-partition-fix.patch
new file mode 100644
index 00000000000..1be8c810ddf
--- /dev/null
+++ b/sys-boot/os-prober/files/os-prober-1.79-mounted-boot-partition-fix.patch
@@ -0,0 +1,17 @@
+Fixes the problem of the root partition being returned instead of the boot
+partition when both are already mounted somewhere.
+
+Bug: https://bugs.debian.org/699840
+     https://bugzilla.redhat.com/906886
+
+--- a/linux-boot-prober
++++ b/linux-boot-prober
+@@ -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

diff --git a/sys-boot/os-prober/os-prober-9999.ebuild 
b/sys-boot/os-prober/os-prober-9999.ebuild
index 392bf080566..59539158759 100644
--- a/sys-boot/os-prober/os-prober-9999.ebuild
+++ b/sys-boot/os-prober/os-prober-9999.ebuild
@@ -29,6 +29,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-1.79-mdraid-detection.patch
        "${FILESDIR}"/${PN}-1.79-btrfs-subvolume-detection.patch
        "${FILESDIR}"/${PN}-1.79-use-fstab-name.patch
+       "${FILESDIR}"/${PN}-1.79-mounted-boot-partition-fix.patch
 )
 
 DOC_CONTENTS="

Reply via email to