# 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=19 _minver=6 _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 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=('41a4f824af614460c429a7c723e8dcbb0e042f0047d328c18b4ed6f2b4efa63a' 'SKIP' '6bcf2eb3d3847dff866eb1a755598fa8c8bcda3242e80bd417b452a72d73d059' '180c46b1a72a472595ae56ad480c1999d165d485e277b5fde617e9b47fa043cd' 'f005c97c004164f974929b40821a1e1d83f2c596a53fa15d5b11f974dc4b90d3' '0e1cb39e301ba7a8a86f110caafeb51f02222a0302681aa4b357fc48ced545b0' 'c95f77b0dd8eef06ef1c3399ec32143baebce5349ba4fe7c102c0ad4389cb359' '3770a414a5d3a74f30ce20883b2e44d11e2e5c1ce6c877f30247b8976ea210ef' '5a29d172d442a3f31a402d7d306aaa292b0b5ea29139d05080a55e2425f48c5c' 'e9e0d289170b7fb598b572d9c892ae8d1420952034aa415e8b3334f20a58edcc' '6ab863c8cfe6e0dd53a9d6455872fd4391508a8b97ab92e3f13558a6617b12a6') b2sums=('dd6fba4d56d26923310426589b28c83f699a62b676a76257e0ac49bc85d30ffb24f7a66a20108dfc5bdaa1454fb0ece3f28c483b246d3778cff220de527ec4aa' 'SKIP' '905eb48a5fc52f012931fa8576d41654c3949f71f80b082c6f5014abb439f62ae2acd86bd335d66b1e794ff5909080e76d642382b86b0d3e93cbb8257aa97f42' 'a16b6618d6f40332b05f867d6611a7542806f5b1f13ffd6f06d875c281187aea28f5f26cf1250fe8902d94b473c68e2173c62073416e5e2f414eded588df7b19' '07f4568e058391e28dbb3bd959d977d1bec3b661e46bf2f28492b8a308203c93f9e9f73348da13c660510ff55d15d7cfc9406e677aa00c86ce6d1b553bd9bbb6' '26622129cf33159aee5b1061847958575e3c3703723ea1e83e266462b44a5e216b6aae1680c70463d4b2122ee8fe31487d39fb61a7335111ee62d2959539b6ed' 'a09b7ccf3192a42b756d3feb89753d16042da3113bb5d269f9cc9e17a6e3ddaedc19ccca21f65c6306f987443e11b8faa0fa48595bab27deec7bc7ddb5d296c5' '77c8caa7c5fc9c64f9e27d0a1a70496e970fa769f8e9cba38908c97dea2657eebeb8a0e7386aacbf7d126a1a8f351f3157b1853c1085bc97087a1205997430f3' '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 # 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 $(