mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-16 09:26:58 +02:00
sys-fs/zfs-kmod: Sync with Gentoo
It's from Gentoo commit 9de7683cf4e8a4bf71d0e4e7df250c729f321af0.
This commit is contained in:
parent
05adc95402
commit
347fb25eb4
@ -1,14 +1,8 @@
|
||||
DIST zfs-2.1.14.tar.gz 35167471 BLAKE2B a7b22eaf05e4fbf416ebe4d7b884c515942fc9375c1dd322cefa00c19c550b9318a4192d6a909d49d58523c8f1a6eaf00189dd58e6543fae17cf8cc35042f469 SHA512 4a65c8b7d5576fa2dcc14e7ccaa93191c1d3791479cf89bd02c2bd04434ff5e93709b328796d4f9ba93da19f12772e359df373f40919350a3e1e4c52758b47c8
|
||||
DIST zfs-2.1.14.tar.gz.asc 836 BLAKE2B f01bc58bf6c3d367c494ed4ea9f3fb1141f3aafdbf4f913b9e0d60d31557076d5ae0e25ca93b013f5fd85e21ba5ae9f61e1a03af54bb0c743869c0ce3d5519df SHA512 be0f386cce952b4047dc2448e356078668e8d4392802dd3bb1a426741f15f4d9fb689cd1cb09972bdbc9fe2e4e782ec4b4754fe811c5657bc1f5308bd38e3926
|
||||
DIST zfs-2.1.15.tar.gz 35209038 BLAKE2B 61f9e14c54d43d1c51269917bb3ffde0530166126ea0467103ff1171dffc537315fd21c270d12f73d677e121b8094af39dd0a1fe3f80986bb42dc16d627dff52 SHA512 24096f2a6ecb3cc51f3d2f11cc69ad134d6fc33667007277c50cf798be2b19b6ddfa9be6923ca53d8b09f0bebae14c44d74811ec776e5aaf4ea0e810844c1f3d
|
||||
DIST zfs-2.1.15.tar.gz.asc 836 BLAKE2B 897c05a8870cd0418493b42fe854ef5b28f9a31513ac262a25631089defa59190808b51bd31e43412b01171bcac0dff0608d417dfdacfeee0b0f067e0627d48f SHA512 a6c5a9d214070a220716075455eb1cb85a53fb20b5fe4319f112cde0653a25f87b66d0f0bcf0ca641e3ac38239759cb9df6ed7f4700056a2732cc8c1ccd9ce05
|
||||
DIST zfs-2.2.2.tar.gz 33816541 BLAKE2B f0619ae42d898d18077096217d0a9ddd7c7378424707aa51d3645661b2889a1459bc4a5e9fe42b6860b2d26e4600da35765b0e741725dafacc2ead2370cad866 SHA512 bba252cbf7986f2cce154dd18a34aa478cf98f70106337188dc894de2446d60a58fa643706927757d1787506b44d4ff404897a2d0e16aacb0a7bf27765703332
|
||||
DIST zfs-2.2.2.tar.gz.asc 836 BLAKE2B bdc86492b2bf45d329e34e89ea7796f5cbf518d32ab114c909321b1d0d8040b9ce4e25b3b85fcbc5ea62ee10a2d716b5b27e37c2c005b307c0b593815c49d625 SHA512 110be1aa90f4749106717165a3cb5116379e2d170146a2b3d2601f04212450da9327e028d6e1e5de7f8a46c6bb7a15e2bcdd09e3e760590fbc695f9562f1440b
|
||||
DIST zfs-2.2.3.tar.gz 33854765 BLAKE2B f83439aa929609191a048dd326b2a15e0f57c72d2901cbfb205b81a29aa42dab49b42eb61647ca3eaed17518b8c907e81343364bfecf83ed441271648f8efd4b SHA512 e6c3df531a33f4bd198429e61b7630f1e965a03fd60d1b847bdf0d55c6d2af3abc38b5e8a63aa9ef9f969cc7eca36cb24a7641f6fb8c41ef2fa024d76cd28f3d
|
||||
DIST zfs-2.2.3.tar.gz.asc 836 BLAKE2B 86e1adc393d1f4643a6fd8c188b555e9dc0fdf7e25690f37ff0a04ff8826eb4fe3c125b54f0c5b9ab33f1daff43c4b44373ee9a4df506f6714f98d77782e6c3c SHA512 fe23ddb9bde78416776411d66a56aa662fa051c8544b4be01ba238b8c1a85ccde1c55329f228fe8ab2681b54a4e4cb08d4e927c597c117242f0b536a40921dc9
|
||||
DIST zfs-2.2.4.tar.gz 33882933 BLAKE2B f0026a12b7c1252bf8941e39f23d3e165750034707dfddf034d8aac942a749cb7f0108478797ca978704a22743d9928240b29cf78fe89eda9f873f40102413f0 SHA512 1d17e30573d594fb5c9ea77cde104616dca362fed7530296816d1b55173594f66170fcfb23ab57c27074f85b79d3eb557b4ee9a1c420e507b2434a7902d8dcc1
|
||||
DIST zfs-2.2.4.tar.gz.asc 836 BLAKE2B 7fde4232c25056eac2fae76abec4d6749c91d285d79ae6dce4ae4880fa90a26c9fb370dfa4daaf8a849f30fcc1b63eeb215444bfca724f6750bf7e4344f35fa7 SHA512 0cb3caf01b9e4d1f0c35d9f7933a4b11560b9bbf6c05494d8a1775b0a52ac1d642aebd77ef1c7b23a0a06f92e2b1ab3d8afacce41017eb07745d148af7f76a17
|
||||
DIST zfs-2.2.5.tar.gz 33896824 BLAKE2B ec73c866bf931e4af63a35b3e61e1254d681d21aadba304ea95c147a3911c3d92db686591147036848ceae1683f31f6f81e04a24df6cb11a91a8abaed179567f SHA512 8e288620ce78fb235fa0c9929fc97150987a64091a8a5209209f1e0975d4d6213b8b307e32b3c89d934e83dc8468a1998b797fcdff5bbbbd023f07674877b0c6
|
||||
DIST zfs-2.2.5.tar.gz.asc 836 BLAKE2B ae6e47ce82ffda8834047e03f361ca096448f98ea811a09c0c68b202996c613e6524501cda49873acc4bca9f60c298635f89e5d7fe8f00ffa05b192fc98e16ef SHA512 0a397471c3f1ee9675eb9fcd589409c5085f8692930275ea15d92042fadaf1d3772666a3cca5adb1730c953464e0ec00f501cc5333a303d322c636020c2a7060
|
||||
DIST zfs-2.2.6.tar.gz 33900138 BLAKE2B 0bbe36df779aaf19460a75725af9c9b13e64e77a6020974ad18d60d9fd52db2ddd6ea98b3e6c7451195bdfb347b8aab51db9b3f9a7c15c77bff47329bbd07dd2 SHA512 c217a3397b67d7239bc30bc492d58fff96bb29c9cf73e390d1787a4fb787cb297557e594a926453fed11faaab80363d40853af271f8ee18ce9a317dfde4c6745
|
||||
DIST zfs-2.2.6.tar.gz.asc 836 BLAKE2B db66f3e2e629ab8a344a8e0c2609bcbb98d69d110fc9e064760ee0c5c25cd67421a71764c4b65d7005e8ff66167bf24beb4be2560a47318eabffa888c1539f26 SHA512 d09f343b3acc3a81e96c069072cfb16d0b490ee77562f50e14524faf05560f9e1d1325ec4bc1760c86ed29186d5860d59646d4ea07385ee3b28d879f2374b9b4
|
||||
DIST zfs-2.3.0-rc1.tar.gz 33887119 BLAKE2B dd4e159bef6de216cc51c1dd22620e6edb5b7503d95402022d0b9439471fe432181b1e5df2142e63cdac812a74b62657a96573b3bf48ad78bd6fd885a5f8913e SHA512 fe7de046dd48dbb67545726482a501788a1d5601e6e9a17deeb29047946689d9c8deb95f72b2b47c26a205a3c94fa1f0123437479a06b1376b9dac3dd6faf463
|
||||
DIST zfs-2.3.0-rc1.tar.gz.asc 195 BLAKE2B f70e6223e94a3f79d6d685b2b06254fba845d79768c82b7a3fedb865b6e6c97499c497def0f4c3e4a2869fed88b0965650ae88d5eb72c0ffaed43c4479d3bf96 SHA512 26b395feaf03e2be20b75ef64e573aa98a0706c46a1eb57503925731bf0cb9bf7fef8a2cdcf163233bccd7da9f5aedc0cae73f0183f39e0f13dcf315b4a5d809
|
||||
|
@ -1,100 +0,0 @@
|
||||
https://bugs.gentoo.org/904657
|
||||
https://github.com/openzfs/zfs/issues/14555
|
||||
https://github.com/openzfs/zfs/commit/976bf9b6a61919638d42ed79cd207132785d128a
|
||||
|
||||
From 976bf9b6a61919638d42ed79cd207132785d128a Mon Sep 17 00:00:00 2001
|
||||
From: Shengqi Chen <harry-chen@outlook.com>
|
||||
Date: Tue, 9 Jan 2024 08:05:24 +0800
|
||||
Subject: [PATCH] Linux 6.2 compat: add check for kernel_neon_* availability
|
||||
|
||||
This patch adds check for `kernel_neon_*` symbols on arm and arm64
|
||||
platforms to address the following issues:
|
||||
|
||||
1. Linux 6.2+ on arm64 has exported them with `EXPORT_SYMBOL_GPL`, so
|
||||
license compatibility must be checked before use.
|
||||
2. On both arm and arm64, the definitions of these symbols are guarded
|
||||
by `CONFIG_KERNEL_MODE_NEON`, but their declarations are still
|
||||
present. Checking in configuration phase only leads to MODPOST
|
||||
errors (undefined references).
|
||||
|
||||
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
|
||||
Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
|
||||
Closes #15711
|
||||
Closes #14555
|
||||
Closes: #15401
|
||||
--- a/config/kernel-fpu.m4
|
||||
+++ b/config/kernel-fpu.m4
|
||||
@@ -79,6 +79,12 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_FPU], [
|
||||
__kernel_fpu_end();
|
||||
], [], [ZFS_META_LICENSE])
|
||||
|
||||
+ ZFS_LINUX_TEST_SRC([kernel_neon], [
|
||||
+ #include <asm/neon.h>
|
||||
+ ], [
|
||||
+ kernel_neon_begin();
|
||||
+ kernel_neon_end();
|
||||
+ ], [], [ZFS_META_LICENSE])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_FPU], [
|
||||
@@ -105,9 +111,20 @@ AC_DEFUN([ZFS_AC_KERNEL_FPU], [
|
||||
AC_DEFINE(KERNEL_EXPORTS_X86_FPU, 1,
|
||||
[kernel exports FPU functions])
|
||||
],[
|
||||
- AC_MSG_RESULT(internal)
|
||||
- AC_DEFINE(HAVE_KERNEL_FPU_INTERNAL, 1,
|
||||
- [kernel fpu internal])
|
||||
+ dnl #
|
||||
+ dnl # ARM neon symbols (only on arm and arm64)
|
||||
+ dnl # could be GPL-only on arm64 after Linux 6.2
|
||||
+ dnl #
|
||||
+ ZFS_LINUX_TEST_RESULT([kernel_neon_license],[
|
||||
+ AC_MSG_RESULT(kernel_neon_*)
|
||||
+ AC_DEFINE(HAVE_KERNEL_NEON, 1,
|
||||
+ [kernel has kernel_neon_* functions])
|
||||
+ ],[
|
||||
+ # catch-all
|
||||
+ AC_MSG_RESULT(internal)
|
||||
+ AC_DEFINE(HAVE_KERNEL_FPU_INTERNAL, 1,
|
||||
+ [kernel fpu internal])
|
||||
+ ])
|
||||
])
|
||||
])
|
||||
])
|
||||
--- a/include/os/linux/kernel/linux/simd_aarch64.h
|
||||
+++ b/include/os/linux/kernel/linux/simd_aarch64.h
|
||||
@@ -71,9 +71,15 @@
|
||||
#define ID_AA64PFR0_EL1 sys_reg(3, 0, 0, 1, 0)
|
||||
#define ID_AA64ISAR0_EL1 sys_reg(3, 0, 0, 6, 0)
|
||||
|
||||
+#if (defined(HAVE_KERNEL_NEON) && defined(CONFIG_KERNEL_MODE_NEON))
|
||||
#define kfpu_allowed() 1
|
||||
#define kfpu_begin() kernel_neon_begin()
|
||||
#define kfpu_end() kernel_neon_end()
|
||||
+#else
|
||||
+#define kfpu_allowed() 0
|
||||
+#define kfpu_begin() do {} while (0)
|
||||
+#define kfpu_end() do {} while (0)
|
||||
+#endif
|
||||
#define kfpu_init() (0)
|
||||
#define kfpu_fini() do {} while (0)
|
||||
|
||||
--- a/include/os/linux/kernel/linux/simd_arm.h
|
||||
+++ b/include/os/linux/kernel/linux/simd_arm.h
|
||||
@@ -53,9 +53,15 @@
|
||||
#include <asm/elf.h>
|
||||
#include <asm/hwcap.h>
|
||||
|
||||
+#if (defined(HAVE_KERNEL_NEON) && defined(CONFIG_KERNEL_MODE_NEON))
|
||||
#define kfpu_allowed() 1
|
||||
#define kfpu_begin() kernel_neon_begin()
|
||||
#define kfpu_end() kernel_neon_end()
|
||||
+#else
|
||||
+#define kfpu_allowed() 0
|
||||
+#define kfpu_begin() do {} while (0)
|
||||
+#define kfpu_end() do {} while (0)
|
||||
+#endif
|
||||
#define kfpu_init() (0)
|
||||
#define kfpu_fini() do {} while (0)
|
||||
|
||||
|
@ -1,31 +0,0 @@
|
||||
https://bugs.gentoo.org/923745
|
||||
https://github.com/openzfs/zfs/issues/15453
|
||||
https://github.com/openzfs/zfs/pull/15781
|
||||
https://github.com/openzfs/zfs/pull/15789
|
||||
|
||||
From a0aa7a2ee3b56d7b6d69c2081034ec8293a6d605 Mon Sep 17 00:00:00 2001
|
||||
From: Kevin Jin <33590050+jxdking@users.noreply.github.com>
|
||||
Date: Wed, 17 Jan 2024 12:03:58 -0500
|
||||
Subject: [PATCH] Autotrim High Load Average Fix
|
||||
|
||||
Switch from cv_wait() to cv_wait_idle() in vdev_autotrim_wait_kick(),
|
||||
which should mitigate the high load average while waiting.
|
||||
|
||||
Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
|
||||
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
|
||||
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
|
||||
Signed-off-by: jxdking <lostking2008@hotmail.com>
|
||||
Closes #15781
|
||||
--- a/module/zfs/vdev_trim.c
|
||||
+++ b/module/zfs/vdev_trim.c
|
||||
@@ -194,7 +194,8 @@ vdev_autotrim_wait_kick(vdev_t *vd, int num_of_kick)
|
||||
for (int i = 0; i < num_of_kick; i++) {
|
||||
if (vd->vdev_autotrim_exit_wanted)
|
||||
break;
|
||||
- cv_wait(&vd->vdev_autotrim_kick_cv, &vd->vdev_autotrim_lock);
|
||||
+ cv_wait_idle(&vd->vdev_autotrim_kick_cv,
|
||||
+ &vd->vdev_autotrim_lock);
|
||||
}
|
||||
boolean_t exit_wanted = vd->vdev_autotrim_exit_wanted;
|
||||
mutex_exit(&vd->vdev_autotrim_lock);
|
||||
|
@ -1,167 +0,0 @@
|
||||
# Copyright 1999-2024 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
MODULES_INITRAMFS_IUSE=+initramfs
|
||||
inherit autotools flag-o-matic linux-mod-r1 multiprocessing
|
||||
|
||||
DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
|
||||
HOMEPAGE="https://github.com/openzfs/zfs"
|
||||
|
||||
MODULES_KERNEL_MAX=6.5
|
||||
MODULES_KERNEL_MIN=3.10
|
||||
|
||||
if [[ ${PV} == 9999 ]] ; then
|
||||
EGIT_REPO_URI="https://github.com/openzfs/zfs.git"
|
||||
inherit git-r3
|
||||
unset MODULES_KERNEL_MAX
|
||||
else
|
||||
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/openzfs.asc
|
||||
inherit verify-sig
|
||||
|
||||
MY_PV=${PV/_rc/-rc}
|
||||
SRC_URI="https://github.com/openzfs/zfs/releases/download/zfs-${MY_PV}/zfs-${MY_PV}.tar.gz"
|
||||
SRC_URI+=" verify-sig? ( https://github.com/openzfs/zfs/releases/download/zfs-${MY_PV}/zfs-${MY_PV}.tar.gz.asc )"
|
||||
S="${WORKDIR}/zfs-${PV%_rc?}"
|
||||
|
||||
ZFS_KERNEL_COMPAT="${MODULES_KERNEL_MAX}"
|
||||
# Increments minor eg 5.14 -> 5.15, and still supports override.
|
||||
ZFS_KERNEL_DEP="${ZFS_KERNEL_COMPAT_OVERRIDE:-${ZFS_KERNEL_COMPAT}}"
|
||||
ZFS_KERNEL_DEP="${ZFS_KERNEL_DEP%%.*}.$(( ${ZFS_KERNEL_DEP##*.} + 1))"
|
||||
|
||||
if [[ ${PV} != *_rc* ]] ; then
|
||||
KEYWORDS="amd64 arm64 ppc64 ~riscv ~sparc"
|
||||
fi
|
||||
fi
|
||||
|
||||
LICENSE="CDDL MIT debug? ( GPL-2+ )"
|
||||
SLOT="0/${PVR}"
|
||||
IUSE="custom-cflags debug +rootfs"
|
||||
RESTRICT="test"
|
||||
|
||||
BDEPEND="
|
||||
dev-lang/perl
|
||||
app-alternatives/awk
|
||||
"
|
||||
|
||||
if [[ ${PV} != 9999 ]] ; then
|
||||
BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )"
|
||||
|
||||
IUSE+=" +dist-kernel-cap"
|
||||
RDEPEND="
|
||||
dist-kernel-cap? ( dist-kernel? (
|
||||
<virtual/dist-kernel-${ZFS_KERNEL_DEP}
|
||||
) )
|
||||
"
|
||||
fi
|
||||
|
||||
# Used to suggest matching USE, but without suggesting to disable
|
||||
PDEPEND="dist-kernel? ( ~sys-fs/zfs-${PV}[dist-kernel] )"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${PN}-2.1.11-gentoo.patch
|
||||
)
|
||||
|
||||
pkg_pretend() {
|
||||
use rootfs || return 0
|
||||
}
|
||||
|
||||
pkg_setup() {
|
||||
local CONFIG_CHECK="
|
||||
EFI_PARTITION
|
||||
ZLIB_DEFLATE
|
||||
ZLIB_INFLATE
|
||||
!DEBUG_LOCK_ALLOC
|
||||
!PAX_KERNEXEC_PLUGIN_METHOD_OR
|
||||
"
|
||||
use debug && CONFIG_CHECK+="
|
||||
DEBUG_INFO
|
||||
FRAME_POINTER
|
||||
!DEBUG_INFO_REDUCED
|
||||
"
|
||||
use rootfs && CONFIG_CHECK+="
|
||||
BLK_DEV_INITRD
|
||||
DEVTMPFS
|
||||
"
|
||||
|
||||
kernel_is -lt 5 && CONFIG_CHECK+=" IOSCHED_NOOP"
|
||||
|
||||
if [[ ${PV} != 9999 ]] ; then
|
||||
local kv_major_max kv_minor_max zcompat
|
||||
zcompat="${ZFS_KERNEL_COMPAT_OVERRIDE:-${ZFS_KERNEL_COMPAT}}"
|
||||
kv_major_max="${zcompat%%.*}"
|
||||
zcompat="${zcompat#*.}"
|
||||
kv_minor_max="${zcompat%%.*}"
|
||||
kernel_is -le "${kv_major_max}" "${kv_minor_max}" || die \
|
||||
"Linux ${kv_major_max}.${kv_minor_max} is the latest supported version"
|
||||
fi
|
||||
|
||||
linux-mod-r1_pkg_setup
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
|
||||
# Run unconditionally (bug #792627)
|
||||
eautoreconf
|
||||
|
||||
if [[ ${PV} != 9999 ]] ; then
|
||||
# Set module revision number
|
||||
sed -Ei "s/(Release:.*)1/\1${PR}-gentoo/" META || die
|
||||
fi
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
use custom-cflags || strip-flags
|
||||
filter-ldflags -Wl,*
|
||||
|
||||
local myconf=(
|
||||
--bindir="${EPREFIX}"/bin
|
||||
--sbindir="${EPREFIX}"/sbin
|
||||
--with-config=kernel
|
||||
--with-linux="${KV_DIR}"
|
||||
--with-linux-obj="${KV_OUT_DIR}"
|
||||
$(use_enable debug)
|
||||
|
||||
# See gentoo.patch
|
||||
GENTOO_MAKEARGS_EVAL="${MODULES_MAKEARGS[*]@Q}"
|
||||
TEST_JOBS="$(makeopts_jobs)"
|
||||
)
|
||||
|
||||
econf "${myconf[@]}"
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
emake "${MODULES_MAKEARGS[@]}"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
emake "${MODULES_MAKEARGS[@]}" DESTDIR="${ED}" install
|
||||
modules_post_process
|
||||
|
||||
dodoc AUTHORS COPYRIGHT META README.md
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
linux-mod-r1_pkg_postinst
|
||||
|
||||
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
|
||||
|
||||
if has_version sys-boot/grub ; then
|
||||
ewarn "This version of OpenZFS 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 OpenZFS. To"
|
||||
ewarn "create a new pool that is backward compatible wih GRUB2, use "
|
||||
ewarn
|
||||
ewarn "zpool create -o compatibility=grub2 ..."
|
||||
ewarn
|
||||
ewarn "Refer to /usr/share/zfs/compatibility.d/grub2 for list of features."
|
||||
fi
|
||||
}
|
@ -1,209 +0,0 @@
|
||||
# Copyright 1999-2024 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
MODULES_INITRAMFS_IUSE=+initramfs
|
||||
inherit autotools flag-o-matic linux-mod-r1 multiprocessing
|
||||
|
||||
DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
|
||||
HOMEPAGE="https://github.com/openzfs/zfs"
|
||||
|
||||
MODULES_KERNEL_MAX=6.6
|
||||
MODULES_KERNEL_MIN=3.10
|
||||
|
||||
if [[ ${PV} == 9999 ]] ; then
|
||||
EGIT_REPO_URI="https://github.com/openzfs/zfs.git"
|
||||
inherit git-r3
|
||||
unset MODULES_KERNEL_MAX
|
||||
else
|
||||
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/openzfs.asc
|
||||
inherit verify-sig
|
||||
|
||||
MY_PV=${PV/_rc/-rc}
|
||||
SRC_URI="https://github.com/openzfs/zfs/releases/download/zfs-${MY_PV}/zfs-${MY_PV}.tar.gz"
|
||||
SRC_URI+=" verify-sig? ( https://github.com/openzfs/zfs/releases/download/zfs-${MY_PV}/zfs-${MY_PV}.tar.gz.asc )"
|
||||
S="${WORKDIR}/zfs-${MY_PV}"
|
||||
|
||||
ZFS_KERNEL_COMPAT="${MODULES_KERNEL_MAX}"
|
||||
# Increments minor eg 5.14 -> 5.15, and still supports override.
|
||||
ZFS_KERNEL_DEP="${ZFS_KERNEL_COMPAT_OVERRIDE:-${ZFS_KERNEL_COMPAT}}"
|
||||
ZFS_KERNEL_DEP="${ZFS_KERNEL_DEP%%.*}.$(( ${ZFS_KERNEL_DEP##*.} + 1))"
|
||||
|
||||
if [[ ${PV} != *_rc* ]] ; then
|
||||
KEYWORDS="~amd64 ~arm64 ~loong ~ppc64 ~riscv ~sparc"
|
||||
fi
|
||||
fi
|
||||
|
||||
LICENSE="CDDL MIT debug? ( GPL-2+ )"
|
||||
SLOT="0/${PVR}"
|
||||
IUSE="custom-cflags debug +rootfs"
|
||||
RESTRICT="test"
|
||||
|
||||
BDEPEND="
|
||||
app-alternatives/awk
|
||||
dev-lang/perl
|
||||
"
|
||||
|
||||
if [[ ${PV} != 9999 ]] ; then
|
||||
BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )"
|
||||
|
||||
IUSE+=" +dist-kernel-cap"
|
||||
RDEPEND="
|
||||
dist-kernel-cap? ( dist-kernel? (
|
||||
<virtual/dist-kernel-${ZFS_KERNEL_DEP}
|
||||
) )
|
||||
"
|
||||
fi
|
||||
|
||||
# Used to suggest matching USE, but without suggesting to disable
|
||||
PDEPEND="dist-kernel? ( ~sys-fs/zfs-${PV}[dist-kernel] )"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${PN}-2.1.11-gentoo.patch
|
||||
"${FILESDIR}"/${PN}-2.2.2-arm64-neon.patch
|
||||
"${FILESDIR}"/${PN}-2.2.2-autotrim.patch
|
||||
)
|
||||
|
||||
pkg_pretend() {
|
||||
use rootfs || return 0
|
||||
}
|
||||
|
||||
pkg_setup() {
|
||||
local CONFIG_CHECK="
|
||||
EFI_PARTITION
|
||||
ZLIB_DEFLATE
|
||||
ZLIB_INFLATE
|
||||
!DEBUG_LOCK_ALLOC
|
||||
!PAX_KERNEXEC_PLUGIN_METHOD_OR
|
||||
"
|
||||
use debug && CONFIG_CHECK+="
|
||||
DEBUG_INFO
|
||||
FRAME_POINTER
|
||||
!DEBUG_INFO_REDUCED
|
||||
"
|
||||
use rootfs && CONFIG_CHECK+="
|
||||
BLK_DEV_INITRD
|
||||
DEVTMPFS
|
||||
"
|
||||
|
||||
kernel_is -lt 5 && CONFIG_CHECK+=" IOSCHED_NOOP"
|
||||
|
||||
if [[ ${PV} != 9999 ]] ; then
|
||||
local kv_major_max kv_minor_max zcompat
|
||||
zcompat="${ZFS_KERNEL_COMPAT_OVERRIDE:-${ZFS_KERNEL_COMPAT}}"
|
||||
kv_major_max="${zcompat%%.*}"
|
||||
zcompat="${zcompat#*.}"
|
||||
kv_minor_max="${zcompat%%.*}"
|
||||
kernel_is -le "${kv_major_max}" "${kv_minor_max}" || die \
|
||||
"Linux ${kv_major_max}.${kv_minor_max} is the latest supported version"
|
||||
fi
|
||||
|
||||
linux-mod-r1_pkg_setup
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
|
||||
# Run unconditionally (bug #792627)
|
||||
eautoreconf
|
||||
|
||||
if [[ ${PV} != 9999 ]] ; then
|
||||
# Set module revision number
|
||||
sed -Ei "s/(Release:.*)1/\1${PR}-gentoo/" META || die
|
||||
fi
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
use custom-cflags || strip-flags
|
||||
filter-ldflags -Wl,*
|
||||
|
||||
local myconf=(
|
||||
--bindir="${EPREFIX}"/bin
|
||||
--sbindir="${EPREFIX}"/sbin
|
||||
--with-config=kernel
|
||||
--with-linux="${KV_DIR}"
|
||||
--with-linux-obj="${KV_OUT_DIR}"
|
||||
$(use_enable debug)
|
||||
|
||||
# See gentoo.patch
|
||||
GENTOO_MAKEARGS_EVAL="${MODULES_MAKEARGS[*]@Q}"
|
||||
TEST_JOBS="$(makeopts_jobs)"
|
||||
)
|
||||
|
||||
econf "${myconf[@]}"
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
emake "${MODULES_MAKEARGS[@]}"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
emake "${MODULES_MAKEARGS[@]}" DESTDIR="${ED}" install
|
||||
modules_post_process
|
||||
|
||||
dodoc AUTHORS COPYRIGHT META README.md
|
||||
}
|
||||
|
||||
_old_layout_cleanup() {
|
||||
# new files are just extra/{spl,zfs}.ko with no subdirs.
|
||||
local olddir=(
|
||||
avl/zavl
|
||||
icp/icp
|
||||
lua/zlua
|
||||
nvpair/znvpair
|
||||
spl/spl
|
||||
unicode/zunicode
|
||||
zcommon/zcommon
|
||||
zfs/zfs
|
||||
zstd/zzstd
|
||||
)
|
||||
|
||||
# kernel/module/Kconfig contains possible compressed extentions.
|
||||
local kext kextfiles
|
||||
for kext in .ko{,.{gz,xz,zst}}; do
|
||||
kextfiles+=( "${olddir[@]/%/${kext}}" )
|
||||
done
|
||||
|
||||
local oldfile oldpath
|
||||
for oldfile in "${kextfiles[@]}"; do
|
||||
oldpath="${EROOT}/lib/modules/${KV_FULL}/extra/${oldfile}"
|
||||
if [[ -f "${oldpath}" ]]; then
|
||||
ewarn "Found obsolete zfs module ${oldfile} for current kernel ${KV_FULL}, removing."
|
||||
rm -rv "${oldpath}" || die
|
||||
# we do not remove non-empty directories just for safety in case there's something else.
|
||||
# also it may fail if there are both compressed and uncompressed modules installed.
|
||||
rmdir -v --ignore-fail-on-non-empty "${oldpath%/*.*}" || die
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
# Check for old module layout before doing anything else.
|
||||
# only attempt layout cleanup if new .ko location is used.
|
||||
local newko=( "${EROOT}/lib/modules/${KV_FULL}/extra"/{zfs,spl}.ko* )
|
||||
# We check first array member, if glob above did not exand, it will be "zfs.ko*" and -f will return false.
|
||||
# if glob expanded -f will do correct file precense check.
|
||||
[[ -f ${newko[0]} ]] && _old_layout_cleanup
|
||||
|
||||
linux-mod-r1_pkg_postinst
|
||||
|
||||
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
|
||||
|
||||
if has_version sys-boot/grub ; then
|
||||
ewarn "This version of OpenZFS 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 OpenZFS. To"
|
||||
ewarn "create a new pool that is backward compatible wih GRUB2, use "
|
||||
ewarn
|
||||
ewarn "zpool create -o compatibility=grub2 ..."
|
||||
ewarn
|
||||
ewarn "Refer to /usr/share/zfs/compatibility.d/grub2 for list of features."
|
||||
fi
|
||||
}
|
@ -1,208 +0,0 @@
|
||||
# Copyright 1999-2024 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
MODULES_INITRAMFS_IUSE=+initramfs
|
||||
inherit autotools flag-o-matic linux-mod-r1 multiprocessing
|
||||
|
||||
DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
|
||||
HOMEPAGE="https://github.com/openzfs/zfs"
|
||||
|
||||
MODULES_KERNEL_MAX=6.6
|
||||
MODULES_KERNEL_MIN=3.10
|
||||
|
||||
if [[ ${PV} == 9999 ]] ; then
|
||||
EGIT_REPO_URI="https://github.com/openzfs/zfs.git"
|
||||
inherit git-r3
|
||||
unset MODULES_KERNEL_MAX
|
||||
else
|
||||
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/openzfs.asc
|
||||
inherit verify-sig
|
||||
|
||||
MY_PV=${PV/_rc/-rc}
|
||||
SRC_URI="https://github.com/openzfs/zfs/releases/download/zfs-${MY_PV}/zfs-${MY_PV}.tar.gz"
|
||||
SRC_URI+=" verify-sig? ( https://github.com/openzfs/zfs/releases/download/zfs-${MY_PV}/zfs-${MY_PV}.tar.gz.asc )"
|
||||
S="${WORKDIR}/zfs-${MY_PV}"
|
||||
|
||||
ZFS_KERNEL_COMPAT="${MODULES_KERNEL_MAX}"
|
||||
# Increments minor eg 5.14 -> 5.15, and still supports override.
|
||||
ZFS_KERNEL_DEP="${ZFS_KERNEL_COMPAT_OVERRIDE:-${ZFS_KERNEL_COMPAT}}"
|
||||
ZFS_KERNEL_DEP="${ZFS_KERNEL_DEP%%.*}.$(( ${ZFS_KERNEL_DEP##*.} + 1))"
|
||||
|
||||
if [[ ${PV} != *_rc* ]] ; then
|
||||
KEYWORDS="amd64 arm64 ~loong ppc64 ~riscv ~sparc"
|
||||
fi
|
||||
fi
|
||||
|
||||
LICENSE="CDDL MIT debug? ( GPL-2+ )"
|
||||
SLOT="0/${PVR}"
|
||||
IUSE="custom-cflags debug +rootfs"
|
||||
RESTRICT="test"
|
||||
|
||||
BDEPEND="
|
||||
app-alternatives/awk
|
||||
dev-lang/perl
|
||||
"
|
||||
|
||||
if [[ ${PV} != 9999 ]] ; then
|
||||
BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )"
|
||||
|
||||
IUSE+=" +dist-kernel-cap"
|
||||
RDEPEND="
|
||||
dist-kernel-cap? ( dist-kernel? (
|
||||
<virtual/dist-kernel-${ZFS_KERNEL_DEP}
|
||||
) )
|
||||
"
|
||||
fi
|
||||
|
||||
# Used to suggest matching USE, but without suggesting to disable
|
||||
PDEPEND="dist-kernel? ( ~sys-fs/zfs-${PV}[dist-kernel] )"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${PN}-2.1.11-gentoo.patch
|
||||
"${FILESDIR}"/${PN}-2.2.2-arm64-neon.patch
|
||||
)
|
||||
|
||||
pkg_pretend() {
|
||||
use rootfs || return 0
|
||||
}
|
||||
|
||||
pkg_setup() {
|
||||
local CONFIG_CHECK="
|
||||
EFI_PARTITION
|
||||
ZLIB_DEFLATE
|
||||
ZLIB_INFLATE
|
||||
!DEBUG_LOCK_ALLOC
|
||||
!PAX_KERNEXEC_PLUGIN_METHOD_OR
|
||||
"
|
||||
use debug && CONFIG_CHECK+="
|
||||
DEBUG_INFO
|
||||
FRAME_POINTER
|
||||
!DEBUG_INFO_REDUCED
|
||||
"
|
||||
use rootfs && CONFIG_CHECK+="
|
||||
BLK_DEV_INITRD
|
||||
DEVTMPFS
|
||||
"
|
||||
|
||||
kernel_is -lt 5 && CONFIG_CHECK+=" IOSCHED_NOOP"
|
||||
|
||||
if [[ ${PV} != 9999 ]] ; then
|
||||
local kv_major_max kv_minor_max zcompat
|
||||
zcompat="${ZFS_KERNEL_COMPAT_OVERRIDE:-${ZFS_KERNEL_COMPAT}}"
|
||||
kv_major_max="${zcompat%%.*}"
|
||||
zcompat="${zcompat#*.}"
|
||||
kv_minor_max="${zcompat%%.*}"
|
||||
kernel_is -le "${kv_major_max}" "${kv_minor_max}" || die \
|
||||
"Linux ${kv_major_max}.${kv_minor_max} is the latest supported version"
|
||||
fi
|
||||
|
||||
linux-mod-r1_pkg_setup
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
|
||||
# Run unconditionally (bug #792627)
|
||||
eautoreconf
|
||||
|
||||
if [[ ${PV} != 9999 ]] ; then
|
||||
# Set module revision number
|
||||
sed -Ei "s/(Release:.*)1/\1${PR}-gentoo/" META || die
|
||||
fi
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
use custom-cflags || strip-flags
|
||||
filter-ldflags -Wl,*
|
||||
|
||||
local myconf=(
|
||||
--bindir="${EPREFIX}"/bin
|
||||
--sbindir="${EPREFIX}"/sbin
|
||||
--with-config=kernel
|
||||
--with-linux="${KV_DIR}"
|
||||
--with-linux-obj="${KV_OUT_DIR}"
|
||||
$(use_enable debug)
|
||||
|
||||
# See gentoo.patch
|
||||
GENTOO_MAKEARGS_EVAL="${MODULES_MAKEARGS[*]@Q}"
|
||||
TEST_JOBS="$(makeopts_jobs)"
|
||||
)
|
||||
|
||||
econf "${myconf[@]}"
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
emake "${MODULES_MAKEARGS[@]}"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
emake "${MODULES_MAKEARGS[@]}" DESTDIR="${ED}" install
|
||||
modules_post_process
|
||||
|
||||
dodoc AUTHORS COPYRIGHT META README.md
|
||||
}
|
||||
|
||||
_old_layout_cleanup() {
|
||||
# new files are just extra/{spl,zfs}.ko with no subdirs.
|
||||
local olddir=(
|
||||
avl/zavl
|
||||
icp/icp
|
||||
lua/zlua
|
||||
nvpair/znvpair
|
||||
spl/spl
|
||||
unicode/zunicode
|
||||
zcommon/zcommon
|
||||
zfs/zfs
|
||||
zstd/zzstd
|
||||
)
|
||||
|
||||
# kernel/module/Kconfig contains possible compressed extentions.
|
||||
local kext kextfiles
|
||||
for kext in .ko{,.{gz,xz,zst}}; do
|
||||
kextfiles+=( "${olddir[@]/%/${kext}}" )
|
||||
done
|
||||
|
||||
local oldfile oldpath
|
||||
for oldfile in "${kextfiles[@]}"; do
|
||||
oldpath="${EROOT}/lib/modules/${KV_FULL}/extra/${oldfile}"
|
||||
if [[ -f "${oldpath}" ]]; then
|
||||
ewarn "Found obsolete zfs module ${oldfile} for current kernel ${KV_FULL}, removing."
|
||||
rm -rv "${oldpath}" || die
|
||||
# we do not remove non-empty directories just for safety in case there's something else.
|
||||
# also it may fail if there are both compressed and uncompressed modules installed.
|
||||
rmdir -v --ignore-fail-on-non-empty "${oldpath%/*.*}" || die
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
# Check for old module layout before doing anything else.
|
||||
# only attempt layout cleanup if new .ko location is used.
|
||||
local newko=( "${EROOT}/lib/modules/${KV_FULL}/extra"/{zfs,spl}.ko* )
|
||||
# We check first array member, if glob above did not exand, it will be "zfs.ko*" and -f will return false.
|
||||
# if glob expanded -f will do correct file precense check.
|
||||
[[ -f ${newko[0]} ]] && _old_layout_cleanup
|
||||
|
||||
linux-mod-r1_pkg_postinst
|
||||
|
||||
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
|
||||
|
||||
if has_version sys-boot/grub ; then
|
||||
ewarn "This version of OpenZFS 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 OpenZFS. To"
|
||||
ewarn "create a new pool that is backward compatible wih GRUB2, use "
|
||||
ewarn
|
||||
ewarn "zpool create -o compatibility=grub2 ..."
|
||||
ewarn
|
||||
ewarn "Refer to /usr/share/zfs/compatibility.d/grub2 for list of features."
|
||||
fi
|
||||
}
|
@ -1,207 +0,0 @@
|
||||
# Copyright 1999-2024 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
MODULES_INITRAMFS_IUSE=+initramfs
|
||||
inherit autotools flag-o-matic linux-mod-r1 multiprocessing
|
||||
|
||||
DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
|
||||
HOMEPAGE="https://github.com/openzfs/zfs"
|
||||
|
||||
MODULES_KERNEL_MAX=6.8
|
||||
MODULES_KERNEL_MIN=3.10
|
||||
|
||||
if [[ ${PV} == 9999 ]] ; then
|
||||
EGIT_REPO_URI="https://github.com/openzfs/zfs.git"
|
||||
inherit git-r3
|
||||
unset MODULES_KERNEL_MAX
|
||||
else
|
||||
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/openzfs.asc
|
||||
inherit verify-sig
|
||||
|
||||
MY_PV=${PV/_rc/-rc}
|
||||
SRC_URI="https://github.com/openzfs/zfs/releases/download/zfs-${MY_PV}/zfs-${MY_PV}.tar.gz"
|
||||
SRC_URI+=" verify-sig? ( https://github.com/openzfs/zfs/releases/download/zfs-${MY_PV}/zfs-${MY_PV}.tar.gz.asc )"
|
||||
S="${WORKDIR}/zfs-${MY_PV}"
|
||||
|
||||
ZFS_KERNEL_COMPAT="${MODULES_KERNEL_MAX}"
|
||||
# Increments minor eg 5.14 -> 5.15, and still supports override.
|
||||
ZFS_KERNEL_DEP="${ZFS_KERNEL_COMPAT_OVERRIDE:-${ZFS_KERNEL_COMPAT}}"
|
||||
ZFS_KERNEL_DEP="${ZFS_KERNEL_DEP%%.*}.$(( ${ZFS_KERNEL_DEP##*.} + 1))"
|
||||
|
||||
if [[ ${PV} != *_rc* ]] ; then
|
||||
KEYWORDS="amd64 arm64 ~loong ppc64 ~riscv ~sparc"
|
||||
fi
|
||||
fi
|
||||
|
||||
LICENSE="CDDL MIT debug? ( GPL-2+ )"
|
||||
SLOT="0/${PVR}"
|
||||
IUSE="custom-cflags debug +rootfs"
|
||||
RESTRICT="test"
|
||||
|
||||
BDEPEND="
|
||||
app-alternatives/awk
|
||||
dev-lang/perl
|
||||
"
|
||||
|
||||
if [[ ${PV} != 9999 ]] ; then
|
||||
BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-openzfs )"
|
||||
|
||||
IUSE+=" +dist-kernel-cap"
|
||||
RDEPEND="
|
||||
dist-kernel-cap? ( dist-kernel? (
|
||||
<virtual/dist-kernel-${ZFS_KERNEL_DEP}
|
||||
) )
|
||||
"
|
||||
fi
|
||||
|
||||
# Used to suggest matching USE, but without suggesting to disable
|
||||
PDEPEND="dist-kernel? ( ~sys-fs/zfs-${PV}[dist-kernel] )"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${PN}-2.1.11-gentoo.patch
|
||||
)
|
||||
|
||||
pkg_pretend() {
|
||||
use rootfs || return 0
|
||||
}
|
||||
|
||||
pkg_setup() {
|
||||
local CONFIG_CHECK="
|
||||
EFI_PARTITION
|
||||
ZLIB_DEFLATE
|
||||
ZLIB_INFLATE
|
||||
!DEBUG_LOCK_ALLOC
|
||||
!PAX_KERNEXEC_PLUGIN_METHOD_OR
|
||||
"
|
||||
use debug && CONFIG_CHECK+="
|
||||
DEBUG_INFO
|
||||
FRAME_POINTER
|
||||
!DEBUG_INFO_REDUCED
|
||||
"
|
||||
use rootfs && CONFIG_CHECK+="
|
||||
BLK_DEV_INITRD
|
||||
DEVTMPFS
|
||||
"
|
||||
|
||||
kernel_is -lt 5 && CONFIG_CHECK+=" IOSCHED_NOOP"
|
||||
|
||||
if [[ ${PV} != 9999 ]] ; then
|
||||
local kv_major_max kv_minor_max zcompat
|
||||
zcompat="${ZFS_KERNEL_COMPAT_OVERRIDE:-${ZFS_KERNEL_COMPAT}}"
|
||||
kv_major_max="${zcompat%%.*}"
|
||||
zcompat="${zcompat#*.}"
|
||||
kv_minor_max="${zcompat%%.*}"
|
||||
kernel_is -le "${kv_major_max}" "${kv_minor_max}" || die \
|
||||
"Linux ${kv_major_max}.${kv_minor_max} is the latest supported version"
|
||||
fi
|
||||
|
||||
linux-mod-r1_pkg_setup
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
|
||||
# Run unconditionally (bug #792627)
|
||||
eautoreconf
|
||||
|
||||
if [[ ${PV} != 9999 ]] ; then
|
||||
# Set module revision number
|
||||
sed -Ei "s/(Release:.*)1/\1${PR}-gentoo/" META || die
|
||||
fi
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
use custom-cflags || strip-flags
|
||||
filter-ldflags -Wl,*
|
||||
|
||||
local myconf=(
|
||||
--bindir="${EPREFIX}"/bin
|
||||
--sbindir="${EPREFIX}"/sbin
|
||||
--with-config=kernel
|
||||
--with-linux="${KV_DIR}"
|
||||
--with-linux-obj="${KV_OUT_DIR}"
|
||||
$(use_enable debug)
|
||||
|
||||
# See gentoo.patch
|
||||
GENTOO_MAKEARGS_EVAL="${MODULES_MAKEARGS[*]@Q}"
|
||||
TEST_JOBS="$(makeopts_jobs)"
|
||||
)
|
||||
|
||||
econf "${myconf[@]}"
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
emake "${MODULES_MAKEARGS[@]}"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
emake "${MODULES_MAKEARGS[@]}" DESTDIR="${ED}" install
|
||||
modules_post_process
|
||||
|
||||
dodoc AUTHORS COPYRIGHT META README.md
|
||||
}
|
||||
|
||||
_old_layout_cleanup() {
|
||||
# new files are just extra/{spl,zfs}.ko with no subdirs.
|
||||
local olddir=(
|
||||
avl/zavl
|
||||
icp/icp
|
||||
lua/zlua
|
||||
nvpair/znvpair
|
||||
spl/spl
|
||||
unicode/zunicode
|
||||
zcommon/zcommon
|
||||
zfs/zfs
|
||||
zstd/zzstd
|
||||
)
|
||||
|
||||
# kernel/module/Kconfig contains possible compressed extentions.
|
||||
local kext kextfiles
|
||||
for kext in .ko{,.{gz,xz,zst}}; do
|
||||
kextfiles+=( "${olddir[@]/%/${kext}}" )
|
||||
done
|
||||
|
||||
local oldfile oldpath
|
||||
for oldfile in "${kextfiles[@]}"; do
|
||||
oldpath="${EROOT}/lib/modules/${KV_FULL}/extra/${oldfile}"
|
||||
if [[ -f "${oldpath}" ]]; then
|
||||
ewarn "Found obsolete zfs module ${oldfile} for current kernel ${KV_FULL}, removing."
|
||||
rm -rv "${oldpath}" || die
|
||||
# we do not remove non-empty directories just for safety in case there's something else.
|
||||
# also it may fail if there are both compressed and uncompressed modules installed.
|
||||
rmdir -v --ignore-fail-on-non-empty "${oldpath%/*.*}" || die
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
# Check for old module layout before doing anything else.
|
||||
# only attempt layout cleanup if new .ko location is used.
|
||||
local newko=( "${EROOT}/lib/modules/${KV_FULL}/extra"/{zfs,spl}.ko* )
|
||||
# We check first array member, if glob above did not exand, it will be "zfs.ko*" and -f will return false.
|
||||
# if glob expanded -f will do correct file precense check.
|
||||
[[ -f ${newko[0]} ]] && _old_layout_cleanup
|
||||
|
||||
linux-mod-r1_pkg_postinst
|
||||
|
||||
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
|
||||
|
||||
if has_version sys-boot/grub ; then
|
||||
ewarn "This version of OpenZFS 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 OpenZFS. To"
|
||||
ewarn "create a new pool that is backward compatible wih GRUB2, use "
|
||||
ewarn
|
||||
ewarn "zpool create -o compatibility=grub2 ..."
|
||||
ewarn
|
||||
ewarn "Refer to /usr/share/zfs/compatibility.d/grub2 for list of features."
|
||||
fi
|
||||
}
|
@ -9,8 +9,8 @@ inherit autotools flag-o-matic linux-mod-r1 multiprocessing
|
||||
DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
|
||||
HOMEPAGE="https://github.com/openzfs/zfs"
|
||||
|
||||
MODULES_KERNEL_MAX=6.7
|
||||
MODULES_KERNEL_MIN=3.10
|
||||
MODULES_KERNEL_MAX=6.11
|
||||
MODULES_KERNEL_MIN=4.18
|
||||
|
||||
if [[ ${PV} == 9999 ]] ; then
|
||||
EGIT_REPO_URI="https://github.com/openzfs/zfs.git"
|
||||
@ -31,7 +31,7 @@ else
|
||||
ZFS_KERNEL_DEP="${ZFS_KERNEL_DEP%%.*}.$(( ${ZFS_KERNEL_DEP##*.} + 1))"
|
||||
|
||||
if [[ ${PV} != *_rc* ]] ; then
|
||||
KEYWORDS="amd64 arm64 ~loong ppc64 ~riscv ~sparc"
|
||||
KEYWORDS="~amd64 ~arm64 ~loong ~ppc64 ~riscv ~sparc"
|
||||
fi
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user