2007-03-04 01:16:24 +00:00
|
|
|
{modprobe, mdadm}:
|
2007-01-11 00:40:28 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
|
2007-01-23 20:09:06 +00:00
|
|
|
tempConf = "/var/run/mdadm.conf";
|
2007-01-11 00:40:28 +00:00
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
name = "swraid";
|
|
|
|
|
|
|
|
job = "
|
|
|
|
start on udev
|
|
|
|
#start on new-devices
|
|
|
|
|
|
|
|
script
|
|
|
|
|
|
|
|
# Load the necessary RAID personalities.
|
2007-03-04 01:16:24 +00:00
|
|
|
# !!! hm, doesn't the kernel load these automatically?
|
2007-01-11 00:40:28 +00:00
|
|
|
for mod in raid0 raid1 raid5; do
|
2007-03-04 01:16:24 +00:00
|
|
|
${modprobe}/sbin/modprobe $mod || true
|
2007-01-11 00:40:28 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
# Scan /proc/partitions for RAID devices.
|
|
|
|
${mdadm}/sbin/mdadm --examine --brief --scan -c partitions > ${tempConf}
|
|
|
|
|
|
|
|
# Activate each device found.
|
|
|
|
${mdadm}/sbin/mdadm --assemble -c ${tempConf} --scan
|
|
|
|
|
|
|
|
initctl emit new-devices
|
|
|
|
|
|
|
|
end script
|
|
|
|
|
|
|
|
";
|
|
|
|
|
|
|
|
}
|