From 933050cfdb1bf16583c9b84627bcc0def8040265 Mon Sep 17 00:00:00 2001 From: Hedayat Vatankhah Date: Fri, 25 May 2012 14:00:01 +0430 Subject: [PATCH] Add mdraid detection fix patch --- os-prober-mdraidfix.patch | 24 ++++++++++++++++++++++++ os-prober.spec | 8 ++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 os-prober-mdraidfix.patch diff --git a/os-prober-mdraidfix.patch b/os-prober-mdraidfix.patch new file mode 100644 index 0000000..548dcd9 --- /dev/null +++ b/os-prober-mdraidfix.patch @@ -0,0 +1,24 @@ +diff -up os-prober-1.53/os-prober.mdraidfix os-prober-1.53/os-prober +--- os-prober-1.53/os-prober.mdraidfix 2012-05-25 13:28:16.544374104 +0430 ++++ os-prober-1.53/os-prober 2012-05-25 13:34:11.096941585 +0430 +@@ -57,6 +57,11 @@ partitions () { + exit 0 + fi + ++ # Add MD RAID devices ++ if [ -f /proc/mdstat ] ; then ++ awk '/^md/ {printf "/dev/"$1"\n"}' /proc/mdstat ++ fi ++ + # Also detect OSes on LVM volumes (assumes LVM is active) + if type lvs >/dev/null 2>&1; then + echo "$(LVM_SUPPRESS_FD_WARNINGS=1 log_output lvs --noheadings --separator : -o vg_name,lv_name | +@@ -113,7 +118,7 @@ grep "^/dev/" /proc/mounts | parse_proc_ + grep "^/dev/" /proc/swaps | parse_proc_swaps >"$OS_PROBER_TMP/swaps-map" || true + : >"$OS_PROBER_TMP/raided-map" + if [ -f /proc/mdstat ] ; then +- grep "^md" /proc/mdstat | parse_proc_mdstat >"$OS_PROBER_TMP/raided-map" || true ++ grep "^md" /proc/mdstat | cut -d: -f2- | parse_proc_mdstat >"$OS_PROBER_TMP/raided-map" || true + fi + + for partition in $(partitions); do diff --git a/os-prober.spec b/os-prober.spec index fde02e1..f7e0f5f 100644 --- a/os-prober.spec +++ b/os-prober.spec @@ -11,8 +11,10 @@ Source0: http://ftp.de.debian.org/debian/pool/main/o/os-prober/%{name}_%{ # move newns binary outside of os-prober subdirectory, so that debuginfo # can be automatically generated for it Patch0: os-prober-newnsdirfix.patch -Patch1: os-porber-no-dummy-mach-kernel.patch -Patch2: os-prober-grub2-fedorafix.patch +Patch1: os-porber-no-dummy-mach-kernel.patch +# Sent upstream +Patch2: os-prober-grub2-fedorafix.patch +Patch3: os-prober-mdraidfix.patch Requires: udev coreutils util-linux Requires: grep /bin/sed /sbin/modprobe @@ -27,6 +29,7 @@ distributions can be added easily. %patch0 -p1 -b .newnsdirfix %patch1 -p1 -b .macosxdummyfix %patch2 -p1 -b .grub2-fedorafix +%patch3 -p1 -b .mdraidfix find -type f -exec sed -i -e 's|usr/lib|usr/libexec|g' {} \; sed -i -e 's|grub-probe|grub2-probe|g' os-probes/common/50mounted-tests \ linux-boot-probes/common/50mounted-tests @@ -79,6 +82,7 @@ fi * Fri May 25 2012 Hedayat Vatankhah - 1.53-2 - Add Fedora's grub2 config path, fixes generating menu entries for other installed Fedora's +- Add support for OSes installed on Linux mdraid partitions, bug #752402 * Fri May 11 2012 Hedayat Vatankhah - 1.53-1 - Updated to 1.53 for a bugfix