# Maintainer: jc_gargma # Maintainer (Arch): Jan Alexander Steffens (heftig) # Contributor: Aqua-sama # # I maintain this because: # Arch version patch script does not apply consistently # Arch version lacks graysky gcc patch # Arch version lacks ath9k regdom and raid6 algo patches # Arch version is 300 Hz # Arch version does not disable lockdown or integrity eee # Arch version does not disable HDCP # Arch version does not disable IME/PSP and SGX/SEV and TXT/TEE and PXP # Arch version does not disable /dev/random being directly filled by rdrand # Arch version uses git # set _custom to 0 when using mkchrootpkg _custom=0 pkgbase=linux _supver=5 _majver=18 _minver=5 _gccpatchver='20220315' _gccpatchker='5.17+' if [ "$_minver" == "0" ]; then pkgver=${_supver}.${_majver} else pkgver=${_supver}.${_majver}.${_minver} fi pkgrel=1 pkgdesc='Linux' url='https://kernel.org' arch=(x86_64) license=(GPL2) makedepends=( bc libelf pahole cpio perl tar xz xmlto python-sphinx python-sphinx_rtd_theme graphviz imagemagick texlive-latexextra ) conflicts=('linux-libre') options=('!strip') _srcname=linux-${pkgver} source=( https://www.kernel.org/pub/linux/kernel/v${_supver}.x/${_srcname}.tar.{xz,sign} config # the main kernel config file 0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch 0002-PCI-Add-more-NVIDIA-controllers-to-the-MSI-masking-q.patch 0003-iommu-intel-do-deep-dma-unmapping-to-avoid-kernel-fl.patch 0004-cpufreq-intel_pstate-ITMT-support-for-overclocked-sy.patch 0005-Bluetooth-btintel-Fix-bdaddress-comparison-with-garb.patch 0006-lg-laptop-Recognize-more-models.patch kernel_compiler_patch-${_gccpatchver}.tar.gz::https://github.com/graysky2/kernel_compiler_patch/archive/${_gccpatchver}.tar.gz ath9k-regdom-hack.patch raid6-default-algo.patch ) validpgpkeys=( 'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds '647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman ) # https://www.kernel.org/pub/linux/kernel/v5.x/sha256sums.asc sha256sums=('9c3731d405994f9cd3a1bb72e83140735831b19c7cec18e0d7a8f3046fa034e7' 'SKIP' '64a826a33cc95ff2af49c221229afc09b41a850efd4113ae6f0e33729fa91b15' '996504410a29ea81f2e3d811e4f461c9a996ca0dc4a7d17356da553b5a0a0ae3' 'b8889c24e947370e549b4b32df37ed78907eba1a8962a9cc4d2b115e6761690e' '9acbc5b3adb075fb8270ec1a6f4057c16b9a6f95605fb7bed5adf53e7cab79cf' '4112a5de6b27f4f861562f34e5b3e9a1a50e3600470b62bdd6a7aacac4e59f3b' 'aa11637c04a6f5c7851244a7537a1d1e08ccd6bbf5c13f8f6728d6c0d1824fb8' '056d16f200eb7160d10fbeca2dac1811e1a371ee6ddd1e498ccd19517719de80' '5a29d172d442a3f31a402d7d306aaa292b0b5ea29139d05080a55e2425f48c5c' 'e9e0d289170b7fb598b572d9c892ae8d1420952034aa415e8b3334f20a58edcc' '6ab863c8cfe6e0dd53a9d6455872fd4391508a8b97ab92e3f13558a6617b12a6') b2sums=('d2670e53d72fc5f0cf637394452a701c7ab41473be526d29deba7b60789dc56e1c369f3ae05a76f67890822588a36d0b497f267b4b75c33d0a98ad5131c697c9' 'SKIP' '3f8b8919b9382121bb3f20d09cc03fc9dc353d498df8e008e64f2060c7b1d9ab637e98560a0f9363a41c2ca05517497314f0768dd1e412c8d11637ff88a2ea4d' 'e8ccdb62fdf999dd39bee1590eb78de30dac6dc40b2c0a040b310e6c9f83baac34c8d15435a7537e21ccd848f6cd1779626846d23a6d7d6ceeb0931de91e44cd' 'bb78fac217e30cc0eaa6eba8c72403a80a2ccbf229005a0599288e40bad3fa270d6c366919748e44e68178dcd426c5d58cbea96c944f6f92dfc1210c0f8cdd68' '36cf961c14e8e15969a32809443c81c9d12ed607d21916eb839b8359e6794849cd5f34dc93546d83e0e3c8eb51754d216befb4877ea11edce908e08b80f76e44' '0d406b76dcc4b3265bc2eff4e11282c325e5ed73fcc0d96fe4389ba455f598df1baad2ef0d23f7a761dcb7454f024968c1c6198bfb2e3fffbc72f71391aafe1a' 'ce3be8d6f80cd1eb455901b5f121ca47726a96a760821cc8f4e7f515889c915794cababe41906bd4fb72101343e6671940f244e75ab17a8f0283a5a4479fa230' '3ca5c8ed70ff319cba5780dca8536da702d0483180865077baf7755bb79ee69962bc4aa8f2640f3920a8167901079e86a964d15c553323fa55400dd63eb2f793' '20674a8fcc0a85726e06460a7dbccfe731c46bf377cc3bf511b7591175e7df892f271bc1909e77d9a02913c753d241493502c5ab15d9f78e95f31aa4399c2c27' 'b6ef77035611139fa9a6d5b8d30570e2781bb4da483bb569884b0bd0129b62e0b82a5a6776fefe43fee801c70d39de1ea4d4c177f7cedd5ac135e3c64f7b895a' 'e94aa35d92cec92f4b0d487e0569790f3b712b9eaa5107f14a4200578e398ca740bf369f30f070c8beb56a72d1a6d0fc06beb650d798a64f44abe5e3af327728') export KBUILD_BUILD_HOST=arc4linux export KBUILD_BUILD_USER=$pkgbase export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})" prepare() { cd $_srcname # # kernel.org hasn't signed patches since 4.17.10 # add upstream patch # if [ "$_minver" != "0" ]; then # echo "Applying upstream patch" # patch -Np1 < ../patch-${_supver}.${_majver}-${pkgver} # fi # Hotfixes echo "Applying hotfixes" patch -p1 -i ../0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch # Fails to apply #patch -p1 -i ../0002-PCI-Add-more-NVIDIA-controllers-to-the-MSI-masking-q.patch patch -p1 -i ../0003-iommu-intel-do-deep-dma-unmapping-to-avoid-kernel-fl.patch # Fails to apply #patch -p1 -i ../0004-cpufreq-intel_pstate-ITMT-support-for-overclocked-sy.patch # Fails to apply #patch -p1 -i ../0005-Bluetooth-btintel-Fix-bdaddress-comparison-with-garb.patch # Fails to apply #patch -p1 -i ../0006-lg-laptop-Recognize-more-models.patch # graysky gcc patch echo "Applying graysky gcc patch" patch -p1 -i ../kernel_compiler_patch-${_gccpatchver}/more-uarches-for-kernel-${_gccpatchker}.patch # Ignore ath9k eeprom patch echo "Applying ath9k patch" patch -p1 -i ../ath9k-regdom-hack.patch # Set default raid6 algo patch echo " Applying raid6 patch" patch -p1 -i ../raid6-default-algo.patch # Append pkgrel and patchset suffixes echo "Setting version..." scripts/setlocalversion --save-scmversion echo "-$pkgrel" > localversion.10-pkgrel echo "${pkgbase#linux}" > localversion.20-pkgname echo "Setting config..." # we are in src/linux-x.yy.zz, looking for a config next to the pkgbuild # if [ "$_custom" == "1" ]; then # if [ -f ${SRCDEST}/config.previous ]; then # cp ${SRCDEST}/config.previous .config # fi # else cp ../config .config # fi echo "Cleaning up old and broken config settings..." make olddefconfig echo "Displaying diff between stock and updated config settings..." diff -u ../config .config || : # if [ "$_custom" == "1" ]; then # if [ -f $HOME/.config/modprobed.db ]; then # echo "Running make localmodconfig" # make LSMOD=$HOME/.config/modprobed.db localmodconfig # fi # fi if [ "$_custom" == "1" ]; then make menuconfig fi # Remove sublevel when no sublevel exists if [ "$_minver" == "0" ]; then sed -i '/SUBLEVEL = 0/d' Makefile fi make -s kernelrelease > version # workaround for make -s kernelrelease not applying # localversion to version when changed using menuconfig grep -Po '(?<=CONFIG_LOCALVERSION=").*(?=")' .config > ../localversion echo "$pkgver" > ../version.temp cat "localversion.10-pkgrel" >> ../version.temp cat "localversion.20-pkgname" >> ../version.temp cat ../localversion >> ../version.temp cat ../version.temp | tr -d "\n" > version # back up the config # if [ "$_custom" == "1" ]; then # echo "Backing up config..." # cp .config ${SRCDEST}/config.previous # fi echo "Prepared $pkgbase version $(