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

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