summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys-kernel/gentoo-kernel/Manifest1
-rw-r--r--sys-kernel/gentoo-kernel/gentoo-kernel-6.12.57.ebuild185
2 files changed, 186 insertions, 0 deletions
diff --git a/sys-kernel/gentoo-kernel/Manifest b/sys-kernel/gentoo-kernel/Manifest
index aad26550b05a..9963ce5feea7 100644
--- a/sys-kernel/gentoo-kernel/Manifest
+++ b/sys-kernel/gentoo-kernel/Manifest
@@ -60,6 +60,7 @@ DIST patch-6.12.47.xz 2896968 BLAKE2B 4064af2ae029d13d63a0a6cfb9e4121266ab33622c
DIST patch-6.12.54.xz 3096864 BLAKE2B f5bff8166a5a45535092614ef9ed1d9e39064fd2762f0d71e852a87437326892c9d25a095ad51eb3b7fdfe266ba5f16d271303b98c4c1c6ed1716cfa09b669bb SHA512 744143218b5258a67f4b00126c72d7630b6e563dd0cc0a9cf685bc38cb48dc217d717053117e72a52fba061b2171a99ef64d992288f75500f069c617d1663b5b
DIST patch-6.12.55.xz 3132512 BLAKE2B b78f35653171cb91d00f115cfb7a9d5e1b1eb43e77f342b06e7eed3425e620975addcc35608b64eee11d08f0b0599850520ce92fc8170dad3742fd65a2d529b4 SHA512 c81f4e2afc3bb1e5c279147c26ad91bbc045b34bb557f0f2ccaa05d59991320e936a7fd71237ea177e246062280496d72e3e6a006b87e8d67aaaa6c8dfce4608
DIST patch-6.12.56.xz 3156620 BLAKE2B dec99addb9b6a695bfb77f38dda3d1fb6cfbf2854c41431dbe774992c7de20128238073a40d83cd6532bdc138c4b195f7e896dc034d478733951b90ce2398c8f SHA512 d52ed60eb1a7f4072017f6fda5a70b8566dd9db2d79ad6bdf0c18a404de08b218f1ff30c227a20caae0ce0ef82210059e8f15f6267d93be50f3f8e1652a9fb1c
+DIST patch-6.12.57.xz 3166572 BLAKE2B d3de49aef49104485236672f0d932a790f81f43d10d3178c4d22dbdc42f2f0bf5e58f74455b1a2f96ff4edb28a68ade510400025eb5da0e3e9d0d0fedb1c0f3e SHA512 32c056e4bdc5ccdaa6d74517f841b5e051197337a3c22a9e1324a7c5ab23ccfa1842403ad4887a31a6a68beee73a5800c92c7fb043a22d49ddc316d6ad909ea5
DIST patch-6.17.4.xz 315840 BLAKE2B 4121f8cc485a71878335d1b186c39271b83bca4e176566ee63e60a26eedd74e68e5d238492c7bb462c4139fade13bff105c46a1d12411cb4fa0972c9eb9cb3d9 SHA512 c81d328581330b10d1b6b99e3bc1386a20c0661905d953a294bf0e68e8f7ccec698ba2286e2c868c8c0ed4e2f42fb8432a988080cc3cdeb57de36630b576400f
DIST patch-6.17.5.xz 374980 BLAKE2B d1a8f1ab63801a8ca421981cce57aae2b5da5864336821fe8bbb5131a40b16c100d4fa3d3dd2d5c4ce28bb6e3dd9c6b4b5a642d81f2303dbe12739ce4b7f3c68 SHA512 decf5a01bb3ea68e62257233225e3648d140690ac471cbac9048386aa0ebe7f7362c34cfce1d8fb615c2b37368893d33346da6ea0376feab8b7f3d3187288c83
DIST patch-6.17.6.xz 425004 BLAKE2B 1ebe67d9ebed5fae42b26a6603560e100c6016a6fef85d8b50e5e7ab2467a569c99d5d79ecd4ee261046d342117dd523b28ffb5815ca8f60d5c83cac9a29b3e5 SHA512 1903795778b5a8e8ee017ae4dce5ad1309a975c13151d8ff637c8f74bed64401397ed71df431731fdce54541b4b6919de64e7aad44759ac7b2e596f88d56a05a
diff --git a/sys-kernel/gentoo-kernel/gentoo-kernel-6.12.57.ebuild b/sys-kernel/gentoo-kernel/gentoo-kernel-6.12.57.ebuild
new file mode 100644
index 000000000000..04414eb6b676
--- /dev/null
+++ b/sys-kernel/gentoo-kernel/gentoo-kernel-6.12.57.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.12.52
+# 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=20251102
+
+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-${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[@]}"
+}