Add mdraid detection fix patch

This commit is contained in:
Hedayat Vatankhah 2012-05-25 14:00:01 +04:30
parent f8e8dfcdbd
commit 933050cfdb
2 changed files with 30 additions and 2 deletions

24
os-prober-mdraidfix.patch Normal file
View File

@ -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

View File

@ -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 # move newns binary outside of os-prober subdirectory, so that debuginfo
# can be automatically generated for it # can be automatically generated for it
Patch0: os-prober-newnsdirfix.patch Patch0: os-prober-newnsdirfix.patch
Patch1: os-porber-no-dummy-mach-kernel.patch Patch1: os-porber-no-dummy-mach-kernel.patch
Patch2: os-prober-grub2-fedorafix.patch # Sent upstream
Patch2: os-prober-grub2-fedorafix.patch
Patch3: os-prober-mdraidfix.patch
Requires: udev coreutils util-linux Requires: udev coreutils util-linux
Requires: grep /bin/sed /sbin/modprobe Requires: grep /bin/sed /sbin/modprobe
@ -27,6 +29,7 @@ distributions can be added easily.
%patch0 -p1 -b .newnsdirfix %patch0 -p1 -b .newnsdirfix
%patch1 -p1 -b .macosxdummyfix %patch1 -p1 -b .macosxdummyfix
%patch2 -p1 -b .grub2-fedorafix %patch2 -p1 -b .grub2-fedorafix
%patch3 -p1 -b .mdraidfix
find -type f -exec sed -i -e 's|usr/lib|usr/libexec|g' {} \; 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 \ sed -i -e 's|grub-probe|grub2-probe|g' os-probes/common/50mounted-tests \
linux-boot-probes/common/50mounted-tests linux-boot-probes/common/50mounted-tests
@ -79,6 +82,7 @@ fi
* Fri May 25 2012 Hedayat Vatankhah <hedayat.fwd+rpmchlog@gmail.com> - 1.53-2 * Fri May 25 2012 Hedayat Vatankhah <hedayat.fwd+rpmchlog@gmail.com> - 1.53-2
- Add Fedora's grub2 config path, fixes generating menu entries for other - Add Fedora's grub2 config path, fixes generating menu entries for other
installed Fedora's installed Fedora's
- Add support for OSes installed on Linux mdraid partitions, bug #752402
* Fri May 11 2012 Hedayat Vatankhah <hedayat.fwd+rpmchlog@gmail.com> - 1.53-1 * Fri May 11 2012 Hedayat Vatankhah <hedayat.fwd+rpmchlog@gmail.com> - 1.53-1
- Updated to 1.53 for a bugfix - Updated to 1.53 for a bugfix