Gentoo Archives: gentoo-commits

From: Ben Kohler <bkohler@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-boot/os-prober/, sys-boot/os-prober/files/
Date: Fri, 08 Oct 2021 11:12:37
Message-Id: 1633691535.c305cbb85b681269a94554866be0e3738ed4111d.bkohler@gentoo
1 commit: c305cbb85b681269a94554866be0e3738ed4111d
2 Author: Peter Levine <plevine457 <AT> gmail <DOT> com>
3 AuthorDate: Fri Oct 8 01:06:15 2021 +0000
4 Commit: Ben Kohler <bkohler <AT> gentoo <DOT> org>
5 CommitDate: Fri Oct 8 11:12:15 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c305cbb8
7
8 sys-boot/os-prober: fix detection on software-raid devices
9
10 Fixes detection of OSes installed on /dev/md* devices (not linked to
11 /dev/mapper/*).
12
13 Package-Manager: Portage-3.0.26, Repoman-3.0.3
14 Signed-off-by: Peter Levine <plevine457 <AT> gmail.com>
15 Signed-off-by: Ben Kohler <bkohler <AT> gentoo.org>
16
17 .../files/os-prober-1.79-mdraid-detection.patch | 28 ++++++++++++++++++++++
18 sys-boot/os-prober/os-prober-9999.ebuild | 1 +
19 2 files changed, 29 insertions(+)
20
21 diff --git a/sys-boot/os-prober/files/os-prober-1.79-mdraid-detection.patch b/sys-boot/os-prober/files/os-prober-1.79-mdraid-detection.patch
22 new file mode 100644
23 index 00000000000..15b9de5117a
24 --- /dev/null
25 +++ b/sys-boot/os-prober/files/os-prober-1.79-mdraid-detection.patch
26 @@ -0,0 +1,28 @@
27 +Fixes OS detection on mdraid devices
28 +
29 +Bug: https://bugs.debian.org/648251
30 + https://bugzilla.redhat.com/752402
31 +
32 +--- a/os-prober
33 ++++ b/os-prober
34 +@@ -64,6 +64,11 @@ partitions () {
35 + exit 0
36 + fi
37 +
38 ++ # Add MD RAID devices
39 ++ if [ -f /proc/mdstat ] ; then
40 ++ awk '/^md/ {printf "/dev/"$1"\n"}' /proc/mdstat
41 ++ fi
42 ++
43 + # Also detect OSes on LVM volumes (assumes LVM is active)
44 + if type lvs >/dev/null 2>&1; then
45 + echo "$(LVM_SUPPRESS_FD_WARNINGS=1 log_output lvs --noheadings --separator : -o vg_name,lv_name |
46 +@@ -123,7 +128,7 @@ if [ -f /proc/swaps ]; then
47 + fi
48 + : >"$OS_PROBER_TMP/raided-map"
49 + if [ -f /proc/mdstat ] ; then
50 +- grep "^md" /proc/mdstat | parse_proc_mdstat >"$OS_PROBER_TMP/raided-map" || true
51 ++ grep "^md" /proc/mdstat | cut -d: -f2- | parse_proc_mdstat >"$OS_PROBER_TMP/raided-map" || true
52 + fi
53 +
54 + for partition in $(partitions); do
55
56 diff --git a/sys-boot/os-prober/os-prober-9999.ebuild b/sys-boot/os-prober/os-prober-9999.ebuild
57 index 2b0ace332d0..4feb1e2b320 100644
58 --- a/sys-boot/os-prober/os-prober-9999.ebuild
59 +++ b/sys-boot/os-prober/os-prober-9999.ebuild
60 @@ -26,6 +26,7 @@ RDEPEND="sys-boot/grub:2[mount]"
61 QA_MULTILIB_PATHS="usr/lib/os-prober/.*"
62
63 PATCHES=(
64 + "${FILESDIR}"/${PN}-1.79-mdraid-detection.patch
65 "${FILESDIR}"/${PN}-1.78-btrfsfix.patch
66 )