lvm2_install 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. # beinaries from device-mapper
  12. add_binary "dmsetup"
  13. # from thin-provisioning-tools
  14. add_binary "pdata_tools"
  15. for symlink in cache_{check,dump,metadata_size,repair,restore} thin_{check,delta,dump,ls,metadata_size,repair,restore,rmap,trim}; do
  16. add_symlink "/usr/bin/${symlink}" "pdata_tools"
  17. done
  18. # udev rules and lvm configuration
  19. add_file "/lib/udev/rules.d/10-dm.rules"
  20. add_file "/lib/udev/rules.d/11-dm-lvm.rules"
  21. add_file "/lib/udev/rules.d/13-dm-disk.rules"
  22. add_file "/lib/udev/rules.d/95-dm-notify.rules"
  23. add_file "/usr/lib/initcpio/udev/11-dm-initramfs.rules" "/lib/udev/rules.d/11-dm-initramfs.rules"
  24. add_file "/usr/lib/initcpio/udev/69-dm-lvm-metad.rules" "/lib/udev/rules.d/69-dm-lvm-metad.rules"
  25. add_file "/etc/lvm/lvm.conf"
  26. sed -i '/^\smonitoring =/s/1/0/' "${BUILDROOT}/etc/lvm/lvm.conf"
  27. }
  28. help() {
  29. cat <<HELPEOF
  30. This hook enables LVM2 volumes in initramfs.
  31. HELPEOF
  32. }
  33. # vim: set ft=sh ts=4 sw=4 et: