1 # Copyright 2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
9 GENPATCHES_P=genpatches-${PV%.*}-${PV##*.}
10 # https://git.archlinux.org/svntogit/packages.git/log/trunk/config?h=packages/linux
11 AMD64_CONFIG_VER=5.4.15-arch1
12 AMD64_CONFIG_HASH=dc8d69b59a7a529ec5aaeb6b32b16e59a3cc1569
13 # https://git.archlinux32.org/packages/log/core/linux/config.i686
14 I686_CONFIG_VER=5.4.15-arch1
15 I686_CONFIG_HASH=1ad219bd3f0ab439a81ed01fec7660eeea7daa0e
17 DESCRIPTION="Linux kernel built with Gentoo patches"
18 HOMEPAGE="https://www.kernel.org/"
19 SRC_URI+=" https://cdn.kernel.org/pub/linux/kernel/v$(ver_cut 1).x/${MY_P}.tar.xz
20 https://dev.gentoo.org/~mpagano/dist/genpatches/${GENPATCHES_P}.base.tar.xz
21 https://dev.gentoo.org/~mpagano/dist/genpatches/${GENPATCHES_P}.extras.tar.xz
23 https://git.archlinux.org/svntogit/packages.git/plain/trunk/config?h=packages/linux&id=${AMD64_CONFIG_HASH}
24 -> linux-${AMD64_CONFIG_VER}.amd64.config
27 https://git.archlinux32.org/packages/plain/core/linux/config.i686?id=${I686_CONFIG_HASH}
28 -> linux-${I686_CONFIG_VER}.i686.config
33 KEYWORDS="~amd64 ~x86"
36 !sys-kernel/vanilla-kernel:${SLOT}
37 !sys-kernel/vanilla-kernel-bin:${SLOT}"
41 # meh, genpatches have no directory
46 # prepare the default config
49 cp "${DISTDIR}"/linux-${AMD64_CONFIG_VER}.amd64.config .config || die
52 cp "${DISTDIR}"/linux-${I686_CONFIG_VER}.i686.config .config || die
55 die "Unsupported arch ${ARCH}"
60 # shove arch under the carpet!
61 -e 's:^CONFIG_DEFAULT_HOSTNAME=:&"gentoo":'
63 -e '/CONFIG_X86_X32/s:.*:CONFIG_X86_X32=y:'
65 -e '/CONFIG_MODULE_SIG/d'
66 -e '/CONFIG_SECURITY_LOCKDOWN/d'
67 # disable compression to allow stripping
68 -e '/CONFIG_MODULE_COMPRESS/d'
69 # disable gcc plugins to unbreak distcc
70 -e '/CONFIG_GCC_PLUGIN_STRUCTLEAK/d'
72 sed -i "${config_tweaks[@]}" .config || die