# 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.4.13 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.4-r2 _bmq_patch="bmq_v${_bmqversion}.patch" _gcc_more_v='20190822' 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=('a2a1750ea4de933320126cbe167aede5999cdc30c1c02b1be4b58187e93c9c23' '548d4588a491ba2bb7d53b6e3c59aa3fcf68a6d3465079607e4f1bee5add7016' '6a6a736cf1b3513d108bfd36f60baf50bb36b33aec21ab0d0ffad13602b7ff75' '8c11086809864b5cef7d079f930bd40da8d0869c091965fa62e95de9a0fe13b5') _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 msg2 "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 msg2 "Applying patch $src..." patch -Np1 < "../$src" done msg2 "Setting config..." cp ../config .config # https://github.com/graysky2/kernel_gcc_patch msg2 "Applying enable_additional_cpu_optimizations_for_gcc_v9.1+_kernel_v4.13+.patch ..." patch -Np1 -i "$srcdir/kernel_gcc_patch-$_gcc_more_v/enable_additional_cpu_optimizations_for_gcc_v9.1+_kernel_v4.13+.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 msg2 "Running Steven Rostedt's make localmodconfig now" make LSMOD=$HOME/.config/modprobed.db localmodconfig else msg2 "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 msg2 "Prepared %s version %s" "$pkgbase" "$( "${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="$(