2012-05-27 11:53:08 +02:00
|
|
|
#!/bin/bash
|
2009-12-11 11:32:41 +01:00
|
|
|
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
2009-03-28 14:07:42 +01:00
|
|
|
|
2011-07-06 15:55:39 +02:00
|
|
|
build ()
|
2009-03-28 14:07:42 +01:00
|
|
|
{
|
2012-05-27 11:53:08 +02:00
|
|
|
add_checked_modules -f 'dm-' 'drivers/md/*'
|
2013-05-22 10:01:52 +02:00
|
|
|
add_binary "mdassemble"
|
|
|
|
add_binary "mdadm"
|
|
|
|
add_binary "mdmon"
|
2009-03-28 14:07:42 +01:00
|
|
|
# check if a custom mdadm.conf exists
|
|
|
|
if grep -q ^ARRAY /etc/mdadm.conf; then
|
|
|
|
echo "Custom /etc/mdadm.conf file will be used in initramfs for assembling arrays."
|
|
|
|
add_file "/etc/mdadm.conf"
|
|
|
|
fi
|
2012-05-27 11:53:08 +02:00
|
|
|
add_runscript
|
2009-03-28 14:07:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
help ()
|
|
|
|
{
|
|
|
|
cat<<HELPEOF
|
|
|
|
This hook loads the necessary modules for any raid root device,
|
|
|
|
and assembles the raid device when run.
|
|
|
|
|
|
|
|
If arrays are defined in /etc/mdadm.conf, the file will be used instead
|
|
|
|
of command line assembling.
|
|
|
|
|
|
|
|
Command Line Setup:
|
|
|
|
- for raid arrays with persistent superblocks:
|
|
|
|
md=<md device no.>,dev0,dev1,...,devn
|
|
|
|
md=<md device no.>,uuid
|
|
|
|
- for partitionable raid arrays with persistent superblocks:
|
|
|
|
md=d<md device no.>,dev0,dev1,...,devn
|
|
|
|
md=d<md device no.>,uuid
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
- <md device no.> = the number of the md device:
|
|
|
|
0 means md0, 1 means md1, ...
|
|
|
|
- <dev0-devn>: e.g. /dev/hda1,/dev/hdc1,/dev/sda1,/dev/sdb1
|
|
|
|
or 0900878d:f95f6057:c39a36e9:55efa60a
|
|
|
|
Examples:
|
|
|
|
- md=d0,/dev/sda3,/dev/sda4 md=d1,/dev/hda1,/dev/hdb1
|
|
|
|
This will setup 2 md partitionable arrays.
|
|
|
|
- md=0,/dev/sda3,/dev/sda4 md=1,/dev/hda1,/dev/hdb1
|
|
|
|
This will setup 2 md arrays with persistent superblocks.
|
|
|
|
HELPEOF
|
|
|
|
}
|