From: Harald Hoyer Date: Fri, 6 Mar 2009 11:32:54 +0000 (+0100) Subject: use udev rules to autoassemble a md raid and added mdmon pre-pivot X-Git-Tag: 0.1~352 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=379dd5de55abab3438112121a37fbcbc9b80c19f;p=thirdparty%2Fdracut.git use udev rules to autoassemble a md raid and added mdmon pre-pivot --- diff --git a/modules.d/90mdraid/70-mdadm.rules b/modules.d/90mdraid/70-mdadm.rules new file mode 100644 index 000000000..bd116338c --- /dev/null +++ b/modules.d/90mdraid/70-mdadm.rules @@ -0,0 +1,6 @@ +# This file causes block devices with Linux RAID (mdadm) signatures to +# automatically cause mdadm to be run. +# See udev(8) for syntax + +SUBSYSTEM=="block", ACTION=="add|change", ENV{ID_FS_TYPE}=="linux_raid*", \ + RUN+="/sbin/mdadm -I --auto=yes $root/%k" diff --git a/modules.d/90mdraid/install b/modules.d/90mdraid/install index f68cee685..41982f9b2 100755 --- a/modules.d/90mdraid/install +++ b/modules.d/90mdraid/install @@ -1,4 +1,8 @@ #!/bin/bash dracut_install mdadm -inst_hook pre-mount 10 "$moddir/mdraid.sh" +[ -x /sbin/mdmon ] && dracut_install mdmon +inst_rules "$moddir/70-mdadm.rules" +[ -f /etc/mdadm/mdadm.conf ] && inst /etc/mdadm/mdadm.conf "$initdir" /etc/mdadm.conf +[ -f /etc/mdadm.conf ] && inst /etc/mdadm.conf "$initdir" +inst_hook pre-pivot 30 "$moddir/mdmon-pre-pivot.sh" diff --git a/modules.d/90mdraid/mdmon-pre-pivot.sh b/modules.d/90mdraid/mdmon-pre-pivot.sh new file mode 100644 index 000000000..b1f379f34 --- /dev/null +++ b/modules.d/90mdraid/mdmon-pre-pivot.sh @@ -0,0 +1,3 @@ +# switch any mdmon instances to newroot +[ -f /etc/mdadm.conf ] && /sbin/mdmon /proc/mdstat $NEWROOT + diff --git a/modules.d/90mdraid/mdraid.sh b/modules.d/90mdraid/mdraid.sh deleted file mode 100644 index 79f60c7a0..000000000 --- a/modules.d/90mdraid/mdraid.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -mdadm --assemble \ - --homehost=localhost \ - --auto-update-homehost \ - --scan - -udevadm settle --timeout=30 -