summaryrefslogtreecommitdiffstats
path: root/abs/core/mdadm/raid-partitions_hook
blob: bed1cb2e32c7254f651c1cab735883f7f4125c5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# vim: set ft=sh:
run_hook ()
{
    #TODO scan for these somehow...
    /sbin/modprobe -aq linear multipath raid0 raid1 raid456 raid10>/dev/null 2>&1
    # md= can be specified multiple times.  The simplistic commandline
    #  parsing does not handle this, so we will let mdassemble parse it
    for i in $(replace $(echo $md) ',' ' '); do 
	case $i in d[0-9])
    		for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do 
         		/sbin/mdadm --create -a mdp /dev/md_d$i >/dev/null 2>&1
    		done
    		mdadm --assemble --auto=mdp /dev/md_$(replace $(echo $md) ',' ' ')
    		export USE_RAID_ARRAY=1
		;;
    	esac
    done
    if  ! [ "$USE_RAID_ARRAY" = "1" ] ; then
      /bin/mdassemble ${CMDLINE}
    fi
}