commit:     21afe3d728be864edc38df07933e49d320ee0502
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Aug  3 17:06:31 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Aug  3 19:01:23 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=21afe3d7

sys-kernel/gentoo-kernel: Backport btrfs fixes to 6.15.9-r1

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

 sys-kernel/gentoo-kernel/Manifest                  |   1 +
 .../gentoo-kernel/gentoo-kernel-6.15.9-r1.ebuild   | 177 +++++++++++++++++++++
 2 files changed, 178 insertions(+)

diff --git a/sys-kernel/gentoo-kernel/Manifest 
b/sys-kernel/gentoo-kernel/Manifest
index 4d1079d751cd..72b2e2609622 100644
--- a/sys-kernel/gentoo-kernel/Manifest
+++ b/sys-kernel/gentoo-kernel/Manifest
@@ -54,6 +54,7 @@ DIST linux-gentoo-patches-6.12.36.tar.xz 17848 BLAKE2B 
b1257367ba4d02ef5f1bce884
 DIST linux-gentoo-patches-6.12.40.tar.xz 19240 BLAKE2B 
2e5bdafcbe44cab520c86d7ab37c48c5b032693cee5674d1625432e4ac6285137a3df2aec24abe4cf795247f76226ff236f09f7e748ba3bd7db81cc76af03526
 SHA512 
dfb551b87530b0509293e87cd70d2d91f1c669c62adc6c7f34395ffdd5fbfc19bbfe943f84c188653a71bd627bea95f5f9391f4edbf0e269a8da98e191477fe2
 DIST linux-gentoo-patches-6.15.5.tar.xz 83692 BLAKE2B 
0b0831734f25b00a3523592439625342d12b0361b56e4d8243f94c045a27eeedbc02086032f01240d26807721d55d8a4011513b5610d1bf4889e35b7ac171afb
 SHA512 
876750fbfb36f75ddb69026563a2d43310e116c567491a5428da30383a38d9384b97455c7ea61a1faa949b44dd22f402262c63a3701568ef3f8ab2d5f67f6c0f
 DIST linux-gentoo-patches-6.15.8.tar.xz 85336 BLAKE2B 
04e7f012c9375fac93fdbfd97a7450ed9022110c56eff2b9b76a856d83c2dab97da983c4c577c7df3f06ec889771f772f281d0ae837b3e07dee30fec79dad110
 SHA512 
cc51a68444a20c4f106fc16d6f6327d40372faf77fad8e76936a50f97102736166efffc107a405cfe8124b61dbf1370095b811d0172af9003d6e6eaca4effa64
+DIST linux-gentoo-patches-6.15.9-r1.tar.xz 87392 BLAKE2B 
68051079724733a470bba024c4d0581ba88bed0f9e92bf95c4e3b74160787654f54960cff05d0a61f0e88f5ad8d23dc1d87df1eaf174e6b9ef4ec0919f2335ec
 SHA512 
3be9b5e9a84a211611bd55119d95758631d497b6e0a30e2e0749a7592e90c63a1e1eb56f187aafba3af52f2ad06aadd0842df28ead937a44e139f84bd2df27b1
 DIST linux-gentoo-patches-6.6.100.tar.xz 42828 BLAKE2B 
e9d17c21e5355919e30e1a93178d3977d6ca1bf964ba18b601518616f31e098d65cb5008003fb6c8e1a8a5cc3ed803eaef3e1c9af5f1a895d230f172412b1283
 SHA512 
95c2790a5ebcca9f2b9e1ff098be0bcb9ef60f134a0f955995f27c020cff0d6831fc1af7c159b0bb918d3e3eba351f9428458d6e6964e9e751bd85afd47f7a2b
 DIST linux-gentoo-patches-6.6.96.tar.xz 41508 BLAKE2B 
fd1a612b4376ffc7b916dba5c1f7b7d54a2f7724e96b44fbb1be929ff09868414b2462a37dd57f06960eba3c981088880ce350b1d5a1def225482bbb4f1e6971
 SHA512 
913ea1723e814930a7f78bf46cfc7d677a4f574f3e1a17b2a2af4075e86ce3d88de59cc1884dd2e8b49975dd293ea190545040b9b1f430bd74d37b88e58b9a21
 DIST patch-5.10.240.xz 6786568 BLAKE2B 
1cb287b2c99bb403585cad3500a2de0819db40ea62a72d276c2b53d8637915cfc0350051bfdfc99cbb56a4e839331b7e11cbb2abdf6768a683d44e798ee5862d
 SHA512 
91f059de27701a33e5c4d40f2d3e982dc60d9dc14fa8cb6a0bbd49e4452195715f0093a563e3a1db1efa37b3a1e09e74b0a6d53f77357757ffd29374abcead19

diff --git a/sys-kernel/gentoo-kernel/gentoo-kernel-6.15.9-r1.ebuild 
b/sys-kernel/gentoo-kernel/gentoo-kernel-6.15.9-r1.ebuild
new file mode 100644
index 000000000000..b038a6618370
--- /dev/null
+++ b/sys-kernel/gentoo-kernel/gentoo-kernel-6.15.9-r1.ebuild
@@ -0,0 +1,177 @@
+# 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.15.9-r1
+# https://koji.fedoraproject.org/koji/packageinfo?packageID=8
+# forked to https://github.com/projg2/fedora-kernel-config-for-gentoo
+CONFIG_VER=6.15.8-gentoo
+GENTOO_CONFIG_VER=g16
+SHA256SUM_DATE=20250801
+
+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" )
+
+       kernel-build_merge_configs "${merge_configs[@]}"
+}

Reply via email to