diff options
Diffstat (limited to 'mdadm_udev_install')
-rw-r--r-- | mdadm_udev_install | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/mdadm_udev_install b/mdadm_udev_install new file mode 100644 index 000000000000..64a0862c1d69 --- /dev/null +++ b/mdadm_udev_install @@ -0,0 +1,25 @@ +#!/bin/bash + +build() { + add_checked_modules -f 'dm-' 'drivers/md/*' + + # check if a custom mdadm.conf exists + if grep -qw ^ARRAY "$BASEDIR/etc/mdadm.conf"; then + echo "Custom /etc/mdadm.conf file will be used in initramfs for assembling arrays." + add_file "/etc/mdadm.conf" + fi + + map add_udev_rule \ + '63-md-raid-arrays.rules' \ + '64-md-raid-assembly.rules' +} + +help() { + cat <<HELPEOF +This hook loads the necessary modules for a RAID array and uses incremental +assembly via udev at runtime to create the devices. This hook will NOT work +without the udev hook included on the image. +HELPEOF +} + +# vim: set ft=sh ts=4 sw=4 et: |