lvm2_install 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/usr/bin/bash
  2. build() {
  3. local mod
  4. local symlink
  5. # device mapper modules
  6. for mod in dm-mod dm-snapshot dm-mirror dm-cache dm-cache-smq dm-thin-pool; do
  7. add_module "$mod"
  8. done
  9. # binaries from lvm2
  10. add_binary "lvm"
  11. add_binary "lvmetad"
  12. # beinaries from device-mapper
  13. add_binary "dmsetup"
  14. # from thin-provisioning-tools
  15. add_binary "pdata_tools"
  16. for symlink in cache_{check,dump,metadata_size,repair,restore} thin_{check,delta,dump,ls,metadata_size,repair,restore,rmap,trim}; do
  17. add_symlink "/usr/bin/${symlink}" "pdata_tools"
  18. done
  19. # udev rules and lvm configuration
  20. add_file "/usr/lib/udev/rules.d/10-dm.rules"
  21. add_file "/usr/lib/udev/rules.d/11-dm-lvm.rules"
  22. add_file "/usr/lib/udev/rules.d/13-dm-disk.rules"
  23. add_file "/usr/lib/udev/rules.d/95-dm-notify.rules"
  24. add_file "/usr/lib/initcpio/udev/11-dm-initramfs.rules" "/usr/lib/udev/rules.d/11-dm-initramfs.rules"
  25. add_file "/usr/lib/initcpio/udev/69-dm-lvm-metad.rules" "/usr/lib/udev/rules.d/69-dm-lvm-metad.rules"
  26. add_file "/etc/lvm/lvm.conf"
  27. add_runscript
  28. }
  29. help() {
  30. cat <<HELPEOF
  31. This hook enables LVM2 volumes in initramfs.
  32. HELPEOF
  33. }
  34. # vim: set ft=sh ts=4 sw=4 et: