# Maintainer: graysky # Contributor: Jan Alexander Steffens (heftig) pkgbase=linux-rc pkgrel=1 _srcname=linux-5.10 _major=5.10 ### on initial release this is null otherwise it is the current stable subversion ### ie 1,2,3 corresponding $_major.1, $_major.3 etc _minor=15 _minorc=$((_minor+1)) ### on initial release this is just $_major _fullver=$_major.$_minor #_fullver=$_major _rcver=1 _rcpatch=patch-${_major}.${_minorc}-rc${_rcver} pkgver=${_major}.${_minorc}rc${_rcver} arch=(x86_64) license=(GPL2) url="https://www.kernel.org/" makedepends=( bc kmod libelf cpio perl tar xz ) options=('!strip') _modprobeddb= source=( https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/"$_rcpatch".{xz,sign} # https://lkml.org/lkml/2019/8/23/712 #"$_rcpatch.patch::https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/patch/?id=$_srcname.y&id2=v${_major}.${_minor}" https://www.kernel.org/pub/linux/kernel/v5.x/linux-$_fullver.tar.{xz,sign} config # the main kernel config file 0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch 0002-HID-quirks-Add-Apple-Magic-Trackpad-2-to-hid_have_sp.patch ) validpgpkeys=( 'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds '647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman ) b2sums=('4c179da64ec40ed5876a403889d511631dac6c536fcc0dc6b4fc68f785e00f07028285bf05db1256d6a91cc2a0174bf7fe3a9f26f89ade025ff3e570615f9b7a' 'SKIP' '7cf58513bf2266697843f6d91fbb214268ad511e110a4e2b66bc0db84ecb4df724a7d65f641eee5837f4d88c1371ec8b313ee8aaa1d1f0260709eae2e3af32b3' 'SKIP' '74b6ea3f314aa8291c9e2c3b5763f9b0c8aabbc0e714e30529f557955a7a315b44b0cd2f2d665ffe3ba48e7df71274c5901d3891ed395191ceb6ca88f69cdb1a' 'a72505887e56d422b837454babd6990f12f6581138192331b2646a58ec87cc43a2630577b84312d79fedfb1a343e6ecdd9420ab4efe07ccb5ad792e95450430e' '858e46f4ad443499ab7853bc69fd31bd48f99e348e866dbcb226ac7e802f27df5bd2afeb6335bf9d845185f059657e9aa7f08ae49b0097c18b972002a1f6d673') export KBUILD_BUILD_HOST=archlinux export KBUILD_BUILD_USER=$pkgbase export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})" prepare() { cd linux-${_fullver} msg2 "Setting version..." scripts/setlocalversion --save-scmversion echo "-$pkgrel" > localversion.10-pkgrel echo "${pkgbase#linux}" > localversion.20-pkgname echo "Applying $_rcpatch..." patch -Np1 <"../$_rcpatch" local src for src in "${source[@]}"; do src="${src%%::*}" src="${src##*/}" [[ $src = 0*.patch ]] || continue echo "Applying patch $src..." patch -Np1 < "../$src" done echo "Setting config..." cp ../config .config # disable CONFIG_DEBUG_INFO=y at build time otherwise memory usage blows up # and can easily overwhelm a system with 32 GB of memory using a tmpfs build # partition ... this was introduced by FS#66260, see: # https://git.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/linux&id=663b08666b269eeeeaafbafaee07fd03389ac8d7 sed -i -e 's/CONFIG_CGROUP_BPF=y/# CONFIG_CGROUP_BPF is not set/' \ -i -e 's/CONFIG_BPF_LSM=y/# CONFIG_BPF_LSM is not set/' \ -i -e 's/CONFIG_USERMODE_DRIVER=y/# CONFIG_BPF_PRELOAD is not set/' \ -i -e '/CONFIG_BPF_PRELOAD=y/d' \ -i -e '/CONFIG_BPF_PRELOAD_UMD=m/d' \ -i -e '/CONFIG_BPF_STREAM_PARSER=y/g' \ -i -e 's/CONFIG_BPF_LIRC_MODE2=y/# CONFIG_BPF_LIRC_MODE2 is not set/' \ -i -e 's/CONFIG_DEBUG_INFO=y/# CONFIG_DEBUG_INFO is not set/' \ -i -e '/# CONFIG_DEBUG_INFO_REDUCED is not set/d' \ -i -e '/# CONFIG_DEBUG_INFO_COMPRESSED is not set/d' \ -i -e '/# CONFIG_DEBUG_INFO_SPLIT is not set/d' \ -i -e '/CONFIG_DEBUG_INFO_DWARF4=y/d' \ -i -e '/CONFIG_DEBUG_INFO_BTF=y/d' \ -i -e '/# CONFIG_GDB_SCRIPTS is not set/d' \ -i -e 's/CONFIG_BPF_KPROBE_OVERRIDE=y/# CONFIG_BPF_KPROBE_OVERRIDE is not set/' ./.config if [[ -n "$_modprobeddb" ]]; then #msg "Running Steven Rostedt's make localmodconfig now" #sudo /usr/bin/modprobed-db recall #make localmodconfig msg "Running Steven Rostedt's make localmodconfig now" if [[ -f $HOME/.config/modprobed.db ]]; then _useit="$HOME/.config/modprobed.db" else _useit="../modprobed.db" fi make LSMOD="$_useit" localmodconfig fi make olddefconfig # make nconfig make -s kernelrelease > version echo "Prepared $pkgbase version $(