zfs.mk 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. ################################################################################
  2. #
  3. # zfs
  4. #
  5. ################################################################################
  6. ZFS_VERSION = 2.3.1
  7. ZFS_SITE = https://github.com/openzfs/zfs/releases/download/zfs-$(ZFS_VERSION)
  8. ZFS_SELINUX_MODULES = zfs
  9. ZFS_LICENSE = CDDL
  10. ZFS_LICENSE_FILES = LICENSE COPYRIGHT
  11. ZFS_CPE_ID_VENDOR = openzfs
  12. ZFS_CPE_ID_PRODUCT = openzfs
  13. ZFS_DEPENDENCIES = libaio openssl udev util-linux zlib libcurl linux
  14. # sysvinit installs only a commented-out modules-load.d/ config file
  15. ZFS_CONF_OPTS = \
  16. --with-linux=$(LINUX_DIR) \
  17. --with-linux-obj=$(LINUX_DIR) \
  18. --disable-rpath \
  19. --disable-sysvinit
  20. ifeq ($(BR2_PACKAGE_LIBTIRPC),y)
  21. ZFS_DEPENDENCIES += libtirpc
  22. ZFS_CONF_OPTS += --with-tirpc
  23. else
  24. ZFS_CONF_OPTS += --without-tirpc
  25. endif
  26. ifeq ($(BR2_INIT_SYSTEMD),y)
  27. # Installs the optional systemd generators, units, and presets files.
  28. ZFS_CONF_OPTS += --enable-systemd
  29. else
  30. ZFS_CONF_OPTS += --disable-systemd
  31. endif
  32. ifeq ($(BR2_PACKAGE_PYTHON3),y)
  33. ZFS_DEPENDENCIES += python3 python-setuptools host-python-cffi host-python-packaging
  34. ZFS_CONF_ENV += \
  35. PYTHON=$(HOST_DIR)/bin/python3 \
  36. PYTHON_CPPFLAGS="`$(STAGING_DIR)/usr/bin/python3-config --includes`" \
  37. PYTHON_LIBS="`$(STAGING_DIR)/usr/bin/python3-config --ldflags`" \
  38. PYTHON_EXTRA_LIBS="`$(STAGING_DIR)/usr/bin/python3-config --libs --embed`" \
  39. PYTHON_SITE_PKG="/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages"
  40. ZFS_CONF_OPTS += --enable-pyzfs
  41. else
  42. ZFS_CONF_OPTS += --disable-pyzfs --without-python
  43. endif
  44. ifeq ($(BR2_PACKAGE_LINUX_PAM),y)
  45. ZFS_DEPENDENCIES += linux-pam
  46. ZFS_CONF_OPTS += --enable-pam
  47. else
  48. ZFS_CONF_OPTS += --disable-pam
  49. endif
  50. # Sets the environment for the `make` that will be run ZFS autotools checks.
  51. ZFS_CONF_ENV += \
  52. ARCH=$(KERNEL_ARCH) \
  53. CROSS_COMPILE="$(TARGET_CROSS)"
  54. ZFS_MAKE_ENV += \
  55. ARCH=$(KERNEL_ARCH) \
  56. CROSS_COMPILE="$(TARGET_CROSS)"
  57. # ZFS userland tools are unfunctional without the Linux kernel modules.
  58. ZFS_MODULE_SUBDIRS = \
  59. module/avl \
  60. module/icp \
  61. module/lua \
  62. module/nvpair \
  63. module/spl \
  64. module/unicode \
  65. module/zcommon \
  66. module/zstd \
  67. module/zfs
  68. # These requirements will be validated by zfs/config/kernel-config-defined.m4
  69. define ZFS_LINUX_CONFIG_FIXUPS
  70. $(call KCONFIG_DISABLE_OPT,CONFIG_DEBUG_LOCK_ALLOC)
  71. $(call KCONFIG_DISABLE_OPT,CONFIG_TRIM_UNUSED_KSYMS)
  72. $(call KCONFIG_ENABLE_OPT,CONFIG_CRYPTO_DEFLATE)
  73. $(call KCONFIG_ENABLE_OPT,CONFIG_ZLIB_DEFLATE)
  74. $(call KCONFIG_ENABLE_OPT,CONFIG_ZLIB_INFLATE)
  75. endef
  76. # Even though zfs builds a kernel module, it gets built directly by
  77. # the autotools logic, so we don't use the kernel-module
  78. # infrastructure.
  79. $(eval $(autotools-package))