From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1706813-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 2C8CF15812D
	for <garchives@archives.gentoo.org>; Tue, 07 Jan 2025 02:35:45 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 92DF9E07C7;
	Tue, 07 Jan 2025 02:35:43 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 4B747E07C7
	for <gentoo-commits@lists.gentoo.org>; Tue, 07 Jan 2025 02:35:43 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 485AD335DEB
	for <gentoo-commits@lists.gentoo.org>; Tue, 07 Jan 2025 02:35:42 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 9EDDF19C8
	for <gentoo-commits@lists.gentoo.org>; Tue, 07 Jan 2025 02:35:40 +0000 (UTC)
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" <sam@gentoo.org>
Message-ID: <1736217251.b52e0aee43435d3ee0118d31d118ab92f31a77e9.sam@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/Manifest sys-fs/zfs-kmod/zfs-kmod-2.3.0_rc5.ebuild
X-VCS-Directories: sys-fs/zfs-kmod/
X-VCS-Committer: sam
X-VCS-Committer-Name: Sam James
X-VCS-Revision: b52e0aee43435d3ee0118d31d118ab92f31a77e9
X-VCS-Branch: master
Date: Tue, 07 Jan 2025 02:35:40 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: f177d77e-4a39-4e48-9e1c-faa7e0e3dd13
X-Archives-Hash: 0ba0570e666db706ac324c1e16838b15

commit:     b52e0aee43435d3ee0118d31d118ab92f31a77e9
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Jan  7 02:34:11 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jan  7 02:34:11 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b52e0aee

sys-fs/zfs-kmod: add 2.3.0_rc5

Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-fs/zfs-kmod/Manifest                  |   2 +
 sys-fs/zfs-kmod/zfs-kmod-2.3.0_rc5.ebuild | 207 ++++++++++++++++++++++++++++++
 2 files changed, 209 insertions(+)

diff --git a/sys-fs/zfs-kmod/Manifest b/sys-fs/zfs-kmod/Manifest
index 3623d48abe5d..f77da13e37a0 100644
--- a/sys-fs/zfs-kmod/Manifest
+++ b/sys-fs/zfs-kmod/Manifest
@@ -14,3 +14,5 @@ DIST zfs-2.3.0-rc3.tar.gz 33897910 BLAKE2B 518e2c56130a71d4c35f27328184e882815e2
 DIST zfs-2.3.0-rc3.tar.gz.asc 195 BLAKE2B 34685869cb8d4f911b3ce0a5098411ce4cb346310564b7ad5fbe9cfc50a3bbe7665c8daa36384b2d5f3ee1dad4b98d6d5bad5a6b8e2f45da35354428853f748d SHA512 1f32119b24c703dd5dbdcce63ddc97cd24f2052522cf1f2f9a4228691d0db7c136262d98b38f2d795a4edfce1d25b423c5bc4f65dbc008bd12f64acc24f3406e
 DIST zfs-2.3.0-rc4.tar.gz 33899889 BLAKE2B 97aabe9c020ab496e6fe621ecb34fd33b70b786664aee0ebdc1d9d8b0d8027bb092354451c882bf0a2954967414420b33b081a7302a4805dcf2e04a584b81463 SHA512 77bb0b8f9d8995edfc7ebb298c6b0a0834e89cd58410d8d4bc4e7f04ce04e26d486e9d0ce23dd22e74cff8e9a9e827ca9d3549885045265f8b17638e68f35f0f
 DIST zfs-2.3.0-rc4.tar.gz.asc 195 BLAKE2B 8c1b104c7cf88bc0415d13e4b4d7f21ec5d35722b09e977aa240d842cad36f51d1ae84fbb03d51e3408b7c1a427d56658b90e53109d1e3c6921ae772c256f122 SHA512 a0e74bbcc1062c7196e6e67c77175456ae995159b22c788c5f4c3026dfde662cfb396677b3aa46628576504bc38f374a191dec4ccd55c2b41685be408067b9ee
+DIST zfs-2.3.0-rc5.tar.gz 33907372 BLAKE2B 271e6f7e554e3b94d26edac2c53b12f1217013884fd74b3906107c34a4a8ffbfcee75295d05f50f4a13ba0f9368d7e2a8c86dae75bb73191d136ac9c3b92c375 SHA512 ea69909f70f2a5d4b2e3b6e5be61d224504f8936045372bb2d63279e2a051e53812b093fafcad09083925201b9ba940e9327f9d68d1754bf914b4cea5aa5090b
+DIST zfs-2.3.0-rc5.tar.gz.asc 195 BLAKE2B 9abacfa95552837cac092a9e207cf56e4224dc24c1015c289a49d19f4173bcc1781b6b118bd89b4c4c89060ace5955447aaa96228266bcc77232fdf5c0037e20 SHA512 76c5dc000440b0a90e3bcb0ef0de61153ea80f2d9e1798475a25234be407f061448dbfc7b94813debda696caf323539e08b43651c7eeff507dc395d2c770ffc7

diff --git a/sys-fs/zfs-kmod/zfs-kmod-2.3.0_rc5.ebuild b/sys-fs/zfs-kmod/zfs-kmod-2.3.0_rc5.ebuild
new file mode 100644
index 000000000000..435d8a40d273
--- /dev/null
+++ b/sys-fs/zfs-kmod/zfs-kmod-2.3.0_rc5.ebuild
@@ -0,0 +1,207 @@
+# Copyright 1999-2025 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.12
+MODULES_KERNEL_MIN=4.18
+
+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
+}