DIST genpatches-5.4-38.extras.tar.xz 1756 BLAKE2B 2e4d217bf53de074717b18748263318cc637ee85c1217caea175e7f47ffa74217b1e06a5bd19a0ba88307423d16c0a2c6c7975c8d3fee83a8d1fd65a0cbe4544 SHA512 db347a70bb1fd88ff37573ffe7bb1b03f61f7cca9b25ef302ce26e7e849bc87aa1f5b5c732fb3fae3a5efb339794be6a11eae386cf444fe50143bf46be3544d3
DIST genpatches-5.4-39.base.tar.xz 1376580 BLAKE2B a546be9d077e978f8918f4d3903c2769a898d8985cf20d9b5806312bb1b99b492b1101e104bc2fba10fb5bae372ae941020b064df8fe1aba64814a3adf864fce SHA512 d046451cbc18490c6956d723ddf26a9a0e5c4e6906c76c65a2579b0aa269ea3c4b58a94e17b868f54e752e13e0d67c75074d5d91d3657d4da0be47e81ce2fb89
DIST genpatches-5.4-39.extras.tar.xz 1756 BLAKE2B 5b79d2b75579aa2f660b90a00289398c1d271fce5a07726d487d9fee827a1ec42a9325f6162a82ce73d4e76dccd0a8e3ad58e6221a5e8d227f35fbe16bf75958 SHA512 5a14168aa45866d5c90151f2e8c93306d3e85fe0517763c6384d30d196696c30dd99cee709db322ad2e0089059e39325c91b08b566a09c30f41f45f3499c188c
+DIST genpatches-5.4-40.base.tar.xz 1387836 BLAKE2B 563a3ca82b3e6fad34e37530a9416559e0ede0730897c953ed67364c2ed4aca72e0b10050369779b4c85400784762ff1b672c34d56c0f044be7f28e62c0c2ba8 SHA512 45f02b016db58893b52e7920ad8b4b08bb924fa30df6d9b26546fced609c81f4aa4527026b1b3bb177267eca5e8fa38ad345d36ec1e2d46c2db9263682f05fde
+DIST genpatches-5.4-40.extras.tar.xz 1756 BLAKE2B 546f44a21973cdce099df5f163c9c655b590c9ee7b2fdbc533f2586ef6b3995cd7348ff32378fda3a991c567000b5d5956680b35374ca1b990f2e1ba698ecb32 SHA512 bcf61ddc04e0673c68e025889264f67525a2c7d66c826dfdfb6e65b38f5c1d12a25e9d4aa6b01ebdd170ea6d72196f972df5bfc284122581e153d4fc2f69edf0
DIST genpatches-5.5-21.base.tar.xz 767444 BLAKE2B 812732ed230a0605a40bd0a0d80bb64cf3582e0bcb94cb26e53aee7a69c0e66b200db8787abec14466287d9f9bfaa6f71d15d0cae56c5c820070833aa1996d81 SHA512 ed48a01f132d1dabc2bf2fe6b29156d1303cafdc53bcd843924f4ce14f6e0e35fc4d930b055b37a24365a6a31b36034d79f25112e1bd8526a6e0922e66dfc561
DIST genpatches-5.5-21.extras.tar.xz 1756 BLAKE2B f277d12cbb65f109e49d96a47ba0a8429b2a791872b16548656db9f4275259fc774169a75f310edb7392b0c548b1ea7559eaa841376cb6a7c507cce31385cc37 SHA512 ce1c4b6ac121ecb6bbe1c738abd9ce967e4875654eb5aeb373f59e116c4b29fc2fb3f8383db6d093005ba85be1a36d1023780a35f27bf2e1c3bfaad15abdc084
DIST genpatches-5.6-10.base.tar.xz 191312 BLAKE2B 71aa053ae13888a5b453da03f4942357ad60226505a43e0308c28ec865b605f16179ceba117034949d448345029442796dd0889f89d7d42d86948b53f82a404b SHA512 10aba07f2978ebd7dd4e0b35aa3c8a458359fa823cf6a050e6c61f5dd19f94d4e67a52c720af6dd46068a0654deab5dbdbc5f4d557ea31bb7163267b404c0990
--- /dev/null
+# Copyright 2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit kernel-build
+
+MY_P=linux-${PV%.*}
+GENPATCHES_P=genpatches-${PV%.*}-${PV##*.}
+# https://git.archlinux.org/svntogit/packages.git/log/trunk/config?h=packages/linux
+AMD64_CONFIG_VER=5.4.15-arch1
+AMD64_CONFIG_HASH=dc8d69b59a7a529ec5aaeb6b32b16e59a3cc1569
+# https://git.archlinux32.org/packages/log/core/linux/config.i686
+I686_CONFIG_VER=5.4.15-arch1
+I686_CONFIG_HASH=1ad219bd3f0ab439a81ed01fec7660eeea7daa0e
+
+DESCRIPTION="Linux kernel built 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://git.archlinux.org/svntogit/packages.git/plain/trunk/config?h=packages/linux&id=${AMD64_CONFIG_HASH}
+ -> linux-${AMD64_CONFIG_VER}.amd64.config
+ )
+ x86? (
+ https://git.archlinux32.org/packages/plain/core/linux/config.i686?id=${I686_CONFIG_HASH}
+ -> linux-${I686_CONFIG_VER}.i686.config
+ )"
+S=${WORKDIR}/${MY_P}
+
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="
+ !sys-kernel/vanilla-kernel:${SLOT}
+ !sys-kernel/vanilla-kernel-bin:${SLOT}"
+
+src_prepare() {
+ local PATCHES=(
+ # meh, genpatches have no directory
+ "${WORKDIR}"/*.patch
+ )
+ default
+
+ # prepare the default config
+ case ${ARCH} in
+ amd64)
+ cp "${DISTDIR}"/linux-${AMD64_CONFIG_VER}.amd64.config .config || die
+ ;;
+ x86)
+ cp "${DISTDIR}"/linux-${I686_CONFIG_VER}.i686.config .config || die
+ ;;
+ *)
+ die "Unsupported arch ${ARCH}"
+ ;;
+ esac
+
+ local config_tweaks=(
+ # shove arch under the carpet!
+ -e 's:^CONFIG_DEFAULT_HOSTNAME=:&"gentoo":'
+ # we do support x32
+ -e '/CONFIG_X86_X32/s:.*:CONFIG_X86_X32=y:'
+ # disable signatures
+ -e '/CONFIG_MODULE_SIG/d'
+ -e '/CONFIG_SECURITY_LOCKDOWN/d'
+ # disable compression to allow stripping
+ -e '/CONFIG_MODULE_COMPRESS/d'
+ # disable gcc plugins to unbreak distcc
+ -e '/CONFIG_GCC_PLUGIN_STRUCTLEAK/d'
+ )
+ sed -i "${config_tweaks[@]}" .config || die
+}