# 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/TDX 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=19 _minver=8 _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-drm-i915-psr-Use-full-update-In-case-of-area-calcula.patch 0003-drm-i915-Ensure-damage-clip-area-is-within-pipe-area.patch 0004-mm-vmscan-fix-extreme-overreclaim-and-swap-floods.patch 0005-soundwire-intel-use-pm_runtime_resume-on-component-p.patch 0006-ALSA-hda-Once-again-fix-regression-of-page-allocatio.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=('616308795a952a6a39b4c74807c33916850eb7166d8ed7c9a87a1ba55d7487ce' 'SKIP' '9c432835f1946ae193f59a2bb31fe1710fc3c19a155e076c61ce8d5c67716085' '01cc6ce2532e8d1e7b09356685bbd6411511db172623dffc9893648cfcec965b' 'cb1d989d6d2933aa7014a54ada1d211d1ce7ec4e151b796e31c91b315fcfcdac' 'c780396f89f014b8af75a05b46873c9034444ae3fb4f79dfb9573838b4c9e96c' 'ff8f03fdb1d47fae5a0b963dce81b07d10bbb2d97e5e7364690f70110e8cf59a' 'e29c3d59d7a2fe43fb86d78145f039632c5f124f6a42d712fa99e87fe24ac052' '807d79f002fe0ef0404f20ad28549a2860eb3eb34b297a3fdcd2481d6b7c5a20' '5a29d172d442a3f31a402d7d306aaa292b0b5ea29139d05080a55e2425f48c5c' 'e9e0d289170b7fb598b572d9c892ae8d1420952034aa415e8b3334f20a58edcc' '6ab863c8cfe6e0dd53a9d6455872fd4391508a8b97ab92e3f13558a6617b12a6') b2sums=('59731fb2ceb6b1e6bb79121b0e07c755d2ce37cdf6b82458fe24bf6bb25f88f9d18dd2b657988842bb7b2a1c2ba685fdf3bf130bfca8960b801cd6ee1a973932' 'SKIP' 'db611718464698e8dcc5332d441e0a807b5d6bb42c609b453035a1230b05ee5d7a7cef36a3c3477e389527cf816f645d582f43a50442d66692fe3a5e8a410c69' 'fce7cffc63bdee190179171bd3a1b4c63924f6f20fe2cf365ba25763a423ff91e6f83917f5c07e6c436ffcbc5f3b49c474c1e8d430730cbbba7b83c75fb3ccc9' '3ea126197266d596617941c7f36c29e48b5167b817f19ac24485bafd3815e16eb33589432ca038cd283255b5fd4c4d66f0986b0bb50c3fa50022017ee1bf8507' '471201842b50e639fb3b7a9e01ec311a7384c38c3a6678cde02d83e58711c5634e93702aae43b07ca758de8ada5363c2d42ba2c22b9e2e0eeb9a6be6526894b0' '25f6d4310920e7bb72b1da2f208b40b2e65ea1112b7deb24752b5d694155167eb431322c31f9dde5258e7bcf453e0ce0903bc07b1e515fe7cbbda2bec4392637' 'c137261768ac53a7e7b97f8f86b563a0f41f077f22297ed3c96ca595345c9fcc040461fd33e83af07223ee20d940afb5b5b2001c6ccf433d79453b3d9c14f912' 'fb083e1cb1145a02ab7225240885f40595b86f5440b4b0c52587af4cd4e8395ae212b28754d3541f705e9044b4bc11882d2cd9fb90be2fa92370bbfaac716041' '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 patch -p1 -i ../0002-drm-i915-psr-Use-full-update-In-case-of-area-calcula.patch patch -p1 -i ../0003-drm-i915-Ensure-damage-clip-area-is-within-pipe-area.patch patch -p1 -i ../0004-mm-vmscan-fix-extreme-overreclaim-and-swap-floods.patch patch -p1 -i ../0005-soundwire-intel-use-pm_runtime_resume-on-component-p.patch patch -p1 -i ../0006-ALSA-hda-Once-again-fix-regression-of-page-allocatio.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 $(