# 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.6.5 pkgrel=1 pkgdesc='Linux' 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-${pkgver} _bmqversion=5.6-r2 _bmq_patch="bmq_v${_bmqversion}.patch" _gcc_more_v='20191217' source=( "https://www.kernel.org/pub/linux/kernel/v5.x/linux-$pkgver.tar".{xz,sign} config # the main kernel config file "${_bmq_patch}::https://gitlab.com/alfredchen/bmq/raw/master/${_bmqversion%-*}/${_bmq_patch}" "enable_additional_cpu_optimizations-${_gcc_more_v}.tar.gz::https://github.com/graysky2/kernel_gcc_patch/archive/${_gcc_more_v}.tar.gz" "0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch::https://github.com/archlinux/linux/commit/31d4f0d32196b85f66945ed01b60ed1b55ee5f54.patch" "0002-Revert-ACPI-EC-Do-not-clear-boot_ec_is_ecdt-in-acpi_.patch::https://github.com/archlinux/linux/commit/e5016d0b5460c3bed8f78033723ad22775db7725.patch" "0003-drm-amdgpu-fix-the-hw-hang-during-perform-system-reb.patch::https://github.com/archlinux/linux/commit/1f8782c04f587b9e0901f7736c112814dd0dcc47.patch" ) validpgpkeys=( 'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds '647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman '8218F88849AAC522E94CF470A5E9288C4FA415FA' # Jan Alexander Steffens (heftig) ) sha256sums=('f79bd3dbcbe1e7afba256d59b4ca21da12d2c5b4189804dffb2a49fd2b9b52e6' 'SKIP' '27b84575ea6b1050951906e0b595351fe3f8e39fab9d2ed05e32cb6eaddca08f' '0e1b569bf16a6c514710715eff06df04447378d1c067b853db0c454ac3c5e463' '7a4a209de815f4bae49c7c577c0584c77257e3953ac4324d2aa425859ba657f5' 'e8abbc772f3a9b3face6e8a75990f039022fb679d5d84f3813a291cc91fe828a' 'f4f9c8392eeb6bc4d29d7571f67a8b979099bee2a944c34b2b2413020f4ea02d' '673fd2206a4ae18976908e85b6b7ee7b775896473ab7239930e639378808ec64') _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 = 0*.patch ]] || continue echo "Applying patch $src..." patch -Np1 < "../$src" done echo "Applying patch ${_bmq_patch}..." patch -Np1 -i "$srcdir/${_bmq_patch}" echo "Setting config..." cp ../config .config # https://github.com/graysky2/kernel_gcc_patch echo "Applying enable_additional_cpu_optimizations-${_gcc_more_v}..." 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 all } _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="$(