diff --git a/sys-fs/zfs-kmod/Manifest b/sys-fs/zfs-kmod/Manifest index 744de10008b50..1bc31c10c767e 100644 --- a/sys-fs/zfs-kmod/Manifest +++ b/sys-fs/zfs-kmod/Manifest @@ -10,5 +10,6 @@ DIST zfs-0.6.5.3-patches-p3.tar.xz 88736 SHA256 031cd97765f890d9b78e1a5746cbd2a3 DIST zfs-0.6.5.3.tar.gz 2524218 SHA256 49e6f9760ea172cb756f7357e4bcb90ee0293028540a68d62ed087724276131f SHA512 325cb91b7ddbcd6aa0bb9fc41eb0099dbb047a4e32d096fd414799729ef68cbc9c2e15714092eff8044a681af4ab552bd9ac1949cc673c6c5c3de1a23d9895ec WHIRLPOOL 957c3a75bb11befd4b74583883f2f11f717deb6bda368939b342049e809aa191a9ee8d1e709eaddc2a831418c7fdb5e763f918ff56d45f03baf4569ef8a4a070 DIST zfs-0.6.5.4-patches-p1.tar.xz 64004 SHA256 83877d9b7c629730838325fd5b16bcb54259520e200f0539de9b8edfdcee9403 SHA512 9203356b43bdad2ed78c946af8c95c9fc4d2996b41a09a3b1f5a8657d2742ac69d10b4a87d443db497d591878cf7a70ebb19762b0df135ee25f4e8d2ed6ad71f WHIRLPOOL ff5788356d6a85608d22ea2c010a799464922614204c7eea06b57930a44ee876e596a053a773205de0543d36c04337d60c32594939e8e64d3022906c51c4d4e6 DIST zfs-0.6.5.4.tar.gz 2506470 SHA256 780862ec2301ccace412a324787e9df762cff6046e73e2ac0ebdce9e2bd59b0f SHA512 90c87cd95fd06cf34755358e7cc4053d19f351316133f0b808e7585a3fc8f82e7c0f49072c2995d0520de5104fd04d91a166a0d5b6c923c82dfb2fb4f7f57a01 WHIRLPOOL eacd2ec09afdbc3f6d946583116296fadcd7d0dea5158c89f82f6d0b02e0cbf075712015bfa5f321ae5815cf86af13b39ce93e5026e6a00da58d9ddb04d12320 +DIST zfs-0.6.5.6.tar.gz 2561093 SHA256 c349d46d86b4f61cd53a0891acad916cfc3f0d6754127db7f60a0bd98185aeff SHA512 94c55a50f0f9a90ce07a45dc72bb2730b2a41373ab5a12845df00ef38bb22e4a80ab2fb6e31a9c3a45e51516cdea441bb9da1d0acf71f2f88b38c7c3e9e995b0 WHIRLPOOL 6fcbe473bfce90f800989bac506fa6d4cf5662ad9ca617a477f1251c1625de906495a45759d6190e5a24dcf05f2ed3dd7ea1c0b2f243165a60e5efd098082935 DIST zfs-0.6.5.tar.gz 1816180 SHA256 542121940122c922c9d21a2bb39bca4e4a9db2f6bbfd2e576630840e256d4c82 SHA512 58480ee9b0780f1f21d12504abc226be3e6df1939214f6a8f245315d1fa0b9da56b3a744df26426ee78f13684a4ca288df6dddc50f8f91d9d0b4c542980a9c53 WHIRLPOOL fdb5580ec8d4abe57069ce453c1d91225019758ecf5d31856a7897ac7e4b51c6a8ae3258e822f684fbd70a0a7d7410c65c37a569f37d132767522118c587cc24 DIST zfs-kmod-0.6.2-p2.tar.xz 28636 SHA256 12882463a38a5a57cf2bb3c14c5783f9511f6dc7b163a47575f2f3dcc24f26f6 SHA512 5792660ae8f5013d12e70d608e9cffa92a8c4089a88a5e78728ee88204b3f970d452d5b0b3874e02be49ebbc139e07139be7b5a86ca40bc8b23cb11a7198a9a8 WHIRLPOOL 0e4c57b363cdd3d736efbd1355567b18e22439bd3b20ef40b27f6b97ad4570c7cc99a11b196ac25359d1966c1a70e178f4fd1687b60450f148ccda47b07282a9 diff --git a/sys-fs/zfs-kmod/zfs-kmod-0.6.5.6.ebuild b/sys-fs/zfs-kmod/zfs-kmod-0.6.5.6.ebuild new file mode 100644 index 0000000000000..e7b2197419627 --- /dev/null +++ b/sys-fs/zfs-kmod/zfs-kmod-0.6.5.6.ebuild @@ -0,0 +1,145 @@ +# 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/zfs.git" + inherit git-r3 +else + SRC_URI="https://github.com/zfsonlinux/zfs/releases/download/zfs-${PV}/zfs-${PV}.tar.gz" + S="${WORKDIR}/zfs-${PV}" + KEYWORDS="" +fi + +inherit flag-o-matic linux-info linux-mod toolchain-funcs autotools-utils + +DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs" +HOMEPAGE="http://zfsonlinux.org/" + +LICENSE="CDDL debug? ( GPL-2+ )" +SLOT="0" +IUSE="custom-cflags debug +rootfs" +RESTRICT="debug? ( strip ) test" + +DEPEND=" + =sys-kernel/spl-${PV}* + dev-lang/perl + virtual/awk +" + +RDEPEND="${DEPEND} + !sys-fs/zfs-fuse +" + +AT_M4DIR="config" +AUTOTOOLS_IN_SOURCE_BUILD="1" + +DOCS=( AUTHORS COPYRIGHT DISCLAIMER README.markdown ) + +pkg_setup() { + linux-info_pkg_setup + CONFIG_CHECK="!DEBUG_LOCK_ALLOC + EFI_PARTITION + IOSCHED_NOOP + MODULES + !PAX_KERNEXEC_PLUGIN_METHOD_OR + ZLIB_DEFLATE + ZLIB_INFLATE + " + + use debug && CONFIG_CHECK="${CONFIG_CHECK} + FRAME_POINTER + DEBUG_INFO + !DEBUG_INFO_REDUCED + " + + use rootfs && \ + CONFIG_CHECK="${CONFIG_CHECK} + BLK_DEV_INITRD + DEVTMPFS + " + + kernel_is ge 2 6 32 || die "Linux 2.6.32 or newer required" + + [ ${PV} != "9999" ] && \ + { kernel_is le 4 3 || die "Linux 4.3 is the latest supported version."; } + + check_extra_config +} + +src_prepare() { + # Remove GPLv2-licensed ZPIOS unless we are debugging + use debug || sed -e 's/^subdir-m += zpios$//' -i "${S}/module/Makefile.in" + + # 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() { + local SPL_PATH="$(basename $(echo "${EROOT}usr/src/spl-"*))" + use custom-cflags || strip-flags + filter-ldflags -Wl,* + + set_arch_to_kernel + local myeconfargs=(${myeconfargs} + --bindir="${EPREFIX}/bin" + --sbindir="${EPREFIX}/sbin" + --with-config=kernel + --with-linux="${KV_DIR}" + --with-linux-obj="${KV_OUT_DIR}" + --with-spl="${EROOT}usr/src/${SPL_PATH}" + --with-spl-obj="${EROOT}usr/src/${SPL_PATH}/${KV_FULL}" + $(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/zfs" ] + then + ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/zfs" + ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/zfs" + ewarn "Automatically removing old modules to avoid problems." + rm -r "${EROOT}lib/modules/${KV_FULL}/addon/zfs" || die "Cannot remove modules" + rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon" + fi + + if use x86 || use arm + then + ewarn "32-bit kernels will likely require increasing vmalloc to" + ewarn "at least 256M and decreasing zfs_arc_max to some value less than that." + fi + + ewarn "This version of ZFSOnLinux includes support for new feature flags" + ewarn "that are incompatible with previous versions. GRUB2 support for" + ewarn "/boot with the new feature flags is not yet available." + ewarn "Do *NOT* upgrade root pools to use the new feature flags." + ewarn "Any new pools will be created with the new feature flags by default" + ewarn "and will not be compatible with older versions of ZFSOnLinux. To" + ewarn "create a newpool that is backward compatible wih GRUB2, use " + ewarn + ewarn "zpool create -d -o feature@async_destroy=enabled " + ewarn " -o feature@empty_bpobj=enabled -o feature@lz4_compress=enabled" + ewarn " -o feature@spacemap_histogram=enabled" + ewarn " -o feature@enabled_txg=enabled " + ewarn " -o feature@extensible_dataset=enabled -o feature@bookmarks=enabled" + ewarn " ..." + ewarn + ewarn "GRUB2 support will be updated as soon as either the GRUB2" + ewarn "developers do a tag or the Gentoo developers find time to backport" + ewarn "support from GRUB2 HEAD." +} diff --git a/sys-fs/zfs/Manifest b/sys-fs/zfs/Manifest index c436c04c0b9fa..8ef3795e1bf2e 100644 --- a/sys-fs/zfs/Manifest +++ b/sys-fs/zfs/Manifest @@ -14,4 +14,5 @@ DIST zfs-0.6.5.3.tar.gz 2524218 SHA256 49e6f9760ea172cb756f7357e4bcb90ee02930285 DIST zfs-0.6.5.4-patches-p1.tar.xz 64004 SHA256 83877d9b7c629730838325fd5b16bcb54259520e200f0539de9b8edfdcee9403 SHA512 9203356b43bdad2ed78c946af8c95c9fc4d2996b41a09a3b1f5a8657d2742ac69d10b4a87d443db497d591878cf7a70ebb19762b0df135ee25f4e8d2ed6ad71f WHIRLPOOL ff5788356d6a85608d22ea2c010a799464922614204c7eea06b57930a44ee876e596a053a773205de0543d36c04337d60c32594939e8e64d3022906c51c4d4e6 DIST zfs-0.6.5.4-patches-p2.tar.xz 63912 SHA256 bbcfe43ee4a46deed86543d23abd31bbc662408f56ef8f7c9500dc25fecd49c4 SHA512 9f598c2a750b92dadddb677a6a9dda4573fa91421a82270d8104d718da4b945a4d5412bab92037a033cec1ec177f2a0eb52207babd023847918e3754054ec5e9 WHIRLPOOL bab1330c7489dd172c522300698f6a2d670a2f6ddcf8cd2566d1daffe8b41a3667755ad1ab377d07716af66449f7332974bcd7df4647bb028b5f5279c59c428c DIST zfs-0.6.5.4.tar.gz 2506470 SHA256 780862ec2301ccace412a324787e9df762cff6046e73e2ac0ebdce9e2bd59b0f SHA512 90c87cd95fd06cf34755358e7cc4053d19f351316133f0b808e7585a3fc8f82e7c0f49072c2995d0520de5104fd04d91a166a0d5b6c923c82dfb2fb4f7f57a01 WHIRLPOOL eacd2ec09afdbc3f6d946583116296fadcd7d0dea5158c89f82f6d0b02e0cbf075712015bfa5f321ae5815cf86af13b39ce93e5026e6a00da58d9ddb04d12320 +DIST zfs-0.6.5.6.tar.gz 2561093 SHA256 c349d46d86b4f61cd53a0891acad916cfc3f0d6754127db7f60a0bd98185aeff SHA512 94c55a50f0f9a90ce07a45dc72bb2730b2a41373ab5a12845df00ef38bb22e4a80ab2fb6e31a9c3a45e51516cdea441bb9da1d0acf71f2f88b38c7c3e9e995b0 WHIRLPOOL 6fcbe473bfce90f800989bac506fa6d4cf5662ad9ca617a477f1251c1625de906495a45759d6190e5a24dcf05f2ed3dd7ea1c0b2f243165a60e5efd098082935 DIST zfs-kmod-0.6.2-p4.tar.xz 63984 SHA256 9167edc4be86e3fcda6b3c198e51f92ab0c95ac5baca11666c28029a628cdac9 SHA512 13e4ec415c35d2f268d89565745f5898c0943423577a2ba6714b3a069c5a80f244cd06dff91464f38dd4ed60673d1145ead080bb03a56d4be33e328f948ffa64 WHIRLPOOL 8c399ec67119ed4fbebb5599d00f888918678bc4e4ea369b4bdc5c75bfc90fc76396087624c8011de370a54ff103bccaa8922d05ac7ccebb2b3481bbbcf44b19 diff --git a/sys-fs/zfs/zfs-0.6.5.6.ebuild b/sys-fs/zfs/zfs-0.6.5.6.ebuild new file mode 100644 index 0000000000000..01ea814f5f1b0 --- /dev/null +++ b/sys-fs/zfs/zfs-0.6.5.6.ebuild @@ -0,0 +1,198 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI="5" +PYTHON_COMPAT=( python{2_7,3_3,3_4,3_5} ) + +if [ ${PV} == "9999" ] ; then + inherit git-r3 linux-mod + AUTOTOOLS_AUTORECONF="1" + EGIT_REPO_URI="git://github.com/zfsonlinux/${PN}.git" +else + SRC_URI="https://github.com/zfsonlinux/${PN}/releases/download/${P}/${P}.tar.gz" + KEYWORDS="" +fi + +inherit autotools-utils bash-completion-r1 flag-o-matic linux-info python-r1 systemd toolchain-funcs udev + +DESCRIPTION="Userland utilities for ZFS Linux kernel module" +HOMEPAGE="http://zfsonlinux.org/" + +LICENSE="BSD-2 CDDL MIT" +SLOT="0" +IUSE="custom-cflags debug kernel-builtin +rootfs test-suite static-libs" +RESTRICT="test" + +COMMON_DEPEND=" + sys-apps/util-linux[static-libs?] + sys-libs/zlib[static-libs(+)?] + virtual/awk +" +DEPEND="${COMMON_DEPEND} + virtual/pkgconfig +" + +RDEPEND="${COMMON_DEPEND} + !=sys-apps/grep-2.13* + !kernel-builtin? ( =sys-fs/zfs-kmod-${PV}* ) + !sys-fs/zfs-fuse + !prefix? ( virtual/udev ) + test-suite? ( + sys-apps/util-linux + sys-devel/bc + sys-block/parted + sys-fs/lsscsi + sys-fs/mdadm + sys-process/procps + virtual/modutils + ) + rootfs? ( + app-arch/cpio + app-misc/pax-utils + !=sys-fs/udev-init-scripts-28 +" + +AT_M4DIR="config" +AUTOTOOLS_IN_SOURCE_BUILD="1" + +pkg_setup() { + if use kernel_linux && use test-suite; then + linux-info_pkg_setup + if ! linux_config_exists; then + ewarn "Cannot check the linux kernel configuration." + else + # recheck that we don't have usblp to collide with libusb + if use test-suite; then + if linux_chkconfig_present BLK_DEV_LOOP; then + eerror "The ZFS test suite requires loop device support enabled." + eerror "Please enable it:" + eerror " CONFIG_BLK_DEV_LOOP=y" + eerror "in /usr/src/linux/.config or" + eerror " Device Drivers --->" + eerror " Block devices --->" + eerror " [ ] Loopback device support" + fi + fi + fi + fi + +} + +src_prepare() { + # Update paths + sed -e "s|/sbin/lsmod|/bin/lsmod|" \ + -e "s|/usr/bin/scsi-rescan|/usr/sbin/rescan-scsi-bus|" \ + -e "s|/sbin/parted|/usr/sbin/parted|" \ + -i scripts/common.sh.in + + autotools-utils_src_prepare +} + +src_configure() { + use custom-cflags || strip-flags + local myeconfargs=( + --bindir="${EPREFIX}/bin" + --sbindir="${EPREFIX}/sbin" + --with-config=user + --with-dracutdir="/usr/$(get_libdir)/dracut" + --with-linux="${KV_DIR}" + --with-linux-obj="${KV_OUT_DIR}" + --with-udevdir="$(get_udevdir)" + --with-blkid + $(use_enable debug) + ) + autotools-utils_src_configure + + # prepare systemd unit and helper script + cat "${FILESDIR}/zfs.service.in" | \ + sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \ + -e "s:@sysconfdir@:${EPREFIX}/etc:g" \ + > "${T}/zfs.service" || die + cat "${FILESDIR}/zfs-init.sh.in" | \ + sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \ + -e "s:@sysconfdir@:${EPREFIX}/etc:g" \ + > "${T}/zfs-init.sh" || die +} + +src_install() { + autotools-utils_src_install + gen_usr_ldscript -a uutil nvpair zpool zfs zfs_core + use test-suite || rm -rf "${ED}usr/share/zfs" + + newbashcomp "${FILESDIR}/bash-completion-r1" zfs + bashcomp_alias zfs zpool + + exeinto /usr/libexec + doexe "${T}/zfs-init.sh" + systemd_dounit "${T}/zfs.service" +} + +pkg_postinst() { + if ! use kernel-builtin && [ ${PV} = "9999" ] + then + einfo "Adding ${P} to the module database to ensure that the" + einfo "kernel modules and userland utilities stay in sync." + update_moduledb + fi + + if [ -e "${EROOT}etc/runlevels/boot/zfs" ] + then + einfo 'The zfs boot script has been split into the zfs-import,' + einfo 'zfs-mount and zfs-share scripts.' + einfo + einfo 'You had the zfs script in your boot runlevel. For your' + einfo 'convenience, it has been automatically removed and the three' + einfo 'scripts that replace it have been configured to start.' + einfo 'The zfs-import and zfs-mount scripts have been added to the boot' + einfo 'runlevel while the zfs-share script is in the default runlevel.' + + rm "${EROOT}etc/runlevels/boot/zfs" + ln -snf "${EROOT}etc/init.d/zfs-import" \ + "${EROOT}etc/runlevels/boot/zfs-import" + ln -snf "${EROOT}etc/init.d/zfs-mount" \ + "${EROOT}etc/runlevels/boot/zfs-mount" + ln -snf "${EROOT}etc/init.d/zfs-share" \ + "${EROOT}etc/runlevels/default/zfs-share" + else + [ -e "${EROOT}etc/runlevels/boot/zfs-import" ] || \ + einfo "You should add zfs-import to the boot runlevel." + [ -e "${EROOT}etc/runlevels/boot/zfs-mount" ] || \ + einfo "You should add zfs-mount to the boot runlevel." + [ -e "${EROOT}etc/runlevels/default/zfs-share" ] || \ + einfo "You should add zfs-share to the default runlevel." + fi + + if [ -e "${EROOT}etc/runlevels/default/zed" ] + then + einfo 'The downstream OpenRC zed script has replaced by the upstream' + einfo 'OpenRC zfs-zed script.' + einfo + einfo 'You had the zed script in your default runlevel. For your' + einfo 'convenience, it has been automatically removed and the zfs-zed' + einfo 'script that replaced it has been configured to start.' + + rm "${EROOT}etc/runlevels/boot/zed" + ln -snf "${EROOT}etc/init.d/zfs-sed" \ + "${EROOT}etc/runlevels/default/zfs-zed" + else + [ -e "${EROOT}etc/runlevels/default/zfs-zed" ] || \ + einfo "You should add zfs-zed to the default runlevel." + fi + + if [ -e "${EROOT}etc/runlevels/shutdown/zfs-shutdown" ] + then + einfo "The zfs-shutdown script is obsolete. Removing it from runlevel." + rm "${EROOT}etc/runlevels/shutdown/zfs-shutdown" + fi + +} + +pkg_postrm() { + if ! use kernel-builtin && [ ${PV} = "9999" ] + then + remove_moduledb + fi +} diff --git a/sys-kernel/spl/Manifest b/sys-kernel/spl/Manifest index 79a63bfc84a1b..e53e398c1ac11 100644 --- a/sys-kernel/spl/Manifest +++ b/sys-kernel/spl/Manifest @@ -11,3 +11,4 @@ DIST spl-0.6.5.3-patches-p0.tar.xz 4968 SHA256 8e652d41eba421720bcecee99077d3f3c DIST spl-0.6.5.3.tar.gz 556179 SHA256 637c1eccd721f5d3bb1570621d2cd6646ec0488608482c0dbeb2838cf4bb310c SHA512 24a0c97f1a425e44d12f43519c23ba78672c06d65a03833a8d3827e4c762a873283c90ce66f64b9b186ab815f0b005e69da537e120b8b53877d0f13e649bac57 WHIRLPOOL e67f50c8adc4ac2b770dfaeb479fa8a8c87270c8314b5366dd95665a30adb2f1fb29db9719a0431cc18adc6865ea6f222c1b443f2b95b764cede8db50f49333d DIST spl-0.6.5.4-patches-p1.tar.xz 2020 SHA256 0a554d86ff1874b09263fbec2ee8e03dbae24f4c45cf54c9e8a8d2fcf3a21207 SHA512 2650f06bf23045bd2805ef58baa2561534373862e1fbbaf189cf93283aa8e18cbee989b4e81751b37da3058aeba357cf8e46db97331379e1b5eafde7faa33851 WHIRLPOOL 8054310c8d62d17f45566e67f886e025b5798c1ebb32bf66f3b91b440a42869d09a45030e5d8695687ace829fe21f43289647dafd206d1021626fffb35a2979e DIST spl-0.6.5.4.tar.gz 556298 SHA256 a49ff1dd255215da18ea60bf76dc5b764ddc1aa40d86f4e842b63185357b1504 SHA512 a50d804008237820d6a8e7d938f6699df2966836ebedf0b6a4421f55bd6c24ae69e8f80eaf3aa2b7f6ed308983ab4ca11abfb32f98c8d070e4957b4802e00cac WHIRLPOOL 4c9150fec7e5539e391ffd078e7aa4412d47416749187d62e36136d945514694b09920e595c391ed3fedcf5d13f7486539f49ca33e166909d8a8b2fc99b39a37 +DIST spl-0.6.5.6.tar.gz 559142 SHA256 167595fe76eb5497c3a1ffe396b6300155d0cbe46d06824a710099ca1ae1b8bd SHA512 23c6d2f041a09ffa9e3f12ddbf59fbe76b74ed6cd0de984b2a04adb14247979aabd13de08b5a5a08b37918ac247aefc599cb0e234527bc118f855ffccf6397e1 WHIRLPOOL af8d2a3d523cece5b42b57836d58048c180bddc00b8846cc4887d2a88b022f2b49e09aa27f32407b34e99a0a3842c82f75e34219f53d5b4b9a6749d047dbf718 diff --git a/sys-kernel/spl/spl-0.6.5.6.ebuild b/sys-kernel/spl/spl-0.6.5.6.ebuild new file mode 100644 index 0000000000000..33314daa7508c --- /dev/null +++ b/sys-kernel/spl/spl-0.6.5.6.ebuild @@ -0,0 +1,111 @@ +# 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" + KEYWORDS="" +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 3 || die "Linux 4.3 is the latest supported version."; } + + check_extra_config +} + +src_prepare() { + # 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 +}