commit:     2721be51a91d28003f46539791b25f30f206d910
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 23 11:19:41 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Aug 23 11:42:19 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2721be51

sys-kernel/gentoo-kernel: Backport procfs & crash fixes to 6.12.43-r1

Bug: https://bugs.gentoo.org/961815
Bug: https://bugs.gentoo.org/961922
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

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

diff --git a/sys-kernel/gentoo-kernel/Manifest 
b/sys-kernel/gentoo-kernel/Manifest
index b9a9c21010f1..0e299bf1e389 100644
--- a/sys-kernel/gentoo-kernel/Manifest
+++ b/sys-kernel/gentoo-kernel/Manifest
@@ -43,6 +43,7 @@ DIST linux-gentoo-patches-5.10.240.tar.xz 19396 BLAKE2B 
f61ba4218c2fb65f3e67b7c3
 DIST linux-gentoo-patches-5.15.187.tar.xz 8636 BLAKE2B 
64db6ded446586a589fc36753258ec166cc1260b95fa43e7612f0e5f3f831668dd81c5ec6339bf3bf2dca6228c624cf114ae9380290eddb4acec949f84de3ca9
 SHA512 
b18fd19031ad2f8078ad37cd654a6dffccbe53cec1e0c008ff56c5088a32c7c87895cc00be64d79f5252e842ba757a4e6681a09e5d0ef2f986c9d67666eee81e
 DIST linux-gentoo-patches-6.1.147.tar.xz 29060 BLAKE2B 
ba49c42dad2186d320b37a2ed456ff0388de619bee4bda26336939567b2575be1cdf7adf853e28b7b5b1636a9638238337ff0e4f8001504c4e90287af017b367
 SHA512 
1e376dc5ba8f6d76fdeeb611802248b045059a4a2a7e174c31a73216d78f462366d88439d9cec2a60f493ba6258d5824d752f0f95b263349a0d12b3f196cbe32
 DIST linux-gentoo-patches-6.12.40.tar.xz 19240 BLAKE2B 
2e5bdafcbe44cab520c86d7ab37c48c5b032693cee5674d1625432e4ac6285137a3df2aec24abe4cf795247f76226ff236f09f7e748ba3bd7db81cc76af03526
 SHA512 
dfb551b87530b0509293e87cd70d2d91f1c669c62adc6c7f34395ffdd5fbfc19bbfe943f84c188653a71bd627bea95f5f9391f4edbf0e269a8da98e191477fe2
+DIST linux-gentoo-patches-6.12.43.tar.xz 20956 BLAKE2B 
29333fc247ce5a1cc75ff70a2190e65943e23ec457b13e043ff9df77522fe27152a448074933ac801c91faa6ede75386743ebe58fc399c70067612d5ed1d71c5
 SHA512 
dc9efdc9852cbc33039eb335e8d4d9d490c707b62e2889898cc64a3691e271083f574e1afada68a73e4f94beb8c1ba4ec990d1e5522a585d856152b37d88af3e
 DIST linux-gentoo-patches-6.15.11.tar.xz 85328 BLAKE2B 
8cf3a38013dfd79174ba66f1c61f1e6bb7efec906695740149fd75edaace9717c2ad1831560168c6718f04d3559a219e0ccd16383741988f5adb052ae43b3178
 SHA512 
15f54520a059220f0760b65e03953319af847dd199455f67d161236ee6903433bc78128f8987b3cac48e496000e3b57ba08232e16125485a74dbcbf13cec0b29
 DIST linux-gentoo-patches-6.15.9-r1.tar.xz 87392 BLAKE2B 
68051079724733a470bba024c4d0581ba88bed0f9e92bf95c4e3b74160787654f54960cff05d0a61f0e88f5ad8d23dc1d87df1eaf174e6b9ef4ec0919f2335ec
 SHA512 
3be9b5e9a84a211611bd55119d95758631d497b6e0a30e2e0749a7592e90c63a1e1eb56f187aafba3af52f2ad06aadd0842df28ead937a44e139f84bd2df27b1
 DIST linux-gentoo-patches-6.16.1.tar.xz 87724 BLAKE2B 
3137ea2f6b1784ae905d92b4704068764d1424e6ce315deffa4328c74da6e4aa9599074e621a8e2007c019024dc7802a3a1198e13ca1b947ccd20eafc5a6e8f7
 SHA512 
04268c577718622e1cb5f6154d0c944fef40de9293d4ccc7d9c078ef695f9e51d75d0715fd4b2a8ba2e96b3aa6ce4e86694c61d88b6184bdef65a0aa9033dd50

diff --git a/sys-kernel/gentoo-kernel/gentoo-kernel-6.12.43-r1.ebuild 
b/sys-kernel/gentoo-kernel/gentoo-kernel-6.12.43-r1.ebuild
new file mode 100644
index 000000000000..44ccd6701ae9
--- /dev/null
+++ b/sys-kernel/gentoo-kernel/gentoo-kernel-6.12.43-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.12.43
+# https://koji.fedoraproject.org/koji/packageinfo?packageID=8
+# forked to https://github.com/projg2/fedora-kernel-config-for-gentoo
+CONFIG_VER=6.12.41-gentoo
+GENTOO_CONFIG_VER=g17
+SHA256SUM_DATE=20250820
+
+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