Blame SOURCES/0003-Detect-OS-installed-to-mdraid-partition-752402.patch

e8c52d
From e448a5baca1bb9bcb36cdc2a73de8d7edb3e96f3 Mon Sep 17 00:00:00 2001
e8c52d
From: =?UTF-8?q?Pavel=20Lis=C3=BD?= <pavel.lisy@gmail.com>
e8c52d
Date: Sat, 5 May 2012 14:00:01 +0430
e8c52d
Subject: [PATCH 03/18] Detect OS installed to mdraid partition (#752402)
e8c52d
e8c52d
Add ability to find operating systems installed on mdraid partitions.
e8c52d
e8c52d
Resolves: rhbz#752402
e8c52d
---
e8c52d
 os-prober | 7 ++++++-
e8c52d
 1 file changed, 6 insertions(+), 1 deletion(-)
e8c52d
e8c52d
diff --git a/os-prober b/os-prober
e8c52d
index 2a08736..99ede8e 100755
e8c52d
--- a/os-prober
e8c52d
+++ b/os-prober
c62eab
@@ -57,6 +57,11 @@ partitions () {
c62eab
 		exit 0
c62eab
 	fi
c62eab
 
c62eab
+	# Add MD RAID devices
c62eab
+	if [ -f /proc/mdstat ] ; then
c62eab
+		awk '/^md/ {printf "/dev/"$1"\n"}' /proc/mdstat
c62eab
+	fi
c62eab
+
c62eab
 	# Also detect OSes on LVM volumes (assumes LVM is active)
c62eab
 	if type lvs >/dev/null 2>&1; then
c62eab
 		echo "$(LVM_SUPPRESS_FD_WARNINGS=1 log_output lvs --noheadings --separator : -o vg_name,lv_name |
c62eab
@@ -116,7 +121,7 @@ if [ -f /proc/swaps ]; then
c62eab
 fi
c62eab
 : >"$OS_PROBER_TMP/raided-map"
c62eab
 if [ -f /proc/mdstat ] ; then
c62eab
-	grep "^md" /proc/mdstat | parse_proc_mdstat >"$OS_PROBER_TMP/raided-map" || true
c62eab
+	grep "^md" /proc/mdstat | cut -d: -f2- | parse_proc_mdstat >"$OS_PROBER_TMP/raided-map" || true
c62eab
 fi
c62eab
 
c62eab
 for partition in $(partitions); do
e8c52d
-- 
e8c52d
2.5.5
e8c52d