--- rc.sysinit.orig 2005-04-01 19:36:49 +0400 +++ rc.sysinit 2005-04-04 03:01:09 +0400 @@ -285,11 +285,22 @@ fi # Add raid devices -if [ -z "$EVMS_ACTIVE" ] && [ -f /proc/mdstat -a -s /etc/raidtab ] && ! grep -iwqs noraidtab /proc/cmdline; then - echo -n "Starting up RAID devices: " - rc=0 - +raid_helpers_found() { + [ -s /etc/mdadm.conf ] && return 0 + [ -s /etc/raidtab ] && return 0 + return 1 +} + +mount_raid_using_mdadm() { + [ -s /etc/mdadm.conf ] || return 1 + [ -x /sbin/mdadm ] || return 1 + /sbin/mdadm --assemble --scan +} + +mount_raid_using_raidtools() { + local rc=0 + [ -s /etc/raidtab ] || return 1 for i in `grep -s "^raiddev" /etc/raidtab | awk '{print $2}'`; do RAIDDEV="${i##*/}" RAIDSTAT=`grep -s "^$RAIDDEV : active" /proc/mdstat` @@ -315,6 +326,14 @@ fi echo -n "$RAIDDEV " done + return $rc +} + +if [ -z "$EVMS_ACTIVE" ] && [ -f /proc/mdstat ] && raid_helpers_found && ! grep -iwqs noraidtab /proc/cmdline; then + + echo -n "Starting up RAID devices: " + rc=0 + mount_raid_using_mdadm || mount_raid_using_raidtools || rc=1 echo # A non-zero return means there were problems.