sd-lvm2_install 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. # device mapper and lvm2 systemd units
  10. # binaries and libraries are pull automatically, except ...
  11. add_systemd_unit "lvm2-lvmetad.service"
  12. add_systemd_unit "lvm2-pvscan@.service"
  13. # binaries from lvm2
  14. add_binary "lvm"
  15. add_binary "lvmetad"
  16. # beinaries from device-mapper
  17. add_binary "dmsetup"
  18. # from thin-provisioning-tools
  19. add_binary "pdata_tools"
  20. for symlink in cache_{check,dump,metadata_size,repair,restore} thin_{check,delta,dump,ls,metadata_size,repair,restore,rmap,trim}; do
  21. add_symlink "/usr/bin/${symlink}" "pdata_tools"
  22. done
  23. # udev rules and lvm configuration
  24. add_file "/usr/lib/udev/rules.d/10-dm.rules"
  25. add_file "/usr/lib/udev/rules.d/11-dm-lvm.rules"
  26. add_file "/usr/lib/udev/rules.d/13-dm-disk.rules"
  27. add_file "/usr/lib/udev/rules.d/69-dm-lvm-metad.rules"
  28. add_file "/usr/lib/udev/rules.d/95-dm-notify.rules"
  29. add_file "/usr/lib/initcpio/udev/11-dm-initramfs.rules" "/usr/lib/udev/rules.d/11-dm-initramfs.rules"
  30. add_file "/etc/lvm/lvm.conf"
  31. }
  32. help() {
  33. cat <<HELPEOF
  34. This hook enables LVM2 volumes in systemd-based initramfs.
  35. HELPEOF
  36. }
  37. # vim: set ft=sh ts=4 sw=4 et: