mdadm_install 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/bash
  2. build() {
  3. add_checked_modules -f 'dm-' 'drivers/md/*'
  4. # check if a custom mdadm.conf exists
  5. if grep -q ^ARRAY /etc/mdadm.conf; then
  6. echo "Custom /etc/mdadm.conf file will be used in initramfs for assembling arrays."
  7. add_file "/etc/mdadm.conf"
  8. fi
  9. add_binary "/usr/bin/mdassemble"
  10. add_file "/usr/lib/udev/rules.d/63-md-raid-arrays.rules"
  11. add_runscript
  12. }
  13. help() {
  14. cat <<HELPEOF
  15. This hook loads the necessary modules for any raid root device,
  16. and assembles the raid device when run.
  17. If arrays are defined in /etc/mdadm.conf, the file will be used instead
  18. of command line assembling.
  19. Command Line Setup:
  20. - for raid arrays with persistent superblocks:
  21. md=<md device no.>,dev0,dev1,...,devn
  22. md=<md device no.>,uuid
  23. - for partitionable raid arrays with persistent superblocks:
  24. md=d<md device no.>,dev0,dev1,...,devn
  25. md=d<md device no.>,uuid
  26. Parameters:
  27. - <md device no.> = the number of the md device:
  28. 0 means md0, 1 means md1, ...
  29. - <dev0-devn>: e.g. /dev/hda1,/dev/hdc1,/dev/sda1,/dev/sdb1
  30. or 0900878d:f95f6057:c39a36e9:55efa60a
  31. Examples:
  32. - md=d0,/dev/sda3,/dev/sda4 md=d1,/dev/hda1,/dev/hdb1
  33. This will setup 2 md partitionable arrays.
  34. - md=0,/dev/sda3,/dev/sda4 md=1,/dev/hda1,/dev/hdb1
  35. This will setup 2 md arrays with persistent superblocks.
  36. HELPEOF
  37. }
  38. # vim: set ft=sh ts=4 sw=4 et: