1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
8 AUTOTOOLS_AUTORECONF="1"
9 AUTOTOOLS_IN_SOURCE_BUILD="1"
11 inherit flag-o-matic linux-info linux-mod toolchain-funcs autotools-utils
13 if [ ${PV} == "9999" ] ; then
15 EGIT_REPO_URI="https://github.com/zfsonlinux/zfs.git"
17 inherit eutils versionator
18 SRC_URI="https://github.com/zfsonlinux/zfs/archive/zfs-${PV}.tar.gz
19 https://dev.gentoo.org/~ryao/dist/zfs-${PV}-patches-${PR}.tar.xz"
20 S="${WORKDIR}/zfs-zfs-${PV}"
21 KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
24 DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
25 HOMEPAGE="http://zfsonlinux.org/"
27 LICENSE="CDDL debug? ( GPL-2+ )"
29 IUSE="custom-cflags debug +rootfs"
30 RESTRICT="debug? ( strip ) test"
33 =sys-kernel/spl-${PV}*
44 CONFIG_CHECK="!DEBUG_LOCK_ALLOC
49 !PAX_KERNEXEC_PLUGIN_METHOD_OR
56 use debug && CONFIG_CHECK="${CONFIG_CHECK}
63 CONFIG_CHECK="${CONFIG_CHECK}
68 kernel_is ge 2 6 26 || die "Linux 2.6.26 or newer required"
70 [ ${PV} != "9999" ] && \
71 { kernel_is le 3 17 || die "Linux 3.17 is the latest supported version."; }
77 if [ ${PV} != "9999" ]
80 EPATCH_SUFFIX="patch" \
82 epatch "${WORKDIR}/zfs-${PV}-patches"
85 # Remove GPLv2-licensed ZPIOS unless we are debugging
86 use debug || sed -e 's/^subdir-m += zpios$//' -i "${S}/module/Makefile.in"
88 # Set module revision number
89 [ ${PV} != "9999" ] && \
90 { sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" "${S}/META" || die "Could not set Gentoo release"; }
92 autotools-utils_src_prepare
96 local SPL_PATH="$(basename $(echo "${EROOT}usr/src/spl-"*))"
97 use custom-cflags || strip-flags
101 local myeconfargs=(${myeconfargs}
102 --bindir="${EPREFIX}/bin"
103 --sbindir="${EPREFIX}/sbin"
105 --with-linux="${KV_DIR}"
106 --with-linux-obj="${KV_OUT_DIR}"
107 --with-spl="${EROOT}usr/src/${SPL_PATH}"
108 --with-spl-obj="${EROOT}usr/src/${SPL_PATH}/${KV_FULL}"
112 autotools-utils_src_configure
116 autotools-utils_src_install INSTALL_MOD_PATH="${INSTALL_MOD_PATH:-$EROOT}"
117 dodoc AUTHORS COPYRIGHT DISCLAIMER README.markdown
121 linux-mod_pkg_postinst
124 if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/zfs" ]
126 ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/zfs"
127 ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/zfs"
128 ewarn "Automatically removing old modules to avoid problems."
129 rm -r "${EROOT}lib/modules/${KV_FULL}/addon/zfs" || die "Cannot remove modules"
130 rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon"
133 if use x86 || use arm
135 ewarn "32-bit kernels will likely require increasing vmalloc to"
136 ewarn "at least 256M and decreasing zfs_arc_max to some value less than that."
139 ewarn "This version of ZFSOnLinux includes support for features flags."
140 ewarn "If you upgrade your pools to make use of feature flags, you will lose"
141 ewarn "the ability to import them using older versions of ZFSOnLinux."
142 ewarn "Any new pools will be created with feature flag support and will"
143 ewarn "not be compatible with older versions of ZFSOnLinux. To create a new"
144 ewarn "pool that is backward compatible, use zpool create -o version=28 ..."