diff --git a/sys-kernel/gentoo-kernel/Manifest b/sys-kernel/gentoo-kernel/Manifest index 8cdccd40e740f..be066fdb15ac3 100644 --- a/sys-kernel/gentoo-kernel/Manifest +++ b/sys-kernel/gentoo-kernel/Manifest @@ -47,6 +47,7 @@ DIST patch-5.15.198.xz 7460868 BLAKE2B 82b3476876e7c2126f1a1eef007a4ee6dd07f9fe4 DIST patch-5.15.199.xz 7501352 BLAKE2B 55252fc9fca78b8d36fb9a4dce1db747099a7fb5614a840bba3a7658a5df8c28e41e53c931aaedc94f7583df5cbd43e8cf559d33226d5fb9bd9889a92716cd35 SHA512 97e34579223888f2d2b9dc4520a86b65f690f45f5e03a769493b59966a865f03c8e09839d3def1e0fc9f4121c8446aec62bada96617c4e19e3654263bc5a7f76 DIST patch-6.1.161.xz 7001008 BLAKE2B 0834839f836fe47295f7a81aef9d05d77a8b1ef6dfb0a0c25ba94e32ded0cda8796a1c8594e7e91ea26d92e93f5f5d6cb5bf73b625bcca70bd1192526012f0d8 SHA512 ae33b1b18dfbe9c32cce7315cc649f436c2df8118c0cdc401a31dbc870de7547cf733d4adf698e5a597522fb28a891ab624d995286a296aebe417d3e06a79ff3 DIST patch-6.1.162.xz 7050196 BLAKE2B f27f1c103427be49c17bc308eb09b99bbb22e469f1be371ba2ef5ce4f1155a76602822dac6fc6bad231894360fc944e4eaf8bd6dca7ab43222f06bcc41957d35 SHA512 5dfcb8d60784966e1cb0ff8c2cdaec30c6c7bf568f0936cb2e7293a737a9d3c93281fc49efdce836997a8d8165a3cfa16762a9352f649edbef1fe39665820868 +DIST patch-6.1.163.xz 7059880 BLAKE2B 99f4dc3da7a9a4d088f51cbb577b63dc2a78c9e26f0e3ea5240fb964c97740682a25e401bbb25f135398d75f715fa69a898eba0e595cf550fab3a8496944c892 SHA512 c0385678d1a1bc8c13113cca5cc23f4051c4d7f86f2b00d6b15fde0bf6dcf5bfb6461091bbdac3b3b3732e21e06062647b29125fc03b3fd718c971d91a67c381 DIST patch-6.12.68.xz 3814500 BLAKE2B cc4f7cfac038b6d1015f929c8ffe1949bdf21da073adb40d65f39f6a3501c3f295ebb3d5727cb24a847dae6741531d7eafcdf8b478b5f4cfc9bebcd7e6e5875e SHA512 3963254af3e07d3bca03999ab39d8e18732b76b5972a125f024b82c44f6df63af5474e7b4507553fca5652cf865b9c7ac8d44224f91b704105bc67b65fdafa3f DIST patch-6.12.69.xz 3832080 BLAKE2B f70cbf90f1a96e1b0384990bb238f6d433a6fe4e72f5520703adfcd83900b558bf214301cdf8c4332bb5398136606dc3ce5cb7861f3b9d0ed89f40edfcf5e4f3 SHA512 9c59a3223256782acfc0a1772f33451572e77ecc769e9b785ff777a6748ee9f649361502ade3a9d86a9fa9ab48a62df8622415096d5f1c9b03cc5dc9db64057b DIST patch-6.12.70.xz 3851836 BLAKE2B e271ff2ca48b4d7b339a66c3aaa0a47bb5311af45aa4a69adeabeec45377382290e9c9693444a36ae05bd63ebc5fedfe6e05130ad6aac1be972e1122b0e40d59 SHA512 66c8713ec2f637e0de4b357626d976dc6a1a55471d5c58818377a8913376ebb13ec6331a9fb5fb0c6905fd22a26ad972a4a6c824ef5dec2947eb5ab5dbd7d17b diff --git a/sys-kernel/gentoo-kernel/gentoo-kernel-6.1.163.ebuild b/sys-kernel/gentoo-kernel/gentoo-kernel-6.1.163.ebuild new file mode 100644 index 0000000000000..533a4df675898 --- /dev/null +++ b/sys-kernel/gentoo-kernel/gentoo-kernel-6.1.163.ebuild @@ -0,0 +1,172 @@ +# Copyright 2020-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit kernel-build toolchain-funcs verify-sig + +BASE_P=linux-${PV%.*} +PATCH_PV=${PV%_p*} +PATCHSET=linux-gentoo-patches-6.1.161 +# https://koji.fedoraproject.org/koji/packageinfo?packageID=8 +# forked to https://github.com/projg2/fedora-kernel-config-for-gentoo +CONFIG_VER=6.1.102-gentoo +GENTOO_CONFIG_VER=g17 +SHA256SUM_DATE=20260211 + +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} + ) + 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 ) + 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 "${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 | 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}/${BASE_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[@]}" +}