# Maintainer: Leonidas Spyropoulos # Credit to graysky for shamelessly copying PKGBUILD from linux-ck ### BUILD OPTIONS # Set these variables to ANYTHING that is not null to enable them # Tweak kernel options prior to a build via nconfig _makenconfig= # Compile ONLY used modules to VASTLYreduce the number of modules built # and the build time. # # To keep track of which modules are needed for your specific system/hardware, # give module_db script a try: https://aur.archlinux.org/packages/modprobed-db # This PKGBUILD read the database kept if it exists # # More at this wiki page ---> https://wiki.archlinux.org/index.php/Modprobed-db _localmodcfg= ### IMPORTANT: Do no edit below this line unless you know what you're doing pkgbase=linux-gc pkgver=5.5.9 pkgrel=1 pkgdesc='Linux' _srctag=v${pkgver}-arch1 url="https://cchalpha.blogspot.co.uk/" arch=(x86_64) license=(GPL2) makedepends=( bc kmod libelf xmlto python-sphinx python-sphinx_rtd_theme graphviz imagemagick git ) options=('!strip') _srcname=linux-$_srctag _bmqversion=5.5-r3 _bmq_patch="bmq_v${_bmqversion}.patch" _gcc_more_v='20191217' source=( "$_srcname.tar.gz::https://git.archlinux.org/linux.git/snapshot/linux-$_srctag.tar.gz" config # the main kernel config file "0001_${_bmq_patch}::https://gitlab.com/alfredchen/bmq/raw/master/${_bmqversion%-*}/${_bmq_patch}" "0002_enable_additional_cpu_optimizations-${_gcc_more_v}.tar.gz::https://github.com/graysky2/kernel_gcc_patch/archive/${_gcc_more_v}.tar.gz" ) validpgpkeys=( 'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds '647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman '8218F88849AAC522E94CF470A5E9288C4FA415FA' # Jan Alexander Steffens (heftig) ) sha256sums=('78f57ec561cc4e9cf4b0b3bb98d0640318ef1c6cad260ca5ebcc43a5ebef0414' '9cd23b970ae575c9abaf2c51fb6df4240ad8a94fac239810ef9e826b02d137cd' '1a647aa24074af0cc3a0ecbf8c720ab496be9fe1a62fab41c524eb6cc5dcccda' '7a4a209de815f4bae49c7c577c0584c77257e3953ac4324d2aa425859ba657f5') _kernelname=${pkgbase#linux} : ${_kernelname:=-gc} 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 $_srcname echo "Setting version..." scripts/setlocalversion --save-scmversion echo "-$pkgrel" > localversion.10-pkgrel echo "$_kernelname" > localversion.20-pkgname local src for src in "${source[@]}"; do src="${src%%::*}" src="${src##*/}" [[ $src = *.patch ]] || continue echo "Applying patch $src..." patch -Np1 < "../$src" done echo "Setting config..." cp ../config .config # https://github.com/graysky2/kernel_gcc_patch echo "Applying enable_additional_cpu_optimizations_for_gcc_v9.1+_kernel_v5.5+.patch ..." patch -Np1 -i "$srcdir/kernel_gcc_patch-$_gcc_more_v/enable_additional_cpu_optimizations_for_gcc_v9.1+_kernel_v5.5+.patch" make prepare ### Optionally load needed modules for the make localmodconfig # See https://aur.archlinux.org/packages/modprobed-db if [ -n "$_localmodcfg" ]; then if [ -f $HOME/.config/modprobed.db ]; then echo "Running Steven Rostedt's make localmodconfig now" make LSMOD=$HOME/.config/modprobed.db localmodconfig else echo "No modprobed.db data found" exit fi fi # do not run `make olddefconfig` as it sets default options yes "" | make config >/dev/null make -s kernelrelease > version echo "Prepared ${pkgbase} version $( "${startdir}/config.last" } build() { cd $_srcname make bzImage modules } _package() { pkgdesc="The $pkgdesc kernel and modules with the BMQ CPU scheduler" depends=(coreutils kmod initramfs) optdepends=('crda: to set the correct wireless channels of your country' 'linux-firmware: firmware images needed for some devices') provides=("linux-gc=${pkgver}") cd $_srcname local kernver="$(