# 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.7.9 pkgrel=1 pkgdesc='Linux' url="https://cchalpha.blogspot.co.uk/" arch=(x86_64) license=(GPL2) makedepends=( bc kmod libelf pahole xmlto python-sphinx python-sphinx_rtd_theme graphviz imagemagick git ) options=('!strip') _srcname=linux-${pkgver} _bmqversion=5.7-r2 _bmq_patch="prjc_v${_bmqversion}.patch" _gcc_more_v='20200615' source=( "https://www.kernel.org/pub/linux/kernel/v5.x/linux-$pkgver.tar".{xz,sign} config # the main kernel config file "0000-sphinx-workaround.patch" "${_bmq_patch}::https://gitlab.com/alfredchen/projectc/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://git.archlinux.org/linux.git/patch/?id=f7dd45a3ae86afe15f64746d621d786f13860a65" "0002-PCI-EDR-Log-only-ACPI_NOTIFY_DISCONNECT_RECOVER-even.patch::https://git.archlinux.org/linux.git/patch/?id=ece7e249df5e71be440baaf25b324a62e0a715fa" "0003-iwlwifi-Make-some-Killer-Wireless-AC-1550-cards-work.patch::https://git.archlinux.org/linux.git/patch/?id=b2fd0d69f3b155b0c575dd540ad354e4b5323034" "0004-virt-vbox-Add-support-for-the-new-VBG_IOCTL_ACQUIRE_.patch::https://git.archlinux.org/linux.git/patch/?id=0fe1b29d2826794bfd880944496b433c80da0173" "Fix-compilation-issues-when-CONFIG-SCHED-TRACER.patch::https://gitlab.com/alfredchen/linux-prjc/-/commit/12f9ffec7586ba30fcabd0ce9f13158f0158a529.patch" ) validpgpkeys=( 'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds '647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman 'A2FF3A36AAA56654109064AB19802F8B0D70FC30' # Jan Alexander Steffens (heftig) ) sha256sums=('a87d3066a7849cd6ba9a004311a9ee0402d29d17f12f64ad7d942447070b43f8' 'SKIP' '07bdb86bb34876ba99406b2174dac860b962a721dc9858d08e15e2608eeb96a7' '19c19fef1fd46d1b184d888226d286be9b00e8feb8fb745f8d408cfce3d9622a' 'b19d09da5beef3433702157ac7975710fc815ada9ed2a088136bb87e0c89dfd7' '278fe9ffb29d92cc5220e7beac34a8e3a2006e714d16a21a0427069f9634af90' 'a9dc95da65b85d67cc021062a9e5c9cd10e2a50989dd92222f4929dfceb04c3c' 'd1aba2b46e810374e49296760959da48e58d88c36e377479a54e7636e1ba7dc0' 'bdd0344427007d11412c37294559dc71090dfd0b0e6bd4b7008f32810ba797c4' '095804fb1045f6ccb52825d0d8c3aad1237e919f30586034267918a15d1249f6' 'dd5d00c6e6c47e5869e994f656685db31f50b77dc26393505e941fe5be7faa33') _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 "Setting config..." cp ../config .config # disable CONFIG_DEBUG_INFO=y at build time introduced in this commit # https://git.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/linux&id=663b08666b269eeeeaafbafaee07fd03389ac8d7 sed -i -e 's/CONFIG_DEBUG_INFO=y/# CONFIG_DEBUG_INFO is not set/' \ -i -e '/CONFIG_DEBUG_INFO_DWARF4=y/d' -i -e '/CONFIG_DEBUG_INFO_BTF=y/d' ./.config echo "Applying patch ${_bmq_patch}..." patch -Np1 -i "$srcdir/${_bmq_patch}" patch -Np1 -i "$srcdir/Fix-compilation-issues-when-CONFIG-SCHED-TRACER.patch" # non-interactively apply ck1 default options # this isn't redundant if we want a clean selection of subarch below make olddefconfig # 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_v10.1+_kernel_v5.7+.patch" make oldconfig ### 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 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="$(