commit:     31d201072b3c41da1d688f0c17be23a64f8aa3fb
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 26 05:46:34 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Aug 26 07:03:35 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=31d20107

sys-kernel/gentoo-kernel: Backport more upstream fixes to 6.16.3-r1

Bug: https://bugs.gentoo.org/961815
Bug: https://bugs.gentoo.org/961988
Patchset: 
https://lore.kernel.org/all/20597f81c1439569e34d026542365aef1cedfb00.1756088250.git.calvin
 <AT> wbinvd.org/
Patchset: https://lore.kernel.org/regressions/20250825060918.4799-1-oscmaes92 
<AT> gmail.com/
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 sys-kernel/gentoo-kernel/Manifest                  |   1 +
 .../gentoo-kernel/gentoo-kernel-6.16.3-r1.ebuild   | 180 +++++++++++++++++++++
 2 files changed, 181 insertions(+)

diff --git a/sys-kernel/gentoo-kernel/Manifest 
b/sys-kernel/gentoo-kernel/Manifest
index 6cf68e34af70..8bb3555c1810 100644
--- a/sys-kernel/gentoo-kernel/Manifest
+++ b/sys-kernel/gentoo-kernel/Manifest
@@ -55,6 +55,7 @@ DIST linux-gentoo-patches-6.15.9-r1.tar.xz 87392 BLAKE2B 
68051079724733a470bba02
 DIST linux-gentoo-patches-6.16.1.tar.xz 87724 BLAKE2B 
3137ea2f6b1784ae905d92b4704068764d1424e6ce315deffa4328c74da6e4aa9599074e621a8e2007c019024dc7802a3a1198e13ca1b947ccd20eafc5a6e8f7
 SHA512 
04268c577718622e1cb5f6154d0c944fef40de9293d4ccc7d9c078ef695f9e51d75d0715fd4b2a8ba2e96b3aa6ce4e86694c61d88b6184bdef65a0aa9033dd50
 DIST linux-gentoo-patches-6.16.2-r1.tar.xz 86056 BLAKE2B 
913a0fae068a4e65abada3c484971483b14ab07117ce9a838cb7e3a7f6cf82cdae57a3d8c072efd2e55901709375421d1a80ed3ad5c51ad0f0e488b0afaa4cc2
 SHA512 
e7f49205866b3bf9941617f3f8c2a03956bd10dd11ecca4a509b439c5d43448e3fc7c2c5d9a3718f341c410dfb24fe3c86a022aac82f7c1ab615710fcbb70b8c
 DIST linux-gentoo-patches-6.16.2.tar.xz 85676 BLAKE2B 
31adfc6ebdfe2412c1576734351a6ff5bc0c1cae86e87f3cfbf555d07e8441c64bd0e31f3760674e931a510a9401935dee46689eeff6f5ee5c28029a889a40cf
 SHA512 
aa74585b4c71202176c851cc2b08569a752da58f5a43c5b1fb3dfd59db8ff016907985d448c51f4163b951a5bc500b81eca647e1b6a7c20ab7287292d4c2a3b8
+DIST linux-gentoo-patches-6.16.3.tar.xz 90080 BLAKE2B 
0fdafabbaf6ebcbb997debdc17b5baec5a7e3154902a9093891e5d839540c55ddcba94ba34af11bbc374badcff67d1e47999bc998e5b21168eb92b332438ea01
 SHA512 
83de7cefae3d9ad9d47ae49db4a8328725b7b44fbd4e854dfad2a33917eace57958e9e25d275c83a5d026c2391b529015ac840e2fa3f3cf13733e570349d25e0
 DIST linux-gentoo-patches-6.6.100.tar.xz 42828 BLAKE2B 
e9d17c21e5355919e30e1a93178d3977d6ca1bf964ba18b601518616f31e098d65cb5008003fb6c8e1a8a5cc3ed803eaef3e1c9af5f1a895d230f172412b1283
 SHA512 
95c2790a5ebcca9f2b9e1ff098be0bcb9ef60f134a0f955995f27c020cff0d6831fc1af7c159b0bb918d3e3eba351f9428458d6e6964e9e751bd85afd47f7a2b
 DIST linux-gentoo-patches-6.6.102.tar.xz 43900 BLAKE2B 
119b27bfae8914cc13dcc64203bf4c6f57a6f4713eb84a19980a17be0a121658b5ed4d7ac93ba94e60adf4bc1134c7c1f174b6ade123ece292ef39911afb74f6
 SHA512 
a5606b750c6018655c7bf6357805afab65e08eb8a9c429cec927b1d79ee6a0ec9faf4734445ff261870953d247920f2bdb5cf199e937a8e272062f6609adad4d
 DIST patch-5.10.240.xz 6786568 BLAKE2B 
1cb287b2c99bb403585cad3500a2de0819db40ea62a72d276c2b53d8637915cfc0350051bfdfc99cbb56a4e839331b7e11cbb2abdf6768a683d44e798ee5862d
 SHA512 
91f059de27701a33e5c4d40f2d3e982dc60d9dc14fa8cb6a0bbd49e4452195715f0093a563e3a1db1efa37b3a1e09e74b0a6d53f77357757ffd29374abcead19

diff --git a/sys-kernel/gentoo-kernel/gentoo-kernel-6.16.3-r1.ebuild 
b/sys-kernel/gentoo-kernel/gentoo-kernel-6.16.3-r1.ebuild
new file mode 100644
index 000000000000..805668b543f6
--- /dev/null
+++ b/sys-kernel/gentoo-kernel/gentoo-kernel-6.16.3-r1.ebuild
@@ -0,0 +1,180 @@
+# Copyright 2020-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+KERNEL_IUSE_GENERIC_UKI=1
+KERNEL_IUSE_MODULES_SIGN=1
+
+inherit kernel-build toolchain-funcs verify-sig
+
+MY_P=linux-${PV%.*}
+PATCHSET=linux-gentoo-patches-6.16.3
+# https://koji.fedoraproject.org/koji/packageinfo?packageID=8
+# forked to https://github.com/projg2/fedora-kernel-config-for-gentoo
+CONFIG_VER=6.16.2-gentoo
+GENTOO_CONFIG_VER=g17
+SHA256SUM_DATE=20250823
+
+DESCRIPTION="Linux kernel built with Gentoo patches"
+HOMEPAGE="
+       https://wiki.gentoo.org/wiki/Project:Distribution_Kernel
+       https://www.kernel.org/
+"
+SRC_URI+="
+       https://cdn.kernel.org/pub/linux/kernel/v$(ver_cut 1).x/${MY_P}.tar.xz
+       https://cdn.kernel.org/pub/linux/kernel/v$(ver_cut 1).x/patch-${PV}.xz
+       https://dev.gentoo.org/~mgorny/dist/linux/${PATCHSET}.tar.xz
+       
https://github.com/projg2/gentoo-kernel-config/archive/${GENTOO_CONFIG_VER}.tar.gz
+               -> gentoo-kernel-config-${GENTOO_CONFIG_VER}.tar.gz
+       verify-sig? (
+               https://cdn.kernel.org/pub/linux/kernel/v$(ver_cut 
1).x/sha256sums.asc
+                       -> linux-$(ver_cut 1).x-sha256sums-${SHA256SUM_DATE}.asc
+       )
+       amd64? (
+               
https://raw.githubusercontent.com/projg2/fedora-kernel-config-for-gentoo/${CONFIG_VER}/kernel-x86_64-fedora.config
+                       -> kernel-x86_64-fedora.config.${CONFIG_VER}
+       )
+       arm64? (
+               
https://raw.githubusercontent.com/projg2/fedora-kernel-config-for-gentoo/${CONFIG_VER}/kernel-aarch64-fedora.config
+                       -> kernel-aarch64-fedora.config.${CONFIG_VER}
+       )
+       ppc64? (
+               
https://raw.githubusercontent.com/projg2/fedora-kernel-config-for-gentoo/${CONFIG_VER}/kernel-ppc64le-fedora.config
+                       -> kernel-ppc64le-fedora.config.${CONFIG_VER}
+       )
+       riscv? (
+               
https://raw.githubusercontent.com/projg2/fedora-kernel-config-for-gentoo/${CONFIG_VER}/kernel-riscv64-fedora.config
+                       -> kernel-riscv64-fedora.config.${CONFIG_VER}
+       )
+       x86? (
+               
https://raw.githubusercontent.com/projg2/fedora-kernel-config-for-gentoo/${CONFIG_VER}/kernel-i686-fedora.config
+                       -> kernel-i686-fedora.config.${CONFIG_VER}
+       )
+"
+S=${WORKDIR}/${MY_P}
+
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86"
+IUSE="debug experimental hardened"
+REQUIRED_USE="
+       arm? ( savedconfig )
+       hppa? ( savedconfig )
+       sparc? ( savedconfig )
+"
+
+RDEPEND="
+       !sys-kernel/gentoo-kernel-bin:${SLOT}
+"
+BDEPEND="
+       debug? ( dev-util/pahole )
+       verify-sig? ( >=sec-keys/openpgp-keys-kernel-20250702 )
+"
+PDEPEND="
+       >=virtual/dist-kernel-${PV}
+"
+
+QA_FLAGS_IGNORED="
+       usr/src/linux-.*/scripts/gcc-plugins/.*.so
+       usr/src/linux-.*/vmlinux
+       usr/src/linux-.*/arch/powerpc/kernel/vdso.*/vdso.*.so.dbg
+"
+
+VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/kernel.org.asc
+
+src_unpack() {
+       if use verify-sig; then
+               cd "${DISTDIR}" || die
+               verify-sig_verify_signed_checksums \
+                       "linux-$(ver_cut 1).x-sha256sums-${SHA256SUM_DATE}.asc" 
\
+                       sha256 "${MY_P}.tar.xz patch-${PV}.xz"
+               cd "${WORKDIR}" || die
+       fi
+
+       default
+}
+
+src_prepare() {
+       local patch
+       eapply "${WORKDIR}/patch-${PV}"
+       for patch in "${WORKDIR}/${PATCHSET}"/*.patch; do
+               eapply "${patch}"
+               # non-experimental patches always finish with Gentoo Kconfig
+               # when ! use experimental, stop applying after it
+               if [[ ${patch} == *Add-Gentoo-Linux-support-config-settings* ]] 
&&
+                       ! use experimental
+               then
+                       break
+               fi
+       done
+
+       default
+
+       local biendian=false
+
+       # prepare the default config
+       case ${ARCH} in
+               arm | hppa | loong | sparc)
+                       > .config || die
+               ;;
+               amd64)
+                       cp 
"${DISTDIR}/kernel-x86_64-fedora.config.${CONFIG_VER}" .config || die
+                       ;;
+               arm64)
+                       cp 
"${DISTDIR}/kernel-aarch64-fedora.config.${CONFIG_VER}" .config || die
+                       biendian=true
+                       ;;
+               ppc)
+                       # assume powermac/powerbook defconfig
+                       # we still package.use.force savedconfig
+                       cp 
"${WORKDIR}/${MY_P}/arch/powerpc/configs/pmac32_defconfig" .config || die
+                       ;;
+               ppc64)
+                       cp 
"${DISTDIR}/kernel-ppc64le-fedora.config.${CONFIG_VER}" .config || die
+                       biendian=true
+                       ;;
+               riscv)
+                       cp 
"${DISTDIR}/kernel-riscv64-fedora.config.${CONFIG_VER}" .config || die
+                       ;;
+               x86)
+                       cp "${DISTDIR}/kernel-i686-fedora.config.${CONFIG_VER}" 
.config || die
+                       ;;
+               *)
+                       die "Unsupported arch ${ARCH}"
+                       ;;
+       esac
+
+       local myversion="-gentoo-dist"
+       use hardened && myversion+="-hardened"
+       echo "CONFIG_LOCALVERSION=\"${myversion}\"" > "${T}"/version.config || 
die
+       local 
dist_conf_path="${WORKDIR}/gentoo-kernel-config-${GENTOO_CONFIG_VER}"
+
+       local merge_configs=(
+               "${T}"/version.config
+               "${dist_conf_path}"/base.config
+               "${dist_conf_path}"/6.12+.config
+       )
+       use debug || merge_configs+=(
+               "${dist_conf_path}"/no-debug.config
+       )
+       if use hardened; then
+               merge_configs+=( "${dist_conf_path}"/hardened-base.config )
+
+               tc-is-gcc && merge_configs+=( 
"${dist_conf_path}"/hardened-gcc-plugins.config )
+
+               if [[ -f "${dist_conf_path}/hardened-${ARCH}.config" ]]; then
+                       merge_configs+=( 
"${dist_conf_path}/hardened-${ARCH}.config" )
+               fi
+       fi
+
+       # this covers ppc64 and aarch64_be only for now
+       if [[ ${biendian} == true && $(tc-endian) == big ]]; then
+               merge_configs+=( "${dist_conf_path}/big-endian.config" )
+       fi
+
+       use secureboot && merge_configs+=(
+               "${dist_conf_path}/secureboot.config"
+               "${dist_conf_path}/zboot.config"
+       )
+
+       kernel-build_merge_configs "${merge_configs[@]}"
+}

Reply via email to