commit: 7b5e6b87b108c798bcd1d72d1a5e1b9ae0c1fd53
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 5 11:16:49 2025 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Sep 5 15:03:52 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7b5e6b87
sys-kernel/gentoo-kernel: Backport pde_set_flags() fix to 6.16.5_p1
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
sys-kernel/gentoo-kernel/Manifest | 1 +
.../gentoo-kernel/gentoo-kernel-6.16.5_p1.ebuild | 185 +++++++++++++++++++++
2 files changed, 186 insertions(+)
diff --git a/sys-kernel/gentoo-kernel/Manifest
b/sys-kernel/gentoo-kernel/Manifest
index dac811b45a72..4451654f2e1e 100644
--- a/sys-kernel/gentoo-kernel/Manifest
+++ b/sys-kernel/gentoo-kernel/Manifest
@@ -52,6 +52,7 @@ DIST linux-gentoo-patches-6.16.2.tar.xz 85676 BLAKE2B
31adfc6ebdfe2412c157673435
DIST linux-gentoo-patches-6.16.3.tar.xz 90080 BLAKE2B
0fdafabbaf6ebcbb997debdc17b5baec5a7e3154902a9093891e5d839540c55ddcba94ba34af11bbc374badcff67d1e47999bc998e5b21168eb92b332438ea01
SHA512
83de7cefae3d9ad9d47ae49db4a8328725b7b44fbd4e854dfad2a33917eace57958e9e25d275c83a5d026c2391b529015ac840e2fa3f3cf13733e570349d25e0
DIST linux-gentoo-patches-6.16.4.tar.xz 89184 BLAKE2B
57ee7fcbbc519ff327162163b81f910ff90216b19b066acf7c873f69afdcba99f9d38be7c8998522b3870376441d8b3be5c9de7a12f8464bbaf597e18162a966
SHA512
b4c02d84b7023359e0f378459c31a6b0984d743a9415f667824295292f448aae185665c39537ca9fb8bbff3473956dd90419bbf42dce0b9eb3bdd1fa9465a7c5
DIST linux-gentoo-patches-6.16.5.tar.xz 88704 BLAKE2B
38096552b25e4366ae4b4086b6777e468a52b846d4d9483aa42dadfd49e1d9c3e8a1d00f89a4e3018b7ccb9885b71aa3361a5c5e2c3d1baa2d0ae8ef5f14a263
SHA512
d5905c4e68cea8199f297186fc8174bb80dfd5354f534eb96f0d4c8757bcf7c8108964df54dbf035cb9f6d1336d195be527b57b85701ee121f51ac3826b7eb66
+DIST linux-gentoo-patches-6.16.5_p1.tar.xz 89012 BLAKE2B
fe430dd2ef953ac1e341748b028df42ae1ae370e46d65069a9f463886fa9906800364538b00695a9169443f2e75063dbc9e339c76780c5d343ed7b9e655c7796
SHA512
a2e6519b27cfa817585af2cd92b8be0e72227f0ae3ce63550caca341a995ffa21fe69ab4b1b23f7220810e4ba4c54b5ac57d648f107e93598dae2a2ea340c04e
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.5_p1.ebuild
b/sys-kernel/gentoo-kernel/gentoo-kernel-6.16.5_p1.ebuild
new file mode 100644
index 000000000000..aa1544972de8
--- /dev/null
+++ b/sys-kernel/gentoo-kernel/gentoo-kernel-6.16.5_p1.ebuild
@@ -0,0 +1,185 @@
+# 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
+
+BASE_P=linux-${PV%.*}
+PATCH_PV=${PV%_p*}
+PATCHSET=linux-gentoo-patches-6.16.5_p1
+# 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=20250904
+
+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/${BASE_P}.tar.xz
+ https://cdn.kernel.org/pub/linux/kernel/v$(ver_cut
1).x/patch-${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}/${BASE_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-${PATCH_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 "${BASE_P}.tar.xz patch-${PATCH_PV}.xz"
+ cd "${WORKDIR}" || die
+ fi
+
+ default
+}
+
+src_prepare() {
+ local patch
+ eapply "${WORKDIR}/patch-${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
+
+ # add Gentoo patchset version
+ local extraversion=${PV#${PATCH_PV}}
+ sed -i -e "s:^\(EXTRAVERSION =\).*:\1 ${extraversion/_/-}:" Makefile ||
die
+
+ 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}/${BASE_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[@]}"
+}