diff --git a/sys-kernel/gentoo-kernel-bin/Manifest b/sys-kernel/gentoo-kernel-bin/Manifest index 9bce055228283..1b3f1ef2af407 100644 --- a/sys-kernel/gentoo-kernel-bin/Manifest +++ b/sys-kernel/gentoo-kernel-bin/Manifest @@ -30,6 +30,10 @@ DIST gentoo-kernel-6.12.90_p1-1.amd64.gpkg.tar 325826560 BLAKE2B b57a895bba4e3c3 DIST gentoo-kernel-6.12.90_p1-1.arm64.gpkg.tar 295301120 BLAKE2B 82f94092af10e02fe0785d284e1614cf7601c5d9a79be92005c0dafd26a563262be2c5938ee4fea6833105d244c114a20aea0f53bcd1a93f461923771c0fc870 SHA512 babeb4c9e61882e3c041415cd622e35697339f229dc08d91ce09682f68a1b9bcf0005b5475afbfbd6104d68345ab6255ddc060d7f1e155eb22f29183327e9f26 DIST gentoo-kernel-6.12.90_p1-1.ppc64le.gpkg.tar 73922560 BLAKE2B 865218c7af947594f285d325ae65e19e2df027c464a68435895125eb283637b4fac256e9fd1709c0cba4b20dbf653065f819e003dc54eeb059ae75db3d2a2d4b SHA512 5d6ff22dc6271dbb4e8d83d2e973304e6430d496e3564f397c1f42c4a26027c6db0efa4c64c453c406297a21d40a2e6bcba3e886e21d79106935d9a937b7567f DIST gentoo-kernel-6.12.90_p1-1.x86.gpkg.tar 77711360 BLAKE2B 364e62aad3d2d855bc35b6cb3b76c58e291c202d81b964997bdb6e64bf94af1fba08066082902c121846bfc677d3605d80a707628f44f20f5b6a930db2ba2858 SHA512 1105cdc6605d2fc7251eedf45f7ab062d8198c8ffd980c11638f4d3124de2f8b0d5a0bb10ee83527671d91c2ace52605be3943928373448e252c0519752c9552 +DIST gentoo-kernel-6.12.90_p2-1.amd64.gpkg.tar 325744640 BLAKE2B 088338205c343df3970f0b8c45e9731df48332e661d94393feb309f21723307aa8105a73b8169d422fb0b68788ed0ee9b436176f62df0eac729cddd07dcbb82c SHA512 537eefe58d77eea6caf45922df5a34e400d9e7abbf444255aeedcfc3ed104d33da80e5b730760ea860cc4d3df189f6e95f243cf85b791eb127eeee0a69e9ae49 +DIST gentoo-kernel-6.12.90_p2-1.arm64.gpkg.tar 295301120 BLAKE2B 519b075a29f92c76bac3b8d2b12b3b095677d6b72a891ceef717983758c8b2af9aca51750ddf087e2ab65289c06243439958df118f695bd94e1e99916ca64b09 SHA512 3473c706884e56cdefcaff6471e9f8e5bb0ff85298a4c4a54741bebd8ea58b0a768c78a23bf7d313176462bac49f8925e9f85caf9389bbba431ba53f2ec4a2b5 +DIST gentoo-kernel-6.12.90_p2-1.ppc64le.gpkg.tar 73932800 BLAKE2B 3f284dac5938ac38ed71285bf0cfb026eb4e78ccd4c5461bce93b733ce9a2f6b1d7d3043c6ab9b6aac0230ebd210fa9bd075996f08a50616ab9f419e0253ffbb SHA512 d4168f8f4499da2c5a36a7981f9ac5697f1666cf4479ce441a4649d325be8f75ba4b042e91877260034368dd9d4f0a5a466f2a0f9159749c34a51566c3093dfa +DIST gentoo-kernel-6.12.90_p2-1.x86.gpkg.tar 77701120 BLAKE2B 3b82f24c342604ee79e6fff5fb6c6576bbf38bc23f40a3ec82499b29c53285353be57cf2a625c0c34cc65e62006f4c9985617d7e1ba90949bf269f62bfbc9c43 SHA512 b39aef816b41842456008fc22e2520872106ba0c8103a60146881b96cac49d4b88190625ee80a70fca27f715f7a640a5e48fd94a8d4fc52a60b8c0db98f7123b DIST gentoo-kernel-6.18.32-1.amd64.gpkg.tar 465172480 BLAKE2B dafbbb4dcd2a3e9519190fdce1cc682a4e2054e8c84d3063a28e985c8645ee8fc8a6063c210f6c0e9ca58f627a81a92a9f69d22c2543e7da964b0c82217fddc9 SHA512 063884a15c756ba62759a28b78bfd11ca2245dd24d6ba179b30d2412921269d7cdcf72d727eb8d38e77412b9bcf9c6bb9f3dd144784a8c6f78298f7006bc8e2b DIST gentoo-kernel-6.18.32-1.arm64.gpkg.tar 451328000 BLAKE2B c462b135893f25a7b930b8c6ec561a3cc6d8b94e56e1cb4be29ddf855c9dfb8f5508af697089d11a539eb74670944a099e94c7a0ac8ebf03cb829f6aa3e3279f SHA512 2e95bd465a7e49f6144cd7168a189ace8b59289441f1b54dbf9afc1e71d2f752956a2620a6d8a148ef9476880d72d4b94c37fee4f7c36a9b1935f201ee800586 DIST gentoo-kernel-6.18.32-1.ppc64le.gpkg.tar 77199360 BLAKE2B c0c51ae0e7369f14e2c86922dbf0f4803f8ac3a3e4bf979459623a36b64ad49454d2bee9747b07abe2c2b116c932096e00c01b959b9536e6354b9edad831b731 SHA512 5274eda7686cece522f5c0706b3dbcbf2fa3631bcfa71ee5f7f2e27afd4b7e8d3b0d1b4be4db114cc050e3449f3952678249154dfad27c24570496233171ff13 @@ -81,6 +85,7 @@ DIST linux-gentoo-patches-6.1.173_p1.tar.xz 15408 BLAKE2B 70968590dbbb208ddd5d8a DIST linux-gentoo-patches-6.1.173_p2.tar.xz 15924 BLAKE2B b8e9f6387f7010d7c019e31a3cac79b9466b885cc6651343fe7fa1a45e1e6b96ac88b88500d9f7268e5e87bf6db41ac89beadbc154eda7d8234c85380a001a38 SHA512 64c5c105b7ff2cfb0e8759639df194656679124f4e77e14e1cf0d4691c9e7da062ad7f6c0c52f12341aea372a590484235c617d5de7f8d6ee8f633770ab7a214 DIST linux-gentoo-patches-6.12.90.tar.xz 18204 BLAKE2B b91f9743c88e90e56d269ffcea0e0d53db8b3651f5e15b28b5974cd1a5f3eb98c0de9911c031b46dcd701fb5e31783515fb291301ec7562d5f5d983e69a99e89 SHA512 92c61c8ff31c92d226a52c2bdcf679c9051bafb7d81bd76439f019de5de67d0ce33d32967590db69f65f1af971371050742875d48cd287dbfe0ba905cef19849 DIST linux-gentoo-patches-6.12.90_p1.tar.xz 18720 BLAKE2B 1ca483cf0b85332b8575eb40f9ecf88d11133daf8726f2068b8eb44b1f918fe4ab85690cc24c80eeddf20c10bb1a277e5f39cc2fbda8853f95fde8b6cdb188dd SHA512 a98f4c1a121c90194d70b9b1f0d91eddf66df5dbe1b3ca62cade3e4c7c49ab751ef2fb8aa1f8d9fa4d8c06e1df4b26a6e19cc21efe7df2b96348ec54d8bc8851 +DIST linux-gentoo-patches-6.12.90_p2.tar.xz 19432 BLAKE2B 328cef271bfef36e14d3c75dfb73f3a2505ac0f89c802f8b2d1061c28b328cfed6bb0115d0ae93aee64c8d9a42468bbcf9ceb83a38730a63affc1bc7250e62a4 SHA512 f4f2045800c9f715dccfc6560bc712d2ebaaa44218f0ccb15cbf6592a23eb28e39fa15dbfd7d4b65edf58cc7441c48df5e6f45410825cdc08d96d954c6b5edaa DIST linux-gentoo-patches-6.18.32.tar.xz 16576 BLAKE2B c94123ab9883ed793c2d45766739604a0d8b857731363d6dde516f07817d5fd583a4469e15049dea92693eae79bd81747bf4c3ceb106377773f13ef7759154c6 SHA512 b1001893b5b959d3d4f9309c952e7e1e33d8bb41be9c9947ce9beb75bb3bf70b1621e905d1feb1aafcab8bfe2da29cee194e82f600e0823768be9f475f4a1509 DIST linux-gentoo-patches-6.18.32_p1.tar.xz 17068 BLAKE2B 2cb0900914534d562af46561fdc71018e0d942d43488d7381b42ce1888388b4b83ae258164a59e7aaf7e8bb0d1d81b5eb37925a8d792de66e09c64c902faf5b2 SHA512 e0ea659b9d8367f4a5b134b4bb238380312ce2b65f09b16495a2f28f780cda6cf039dd2f9b723dc2a06bd283ff54b2ccdc989b419508643309af2484f37d5713 DIST linux-gentoo-patches-6.18.32_p2.tar.xz 17812 BLAKE2B 25a112f8c7ee832e5937dd3a7390185f8fcb8a6bd3e605526fbb66e637a65cb0837484d9cd34de9b02a62a71851d250659099e1bf0dad3b7099ebd68eac2708c SHA512 6d4df9cf78018169a65d03433d510f871d0abc513d44d0bd7e756d97cbca773ac87cc1ebf5f8457ece28a9169fdcc2350bfe60d6e62083389ca6aae303bb67cb diff --git a/sys-kernel/gentoo-kernel-bin/gentoo-kernel-bin-6.12.90_p2.ebuild b/sys-kernel/gentoo-kernel-bin/gentoo-kernel-bin-6.12.90_p2.ebuild new file mode 100644 index 0000000000000..a732ce757fb10 --- /dev/null +++ b/sys-kernel/gentoo-kernel-bin/gentoo-kernel-bin-6.12.90_p2.ebuild @@ -0,0 +1,233 @@ +# Copyright 2020-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +KERNEL_IUSE_GENERIC_UKI=1 + +inherit kernel-install toolchain-funcs unpacker verify-sig + +BASE_P=linux-${PV%.*} +PATCH_PV=${PV%_p*} +PATCHSET=linux-gentoo-patches-${PV} +BINPKG=${P/-bin}-1 +SHA256SUM_DATE=20260517 + +DESCRIPTION="Pre-built Linux kernel 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://distfiles.gentoo.org/pub/proj/dist-kernel/patchsets/$(ver_cut 1-2)/${PATCHSET}.tar.xz + 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://distfiles.gentoo.org/pub/proj/dist-kernel/binpkg/amd64/$(ver_cut 1-2)/${BINPKG}.amd64.gpkg.tar + ) + arm64? ( + https://distfiles.gentoo.org/pub/proj/dist-kernel/binpkg/arm64/$(ver_cut 1-2)/${BINPKG}.arm64.gpkg.tar + ) + ppc64? ( + https://distfiles.gentoo.org/pub/proj/dist-kernel/binpkg/ppc64le/$(ver_cut 1-2)/${BINPKG}.ppc64le.gpkg.tar + ) + x86? ( + https://distfiles.gentoo.org/pub/proj/dist-kernel/binpkg/x86/$(ver_cut 1-2)/${BINPKG}.x86.gpkg.tar + ) +" +S=${WORKDIR} + +KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86" +IUSE="debug" + +RDEPEND=" + !sys-kernel/gentoo-kernel:${SLOT} +" +PDEPEND=" + >=virtual/dist-kernel-${PV} +" +BDEPEND=" + app-alternatives/bc + app-alternatives/lex + dev-util/pahole + virtual/libelf + app-alternatives/yacc + amd64? ( app-crypt/sbsigntools ) + arm64? ( app-crypt/sbsigntools ) + verify-sig? ( >=sec-keys/openpgp-keys-kernel-20250702 ) +" + +KV_LOCALVERSION='-gentoo-dist' +KV_FULL=${PV/_p/-p}${KV_LOCALVERSION} + +QA_PREBUILT='*' + +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 + + unpacker +} + +src_prepare() { + local patch + cd "${BASE_P}" || die + eapply "${WORKDIR}/patch-${PATCH_PV}" + for patch in "${WORKDIR}/${PATCHSET}"/*.patch; do + eapply "${patch}" + # non-experimental patches always finish with Gentoo Kconfig + # we built -bins without them + if [[ ${patch} == *Add-Gentoo-Linux-support-config-settings* ]] + then + break + fi + done + + default + + # add Gentoo patchset version + local extraversion=${PV#${PATCH_PV}} + sed -i -e "s:^\(EXTRAVERSION =\).*:\1 ${extraversion/_/-}:" Makefile || die +} + +src_configure() { + # force ld.bfd if we can find it easily + local HOSTLD="$(tc-getBUILD_LD)" + if type -P "${HOSTLD}.bfd" &>/dev/null; then + HOSTLD+=.bfd + fi + local LD="$(tc-getLD)" + if type -P "${LD}.bfd" &>/dev/null; then + LD+=.bfd + fi + tc-export_build_env + local makeargs=( + V=1 + WERROR=0 + + HOSTCC="$(tc-getBUILD_CC)" + HOSTCXX="$(tc-getBUILD_CXX)" + HOSTLD="${HOSTLD}" + HOSTAR="$(tc-getBUILD_AR)" + HOSTCFLAGS="${BUILD_CFLAGS}" + HOSTLDFLAGS="${BUILD_LDFLAGS}" + + CROSS_COMPILE=${CHOST}- + AS="$(tc-getAS)" + CC="$(tc-getCC)" + LD="${LD}" + AR="$(tc-getAR)" + NM="$(tc-getNM)" + STRIP="$(tc-getSTRIP)" + OBJCOPY="$(tc-getOBJCOPY)" + OBJDUMP="$(tc-getOBJDUMP)" + READELF="$(tc-getREADELF)" + + # we need to pass it to override colliding Gentoo envvar + ARCH="$(tc-arch-kernel)" + + O="${WORKDIR}"/modprep + ) + + local kernel_dir="${BINPKG}/image/usr/src/linux-${KV_FULL}" + + # If this is set it will have an effect on the name of the output + # image. Set this variable to track this setting. + if grep -q "CONFIG_EFI_ZBOOT=y" "${kernel_dir}/.config"; then + KERNEL_EFI_ZBOOT=1 + elif use arm64 && use generic-uki; then + die "USE=generic-uki requires a CONFIG_EFI_ZBOOT enabled build" + fi + + local image="${kernel_dir}/$(dist-kernel_get_image_path)" + local uki="${image%/*}/uki.efi" + + # Override user variable with the cert used during build + openssl x509 \ + -inform DER -in "${kernel_dir}/certs/signing_key.x509" \ + -outform PEM -out "${T}/cert.pem" || + die "Failed to convert pcrpkey to PEM format" + export SECUREBOOT_SIGN_CERT=${T}/cert.pem + + if [[ -s ${uki} ]]; then + # We need to extract the plain image for the test phase + # and USE=-generic-uki. + kernel-install_extract_from_uki linux "${uki}" "${image}" + fi + + mkdir modprep || die + cp "${kernel_dir}/.config" modprep/ || die + emake -C "${BASE_P}" "${makeargs[@]}" modules_prepare +} + +src_test() { + local kernel_dir="${BINPKG}/image/usr/src/linux-${KV_FULL}" + kernel-install_test "${KV_FULL}" \ + "${WORKDIR}/${kernel_dir}/$(dist-kernel_get_image_path)" \ + "${BINPKG}/image/lib/modules/${KV_FULL}" \ + "${WORKDIR}/${kernel_dir}/.config" +} + +src_install() { + local rel_kernel_dir=/usr/src/linux-${KV_FULL} + local kernel_dir="${BINPKG}/image${rel_kernel_dir}" + local image="${kernel_dir}/$(dist-kernel_get_image_path)" + local uki="${image%/*}/uki.efi" + if [[ -s ${uki} ]]; then + # Keep the kernel image type we don't want out of install tree + # Replace back with placeholder + if use generic-uki; then + > "${image}" || die + else + > "${uki}" || die + fi + fi + + # Overwrite the identifier in the prebuilt package + echo "${CATEGORY}/${PF}:${SLOT}" > "${kernel_dir}/dist-kernel" || die + + mv "${BINPKG}"/image/{lib,usr} "${ED}"/ || die + + # FIXME: requires proper mount-boot + if [[ -d ${BINPKG}/image/boot/dtbs ]]; then + mv "${BINPKG}"/image/boot "${ED}"/ || die + fi + + # strip out-of-source build stuffs from modprep + # and then copy built files + find modprep -type f '(' \ + -name Makefile -o \ + -name '*.[ao]' -o \ + '(' -name '.*' -a -not -name '.config' ')' \ + ')' -delete || die + rm modprep/source || die + cp -p -R modprep/. "${ED}${rel_kernel_dir}"/ || die + + # Update timestamps on all modules to ensure cleanup works correctly + # when switching USE=modules-compress. + find "${ED}/lib" -name '*.ko' -exec touch {} + || die + + # Modules were already stripped before signing + dostrip -x /lib/modules + kernel-install_compress_modules + + # Mirror the logic from kernel-build_src_install, for architectures + # where USE=debug is used. + if use ppc64; then + dostrip -x "${rel_kernel_dir}/$(dist-kernel_get_image_path)" + elif use debug && { use amd64 || use arm64; }; then + dostrip -x "${rel_kernel_dir}/vmlinux" + dostrip -x "${rel_kernel_dir}/vmlinux.ctfa" + fi +}