commit:     bdf1ba52297d5815fb8ecd6c56278c8ad9c6b879
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Jul  6 14:13:31 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Jul  6 17:49:31 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bdf1ba52

sys-kernel/gentoo-kernel: Bump to 6.6.96

Use upstream patch + own dist-kernel patchset instead of genpatches.
This reduces effective patch size, makes applying faster, enables
verify-sig (using sha256sums) and makes it possible to bump dist-kernels
independently of sys-kernel/gentoo-sources.

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 sys-kernel/gentoo-kernel/Manifest                  |   2 +
 .../gentoo-kernel/gentoo-kernel-6.6.96.ebuild      | 170 +++++++++++++++++++++
 2 files changed, 172 insertions(+)

diff --git a/sys-kernel/gentoo-kernel/Manifest 
b/sys-kernel/gentoo-kernel/Manifest
index ea152e996564..f15f064dd857 100644
--- a/sys-kernel/gentoo-kernel/Manifest
+++ b/sys-kernel/gentoo-kernel/Manifest
@@ -57,5 +57,7 @@ DIST linux-6.6.tar.xz 140064536 BLAKE2B 
5f02fd8696d42f7ec8c5fbadec8e7270bdcfcb1f
 DIST linux-6.x-sha256sums-20250706.asc 154698 BLAKE2B 
8c9f6fce58842bff04a7e67bfa4c526aa4f96e330eb1f340eb4a27255c7c3755143c3bde4b4d4e1a62a73c750bd940ef69902c0da37c8a0a308843bc978dc06d
 SHA512 
4798b646ed4982fb2024f06f346cf0eed66c94dd1ca1972171101b6848a476b85b9deb5937421b643fc760171a246e348b5fb0809317be82f849be4db81fa8eb
 DIST linux-gentoo-patches-6.12.36.tar.xz 17848 BLAKE2B 
b1257367ba4d02ef5f1bce8846368badd80e27f3eef8bd0c6f906478e0316b29be4b0b8ecafc550cffa82fef78c656672faf74682edb8d6ef92e80ac5e0d8c20
 SHA512 
c84797f87077964699edb5b7e34682b99d6fa4278d177385a6d78f7de409ec46eeaf40917443003f7bf5453fbfe608e28cbb05553c27656a0267e6421988790c
 DIST linux-gentoo-patches-6.15.5.tar.xz 83692 BLAKE2B 
0b0831734f25b00a3523592439625342d12b0361b56e4d8243f94c045a27eeedbc02086032f01240d26807721d55d8a4011513b5610d1bf4889e35b7ac171afb
 SHA512 
876750fbfb36f75ddb69026563a2d43310e116c567491a5428da30383a38d9384b97455c7ea61a1faa949b44dd22f402262c63a3701568ef3f8ab2d5f67f6c0f
+DIST linux-gentoo-patches-6.6.96.tar.xz 41508 BLAKE2B 
fd1a612b4376ffc7b916dba5c1f7b7d54a2f7724e96b44fbb1be929ff09868414b2462a37dd57f06960eba3c981088880ce350b1d5a1def225482bbb4f1e6971
 SHA512 
913ea1723e814930a7f78bf46cfc7d677a4f574f3e1a17b2a2af4075e86ce3d88de59cc1884dd2e8b49975dd293ea190545040b9b1f430bd74d37b88e58b9a21
 DIST patch-6.12.36.xz 2388056 BLAKE2B 
9912220c0126fda1c35446d57376ccca45f12dc894a277feccd181e7bf59cdcdf88e6c5c9276c0e4e7f54cadd17b155a3b1aa77f084a58e1043da9d57b768498
 SHA512 
4e469962c9516d7614816d9905895b1d249942a77d800506dba2ef0bb5dd56123e72e5e08a2b8396ece9d672b3a16a52b9d8e3af370c631197f0ed85d5d8675f
 DIST patch-6.15.5.xz 538604 BLAKE2B 
3771e14cb95010a9e553191af6888fa26dd5f1084c16a1df3aad97ed2a03de97cf1af8562a1b7c0d1977dfba1f3973e03079278b72943ac104c4208e1eeed315
 SHA512 
ff35f126fc24cd9fc2ba7dafb10e2c4dc4643a2165893d6dd07ce0ab49bf33d4b67ab33b32875b74371749b5e6f93a061114c9837bdb48203d50b5ec55db5a65
+DIST patch-6.6.96.xz 4574068 BLAKE2B 
047878c4c04057b9d2f342850cbc41d0dc326dc9ad7421500cefc6e8c32a3a769b0f069f6348d1ea0663cf8274e6048a52d900cf48cd18c5cfe3e9808c5133e8
 SHA512 
dce4c83f605f189c8bf2fe0c96118ed56d5d686a145605d125e532e78417076f84a7d85e7b8bdc71d7b3c0c7594a82403d7a9231e61f88ee61a05b43adfb98ff

diff --git a/sys-kernel/gentoo-kernel/gentoo-kernel-6.6.96.ebuild 
b/sys-kernel/gentoo-kernel/gentoo-kernel-6.6.96.ebuild
new file mode 100644
index 000000000000..5a2ef809b105
--- /dev/null
+++ b/sys-kernel/gentoo-kernel/gentoo-kernel-6.6.96.ebuild
@@ -0,0 +1,170 @@
+# 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-${PV}
+# https://koji.fedoraproject.org/koji/packageinfo?packageID=8
+# forked to https://github.com/projg2/fedora-kernel-config-for-gentoo
+CONFIG_VER=6.6.12-gentoo
+GENTOO_CONFIG_VER=g16
+SHA256SUM_DATE=20250706
+
+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}
+       )
+       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 )
+       riscv? ( 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() {
+       default
+       eapply "${WORKDIR}/patch-${PV}"
+
+       local patch
+       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
+
+       local biendian=false
+
+       # prepare the default config
+       case ${ARCH} in
+               arm | hppa | loong | riscv | 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
+                       ;;
+               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
+       )
+       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" )
+
+       kernel-build_merge_configs "${merge_configs[@]}"
+}

Reply via email to