From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 7C4EA138334 for ; Sun, 31 Mar 2019 03:54:05 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 58A86E0898; Sun, 31 Mar 2019 03:54:04 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 1C1B4E0898 for ; Sun, 31 Mar 2019 03:54:04 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 640B6335CCF for ; Sun, 31 Mar 2019 03:54:01 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4BA4E545 for ; Sun, 31 Mar 2019 03:53:59 +0000 (UTC) From: "Georgy Yakovlev" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Georgy Yakovlev" Message-ID: <1554004421.c1b6a5ba7332ef0464a6c05ed874e0daf226de5c.gyakovlev@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs-kmod/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-fs/zfs-kmod/zfs-kmod-9999.ebuild X-VCS-Directories: sys-fs/zfs-kmod/ X-VCS-Committer: gyakovlev X-VCS-Committer-Name: Georgy Yakovlev X-VCS-Revision: c1b6a5ba7332ef0464a6c05ed874e0daf226de5c X-VCS-Branch: master Date: Sun, 31 Mar 2019 03:53:59 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 3b05b857-e228-46a2-9cfc-aa7196aa4adc X-Archives-Hash: 0cab528cc33ea2d7e10106d9a894d746 commit: c1b6a5ba7332ef0464a6c05ed874e0daf226de5c Author: Georgy Yakovlev gentoo org> AuthorDate: Sat Mar 23 04:20:24 2019 +0000 Commit: Georgy Yakovlev gentoo org> CommitDate: Sun Mar 31 03:53:41 2019 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c1b6a5ba sys-fs/zfs-kmod: rework live ebuild major rework bump eapi to 7 add ZFS_KERNEL_COMPAT_OVERRIDE variable one can set to override compat check Closes: https://bugs.gentoo.org/677466 Package-Manager: Portage-2.3.62, Repoman-2.3.12 Signed-off-by: Georgy Yakovlev gentoo.org> sys-fs/zfs-kmod/zfs-kmod-9999.ebuild | 131 ++++++++++++++++++++++++----------- 1 file changed, 89 insertions(+), 42 deletions(-) diff --git a/sys-fs/zfs-kmod/zfs-kmod-9999.ebuild b/sys-fs/zfs-kmod/zfs-kmod-9999.ebuild index 19b0a9a5a51..268f0171103 100644 --- a/sys-fs/zfs-kmod/zfs-kmod-9999.ebuild +++ b/sys-fs/zfs-kmod/zfs-kmod-9999.ebuild @@ -1,53 +1,52 @@ # Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI="5" +EAPI=7 -if [ ${PV} == "9999" ]; then - AUTOTOOLS_AUTORECONF="1" +inherit flag-o-matic linux-info linux-mod toolchain-funcs + +DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs" +HOMEPAGE="https://zfsonlinux.org/" + +if [[ ${PV} == "9999" ]]; then + inherit autotools git-r3 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" + KEYWORDS="~amd64" + ZFS_KERNEL_COMPAT="${ZFS_KERNEL_COMPAT_OVERRIDE:-5.0}" S="${WORKDIR}/zfs-${PV}" - KEYWORDS="~amd64 ~arm ~ppc ~ppc64" fi -inherit flag-o-matic linux-info linux-mod toolchain-funcs autotools-utils - -DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs" -HOMEPAGE="https://zfsonlinux.org/" - -LICENSE="CDDL GPL-2+" +LICENSE="CDDL debug? ( GPL-2+ )" SLOT="0" IUSE="custom-cflags debug +rootfs" -RESTRICT="debug? ( strip ) test" -DEPEND=" - dev-lang/perl - virtual/awk -" +DEPEND="" RDEPEND="${DEPEND} !sys-fs/zfs-fuse !sys-kernel/spl " -AT_M4DIR="config" -AUTOTOOLS_IN_SOURCE_BUILD="1" +BDEPEND=" + dev-lang/perl + virtual/awk +" + +RESTRICT="debug? ( strip ) test" -DOCS=( AUTHORS COPYRIGHT NOTICE META README.md ) +DOCS=( AUTHORS COPYRIGHT META README.md ) pkg_setup() { linux-info_pkg_setup + CONFIG_CHECK=" !DEBUG_LOCK_ALLOC - !GRKERNSEC_RANDSTRUCT - !PAX_KERNEXEC_PLUGIN_METHOD_OR - !TRIM_UNUSED_KSYMS EFI_PARTITION - KALLSYMS MODULES + !PAX_KERNEXEC_PLUGIN_METHOD_OR + !TRIM_UNUSED_KSYMS ZLIB_DEFLATE ZLIB_INFLATE " @@ -64,31 +63,42 @@ pkg_setup() { DEVTMPFS " - kernel_is ge 2 6 32 || die "Linux 2.6.32 or newer required" + kernel_is -lt 5 && CONFIG_CHECK="${CONFIG_CHECK} IOSCHED_NOOP" + + kernel_is -ge 2 6 32 || die "Linux 2.6.32 or newer required" - [ ${PV} != "9999" ] && \ - { kernel_is le 4 17 || die "Linux 4.17 is the latest supported version."; } + if [[ ${PV} != "9999" ]]; then + local KV_MAJOR_MAX="${ZFS_KERNEL_COMPAT%%.*}" + local KV_MINOR_MAX="${ZFS_KERNEL_COMPAT##*.}" + kernel_is -le "${KV_MAJOR_MAX}" "${KV_MINOR_MAX}" || die \ + "Linux ${KV_MAJOR_MAX}.${KV_MINOR_MAX} is the latest supported version" + fi 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" + default - # Set module revision number - [ ${PV} != "9999" ] && \ - { sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" "${S}/META" || die "Could not set Gentoo release"; } + if [[ ${PV} == "9999" ]]; then + eautoreconf + else + # Set module revision number + sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" + fi - autotools-utils_src_prepare + # Remove GPLv2-licensed ZPIOS unless we are debugging + use debug || sed -e 's/^subdir-m += zpios$//' -i module/Makefile.in } src_configure() { + set_arch_to_kernel + use custom-cflags || strip-flags + filter-ldflags -Wl,* - set_arch_to_kernel - local myeconfargs=(${myeconfargs} + local myconf=( --bindir="${EPREFIX}/bin" --sbindir="${EPREFIX}/sbin" --with-config=kernel @@ -97,23 +107,60 @@ src_configure() { $(use_enable debug) ) - autotools-utils_src_configure + econf "${myconf[@]}" +} + +src_compile() { + set_arch_to_kernel + + default } src_install() { - autotools-utils_src_install INSTALL_MOD_PATH="${INSTALL_MOD_PATH:-$EROOT}" + set_arch_to_kernel + + emake \ + DEPMOD="/bin/true" \ + DESTDIR="${D}" \ + INSTALL_MOD_PATH="${INSTALL_MOD_PATH:-$EROOT}" \ + install + + einstalldocs } 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" + 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" + 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." }