summaryrefslogtreecommitdiff
path: root/sys-kernel
diff options
context:
space:
mode:
Diffstat (limited to 'sys-kernel')
-rw-r--r--sys-kernel/Manifest.gzbin4415 -> 4411 bytes
-rw-r--r--sys-kernel/gentoo-kernel-bin/Manifest10
-rw-r--r--sys-kernel/gentoo-kernel-bin/gentoo-kernel-bin-6.1.53-r1.ebuild127
-rw-r--r--sys-kernel/gentoo-kernel-bin/gentoo-kernel-bin-6.5.3-r1.ebuild132
-rw-r--r--sys-kernel/gentoo-kernel/Manifest6
-rw-r--r--sys-kernel/gentoo-kernel/gentoo-kernel-6.1.53-r1.ebuild146
-rw-r--r--sys-kernel/gentoo-kernel/gentoo-kernel-6.5.3-r1.ebuild147
7 files changed, 568 insertions, 0 deletions
diff --git a/sys-kernel/Manifest.gz b/sys-kernel/Manifest.gz
index ac945c39cd8d..348f9e14845e 100644
--- a/sys-kernel/Manifest.gz
+++ b/sys-kernel/Manifest.gz
Binary files differ
diff --git a/sys-kernel/gentoo-kernel-bin/Manifest b/sys-kernel/gentoo-kernel-bin/Manifest
index 1868bb92c974..8d8525259c15 100644
--- a/sys-kernel/gentoo-kernel-bin/Manifest
+++ b/sys-kernel/gentoo-kernel-bin/Manifest
@@ -44,6 +44,10 @@ DIST gentoo-kernel-6.1.53-1.amd64.gpkg.tar 72509440 BLAKE2B 1cd4c14f7f52f8a8bf0f
DIST gentoo-kernel-6.1.53-1.arm64.gpkg.tar 65218560 BLAKE2B 576f4e81241184842d38e1fecc17635a7fcb8657a7ab1b96f629d92ae5231bdeca08c4cedade4d75c07a915d3584ba2f494b4cb92a0d0450e74d0f5bc6b555eb SHA512 07bdac4e29a292631b560d409f0eaf256a9d51d90293051d81b368be13d02ca264e23135fff8e51dd932720fab7d71f66418279ea237f541792e52bc4d5792e3
DIST gentoo-kernel-6.1.53-1.ppc64le.gpkg.tar 59811840 BLAKE2B cee9232bdae834b254321018b485b61b3083cdd01bcdaada32162f8513af67596534efd653fe0352fcbd093d0532f7c74b28ede6993bc22e4544676306dd8dd5 SHA512 0ebc131f6a0e6ef882f584faa1d2c963ba8c3d461326719617bcb97488bd0de8d45453c530e8b41ed4f2b6fb29f6bf29893350f09cd9dfbeaf7d5dc9a101eb95
DIST gentoo-kernel-6.1.53-1.x86.gpkg.tar 61972480 BLAKE2B e87669b4450e1955ef82b781eb4880be2dbaf7b33b9fc90ac04878a7a57c80bd75f7e8388517937dda2e651eb9c83115cac21cefd055739736dd09a23e135712 SHA512 71f36656fc836794b51e2a6be746272f408456e3d26a19aa28b12c5eedeb2344bc3e99f8d6fc19e63b0e1f36725d63fb90b2388b9eee3d7555ef93e9fbf37f64
+DIST gentoo-kernel-6.1.53-r1-1.amd64.gpkg.tar 72478720 BLAKE2B 9bce87f82539a8f6dd68f3bfe17ca7fce0f34353fa55fc3bd21324c15545d7843a627e690a3354b2ef780165cca01ea4c22bd8782a5baf3f2602cc8a8a7bf1d8 SHA512 dfcc892437c33fbced96946ccd02131995cdb07b13a00cfeefd469b9f9eff5673e41f713b4399a0aa3aa291fe479051a4f706e4c01993eaf1b8ac4f4b60382ce
+DIST gentoo-kernel-6.1.53-r1-1.arm64.gpkg.tar 65208320 BLAKE2B 4148c417ce291133c6b7fcca376f9db7d9f8a5254ef263146b15b29fb12a93af38a6082e6c49c50c09e831587003cdb459e645e759d3f6e095cccaf93c76994d SHA512 da6fb9218c69f4da49bc1de22a47943460bbd4630c75b0e3b75952e7991c545db96f1ff753b969d85997d2152f910401086f0a68926ea0814eeb979da912b4d1
+DIST gentoo-kernel-6.1.53-r1-1.ppc64le.gpkg.tar 59822080 BLAKE2B 657c66102de78813e80599101c63a19b75a113ab581c5af1c284f205ffbcee5257b55ddcdb7fa2dbf491dcf7619c3f23678a9cbd787b4e375e7b15991782657c SHA512 756f30a9cbea8864443e38096804491cbe113a7f8f781b82ff4229392b34befa7eb0985036d02092994041a2eccbd69a9101e04051f0f4f9f5c1dd3ef948673d
+DIST gentoo-kernel-6.1.53-r1-1.x86.gpkg.tar 61962240 BLAKE2B 1809d9cd755a88ed2513658f02c033d6a7ed7acf821f2e179e1812c9afb1fef3d947e6dfd6fedcf1cabfb77b05820db4d6d888ffc7f45facfb657e9ec614a986 SHA512 68ad5671a6f8d5e9a6e562ba5bfbb1ea2427944bc8dd22fff88bd5b8114271640e9161e6f20fc0c2c6de66ca2db78cf585b9296897490634171898346f71d560
DIST gentoo-kernel-6.4.16-1.amd64.gpkg.tar 81786880 BLAKE2B adbe09acd265ad50d6cc362be262b94b10fcfc517dd5e463007eef455477c1de7b9340ca472a60c28bd7fbcc02f8538c25b036d736e656500bf749a67ba914cb SHA512 cd3c7a1641b500620f3a8770a2994d53161582ac3c5eca72cb64e4e15cbbd40db1d8bf839a5427662574eb8d4124f2c6b2b74dc087e70b6992d2c522939b87a5
DIST gentoo-kernel-6.4.16-1.arm64.gpkg.tar 71290880 BLAKE2B b42a0cf9dc72716eaf9d14137c06d8229e06a4431b50ae269bada18d977c9fad3eef9b7b5181cb8f7b35b88987ab2db17bd85b1742220ebc8d022f50eef066f6 SHA512 789f3bb759b470f4e29735706a73c64df0646c882c6bad3b051dd395faa89ce2c1cafceec34ff28d9c5c4adf6cca4f5eec6b875bf0e398c925431f9086f3e756
DIST gentoo-kernel-6.4.16-1.ppc64le.gpkg.tar 63488000 BLAKE2B e0604a0b4bf8d7aa7a257798148fac11e0c4a072e0a775c57ddfa74681a265a775081b91e64732e45656fa303e817c2afa8f5c281ad2c5ffdc4373674d5917d3 SHA512 4aa5e73de475bd77f5a0e155033945b5770e761433e3cd983fe5efface2b971545439e99d0c048ed3bc21aa825d3eefa4ecf6615bd0099374c50cc0fd9e90243
@@ -52,6 +56,10 @@ DIST gentoo-kernel-6.5.3-1.amd64.gpkg.tar 83578880 BLAKE2B 9413bc88b067e91939378
DIST gentoo-kernel-6.5.3-1.arm64.gpkg.tar 73175040 BLAKE2B c17faa62cb94999d051a5764df7f3e398795dbcd0bfe13b23582a15d2c59188eff00c5d11cd376d9dc1a8c80629746948cfa62c2a337b3a0bb6382482f797ea9 SHA512 4ae0a14d7938ca325680107a094a7d5a58b9139ae28a4916493c5e114c50dbbccaedac3bb1b0012af6ef408ca844fe3c6b7ef52c234eebb92f92b0a1ae44be5e
DIST gentoo-kernel-6.5.3-1.ppc64le.gpkg.tar 64460800 BLAKE2B 65ccb9381be1572710ded7a369eb665dcd2ffc9b1058e7133fff7a9cccb4e2e159eb4eb9e7b437fd883b92acbe9b54390ecbaa4ee40e8aea9bb37f86687046bd SHA512 0696d19cfb48b465621f2c10fd27c44ccfae37d5bd80fd84f37255ad76c8d7475700784d77ca0ffa981feefe4bc82b920bc78557745634e74bec4c5ac6b38f41
DIST gentoo-kernel-6.5.3-1.x86.gpkg.tar 67338240 BLAKE2B 30f4105c3aa0fd516eba549705294030bd5757e4467490c6f6b95b4444ed89b5575768a15bb64a61c17a362a51505243254bcbbc806af18709553407d919dac2 SHA512 9fd0760261c40ae3cb9adf75ff457866c11454f72a79f836779a533640b5fa9d568090505be3cb502a00aaed6581b8c387f05a36b72c00ded83c2299c0340754
+DIST gentoo-kernel-6.5.3-r1-1.amd64.gpkg.tar 83630080 BLAKE2B eb83ecca1f1543f979dcd086bec0430c19d0425af069f118d49016a04f603882ed0702d7115f3a1a6c81b828b19277cfa2c71e982f6f504e51060f44041d9dd4 SHA512 8b38bb83cacd6e2d16041fdadc8f85e8d85dc7b971d65edb390170586f5f62d3da44dc4c8864032fc6aa7840fb138bc6c055066653aefe163a90f1708f4fead5
+DIST gentoo-kernel-6.5.3-r1-1.arm64.gpkg.tar 73175040 BLAKE2B 8647a368d033d41ed560abb49e23d1bd7305df88902c368b86d9b150cd0f25478f60cb20b97046dbbebe034862a290402b24df11aa1f8421ed547c2cdb48771e SHA512 12f825fe466cba5bea9336a01e68b08032d7dc8eb5d098238d295d6a3f54e404227a2ba754525881974cbf9996fedaa14c0e65387522f96ca3e6c8e7d8bb54a8
+DIST gentoo-kernel-6.5.3-r1-1.ppc64le.gpkg.tar 64450560 BLAKE2B 8adf4b4e64a5cd52639ebf3f1cc45579540f2fcf5bec806d620d0751258a490a9e48586fe92ff84fd99d443a51eccfe4ab6525c3acb627786c57475659819c72 SHA512 550514639606a16aa7094799380b93a402eac07f57bd752c5a5e33520089fd26d0ac446ddfe02de2a94e9a31b3188666ea8b8fd0b606c51b15711771f3917f63
+DIST gentoo-kernel-6.5.3-r1-1.x86.gpkg.tar 67317760 BLAKE2B 93dd9163c763a75919d1207335b5a0a4f23630996981c66b43ef4593cb068975107e7e2b7d25e0c31a59a9e92adb663a110f1ba62221e6dda45a8464aa0142d3 SHA512 e4ef0d789bf62d0f837ce826d4acfdefed515450aa3d869c3fe2d052158d322fff3038a9cfb9de3f425e5f254a8ebf623b473df27c24a4c88f5e1690e988c565
DIST linux-5.10.tar.xz 116606704 BLAKE2B b923d7b66309224f42f35f8a5fa219421b0a9362d2adacdadd8d96251f61f7230878ea297a269a7f3b3c56830f0b177e068691e1d7f88501a05653b0a13274d1 SHA512 95bc137d0cf9148da6a9d1f1a878698dc27b40f68e22c597544010a6c591ce1b256f083489d3ff45ff77753289b535135590194d88ef9f007d0ddab3d74de70e
DIST linux-5.15.tar.xz 121913744 BLAKE2B 3921274b23f7938abdf3ed9334534b4581e13d7484303d3a5280eddb038999aaa8b836666a487472d9c4a219af0f06b9fecccaf348fb5510ab8762f4ef4b7e83 SHA512 d25ad40b5bcd6a4c6042fd0fd84e196e7a58024734c3e9a484fd0d5d54a0c1d87db8a3c784eff55e43b6f021709dc685eb0efa18d2aec327e4f88a79f405705a
DIST linux-5.4.tar.xz 109441440 BLAKE2B 193bc4a3147e147d5529956164ec4912fad5d5c6fb07f909ff1056e57235834173194afc686993ccd785c1ff15804de0961b625f3008cca0e27493efc8f27b13 SHA512 9f60f77e8ab972b9438ac648bed17551c8491d6585a5e85f694b2eaa4c623fbc61eb18419b2656b6795eac5deec0edaa04547fc6723fbda52256bd7f3486898f
@@ -64,7 +72,9 @@ EBUILD gentoo-kernel-bin-5.15.127.ebuild 3025 BLAKE2B 95e4eb0f4309e4141a863875ec
EBUILD gentoo-kernel-bin-5.15.131.ebuild 3029 BLAKE2B 7e344f2c9619826058ab1e7437837bb2307480c9b5be1e52638b4d30cd458ed59f7053e896ab8fb7c02965a1df0f10f2d67fda031e2ee8764460134592585a2b SHA512 eb0c10f46c137cf2a98f606b0bd49fbd43920136bde57d445bc2feefd1d1ec57212b651510b9ad6a7ea37cef2d02e004217e136ed10ca23b39c3791162e5d8f6
EBUILD gentoo-kernel-bin-5.4.254.ebuild 3024 BLAKE2B 1a00a8ccac9f12f20c9f3d39572af89a077c3b3dd424133197f35123ee41804588b9763008011c3ee33f269c49eadefcb4d31c01371685845bcfd9fbd189ff78 SHA512 3fb6a4b6ec491d6bb4ad19c37dc18e40565d7d6ee248563c219a43323c263ff1fccb0863727258c56c7bb6f2397cfe968eb974a1282fa3a685a6ed0c3c5247dc
EBUILD gentoo-kernel-bin-5.4.256.ebuild 3028 BLAKE2B 022cdf6c0db736314e0bb413422f2267146a7c22273e2149f9f8e85feff555b01e28ca044e875d82eaf4e7cb139ec530561c0ba6122059f3b0be63cfe6fb99ea SHA512 c465e8d904061fea29ed34e83879ccc2dca6f2469caf78c76b44f1a696d2e21a36826c6b3a87d6b581ee12ccf72bb02bf6cb20624a3108ad595d5a59dc92b880
+EBUILD gentoo-kernel-bin-6.1.53-r1.ebuild 3029 BLAKE2B 7e344f2c9619826058ab1e7437837bb2307480c9b5be1e52638b4d30cd458ed59f7053e896ab8fb7c02965a1df0f10f2d67fda031e2ee8764460134592585a2b SHA512 eb0c10f46c137cf2a98f606b0bd49fbd43920136bde57d445bc2feefd1d1ec57212b651510b9ad6a7ea37cef2d02e004217e136ed10ca23b39c3791162e5d8f6
EBUILD gentoo-kernel-bin-6.1.53.ebuild 3025 BLAKE2B 95e4eb0f4309e4141a863875ec46ea241e6e9e96260bdd3804400e11d32dd2b12bce79c1c66e0abbe6533cc9c9abf0f19eceabe46885b6feeac986287fec0070 SHA512 1f22d7d6843659d872c9ea6bd6eda48f99841e95c12aa723020633cdf30564f43e4aa63e3433f0598930230a03d2c27a1714d2b865a548edfc5725cf9f99176f
EBUILD gentoo-kernel-bin-6.4.16.ebuild 3160 BLAKE2B 56befa90a572da973654c27f61d9303eebf75154eb8f381c87acf65b05ce70264690c36ff6d2896ead4d7aa6a26c5bbd9ff5a65ce32521cdee4910fd640cc276 SHA512 9c61b0fd4305f5ec716a3f1998875bb6268d3402466776e35e3413c2d69e255c9851cf15f0dd2f5d75d2f94208480f601f3b4cbaf09815cf63624432d5fef531
+EBUILD gentoo-kernel-bin-6.5.3-r1.ebuild 3160 BLAKE2B c48be30980fa7329a4e268bd0743a3bbab040af1acec4bee93a6e019ff8d5cd0b2b5c4f375a32ca37b64bc5d98b67b77d0b2a7b709305de1b1479f099a8f8fd2 SHA512 6302df75ebd899875b237cc3a151b25166648524974bebae807272cb2a6a62e1ce4a79720aac42bfb7ccff7bad4ca0157b0a048e0536333358d810b9a6bb7529
EBUILD gentoo-kernel-bin-6.5.3.ebuild 3160 BLAKE2B c48be30980fa7329a4e268bd0743a3bbab040af1acec4bee93a6e019ff8d5cd0b2b5c4f375a32ca37b64bc5d98b67b77d0b2a7b709305de1b1479f099a8f8fd2 SHA512 6302df75ebd899875b237cc3a151b25166648524974bebae807272cb2a6a62e1ce4a79720aac42bfb7ccff7bad4ca0157b0a048e0536333358d810b9a6bb7529
MISC metadata.xml 353 BLAKE2B cd022bd01b289ae703ae6ef6c2539fcfce833206c55e328ba02fc42b360d60f76b1920927b259dbb199724e6d3e7b0f68ba2044680d962d3cd03a973475582ff SHA512 10b10fd24801843108a71ca7d0c27514965b0a15a60da4d9b521fc41493448a1b1685ae3278dbd46cede0d069e51dede402d2c1448c8ae6a7fcfce8acf415bf3
diff --git a/sys-kernel/gentoo-kernel-bin/gentoo-kernel-bin-6.1.53-r1.ebuild b/sys-kernel/gentoo-kernel-bin/gentoo-kernel-bin-6.1.53-r1.ebuild
new file mode 100644
index 000000000000..83c6a5e4fa8f
--- /dev/null
+++ b/sys-kernel/gentoo-kernel-bin/gentoo-kernel-bin-6.1.53-r1.ebuild
@@ -0,0 +1,127 @@
+# Copyright 2020-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit kernel-install toolchain-funcs unpacker
+
+MY_P=linux-${PV%.*}
+GENPATCHES_P=genpatches-${PV%.*}-$(( ${PV##*.} + 6 ))
+BINPKG=${PF/-bin}-1
+
+DESCRIPTION="Pre-built Linux kernel with Gentoo patches"
+HOMEPAGE="https://www.kernel.org/"
+SRC_URI+="
+ https://cdn.kernel.org/pub/linux/kernel/v$(ver_cut 1).x/${MY_P}.tar.xz
+ https://dev.gentoo.org/~mpagano/dist/genpatches/${GENPATCHES_P}.base.tar.xz
+ https://dev.gentoo.org/~mpagano/dist/genpatches/${GENPATCHES_P}.extras.tar.xz
+ amd64? (
+ https://dev.gentoo.org/~mgorny/binpkg/amd64/kernel/sys-kernel/gentoo-kernel/${BINPKG}.gpkg.tar
+ -> ${BINPKG}.amd64.gpkg.tar
+ )
+ arm64? (
+ https://dev.gentoo.org/~mgorny/binpkg/arm64/kernel/sys-kernel/gentoo-kernel/${BINPKG}.gpkg.tar
+ -> ${BINPKG}.arm64.gpkg.tar
+ )
+ ppc64? (
+ https://dev.gentoo.org/~mgorny/binpkg/ppc64le/kernel/sys-kernel/gentoo-kernel/${BINPKG}.gpkg.tar
+ -> ${BINPKG}.ppc64le.gpkg.tar
+ )
+ x86? (
+ https://dev.gentoo.org/~mgorny/binpkg/x86/kernel/sys-kernel/gentoo-kernel/${BINPKG}.gpkg.tar
+ -> ${BINPKG}.x86.gpkg.tar
+ )
+"
+S=${WORKDIR}
+
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
+
+RDEPEND="
+ !sys-kernel/gentoo-kernel:${SLOT}
+"
+PDEPEND="
+ >=virtual/dist-kernel-${PV}
+"
+BDEPEND="
+ sys-devel/bc
+ sys-devel/flex
+ virtual/libelf
+ app-alternatives/yacc
+"
+
+QA_PREBUILT='*'
+
+KV_LOCALVERSION='-gentoo-dist'
+KPV=${PV}${KV_LOCALVERSION}
+
+src_prepare() {
+ local PATCHES=(
+ # meh, genpatches have no directory
+ "${WORKDIR}"/*.patch
+ )
+ cd "${MY_P}" || die
+ default
+}
+
+src_configure() {
+ # force ld.bfd if we can find it easily
+ local LD="$(tc-getLD)"
+ if type -P "${LD}.bfd" &>/dev/null; then
+ LD+=.bfd
+ fi
+
+ tc-export_build_env
+ local makeargs=(
+ V=1
+
+ HOSTCC="$(tc-getBUILD_CC)"
+ HOSTCXX="$(tc-getBUILD_CXX)"
+ HOSTCFLAGS="${BUILD_CFLAGS}"
+ HOSTLDFLAGS="${BUILD_LDFLAGS}"
+
+ CROSS_COMPILE=${CHOST}-
+ AS="$(tc-getAS)"
+ CC="$(tc-getCC)"
+ LD="${LD}"
+ AR="$(tc-getAR)"
+ NM="$(tc-getNM)"
+ STRIP=":"
+ OBJCOPY="$(tc-getOBJCOPY)"
+ OBJDUMP="$(tc-getOBJDUMP)"
+
+ # we need to pass it to override colliding Gentoo envvar
+ ARCH="$(tc-arch-kernel)"
+
+ O="${WORKDIR}"/modprep
+ )
+
+ mkdir modprep || die
+ cp "${BINPKG}/image/usr/src/linux-${KPV}/.config" modprep/ || die
+ emake -C "${MY_P}" "${makeargs[@]}" modules_prepare
+}
+
+src_test() {
+ kernel-install_test "${KPV}" \
+ "${WORKDIR}/${BINPKG}/image/usr/src/linux-${KPV}/$(dist-kernel_get_image_path)" \
+ "${BINPKG}/image/lib/modules/${KPV}"
+}
+
+src_install() {
+ 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}/usr/src/linux-${KPV}"/ || die
+}
diff --git a/sys-kernel/gentoo-kernel-bin/gentoo-kernel-bin-6.5.3-r1.ebuild b/sys-kernel/gentoo-kernel-bin/gentoo-kernel-bin-6.5.3-r1.ebuild
new file mode 100644
index 000000000000..26b296bcb3b6
--- /dev/null
+++ b/sys-kernel/gentoo-kernel-bin/gentoo-kernel-bin-6.5.3-r1.ebuild
@@ -0,0 +1,132 @@
+# Copyright 2020-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+KERNEL_EFI_ZBOOT=1
+KERNEL_IUSE_SECUREBOOT=1
+inherit kernel-install toolchain-funcs unpacker
+
+MY_P=linux-${PV%.*}
+GENPATCHES_P=genpatches-${PV%.*}-$(( ${PV##*.} + 1 ))
+BINPKG=${PF/-bin}-1
+
+DESCRIPTION="Pre-built Linux kernel with Gentoo patches"
+HOMEPAGE="https://www.kernel.org/"
+SRC_URI+="
+ https://cdn.kernel.org/pub/linux/kernel/v$(ver_cut 1).x/${MY_P}.tar.xz
+ https://dev.gentoo.org/~mpagano/dist/genpatches/${GENPATCHES_P}.base.tar.xz
+ https://dev.gentoo.org/~mpagano/dist/genpatches/${GENPATCHES_P}.extras.tar.xz
+ amd64? (
+ https://dev.gentoo.org/~mgorny/binpkg/amd64/kernel/sys-kernel/gentoo-kernel/${BINPKG}.gpkg.tar
+ -> ${BINPKG}.amd64.gpkg.tar
+ )
+ arm64? (
+ https://dev.gentoo.org/~mgorny/binpkg/arm64/kernel/sys-kernel/gentoo-kernel/${BINPKG}.gpkg.tar
+ -> ${BINPKG}.arm64.gpkg.tar
+ )
+ ppc64? (
+ https://dev.gentoo.org/~mgorny/binpkg/ppc64le/kernel/sys-kernel/gentoo-kernel/${BINPKG}.gpkg.tar
+ -> ${BINPKG}.ppc64le.gpkg.tar
+ )
+ x86? (
+ https://dev.gentoo.org/~mgorny/binpkg/x86/kernel/sys-kernel/gentoo-kernel/${BINPKG}.gpkg.tar
+ -> ${BINPKG}.x86.gpkg.tar
+ )
+"
+S=${WORKDIR}
+
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
+
+RDEPEND="
+ !sys-kernel/gentoo-kernel:${SLOT}
+"
+PDEPEND="
+ >=virtual/dist-kernel-${PV}
+"
+BDEPEND="
+ sys-devel/bc
+ sys-devel/flex
+ virtual/libelf
+ app-alternatives/yacc
+"
+
+QA_PREBUILT='*'
+
+KV_LOCALVERSION='-gentoo-dist'
+KPV=${PV}${KV_LOCALVERSION}
+
+src_prepare() {
+ local PATCHES=(
+ # meh, genpatches have no directory
+ "${WORKDIR}"/*.patch
+ )
+ cd "${MY_P}" || die
+ default
+}
+
+src_configure() {
+ # force ld.bfd if we can find it easily
+ local LD="$(tc-getLD)"
+ if type -P "${LD}.bfd" &>/dev/null; then
+ LD+=.bfd
+ fi
+
+ tc-export_build_env
+ local makeargs=(
+ V=1
+
+ HOSTCC="$(tc-getBUILD_CC)"
+ HOSTCXX="$(tc-getBUILD_CXX)"
+ 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)"
+
+ # we need to pass it to override colliding Gentoo envvar
+ ARCH="$(tc-arch-kernel)"
+
+ O="${WORKDIR}"/modprep
+ )
+
+ mkdir modprep || die
+ cp "${BINPKG}/image/usr/src/linux-${KPV}/.config" modprep/ || die
+ emake -C "${MY_P}" "${makeargs[@]}" modules_prepare
+}
+
+src_test() {
+ kernel-install_test "${KPV}" \
+ "${WORKDIR}/${BINPKG}/image/usr/src/linux-${KPV}/$(dist-kernel_get_image_path)" \
+ "${BINPKG}/image/lib/modules/${KPV}"
+}
+
+src_install() {
+ 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}/usr/src/linux-${KPV}"/ || die
+
+ # Modules were already stripped before signing
+ dostrip -x /lib/modules
+}
diff --git a/sys-kernel/gentoo-kernel/Manifest b/sys-kernel/gentoo-kernel/Manifest
index 2b7df466acdc..3bad098612db 100644
--- a/sys-kernel/gentoo-kernel/Manifest
+++ b/sys-kernel/gentoo-kernel/Manifest
@@ -12,10 +12,14 @@ DIST genpatches-5.4-263.base.tar.xz 6140940 BLAKE2B 7a33829d7a85497a6a6c8ae89cc9
DIST genpatches-5.4-263.extras.tar.xz 1812 BLAKE2B 67a75053cc93216cd0b6f34e11c2cdb4d4606e7356424006d08d35583344ec09211d95d0e5613b7352a1b3317053c4c964d373736f387d76d0209bb915d9256d SHA512 64b041945553ca97df6291848e4a9875fb2a2526b82d730e6d84c6838c761803a819c9765cdf953130695e2c91af28b6b0a64a4e7d37473306b26d0db6c16f2c
DIST genpatches-6.1-59.base.tar.xz 3488836 BLAKE2B 5e92e2d1c4ab691284991ae953eb4ec8f6ae5580d2ec410b94d4bd0c8644752d4be1fb962eb5f315b22d811bd49983f2fdb352523547d973fd712fe117f4452d SHA512 29963613fbe41485226137bb35e77daa4d4b2fb8eea6c18c6d9713f1d5cd27192273b3337ca4c02af6d2dba04c564be66edfda6ea6dbbebc22b9358875860288
DIST genpatches-6.1-59.extras.tar.xz 3808 BLAKE2B bad1dc9ff79b84c02f4f634764c6fdf5ef437c14076048d2e0b777f0ec967fe3dc544739684b50533accdf22d3d85af2c0422ba1183ba4ee26590d02c155cf5e SHA512 451bbbb7bce1263d97bce0580729e0a948021734d6e546e318ab37da786a848d9c2376c9849894be9bc8028ee9afece670b86727ded1cf9857d236869c113530
+DIST genpatches-6.1-60.base.tar.xz 3489052 BLAKE2B 528e6ddde93a9699899b0130c0f1fb3d4107c40e10ecee9a1ed813f6ebb2831f4b2340bc5932e98a7cacb79886d14b5ef5cab9f66b207f1304caba6200775be6 SHA512 05de7c393477abce8633185c588ced4568c3c7d5394d5db1a052942e4c417814149fd99f669521917847db482c442ad54b886b018c9edf20028cade120ae37b0
+DIST genpatches-6.1-60.extras.tar.xz 3808 BLAKE2B fd36141eca7e2e6c1f70b12af7ed21442b3b79ca63ce8dda25a7a090e94d752cdde9d6d3dd1b548c629820779126a78a774d071790d936fcf8668757111c22ae SHA512 a2a0affb5af269512403178d90f25d1776948d20c640fc29743846a44a0aca98f3883a5270dcbdec9eef99006b919769f6c702279647af159fedfd6e236acefe
DIST genpatches-6.4-18.base.tar.xz 1040816 BLAKE2B 61ce7d234cba40c266e92dbab80b26e9958d9501fe884ed1fe45c25a89f2385259d5776049d7ce172c05d6829a92f591652544d7a3ce3ce7c81d09ce871800f5 SHA512 559a4e9690a72dc76a0ab38f463149dc9221bad128b59fdafc1250b964af2ccf573ee0d4e593e98811f83325a0d10772a6a6b32bbaef50aee3c5a0d1938677d7
DIST genpatches-6.4-18.extras.tar.xz 3700 BLAKE2B b360eff83abdbed397db6405b6b68649a3d6f85a37716eb2f923d47dc3ae5d738ca49c29a58dd2f236c7f50dc233641e3df15b7b75a19364b0af6261afc36d4e SHA512 778791e5e9232bc432119d14a016c00e1a968af30f0a2dd931ebb4103f7f457db991eb1d9ca500d1a3c9295dbf87d9b4fab18ffaebbd46cc8c82077b27c344e6
DIST genpatches-6.5-4.base.tar.xz 258812 BLAKE2B df197ed4a66568eb823c889b15f126c66b6acb9a2cef224e198e576d601f1c5d1ba43bbecf510585adb93445f2fd634889714a31101fb2dddec67da9052adb7e SHA512 70b21a38cd4a2d1759819341365de33590d8d3f460d12cecd781dddbdc69e87e66f81389d8a1bea381bf74188c19b667d3c7789a92e3d8f80080982ba5d39872
DIST genpatches-6.5-4.extras.tar.xz 3696 BLAKE2B ca8bf3d3b195dbfea39b27b574ea3f3e99f843604ce8ed6ffac141e2e198a4721a943d24c0bfeb559570f00985e6371c7badb69e94542af7bb291fa2485d5425 SHA512 db11e8db7f3fbbed7a037c4a8ebe47accefa9794e8a201e6e022adcdfc628ce3d2db9ccdcb0b0133e3b7956fdab9f63fbc3140f1759b31d2c1878f4075de9d2c
+DIST genpatches-6.5-5.base.tar.xz 259352 BLAKE2B 57e87c7c7517a4f4860b90dc9054ba41e37044cd83318169b37e3ed15db3cbd80a385b76be12ffd423cb6236f98c47512f361aaf1aad07b78d031056e08409e4 SHA512 f69238963e96ef2842c55a4f786dbc692b96dc8b9c4ef31416592b5f3cbfec875f95a0417628a0aa010e5b06cae03073a0c4ea0107f180c8efa4055686eea47d
+DIST genpatches-6.5-5.extras.tar.xz 3700 BLAKE2B 6a9037df5d22ac2cdfc765e99f29660b694d1ae030b179b1efcbf4da086114c6e5befe93368841735f306c827354fec9e40c0bee057a2f1af963dc41679bdd91 SHA512 72b23278c5b84fcbc91143d29e2d769aebc337d45d372999f91f72b3be6802cd410df2735d79f19accd0a775b875f26276dc99c605352c987e790f626dad1051
DIST gentoo-kernel-config-g7.tar.gz 4625 BLAKE2B 72ba0d038ee34ca5eb26d43bd373735aef3a50d02b414993ea05485e49d83d46df98a6cb0f6f3170a8ec0c99b557432fd9a11cbb92ff7c2837625a7f4469831e SHA512 2d74a8ca9f5402b4290ed93cd3ddba04a7f2ff42c8d8d3f2cbbe22fc20daa0fca119368daa8af39b7a26b1b99e4e3187c3c5d95886a651675ad94ff98d686628
DIST gentoo-kernel-config-g8.tar.gz 4663 BLAKE2B c832df9e2085c6ec2deef5b54195f24d2d8ee039655534f5d9c1d650e06ed2ebfe82e2e62d2119696944353321bc22eb91a0599b06c90f0ac22b280fd4aa81b6 SHA512 64c9a94935e7525152827a1d7ca79259f8770300c5865995d683b4c7ba5f21670681a60153ad268aa0a0ce6c2b18683e7faacdbdfb5adc6248387e7316dbb12e
DIST kernel-aarch64-fedora.config.5.10.12 223184 BLAKE2B a0246dac2f7a4ad6a55b611538d24382ac87a8960077811a859c9595ac67f961b4bccb7e139a89abc7c0e26e80832da5c94211fc658082f2e7dde984f14dd29d SHA512 7d803b347b136331db1ad6e22e0445fe0224c3e26cd7c034cbe9794915d457b492e05f77664865079874ec001351553652646e2e08d0fee31e30b841b0008f52
@@ -54,7 +58,9 @@ EBUILD gentoo-kernel-5.15.127.ebuild 3738 BLAKE2B 0723ac115381c39ddcde714b5dabc3
EBUILD gentoo-kernel-5.15.131.ebuild 3742 BLAKE2B 0c25f6729f9dc9cc4b2aef5c295e7c33c162df8a8ad64b26cf34e5b7f64afa50952a4568b7a10609e9ad83cad6b048637661b1fa772efa6a94e061c8c8655734 SHA512 5169182808b6b1157b02cd4408608a39a3a3a141598f190ba0e5900897b515f0a933852c81cdc8bb86caadc3ce6f4ff578ef6d627dcd01278a7f7fc05bd67c05
EBUILD gentoo-kernel-5.4.254.ebuild 2860 BLAKE2B bc1812c00d3f6c58b51d0e9389055a6ca000db0fea5dbdbed392790fefce8a9abb2766c1083c3215c09453d89d6fe9889ffd62b1bf873ff69dfedce41badbf7f SHA512 96e28a4dc569a8d6ae0ea10710db9187a26a448640e76507414031b5ea16ee494a889cbb4a44b9f13cefc9c00d4066a46e8a0887f9fd5dabba5072605d283023
EBUILD gentoo-kernel-5.4.256.ebuild 2864 BLAKE2B 9c8cfab868459f96ae38c0be597633a33ca73abfbf3fbe6f7e970ebf02874e440b56da5acb8368f54f30b6788b9262952b88c946b36f38dfc11a9a8b54f36f73 SHA512 014eb31ea72d58680b6c5bcadb70439775b2946789ae1a9b478fa8d50355bc834dc09b4cf7357a9ef051b657f5e8bf84a73a839bcc2f86863ec6eec51f053253
+EBUILD gentoo-kernel-6.1.53-r1.ebuild 3978 BLAKE2B 3c2a8ed99cb3254948d204971135ba5f087fcd37f1d6dc70f4c1db38b5933900eb3adfc22ba65f962a0fb0054d04f24d2b302f668dfc179f3f0a8c8c31f629b6 SHA512 992b9f4011a653985451838419926bac52d7f21b58ec1f3bf2ec61d22863fbc305688a2cea6e2de25ed5ba83af24a7d7c5a266fca26329cf28e77cef4ee46644
EBUILD gentoo-kernel-6.1.53.ebuild 3974 BLAKE2B b3986083411b11632a836ce55d8da252dca675d952464d9cc6cd5a50381694868d2e5b8c2c0ea172d0d7d4c780a3b44062400c6a45588c978e5e428cee9647ea SHA512 b9b9db8e559281f80e7bf3ae56f732ec3c80a0d4000b31f78d73e4c4f04d5cac024c5f84494c36fcdead334ef10915ad03696a5d8f347954987e54b9ca91474f
EBUILD gentoo-kernel-6.4.16.ebuild 4006 BLAKE2B e5b85e526a22429eda7a8575b20b958e28ac3ee4d098de2ea007fff86c71112843a85389a21d854c159b8a8739afb91850465dc118ee26549640e44991f7759b SHA512 5d2f75d965d745bc6aba242947057ffc757a44d39f05f7fb7b57cb6f22a113e298f2d55abaaf933823644438a4efeb0b0d6830bd2aa8524feff79e4297cc5424
+EBUILD gentoo-kernel-6.5.3-r1.ebuild 4005 BLAKE2B c5c97bace567bad93fad6ee4dd5e8e53b4a024d49941ec97b9f9bd6a7b4170552eb8fb530ec6eb74b7983ad31d9a2f25a6843648db2dcc78e45e71ffc386eb95 SHA512 e32ae981a3ee1ddff39886864e1c3c79ae417edf9490d512ded25101ff9408528d62cdcbb60429dfef81ed467f007e2df26f0c7328e2195c54caef8b5e4aed1c
EBUILD gentoo-kernel-6.5.3.ebuild 4005 BLAKE2B f752b7c930659f7d0a97a19edf2738bad2417376dccc4e55bff5153ec21504ad9efa9e5441ff8183e277de1c08e3915b0b25b31ee340583252d20d0c15627928 SHA512 543bb7f81f2d5d67bba4d81f1da036f6151038c3f39b05b6ed54b210079a86b25ef3843d56ba2c1cc0b5a6f0318ffa1ebbd12bb2ddb60a3f9789f7ec57253bbd
MISC metadata.xml 465 BLAKE2B ea1260a1638588a48d9dd776e9eabd9730a181af8416ba778c936fa2e80a2360be146d3cc80599e50e0a72ac709eb9538184aac87cb96528e445ed450e34f4af SHA512 c7b7b1a45fb7082b8d8d66cf5a387cc4f7207cd9488d1d5e1d6900f1e4147aa9290b5522a94d941a885f1599b5df2482b529e40912d2b2cff400ecd4b1704c41
diff --git a/sys-kernel/gentoo-kernel/gentoo-kernel-6.1.53-r1.ebuild b/sys-kernel/gentoo-kernel/gentoo-kernel-6.1.53-r1.ebuild
new file mode 100644
index 000000000000..541ef4107ad7
--- /dev/null
+++ b/sys-kernel/gentoo-kernel/gentoo-kernel-6.1.53-r1.ebuild
@@ -0,0 +1,146 @@
+# Copyright 2020-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit kernel-build toolchain-funcs
+
+MY_P=linux-${PV%.*}
+GENPATCHES_P=genpatches-${PV%.*}-$(( ${PV##*.} + 7 ))
+# https://koji.fedoraproject.org/koji/packageinfo?packageID=8
+# forked to https://github.com/projg2/fedora-kernel-config-for-gentoo
+CONFIG_VER=6.1.7-gentoo
+GENTOO_CONFIG_VER=g7
+
+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://dev.gentoo.org/~mpagano/dist/genpatches/${GENPATCHES_P}.base.tar.xz
+ https://dev.gentoo.org/~mpagano/dist/genpatches/${GENPATCHES_P}.extras.tar.xz
+ https://github.com/projg2/gentoo-kernel-config/archive/${GENTOO_CONFIG_VER}.tar.gz
+ -> gentoo-kernel-config-${GENTOO_CONFIG_VER}.tar.gz
+ 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}/${MY_P}
+
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86"
+IUSE="debug hardened"
+REQUIRED_USE="
+ arm? ( savedconfig )
+ hppa? ( savedconfig )
+ riscv? ( savedconfig )
+ sparc? ( savedconfig )
+"
+
+RDEPEND="
+ !sys-kernel/gentoo-kernel-bin:${SLOT}
+"
+BDEPEND="
+ debug? ( dev-util/pahole )
+"
+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
+"
+
+src_prepare() {
+ local PATCHES=(
+ # meh, genpatches have no directory
+ "${WORKDIR}"/*.patch
+ )
+ default
+
+ local biendian=false
+
+ # prepare the default config
+ case ${ARCH} in
+ amd64)
+ cp "${DISTDIR}/kernel-x86_64-fedora.config.${CONFIG_VER}" .config || die
+ ;;
+ arm)
+ return
+ ;;
+ arm64)
+ cp "${DISTDIR}/kernel-aarch64-fedora.config.${CONFIG_VER}" .config || die
+ biendian=true
+ ;;
+ hppa)
+ return
+ ;;
+ 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)
+ return
+ ;;
+ sparc)
+ return
+ ;;
+ 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
+
+ kernel-build_merge_configs "${merge_configs[@]}"
+}
diff --git a/sys-kernel/gentoo-kernel/gentoo-kernel-6.5.3-r1.ebuild b/sys-kernel/gentoo-kernel/gentoo-kernel-6.5.3-r1.ebuild
new file mode 100644
index 000000000000..154f22e183f7
--- /dev/null
+++ b/sys-kernel/gentoo-kernel/gentoo-kernel-6.5.3-r1.ebuild
@@ -0,0 +1,147 @@
+# Copyright 2020-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+KERNEL_IUSE_MODULES_SIGN=1
+inherit kernel-build toolchain-funcs
+
+MY_P=linux-${PV%.*}
+GENPATCHES_P=genpatches-${PV%.*}-$(( ${PV##*.} + 2 ))
+# https://koji.fedoraproject.org/koji/packageinfo?packageID=8
+# forked to https://github.com/projg2/fedora-kernel-config-for-gentoo
+CONFIG_VER=6.5.2-gentoo
+GENTOO_CONFIG_VER=g8
+
+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://dev.gentoo.org/~mpagano/dist/genpatches/${GENPATCHES_P}.base.tar.xz
+ https://dev.gentoo.org/~mpagano/dist/genpatches/${GENPATCHES_P}.extras.tar.xz
+ https://github.com/projg2/gentoo-kernel-config/archive/${GENTOO_CONFIG_VER}.tar.gz
+ -> gentoo-kernel-config-${GENTOO_CONFIG_VER}.tar.gz
+ 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}/${MY_P}
+
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86"
+IUSE="debug hardened"
+REQUIRED_USE="
+ arm? ( savedconfig )
+ hppa? ( savedconfig )
+ riscv? ( savedconfig )
+ sparc? ( savedconfig )
+"
+
+RDEPEND="
+ !sys-kernel/gentoo-kernel-bin:${SLOT}
+"
+BDEPEND="
+ debug? ( dev-util/pahole )
+"
+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
+"
+
+src_prepare() {
+ local PATCHES=(
+ # meh, genpatches have no directory
+ "${WORKDIR}"/*.patch
+ )
+ default
+
+ local biendian=false
+
+ # prepare the default config
+ case ${ARCH} in
+ amd64)
+ cp "${DISTDIR}/kernel-x86_64-fedora.config.${CONFIG_VER}" .config || die
+ ;;
+ arm)
+ return
+ ;;
+ arm64)
+ cp "${DISTDIR}/kernel-aarch64-fedora.config.${CONFIG_VER}" .config || die
+ biendian=true
+ ;;
+ hppa)
+ return
+ ;;
+ 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)
+ return
+ ;;
+ sparc)
+ return
+ ;;
+ 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
+
+ kernel-build_merge_configs "${merge_configs[@]}"
+}