From 70e4bd5c8f26b1f2baeb5146a841273b2cb15179 Mon Sep 17 00:00:00 2001
From: V3n3RiX <venerix@koprulu.sector>
Date: Tue, 30 May 2023 09:20:33 +0100
Subject: gentoo auto-resync : 30:05:2023 - 09:20:33

---
 sys-fs/Manifest.gz                                 | Bin 22577 -> 22571 bytes
 sys-fs/f2fs-tools/Manifest                         |   3 -
 sys-fs/f2fs-tools/f2fs-tools-1.15.0-r2.ebuild      |  45 ------
 .../files/f2fs-tools-1.15.0-lz4-1.9.4.patch        |  25 ----
 sys-fs/zfs-auto-snapshot/Manifest                  |   2 +-
 .../zfs-auto-snapshot-1.2.4-r3.ebuild              |   4 +-
 sys-fs/zfs-kmod/Manifest                           |   6 +-
 sys-fs/zfs-kmod/files/zfs-kmod-2.1.11-gentoo.patch |  24 +++
 sys-fs/zfs-kmod/metadata.xml                       |   1 +
 sys-fs/zfs-kmod/zfs-kmod-2.1.11-r1.ebuild          | 163 +++++++++++++++++++++
 sys-fs/zfs-kmod/zfs-kmod-9999.ebuild               | 141 +++++++-----------
 11 files changed, 246 insertions(+), 168 deletions(-)
 delete mode 100644 sys-fs/f2fs-tools/f2fs-tools-1.15.0-r2.ebuild
 delete mode 100644 sys-fs/f2fs-tools/files/f2fs-tools-1.15.0-lz4-1.9.4.patch
 create mode 100644 sys-fs/zfs-kmod/files/zfs-kmod-2.1.11-gentoo.patch
 create mode 100644 sys-fs/zfs-kmod/zfs-kmod-2.1.11-r1.ebuild

(limited to 'sys-fs')

diff --git a/sys-fs/Manifest.gz b/sys-fs/Manifest.gz
index 53fbc68950c6..507d16106fa5 100644
Binary files a/sys-fs/Manifest.gz and b/sys-fs/Manifest.gz differ
diff --git a/sys-fs/f2fs-tools/Manifest b/sys-fs/f2fs-tools/Manifest
index f412ac87cda0..3f8e9837662f 100644
--- a/sys-fs/f2fs-tools/Manifest
+++ b/sys-fs/f2fs-tools/Manifest
@@ -1,7 +1,4 @@
-AUX f2fs-tools-1.15.0-lz4-1.9.4.patch 819 BLAKE2B 0bedeb4362cf2a85e172cc5bf8b4d61f0f198f50032e431164513e3f92440a66d7e868b963c5e701332285e4045d88da3098094ab7b027d95a9b6b4f561a80f1 SHA512 11bb74d95ae1f182fb6c71f690d835e2225d96d00eccf9e85e35a2ea2dd8f06fbf15785d29ad57cee9ae4d8bf05a8c64d45ce0b9824cf25416fe43f1d0aeeb85
-DIST f2fs-tools-1.15.0.tar.gz 387663 BLAKE2B 1e55f87c839cee6431d9a83e9786201e9b6b872be27c8b92854b30b0fd1c651a9b7235ce93e70c530bfa7a4e9f4dfd309c72702b3338a4aa96e365b29424fb1d SHA512 61e40f16296091b55cec2dbdc6306af6abc2d3f854f39ef03a741b7f6f47348f915498375789f017f8da27fa7d27c79c905dd047693518adde503ea7ebf89387
 DIST f2fs-tools-1.16.0.tar.gz 265507 BLAKE2B a4fb94ff879198652a2922a0101b7e34aad156c3536e5a20c1cb2e36a6a734d92d3f97b2570eb702d029ef1d6c03d6123113fc1aa5658ba979401e0691b7b447 SHA512 ea198cebf7c5bb0c42c9b53bc80484495c403b1ed1354eb7cb7b4f63ed9a5c81653a76eaf1bc35067171fa5fd99b1564178c5440c21b6b025f4e83b9def82680
-EBUILD f2fs-tools-1.15.0-r2.ebuild 1015 BLAKE2B 169d07791116015ca1bb5817ab185293b1ae7b90d018cc424362456898888f5c93efe0485ab197d39075cadab5f39881f5d893443ecec3d3576f4c51051586fe SHA512 ce32a182737e83d8970528b4d6020ef6d9b6af3179a8591eb51df80951b6032f17bb86bc5b2455c771e5f4273a645718b2b60b34654a8764cc0fb836ffa713a4
 EBUILD f2fs-tools-1.16.0.ebuild 1148 BLAKE2B 89db0546409f639f727197ca0ff518bbe401cd45a49062c73586f9fe1eca0ddaddca83b8e68540e15ed0832a78bca638aae9cb747f9232b23eb643a3778c2332 SHA512 6d32619a2a8bdb8ef630c04e24eceb6353e4bec7cca53b47cf8a79a68ed69c2f31f47c3f764e2b91b4f9efe6ae89f8679be04c16a6aa1da647786ab588f5f805
 EBUILD f2fs-tools-9999.ebuild 1087 BLAKE2B 0c99aaa8bd3f97ef49676cf6dba244704a6605fcfe8998e24816e764e80e86cd42d8c1b6518fddcde670be18eb1de289b4d53e0e6fbf8152d05ef504a1aacca3 SHA512 5b9ff6f624bbac4ce7d903424ca28fbaf73de7efb3e06d7fdb24e5dbfba058e19b22874288af2a27f9e9475f0f2d11c30efd5ee2adfdccbe3557a958db1a24d2
 MISC metadata.xml 505 BLAKE2B 97772236b6d7113c38a9d8920ac2b0d949ee55f9971a94caa8b4ebfb1e91a6d6bffc97702b4f952867afb8cffea7972ef17f1ba8f390f4195a465aa90c2f915b SHA512 7a80d22b56aeb5f59203cb2853a63d8a3b1af955051d1c307ce5af2b3c3ae999481a37938b674532807dbffa715a725a384905995532d72d18761b3732540b76
diff --git a/sys-fs/f2fs-tools/f2fs-tools-1.15.0-r2.ebuild b/sys-fs/f2fs-tools/f2fs-tools-1.15.0-r2.ebuild
deleted file mode 100644
index 72236b8baf0b..000000000000
--- a/sys-fs/f2fs-tools/f2fs-tools-1.15.0-r2.ebuild
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit autotools
-
-DESCRIPTION="Tools for Flash-Friendly File System (F2FS)"
-HOMEPAGE="https://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git/about/"
-SRC_URI="https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/${PN}.git/snapshot/${P}.tar.gz"
-
-LICENSE="GPL-2"
-SLOT="0/9"
-KEYWORDS="amd64 arm arm64 ~loong ~mips ppc ppc64 ~riscv x86"
-IUSE="selinux"
-
-RDEPEND="
-	selinux? ( sys-libs/libselinux )
-	elibc_musl? ( sys-libs/queue-standalone )"
-DEPEND="${RDEPEND}"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-1.15.0-lz4-1.9.4.patch
-)
-
-src_prepare() {
-	default
-	eautoreconf
-}
-
-src_configure() {
-	# This is required to install to /sbin, bug #481110
-	econf \
-		--bindir="${EPREFIX}"/sbin \
-		--disable-static \
-		$(use_with selinux)
-}
-
-src_install() {
-	default
-	find "${D}" -name "*.la" -delete || die
-	# Collides with sg3_utils
-	# https://bugs.gentoo.org/880899
-	rm "${ED}/usr/sbin/sg_write_buffer" || die
-}
diff --git a/sys-fs/f2fs-tools/files/f2fs-tools-1.15.0-lz4-1.9.4.patch b/sys-fs/f2fs-tools/files/f2fs-tools-1.15.0-lz4-1.9.4.patch
deleted file mode 100644
index 4194054271db..000000000000
--- a/sys-fs/f2fs-tools/files/f2fs-tools-1.15.0-lz4-1.9.4.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-https://bugs.gentoo.org/867691
-https://github.com/jaegeuk/f2fs-tools/commit/b9e0985dc2e8f0a15faca21fa208afae57593486
-
-From: Jaegeuk Kim <jaegeuk@kernel.org>
-Date: Mon, 29 Aug 2022 11:03:35 -0700
-Subject: [PATCH] f2fs-tools: fix build error on lz4-1.9.4
-
-LZ4_STREAMSIZE_U64 is undefined in new lz4 lib.
-
-Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---- a/fsck/compress.c
-+++ b/fsck/compress.c
-@@ -32,10 +32,7 @@
- #ifdef HAVE_LIBLZ4
- #define LZ4_MEMORY_USAGE		14
- #define LZ4_MAX_INPUT_SIZE		0x7E000000 /* 2 113 929 216 bytes */
--#ifndef LZ4_STREAMSIZE
--#define LZ4_STREAMSIZE			(LZ4_STREAMSIZE_U64 * sizeof(long long))
--#endif
--#define LZ4_MEM_COMPRESS		LZ4_STREAMSIZE
-+#define LZ4_MEM_COMPRESS		sizeof(LZ4_stream_t)
- #define LZ4_ACCELERATION_DEFAULT	1
- #define LZ4_WORK_SIZE			ALIGN_UP(LZ4_MEM_COMPRESS, 8)
- #endif
-
diff --git a/sys-fs/zfs-auto-snapshot/Manifest b/sys-fs/zfs-auto-snapshot/Manifest
index 6e970047cc92..75ee51855fa5 100644
--- a/sys-fs/zfs-auto-snapshot/Manifest
+++ b/sys-fs/zfs-auto-snapshot/Manifest
@@ -13,6 +13,6 @@ AUX zfs-auto-snapshot-weekly.timer 150 BLAKE2B 655187add790017f8328edae33e88eb0a
 AUX zfs-auto-snapshot.target 360 BLAKE2B 17be6ab113a8849d5244fd36140d1165c4e919df2a04f4b16aa591c1c92b29243b1be4f2243bcc6a8ef015b0cc1fb53b183da1c83668e4e7e0b609f7301a3372 SHA512 f607dada27e4be409184152b93e2079eecf12f5eba76f2dbe42bdbf4793603063c23813e752bfd829a081eeb6d09c86bc18ab75d65bff87b2c1d4f998abac516
 DIST zfs-auto-snapshot-upstream-1.2.4.tar.gz 13375 BLAKE2B 2a44cdecb7c4bb432c1804dba9a6674289aced9664ae0fcc6a33b604b128d852fce459367316f11961747594516916da51072ed10f84d0c01ea8cca553ce7eec SHA512 26382303fce8b90dfb40f69fcab92308e88c17c147b4a566c5d32f2e9aa241d64f5da56ad82b4becb824ba01a470037a724460d35676a1d46de9c578c02a57d9
 EBUILD zfs-auto-snapshot-1.2.4-r2.ebuild 2589 BLAKE2B ae75763d83d7919ee78a695be66425cfd97c04036be844fc9582cc7ed49a3dd60ddcf7ce733c8464597f217370c6650cc78afcebafdf1da0bd9f4c4dcbd7a1dc SHA512 be518c8387dc7b4e5142bf094f9556aa05c39bec2c884bf9a3a5edd7f61f6533c743f75ed6cee0fd38a7037622c22f2c2196dd91419aff7ac61cb020cf6d669a
-EBUILD zfs-auto-snapshot-1.2.4-r3.ebuild 2633 BLAKE2B 8d6c345b21d2599896ac70a58abd438b3c32869186896a1157cd4b19241c97c3dc0a8b7f3cd08d892eee0e84dae53eb13d0e09b08c4b3507ec3cb964cdbd5342 SHA512 242b6be67f4ae39b811d6758ba81e1ca82147bb85e48879d0c19c1eadff1bae2d3bd1773f0fbe239ac339eb89cc65b5c5788775fd0c8d0cd2ac41cc04c2dde7f
+EBUILD zfs-auto-snapshot-1.2.4-r3.ebuild 2632 BLAKE2B 28124f72de4d232c34f7d477d4ca02b7056c2495f857ac34b3426c474c84043e24983491b7a669d7e57f253daeed0a5e4427a9b6e4407de1c79c0d68692826c5 SHA512 624f81f5743be12598dc3cbfd8402dc0bd1dd6808f697881d1fa873d3cd3ae1266bfd2cf4d2bb8a6df7350575b25c0b1cf5f681d208a8191ed4e891ad078042f
 EBUILD zfs-auto-snapshot-9999.ebuild 2592 BLAKE2B 4e1fe442bca545372a3c2c4a7ca7456fa134f3d994975bda29c504cf826063b54f0cdd14d49270a7272e0cd37e1785e59d33a0c5b7b916204797395c8a3f2848 SHA512 c5d895bfa2e784771952e0cbdb233db8baef0bebe6db37afc82e3bdd5f847da92780a0f5a788b275287594e7937c76a3683b228c1c93a5ff260806461e67a6b3
 MISC metadata.xml 965 BLAKE2B 4f9cc98f893bcaab842d31a7fe9d3db7d24e34a5cb612137830298bce8450a82636970ba20d69ad31bd36d121cf253deaea7ce3e9435df656a768b9922d2b2ff SHA512 0a816ae56452f48cfc286ae8f0c0ff17ba8e174ec6312ba97c09614568fbad07b4024722e3466406f590579bc614ab85731f6dcd3f873a7256d64f8c7054658e
diff --git a/sys-fs/zfs-auto-snapshot/zfs-auto-snapshot-1.2.4-r3.ebuild b/sys-fs/zfs-auto-snapshot/zfs-auto-snapshot-1.2.4-r3.ebuild
index e503554be28a..8338ae98ab90 100644
--- a/sys-fs/zfs-auto-snapshot/zfs-auto-snapshot-1.2.4-r3.ebuild
+++ b/sys-fs/zfs-auto-snapshot/zfs-auto-snapshot-1.2.4-r3.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -11,7 +11,7 @@ if [[ ${PV} == 9999 ]]; then
 else
 	MY_P="${PN}-upstream-${PV}"
 	SRC_URI="https://github.com/zfsonlinux/${PN}/archive/upstream/${PV}.tar.gz -> ${MY_P}.tar.gz"
-	KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv"
+	KEYWORDS="amd64 ~arm64 ~ppc64 ~riscv"
 	S="${WORKDIR}/${MY_P}"
 fi
 
diff --git a/sys-fs/zfs-kmod/Manifest b/sys-fs/zfs-kmod/Manifest
index df942702f7fb..9f53aebf0ef8 100644
--- a/sys-fs/zfs-kmod/Manifest
+++ b/sys-fs/zfs-kmod/Manifest
@@ -1,5 +1,6 @@
 AUX 2.1.10-Revert-ZFS_IOC_COUNT_FILLED-does-unnecessary-txg_wai.patch 1932 BLAKE2B 761f1ed4a17c946fb08aa46c3b9defb0672897311dc61225f28298af7569f6350b264cb917696c091ebbf2a95aec8e2005385d27d3f996b99cc424ae0b503082 SHA512 ebdb7c6562eba403397b17dc0830f5c10a80b339ff62f52b569b4ddc28660e8ba353f2e54927e546812fe17539249ba6d1757d5cc150d3a2a75f41e702bcd239
 AUX 2.1.7-ppc64-ieee128-compat.patch 6889 BLAKE2B 9214915ed5b1d149927d46f749903fbb9b4d243d993041b8c6db039dcb7a3968a315f211e010ef9373b721336d45daef264d951e7ea1e0aed01818ebccae9d02 SHA512 4e3edbe396d0c1fdb7b286417b2bf7fe114b392e09158b3f5d3e3d1c4844bf0d59263309883363175dacd63194fd0d6a120ace35c83989d0546dae825bbb91bd
+AUX zfs-kmod-2.1.11-gentoo.patch 1076 BLAKE2B d2b0fe2ff1ac31c2a2a184141f107010dae61d2de465462b8177db1a07918be2bd2fc4d4570ad8758da87ef14cf3878db062fe9eb5b53fa3156e7db5c06073d4 SHA512 9e103aae75036e52f89e79c4d4ed3cffe670ef423cda7c2f936533b9329e994c7a02d241289f6565e9d086e5b0bdd6865ab3677c3ad84eaadf3abe310977b6a8
 AUX zfs-kmod-2.1.6-fgrep.patch 2183 BLAKE2B b8c9b58cc6d94e9ddeacbe3c5eca9d040f1c6fba84b814c8c553d5c1e15334765d3190286a4ad2298762bc54f66a8b89ef69d115cfbd5a25d928170a1d46a770 SHA512 f65e7ffa8cfd00da7ad6d1fcbf5d61172c52e55ea2630f719b49750692c1c046e8baed0e04cadc841adbd804cf861ec712b0d07dbbcae7c1c3b475326045ae8c
 DIST zfs-2.1.10.tar.gz 35101856 BLAKE2B 5b1a17d192097f5eab1ef3192217fa34b276b6f344a5114a5411be43208616ac682ae2129ae9da15b4ba6207171ae82140f823041a8067441459d51d994df271 SHA512 3189c6f822c7b6caba650a43f321114ef0bd42b72f566c44ba2400005c61cc3d420149a72520aed5b94494c51c35629a6f645273941774d964f2b61c31c366b2
 DIST zfs-2.1.10.tar.gz.asc 836 BLAKE2B 5a6b408932cb4f39f5a226598527115aa4fa6c105c8b8ad9f236a5909a948150db712bb1f35e4e16a2b7fc7e434530f93c6a6cd2aab40d628b1ded9891694578 SHA512 a45bcce13e7261f90feda51a131fa0c86e2d3c2711286a462072fb120ccbc85719c2bbecb441147a057accffb841ca82df0ba65e1abc0ece9dea8a97cfa31af5
@@ -10,8 +11,9 @@ DIST zfs-2.1.7.tar.gz.asc 836 BLAKE2B 648fb818860a1cecc2ec42f23102e0466c038bfe48
 DIST zfs-2.1.9.tar.gz 35106538 BLAKE2B d7553cc162687531b254089e29e2e15e2eb6b362cecd8e70c24bbb5dbffbde82036ad2d416f4caeceaa324bee8a2e59d9e3cd8a3bf55a2e3c0718c7af9562812 SHA512 a3c410abe911be7d3d66af8ad7023a810eb4ae3284001e544c3a34275eb17a4916a7c094936a2628a590007c007eea84673efa9f3201fd9f24c499fd5ed3ed75
 DIST zfs-2.1.9.tar.gz.asc 836 BLAKE2B 1e76525eab338398dd6ff7539ea4e7d18847d0f40e9093d813ec93fce5fa4c16e09f91c0805ba01a29190f673d131f85442c13035166d6f2d007a7e42dc15486 SHA512 35e1213fcac0458e1243355beba021dfefef455df2b341fbc4b10047f9ed4747df84e319d10ffe4bbcd572fbf014019e0dec200eb4e7d3c116fb805369182cb0
 EBUILD zfs-kmod-2.1.10-r1.ebuild 5576 BLAKE2B 815dd6a12488b0a17e67edc6b77709dc67c8c4eaa12b636fc878df712ce39c3abf5b80960d56cfa314ed9257a3b810b5c067305febd6af451dd6346246ce2f13 SHA512 d77feb3c9ac5698c8d1db64ff22dcd96bff54144e674ad1ef254fa5d1c047c5e0f29b165c037ece23dee9abe89f4ce0e93d1e71267841c69d209ab9dc1a7e65e
+EBUILD zfs-kmod-2.1.11-r1.ebuild 4037 BLAKE2B 7627f4d740f94b6f3682603553c07a9d48a362111a4ca99f02bf51e792c4e3683b17418288bf031ab941e81062289cb6256f0e559e238a60fe942a4a4045e3d2 SHA512 4ac66f8c38397ab60b1ffc1bf15beab0116fe68b25959ddd5eb52d08b2238287f89bcda024b76da62beef00f9f0543055df78b12bf9f1d9dc9c776a03aed1290
 EBUILD zfs-kmod-2.1.11.ebuild 5435 BLAKE2B 792a37580d9cc5452a9b200751d82d337a61f42f01db006b31d1a26b14c0e4c12c654addad3c2eb8b7368062c277dd32bc9e10d8e124e05d66caa753efaf7432 SHA512 ac23176a1c1bba0a6309d4f4c8d2114b2a720409789759c88a94264041495c01d6f3dbc8c8e2515428ca33b87d56886bb535e46015e5c1848bf924e1006629a0
 EBUILD zfs-kmod-2.1.7.ebuild 5580 BLAKE2B 5e4ef24ec54cf5dda899cf9151de0df0a2ef981a9f6a465ab381392dfe8a9214aecc29da61e83c8b317eb568abaa1abff6231660e1c608f709c88d6610da5264 SHA512 253c5cda1e71b51bd2938151ae62872e780a3e2ff3129ef14d39176697f23693c4692da167a3cfa9b386d8521bed63e5345ea8adb60b480d3bac44b198f7a477
 EBUILD zfs-kmod-2.1.9.ebuild 5432 BLAKE2B 1f3473798cb522c80b1d9d244aad191c0118ebaafc8d2041cfad82513b16d68221467473efed4a7b084a44cd0a19331089510ddc402fa064cb15bf21914766ff SHA512 ed69ee9fcfb0ab1db51c1e3ee2a0a155a3eccdd1d297f83dffc3376ef20558e0421e441db0b00302cc2dd499e1693e4b63bbb95102da800e42635f00be2e7f54
-EBUILD zfs-kmod-9999.ebuild 6569 BLAKE2B 2bf117650742e0044bf78d4838c0f8b1a2895d4bac31df742be78ce93aa321074840233d825b8844d01a2de0d1923d0f42bacb53109b7c034592babdb5c4dde9 SHA512 f0342de93072653647992b0b1c22c81f026697446b721fb44cde9808beea93651d58323ebdefb783adfc9eb3b2d8ff02fb267fdf6e4109e1b2355e1867ffedba
-MISC metadata.xml 651 BLAKE2B 477c5d768a2eddab7bc0c14d0845801e25bfd9298fe229a132d7ff11a8560988d0230ec5d4b1447df32f58b9754df0cbe989f2a5600cd3fa99124ea4edc45cdd SHA512 d9bf0598c87bcdaab7d81dd5502caf1400f3c8d3834a6770630d85ed365cd4ebb3beeebae72d2d4d49bcdd0aa6cd709aa57cb2af4195dfc04a9c0cef89cfd724
+EBUILD zfs-kmod-9999.ebuild 5367 BLAKE2B 9b1c77345362ca3f60bbcd2897288778794beb86f5ca3ff3fdd58fb78aee59a510d47c8045941d3c6e2602bf909cc7bb51418692db76ba33166069037ebbaea1 SHA512 156d64dd90d22a63bdefcbadcc0639fa27c896f6ca7cf56e96246afe35a72d6ffd1023d0ec982de2c4f7fd62aebf7381ba78442c4b97480f363959a2ba4a24c2
+MISC metadata.xml 776 BLAKE2B 4c48182f7ceee679b4d947a70cb232980969b59bdc425463a929b6ae8be5f79450a3869bf3cc4d00069b65cda8a06f42eba29a7974c5e1b34a2998992901bcbe SHA512 f3f0af7dcdd26a01fc1b00af46ff64e7e6d7bb83a2225ea4cbff5c1a56651ddfdf3e7f59af914833f52828b9d059c6a8cb7f32037319abed129c40987349745f
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-2.1.11-gentoo.patch b/sys-fs/zfs-kmod/files/zfs-kmod-2.1.11-gentoo.patch
new file mode 100644
index 000000000000..53c5f27b3bed
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-2.1.11-gentoo.patch
@@ -0,0 +1,24 @@
+Hack to pass the full linux-mod-r1 toolchain to make during ./configure.
+Not needed at build time given can pass it normally then.
+
+Eclass has workarounds, compiler/version matching, and its own set of
+user variables which creates disparity between ebuilds if not used.
+
+For the (normal) alternative: KERNEL_{CC,LD} alone is insufficient,
+but combining with KERNEL_LLVM=1 when CC_IS_CLANG will allow it
+to work for *most* people (will likely still need KERNEL_LD from
+linux-mod-r1, or ThinLTO kernels may fail with sandbox violations).
+
+Note KERNEL_* also cause failure if they contain spaces.
+
+https://bugs.gentoo.org/865157
+--- a/config/kernel.m4
++++ b/config/kernel.m4
+@@ -646,6 +646,5 @@
+ 	AC_TRY_COMMAND([
+ 	    KBUILD_MODPOST_NOFINAL="$5" KBUILD_MODPOST_WARN="$6"
+-	    make modules -k -j$TEST_JOBS ${KERNEL_CC:+CC=$KERNEL_CC}
+-	    ${KERNEL_LD:+LD=$KERNEL_LD} ${KERNEL_LLVM:+LLVM=$KERNEL_LLVM}
++	    make modules -k -j$TEST_JOBS '${GENTOO_MAKEARGS_EVAL}'
+ 	    CONFIG_MODULES=y CFLAGS_MODULE=-DCONFIG_MODULES
+ 	    -C $LINUX_OBJ $ARCH_UM M=$PWD/$1 >$1/build.log 2>&1])
diff --git a/sys-fs/zfs-kmod/metadata.xml b/sys-fs/zfs-kmod/metadata.xml
index 936f4ff82c8e..7e27782c6aeb 100644
--- a/sys-fs/zfs-kmod/metadata.xml
+++ b/sys-fs/zfs-kmod/metadata.xml
@@ -10,6 +10,7 @@
 		<name>Sam James</name>
 	</maintainer>
 	<use>
+		<flag name="dist-kernel-cap">Prevents upgrading to an unsupported kernel version when combined with USE=dist-kernel</flag>
 		<flag name="rootfs">Pull dependencies and check kernel options required for root-on-zfs</flag>
 	</use>
 	<upstream>
diff --git a/sys-fs/zfs-kmod/zfs-kmod-2.1.11-r1.ebuild b/sys-fs/zfs-kmod/zfs-kmod-2.1.11-r1.ebuild
new file mode 100644
index 000000000000..cd38e7bd2037
--- /dev/null
+++ b/sys-fs/zfs-kmod/zfs-kmod-2.1.11-r1.ebuild
@@ -0,0 +1,163 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools dist-kernel-utils 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.2
+MODULES_KERNEL_MIN=3.10
+
+if [[ ${PV} == 9999 ]] ; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/openzfs/zfs.git"
+	unset MODULES_KERNEL_MAX
+else
+	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?}"
+	VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/openzfs.asc
+
+	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-${MODULES_KERNEL_MAX%%.*}.$(( ${MODULES_KERNEL_MAX##*.} + 1))
+		) )
+	"
+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
+
+	if has_version virtual/dist-kernel && ! use dist-kernel; then
+		ewarn "You have virtual/dist-kernel installed, but"
+		ewarn "USE=\"dist-kernel\" is not enabled for ${CATEGORY}/${PN}"
+		ewarn "It's recommended to globally enable dist-kernel USE flag"
+		ewarn "to auto-trigger initrd rebuilds with kernel updates"
+	fi
+}
+
+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"
+
+	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 [[ -z ${ROOT} ]] && use dist-kernel ; then
+		dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}"
+	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
+
+	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
+}
diff --git a/sys-fs/zfs-kmod/zfs-kmod-9999.ebuild b/sys-fs/zfs-kmod/zfs-kmod-9999.ebuild
index 1df8508ad03d..82ac6d7c464a 100644
--- a/sys-fs/zfs-kmod/zfs-kmod-9999.ebuild
+++ b/sys-fs/zfs-kmod/zfs-kmod-9999.ebuild
@@ -3,29 +3,29 @@
 
 EAPI=8
 
-inherit autotools dist-kernel-utils flag-o-matic linux-mod toolchain-funcs
+inherit autotools dist-kernel-utils flag-o-matic linux-mod-r1 multiprocessing
 
 DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
 HOMEPAGE="https://github.com/openzfs/zfs"
 
-if [[ ${PV} == "9999" ]]; then
+MODULES_KERNEL_MAX=6.2
+MODULES_KERNEL_MIN=3.10
+
+if [[ ${PV} == 9999 ]] ; then
 	inherit git-r3
 	EGIT_REPO_URI="https://github.com/openzfs/zfs.git"
+	unset MODULES_KERNEL_MAX
 else
-	VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/openzfs.asc
 	inherit verify-sig
 
-	MY_PV="${PV/_rc/-rc}"
+	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="6.2"
-
-	# 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))"
+	VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/openzfs.asc
 
-	if [[ ${PV} != *_rc* ]]; then
+	if [[ ${PV} != *_rc* ]] ; then
 		KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~sparc"
 	fi
 fi
@@ -33,32 +33,30 @@ fi
 LICENSE="CDDL MIT debug? ( GPL-2+ )"
 SLOT="0/${PVR}"
 IUSE="custom-cflags debug +rootfs"
-
-RDEPEND="${DEPEND}"
+RESTRICT="test"
 
 BDEPEND="
 	dev-lang/perl
 	app-alternatives/awk
 "
 
-# we want dist-kernel block in BDEPEND because of portage resolver.
-# since linux-mod.eclass already sets version-unbounded dep, portage
-# will pull new versions. So we set it in BDEPEND which takes priority.
-# and we don't need in in git ebuild.
-if [[ ${PV} != "9999" ]] ; then
-	BDEPEND+="
-		verify-sig? ( sec-keys/openpgp-keys-openzfs )
-		dist-kernel? ( <virtual/dist-kernel-${ZFS_KERNEL_DEP}:= )
+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-${MODULES_KERNEL_MAX%%.*}.$(( ${MODULES_KERNEL_MAX##*.} + 1))
+		) )
 	"
 fi
 
-# PDEPEND in this form is needed to trick portage suggest
-# enabling dist-kernel if only 1 package have it set
+# Used to suggest matching USE, but without suggesting to disable
 PDEPEND="dist-kernel? ( ~sys-fs/zfs-${PV}[dist-kernel] )"
 
-RESTRICT="debug? ( strip ) test"
-
-DOCS=( AUTHORS COPYRIGHT META README.md )
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.1.11-gentoo.patch
+)
 
 pkg_pretend() {
 	use rootfs || return 0
@@ -72,44 +70,26 @@ pkg_pretend() {
 }
 
 pkg_setup() {
-	CONFIG_CHECK="
-		!DEBUG_LOCK_ALLOC
+	local CONFIG_CHECK="
 		EFI_PARTITION
-		MODULES
-		!PAX_KERNEXEC_PLUGIN_METHOD_OR
-		!TRIM_UNUSED_KSYMS
 		ZLIB_DEFLATE
 		ZLIB_INFLATE
+		!DEBUG_LOCK_ALLOC
+		!PAX_KERNEXEC_PLUGIN_METHOD_OR
 	"
-
-	use debug && CONFIG_CHECK="${CONFIG_CHECK}
-		FRAME_POINTER
+	use debug && CONFIG_CHECK+="
 		DEBUG_INFO
+		FRAME_POINTER
 		!DEBUG_INFO_REDUCED
 	"
-
-	use rootfs && \
-		CONFIG_CHECK="${CONFIG_CHECK}
-			BLK_DEV_INITRD
-			DEVTMPFS
+	use rootfs && CONFIG_CHECK+="
+		BLK_DEV_INITRD
+		DEVTMPFS
 	"
 
-	kernel_is -lt 5 && CONFIG_CHECK="${CONFIG_CHECK} IOSCHED_NOOP"
+	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
-
-	kernel_is -ge 3 10 || die "Linux 3.10 or newer required"
-
-	linux-mod_pkg_setup
+	linux-mod-r1_pkg_setup
 }
 
 src_prepare() {
@@ -118,60 +98,41 @@ src_prepare() {
 	# Run unconditionally (bug #792627)
 	eautoreconf
 
-	if [[ ${PV} != "9999" ]]; then
+	if [[ ${PV} != 9999 ]] ; then
 		# Set module revision number
-		sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release"
+		sed -Ei "s/(Release:.*)1/\1${PR}-gentoo/" META || die
 	fi
 }
 
 src_configure() {
-	set_arch_to_kernel
-
 	use custom-cflags || strip-flags
-
 	filter-ldflags -Wl,*
 
-	# Set CROSS_COMPILE in the environment.
-	# This allows the user to override it via make.conf or via a local Makefile.
-	# https://bugs.gentoo.org/811600
-	export CROSS_COMPILE=${CROSS_COMPILE-${CHOST}-}
-
 	local myconf=(
-		HOSTCC="$(tc-getBUILD_CC)"
-		--bindir="${EPREFIX}/bin"
-		--sbindir="${EPREFIX}/sbin"
+		--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() {
-	set_arch_to_kernel
-
-	myemakeargs=(
-		HOSTCC="$(tc-getBUILD_CC)"
-		V=1
-	)
-
-	emake "${myemakeargs[@]}"
+	emake "${MODULES_MAKEARGS[@]}"
 }
 
 src_install() {
-	set_arch_to_kernel
+	emake "${MODULES_MAKEARGS[@]}" DESTDIR="${ED}" install
+	modules_post_process
 
-	myemakeargs+=(
-		DEPMOD=:
-		# INSTALL_MOD_PATH ?= $(DESTDIR) in module/Makefile
-		DESTDIR="${D}"
-	)
-
-	emake "${myemakeargs[@]}" install
-
-	einstalldocs
+	dodoc AUTHORS COPYRIGHT META README.md
 }
 
 _old_layout_cleanup() {
@@ -190,7 +151,7 @@ _old_layout_cleanup() {
 
 	# kernel/module/Kconfig contains possible compressed extentions.
 	local kext kextfiles
-	for kext in .ko{,.{gz,xz,zst}}; do
+		for kext in .ko{,.{gz,xz,zst}}; do
 		kextfiles+=( "${olddir[@]/%/${kext}}" )
 	done
 
@@ -214,19 +175,19 @@ pkg_postinst() {
 	# 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_pkg_postinst
 
-	if [[ -z ${ROOT} ]] && use dist-kernel; then
-		set_arch_to_pkgmgr
+	linux-mod-r1_pkg_postinst
+
+	if [[ -z ${ROOT} ]] && use dist-kernel ; then
 		dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}"
 	fi
 
-	if use x86 || use arm; then
+	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
+	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."
-- 
cgit v1.2.3