# 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.10.4 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} _arch_tag_commit=4c5d5289951e22aeb0abcae7b629bcc1c24e8697 _bmqversion=5.10-r2 _bmq_patch="prjc_v${_bmqversion}.patch" _gcc_more_v='20201113' source=( "https://www.kernel.org/pub/linux/kernel/v5.x/linux-$pkgver.tar".{xz,sign} "config::https://raw.githubusercontent.com/archlinux/svntogit-packages/${_arch_tag_commit}/trunk/config" "${_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=3a8bc83f97cb4ef7ad72a742382f373357d4d95b" "0002-Bluetooth-Fix-attempting-to-set-RPA-timeout-when-uns.patch::https://git.archlinux.org/linux.git/patch/?id=0438f3011663ce01a981bb8b3af0e84e73551ecf" "0003-HID-quirks-Add-Apple-Magic-Trackpad-2-to-hid_have_sp.patch::https://git.archlinux.org/linux.git/patch/?id=e5e77ad2223f662e1615266d8ef39a8db7e65a70" "0004-drm-amd-display-Add-get_dig_frontend-implementation-.patch::https://git.archlinux.org/linux.git/patch/?id=88fbde26128dedf0097aa45b8c923973a4e5f843" "0005-btrfs-Fix-500-2000-performance-regression-w-5.10.patch::https://git.archlinux.org/linux.git/patch/?id=0128c7314a4d856461caacfdd528a7bffa03d41e" "0006-iwlwifi-Fix-regression-from-UDP-segmentation-support.patch::https://git.archlinux.org/linux.git/patch/?id=61e5f6548784e507eb0662a71976a673436e6e3a" "0007-ALSA-hda-hdmi-fix-locking-in-silent_stream_disable.patch::https://git.archlinux.org/linux.git/patch/?id=00f09a6a8193b46c83ae1c8ff6623db011f90099" ) validpgpkeys=( 'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds '647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman 'A2FF3A36AAA56654109064AB19802F8B0D70FC30' # Jan Alexander Steffens (heftig) ) b2sums=('57f6d719451aacfd298452703ae02e6188885500e8cdf18fffa6b9967b0934a23cd378ab4c49b76ccb2f7a9012d6aa7ff1349d488cb31e40924be2f27b244cec' 'SKIP' 'cb3a58e4eef8395b75887d94a84bba25f05fbec8f576a791623057a190a1d51b412a19ecf1b600ac3f9f6c46968eb0e130d571743e61afc231a97146ee4b52d0' '964457a55fe70988fcba968d2940d78d3daff5d1629863279ee15e07f8c1bb4e58e4d22b2cae9e66ab0c61c4d54de04e7a6eb2710eaaa536ec11f29efa961f1c' '7f1eb5938472f57748216bd00e0c875feab99fc1c5cb89babfea467ee30ca5c8e9fc5a691efe2e602bef1ea79820c5383822d7cec354b48d23321ccda8ee8127' '349d852edb6695efc940607cd3fe65bf2cd293109825f6fd31fdc6f3d398e9fd90d36bd0f9c5716a3b006495c7f64b090adb535180f7912d070735ce587877ac' '425ab3ba80caee9f99f408d819d71a4ae55587183ca1137088b6f2177f9a81f172dd5b5437fc54cf2cc16f3e4be54caf5e9992c6ca20c6c57d3da98c144953a1' 'cd6c3054e949a6e1896c8686d2ee81111d60795a239404f54de6154fe83c9f027ed78ac31ce68fc609873f06db6392daf01edac00fe9aaa40549a42e40ac7f07' '0a4eb7eafdbd504a4438c6a4bb25e5a296d83f2a57ba3629defac51a4bda17546ef45bac7b513c6fc084b955e68b08d4cd0b17d5952ccff056a2999dcafd56d8' '241b3f112eb8f250b2a74b9c6255519ced8cc2c2f356cae9272351db16c003608efba1f72115d25e007b443b9151e1fced6848f4966b2648b1d21318304478e4' 'e53c858f4133c04268c0cba8f3ef7201ba5ceda82670544b8da3e12fdfaa62b471bacf171cc0689944d24453155933def0d136fa242e3f6b8763b2c103229867' '7d81beaaa2dc5e00838c27d1bd049ae389128a17d540c72d4b8dba6a6dfb870b6bf4a5148fbdd4bf4337791e9f3c83ff4a84a95295aec7b8e9aec8c3cb2ad866') _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}" # 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.8+.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 ${pkgbase/linux/Linux} kernel and modules with the Project C scheduler" depends=(coreutils kmod initramfs) optdepends=('crda: to set the correct wireless channels of your country' 'linux-firmware: firmware images needed for some devices') cd $_srcname local kernver="$(