zfs_install 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #!/bin/bash
  2. build() {
  3. map add_module \
  4. zavl \
  5. znvpair \
  6. zunicode \
  7. zcommon \
  8. zfs \
  9. spl
  10. map add_binary \
  11. fsck.zfs \
  12. mount.zfs \
  13. seq \
  14. zdb \
  15. zed \
  16. zfs \
  17. zhack \
  18. zinject \
  19. zpool \
  20. zstreamdump \
  21. /usr/lib/udev/vdev_id \
  22. /usr/lib/udev/zvol_id \
  23. findmnt
  24. map add_file \
  25. /usr/lib/udev/rules.d/60-zvol.rules \
  26. /usr/lib/udev/rules.d/69-vdev.rules \
  27. /usr/lib/udev/rules.d/90-zfs.rules \
  28. /usr/lib/libgcc_s.so.1
  29. map add_dir \
  30. /etc/zfs/zed.d
  31. add_runscript
  32. # allow mount(8) to "autodetect" ZFS
  33. echo 'zfs' >>"${BUILDROOT}/etc/filesystems"
  34. [[ -f /etc/hostid ]] && add_file "/etc/hostid"
  35. [[ -f /etc/zfs/zpool.cache ]] && cp "/etc/zfs/zpool.cache" "${BUILDROOT}/etc/zfs/zpool.cache.org"
  36. [[ -f /etc/modprobe.d/zfs.conf ]] && add_file "/etc/modprobe.d/zfs.conf"
  37. }
  38. help() {
  39. cat<<HELPEOF
  40. This hook allows you to use ZFS as your root filesystem.
  41. Command Line Setup:
  42. You can append the following arguments to your kernel parameters list. See
  43. https://wiki.archlinux.org/index.php/Kernel_parameters for more information.
  44. To use ZFS as your boot filesystem:
  45. zfs=bootfs or zfs=auto or root=zfs
  46. To use a pool or dataset:
  47. zfs=<pool/dataset>
  48. To force importing of a ZFS pool:
  49. zfs_force=1
  50. If set to 1, this will use "zpool import -f" when attempting to import
  51. pools.
  52. To change the seconds of time to wait for ZFS devices to show up at boot:
  53. zfs_wait=30
  54. To search for devices in a directory other than "/dev":
  55. zfs_import_dir=/dev/disk/by-uuid
  56. or
  57. zfs_import_dir=/dev/disk/by-partuuid
  58. or
  59. zfs_import_dir=/dev/disk/by-path
  60. etc.
  61. Following initcpio convention, the 'rw' option must be specified to load the
  62. pool as read/write. Pools are loaded as read only by default.
  63. Examples:
  64. To use bootfs on your pool, use
  65. zfs=bootfs rw
  66. This will setup your root using tank/root zfs pool.
  67. zfs=tank/root rw
  68. If you want to set properties for zfs-on-linux module, you should add them to
  69. /etc/modprobe.d/zfs.conf and then rebuild initcpio.
  70. HELPEOF
  71. }
  72. # vim: set ts=4 sw=4 ft=sh et: