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 bash-completion-r1 flag-o-matic linux-info linux-mod toolchain-funcs autotools-utils
13 if [ ${PV} == "9999" ] ; then
16 EGIT_REPO_URI="git://github.com/zfsonlinux/zfs.git"
18 inherit eutils versionator
19 MY_PV=$(replace_version_separator 3 '-')
20 SRC_URI="https://github.com/zfsonlinux/zfs/archive/zfs-${MY_PV}.tar.gz
21 https://dev.gentoo.org/~ryao/dist/${PN}-${MY_PV}-p3.tar.xz"
22 S="${WORKDIR}/zfs-zfs-${MY_PV}"
23 KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
26 DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
27 HOMEPAGE="http://zfsonlinux.org/"
29 LICENSE="CDDL debug? ( GPL-2+ )"
31 IUSE="custom-cflags debug +rootfs"
35 =sys-kernel/spl-${PV}*
46 CONFIG_CHECK="!DEBUG_LOCK_ALLOC
51 !PAX_KERNEXEC_PLUGIN_METHOD_OR
57 CONFIG_CHECK="${CONFIG_CHECK} BLK_DEV_INITRD
60 kernel_is ge 2 6 26 || die "Linux 2.6.26 or newer required"
62 [ ${PV} != "9999" ] && \
63 { kernel_is le 3 14 || die "Linux 3.14 is the latest supported version."; }
69 # Remove GPLv2-licensed ZPIOS unless we are debugging
70 use debug || sed -e 's/^subdir-m += zpios$//' -i "${S}/module/Makefile.in"
72 if [ ${PV} != "9999" ]
75 EPATCH_SUFFIX="patch" \
77 epatch "${WORKDIR}/${PN}-${MY_PV}-patches"
80 autotools-utils_src_prepare
84 use custom-cflags || strip-flags
89 --bindir="${EPREFIX}/bin"
90 --sbindir="${EPREFIX}/sbin"
92 --with-linux="${KV_DIR}"
93 --with-linux-obj="${KV_OUT_DIR}"
96 autotools-utils_src_configure
100 autotools-utils_src_install
101 dodoc AUTHORS COPYRIGHT DISCLAIMER README.markdown
105 linux-mod_pkg_postinst
108 if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/zfs" ]
110 ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/zfs"
111 ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/zfs"
112 ewarn "Automatically removing old modules to avoid problems."
113 rm -r "${EROOT}lib/modules/${KV_FULL}/addon/zfs" || die "Cannot remove modules"
114 rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon"
117 if use x86 || use arm
119 ewarn "32-bit kernels will likely require increasing vmalloc to"
120 ewarn "at least 256M and decreasing zfs_arc_max to some value less than that."
123 ewarn "This version of ZFSOnLinux includes support for features flags."
124 ewarn "If you upgrade your pools to make use of feature flags, you will lose"
125 ewarn "the ability to import them using older versions of ZFSOnLinux."
126 ewarn "Any new pools will be created with feature flag support and will"
127 ewarn "not be compatible with older versions of ZFSOnLinux. To create a new"
128 ewarn "pool that is backward compatible, use zpool create -o version=28 ..."