--- /dev/null
+# This file causes block devices with Linux RAID (mdadm) signatures to
+# automatically cause mdadm to be run.
+# See udev(8) for syntax
+
+SUBSYSTEM!="block", GOTO="dm_end"
+ACTION!="add|change", GOTO="dm_end"
+
+ENV{ID_FS_TYPE}=="linux_raid_member", GOTO="dm_end"
+ENV{ID_FS_TYPE}=="isw_raid_member", GOTO="dm_end"
+
+ENV{ID_FS_TYPE}=="*_raid_member", \
+ TEST!="/tmp/.dmraid_scan-%k", \
+ RUN+="/bin/sh -c '>/tmp/.dmraid_scan-%k; /bin/ln -fs /sbin/dmraid_scan /initqueue/dmraid_scan.sh'"
+
+LABEL="dm_end"
dracut_install dmraid
inst "$moddir/dmraid.sh" /sbin/dmraid_scan
inst_rules 64-md-raid.rules
-inst_rules "$moddir/61-dmraid.rules"
+if [ ! -x /lib/udev/vol_id ] && mdadm -Q -e imsm /dev/null &> /dev/null; then
+ inst_rules "$moddir/61-dmraid-imsm.rules"
+else
+ inst_rules "$moddir/61-dmraid.rules"
+fi
--- /dev/null
+# 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", \
+ ENV{ID_FS_TYPE}=="linux_raid_member|isw_raid_member", \
+ TEST!="/tmp/.mdraid_start-%k", \
+ IMPORT{program}="/sbin/mdadm --examine --export $tempnode", \
+ RUN+="/sbin/mdadm -I --no-degraded $env{DEVNAME}", \
+ RUN+="/bin/sh -c '>/tmp/.mdraid_start-%k; /bin/ln -s /sbin/mdraid_start /initqueue/mdraid_start.sh'"
if [ -x /lib/udev/vol_id ]; then
inst_rules "$moddir/61-mdadm.rules"
else
- inst_rules "$moddir/65-md-incremental.rules"
+ if mdadm -Q -e imsm /dev/null &> /dev/null; then
+ inst_rules "$moddir/65-md-incremental-imsm.rules"
+ else
+ inst_rules "$moddir/65-md-incremental.rules"
+ fi
inst_rules 64-md-raid.rules
fi
fi
inst "$moddir/mdraid_start.sh" /sbin/mdraid_start
-
+inst grep
[ -h "$job" ] && rm -f "$job"
# run mdadm if udev has settled
mdadm -IRs
+ # and activate any containers
+ for md in /dev/md?*; do
+ case $md in
+ /dev/md*p*) ;;
+ *)
+ if mdadm --export --detail $md | grep -q container; then
+ mdadm -IR $md
+ fi
+ esac
+ done
fi
-