zfs-kmod-0.6.0_rc14-r5.ebuild 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="4"
  4. AT_M4DIR="config"
  5. AUTOTOOLS_AUTORECONF="1"
  6. AUTOTOOLS_IN_SOURCE_BUILD="1"
  7. inherit bash-completion-r1 flag-o-matic linux-info linux-mod toolchain-funcs autotools-utils
  8. if [ ${PV} == "9999" ] ; then
  9. inherit git-2
  10. MY_PV=9999
  11. EGIT_REPO_URI="git://github.com/zfsonlinux/zfs.git"
  12. else
  13. inherit eutils versionator
  14. MY_PV=$(replace_version_separator 3 '-')
  15. SRC_URI="https://github.com/zfsonlinux/zfs/archive/zfs-${MY_PV}.tar.gz"
  16. S="${WORKDIR}/zfs-zfs-${MY_PV}"
  17. KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
  18. fi
  19. DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
  20. HOMEPAGE="http://zfsonlinux.org/"
  21. LICENSE="CDDL debug? ( GPL-2+ )"
  22. SLOT="0"
  23. IUSE="custom-cflags debug +rootfs"
  24. RESTRICT="test"
  25. DEPEND="
  26. =sys-kernel/spl-${PV}*
  27. dev-lang/perl
  28. virtual/awk
  29. "
  30. RDEPEND="${DEPEND}
  31. !sys-fs/zfs-fuse
  32. "
  33. pkg_setup() {
  34. linux-info_pkg_setup
  35. CONFIG_CHECK="!DEBUG_LOCK_ALLOC
  36. BLK_DEV_LOOP
  37. EFI_PARTITION
  38. IOSCHED_NOOP
  39. MODULES
  40. !PAX_KERNEXEC_PLUGIN_METHOD_OR
  41. ZLIB_DEFLATE
  42. ZLIB_INFLATE
  43. "
  44. use rootfs && \
  45. CONFIG_CHECK="${CONFIG_CHECK} BLK_DEV_INITRD
  46. DEVTMPFS"
  47. kernel_is ge 2 6 26 || die "Linux 2.6.26 or newer required"
  48. [ ${PV} != "9999" ] && \
  49. { kernel_is le 3 9 || die "Linux 3.9 is the latest supported version."; }
  50. check_extra_config
  51. }
  52. src_prepare() {
  53. if [ ${PV} != "9999" ]
  54. then
  55. # Cast constant for 32-bit compatibility
  56. epatch "${FILESDIR}/${P}-cast-const-for-32bit-compatibility.patch"
  57. # Handle missing name length check in Linux VFS
  58. epatch "${FILESDIR}/${P}-vfs-name-length-compatibility.patch"
  59. # Fix NULL pointer exception on hardened kernels, bug #457176
  60. epatch "${FILESDIR}/${P}-improved-hardened-support.patch"
  61. # Fix barrier regression on Linux 2.6.37 and later
  62. epatch "${FILESDIR}/${P}-flush-properly.patch"
  63. # Improve accuracy of autotools checks
  64. epatch "${FILESDIR}/${P}-improved-autotools-checks.patch"
  65. # Linux 3.9 Support
  66. epatch "${FILESDIR}/${P}-linux-3.9-compat.patch"
  67. # Do not second guess Linux's memory management
  68. epatch "${FILESDIR}/${P}-zfs_arc_memory_throttle_disable.patch"
  69. fi
  70. # Remove GPLv2-licensed ZPIOS unless we are debugging
  71. use debug || sed -e 's/^subdir-m += zpios$//' -i "${S}/module/Makefile.in"
  72. autotools-utils_src_prepare
  73. }
  74. src_configure() {
  75. use custom-cflags || strip-flags
  76. filter-ldflags -Wl,*
  77. set_arch_to_kernel
  78. local myeconfargs=(
  79. --bindir="${EPREFIX}/bin"
  80. --sbindir="${EPREFIX}/sbin"
  81. --with-config=kernel
  82. --with-linux="${KV_DIR}"
  83. --with-linux-obj="${KV_OUT_DIR}"
  84. $(use_enable debug)
  85. )
  86. autotools-utils_src_configure
  87. }
  88. src_install() {
  89. autotools-utils_src_install
  90. dodoc AUTHORS COPYRIGHT DISCLAIMER README.markdown
  91. # Provide /usr/src/zfs symlink for lustre
  92. dosym "$(basename $(echo "${ED}/usr/src/zfs-"*))/${KV_FULL}" /usr/src/zfs
  93. }
  94. pkg_postinst() {
  95. linux-mod_pkg_postinst
  96. if use x86 || use arm
  97. then
  98. ewarn "32-bit kernels will likely require increasing vmalloc to"
  99. ewarn "at least 256M and decreasing zfs_arc_max to some value less than that."
  100. fi
  101. ewarn "This version of ZFSOnLinux introduces support for features flags."
  102. ewarn "If you upgrade your pools to make use of feature flags, you will lose"
  103. ewarn "the ability to import them using older versions of ZFSOnLinux."
  104. ewarn "Any new pools will be created with feature flag support and will"
  105. ewarn "not be compatible with older versions of ZFSOnLinux. To create a new"
  106. ewarn "pool that is backward compatible, use zpool create -o version=28 ..."
  107. }