summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Yao <ryao@gentoo.org>2015-12-03 11:20:38 -0500
committerRichard Yao <ryao@gentoo.org>2015-12-03 11:28:28 -0500
commit56ff62daca4803ffcfcddcd88b8322462ba3ddf1 (patch)
treef65b79df0a33347514f448de6af4d45516bc7fc3 /sys-kernel/spl/spl-0.6.5.3-r1.ebuild
parentnet-libs/rb_libtorrent: Version bump (diff)
downloadgentoo-56ff62daca4803ffcfcddcd88b8322462ba3ddf1.tar.gz
gentoo-56ff62daca4803ffcfcddcd88b8322462ba3ddf1.tar.bz2
gentoo-56ff62daca4803ffcfcddcd88b8322462ba3ddf1.zip
sys-kernel/spl + sys-fs/zfs{,-kmod}: Partial stable /dev/zfs API + backports
This backports various fixes and also implements the partial /dev/zfs stable API that I have developed at ClusterHQ over the past 14 months. Ordinarily, I would not commit something like this until it has gone upstream, but upstream wants review from people in the Illumos project that prefer to see things like this in production before it reaches them and it would have likely been deadlocked until I volunteered Gentoo. I am confident that this is ready for production and I believe Gentoo benefits from it enough to justify being the first production user. Unless the API changes under review, situations where the kernel modules and userland bits fall out of sync will no longer break the boot process (excluding zfs-share and zfs-zed). This was the longstanding blocker to the ebuilds moving from ~arch to arch, so we could finally see that happen around later this month / early next month. Package-Manager: portage-2.2.20.1 Signed-off-by: Richard Yao <ryao@gentoo.org>
Diffstat (limited to 'sys-kernel/spl/spl-0.6.5.3-r1.ebuild')
-rw-r--r--sys-kernel/spl/spl-0.6.5.3-r1.ebuild120
1 files changed, 120 insertions, 0 deletions
diff --git a/sys-kernel/spl/spl-0.6.5.3-r1.ebuild b/sys-kernel/spl/spl-0.6.5.3-r1.ebuild
new file mode 100644
index 000000000000..a705dda5ebaf
--- /dev/null
+++ b/sys-kernel/spl/spl-0.6.5.3-r1.ebuild
@@ -0,0 +1,120 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+if [[ ${PV} == "9999" ]] ; then
+ AUTOTOOLS_AUTORECONF="1"
+ EGIT_REPO_URI="https://github.com/zfsonlinux/${PN}.git"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/zfsonlinux/zfs/releases/download/zfs-${PV}/${P}.tar.gz
+ https://dev.gentoo.org/~ryao/dist/${P}-patches-p0.tar.xz"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+inherit flag-o-matic linux-info linux-mod autotools-utils
+
+DESCRIPTION="The Solaris Porting Layer is a Linux kernel module which provides many of the Solaris kernel APIs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="custom-cflags debug"
+RESTRICT="debug? ( strip ) test"
+
+COMMON_DEPEND="dev-lang/perl
+ virtual/awk"
+
+DEPEND="${COMMON_DEPEND}"
+
+RDEPEND="${COMMON_DEPEND}
+ !sys-devel/spl"
+
+AT_M4DIR="config"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+DOCS=( AUTHORS DISCLAIMER )
+
+pkg_setup() {
+ linux-info_pkg_setup
+ CONFIG_CHECK="
+ !DEBUG_LOCK_ALLOC
+ MODULES
+ KALLSYMS
+ !PAX_KERNEXEC_PLUGIN_METHOD_OR
+ !PAX_SIZE_OVERFLOW
+ ZLIB_DEFLATE
+ ZLIB_INFLATE
+ "
+
+ use debug && CONFIG_CHECK="${CONFIG_CHECK}
+ FRAME_POINTER
+ DEBUG_INFO
+ !DEBUG_INFO_REDUCED
+ "
+
+ kernel_is ge 2 6 32 || die "Linux 2.6.32 or newer required"
+
+ [ ${PV} != "9999" ] && \
+ { kernel_is le 4 4 || die "Linux 4.4 is the latest supported version."; }
+
+ check_extra_config
+}
+
+src_prepare() {
+ if [ ${PV} != "9999" ]
+ then
+ # Apply patch set
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}/${P}-patches"
+ fi
+
+ # Workaround for hard coded path
+ sed -i "s|/sbin/lsmod|/bin/lsmod|" "${S}/scripts/check.sh" || \
+ die "Cannot patch check.sh"
+
+ # splat is unnecessary unless we are debugging
+ use debug || { sed -e 's/^subdir-m += splat$//' -i "${S}/module/Makefile.in" || die ; }
+
+ # Set module revision number
+ [ ${PV} != "9999" ] && \
+ { sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" "${S}/META" || die "Could not set Gentoo release"; }
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ filter-ldflags -Wl,*
+
+ set_arch_to_kernel
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=all
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ $(use_enable debug)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install INSTALL_MOD_PATH="${INSTALL_MOD_PATH:-$EROOT}"
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+
+ # Remove old modules
+ if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/spl" ]
+ then
+ ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/spl"
+ ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/spl"
+ ewarn "Automatically removing old modules to avoid problems."
+ rm -r "${EROOT}lib/modules/${KV_FULL}/addon/spl" || die "Cannot remove modules"
+ rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon"
+ fi
+}