# 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=6 _majver=0 _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-mm-vmscan-fix-extreme-overreclaim-and-swap-floods.patch 0003-soundwire-intel-Initialize-clock-stop-timeout.patch 0004-drm-sched-add-DRM_SCHED_FENCE_DONT_PIPELINE-flag.patch 0005-drm-amdgpu-use-DRM_SCHED_FENCE_DONT_PIPELINE-for-VM-.patch 0006-drm-amdgpu-Fix-VRAM-BO-swap-issue.patch 0007-drm-amdgpu-Fix-for-BO-move-issue.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=('864b05af2d869ba73d61a9c5959e4531a141ab2bd7b217483671f625f9747faa' 'SKIP' '6cae8edbfa8793f8f439b625eddac6c229b2703bb1ecb834da6339fb2b96cfbb' 'f1aafd32cd42e9ebb3475597db05bf27561ae52a7b48ec5bc353be3ca50925a1' '0a4ab2a5f7cf2cd78ca20678775f4ead39169bd7d7ba5e7ecae9053a9c94071b' 'ef1e125fb021ab64aeeda696408d6ed8232a4261a0a2489afc560350fc7312bc' 'feac2bd6fc4ee7c566975e09cb55bdc7be192988b037a0e79fd7e51f3f914221' '76052ea5929bac6b4fccc77b321cb273d6fca64426b7584fca5ff36a470d6eb1' 'e0e9dc4b1a0ea0fd1af0825c0b49844ea364e3163c4291b8712919f49914c4ef' '1487f13aa32de66562fca3b61e8c97c45c6f8dc2362403b141be2db423fcc3e1' '5a29d172d442a3f31a402d7d306aaa292b0b5ea29139d05080a55e2425f48c5c' 'e9e0d289170b7fb598b572d9c892ae8d1420952034aa415e8b3334f20a58edcc' '6ab863c8cfe6e0dd53a9d6455872fd4391508a8b97ab92e3f13558a6617b12a6') b2sums=('af53568340db3d63e3bbe8c5f27fff1e285b332845b9af960ee230c116e0555cc50857b6617d1b54f56e8de6717a940ff443cae9bf7dd8cc81326fe15ec6da5f' 'SKIP' '45e471912f742b68bd445a2d7d9f4026147c8f315712831e12096bf98f8777404acaada639b6ffd52efbe14ec2661dc8b72464990d8c6efc83c2f4f91a01850c' '8236310256459eb29f2f056972adc4e8cbcdfe034ac61c86d3931940f63e9d7c026020f7078cdb0445b8615c21f021400218f84cd583e2d13b6a6d6a23f08a18' '34e940c9ff679522cc5d0df9777ad3b5eaca8bc875c314179aa882fd8b54754672dbc8250708011c1a89ec4021713a1a3e3ae8487d4217929ea02dbd757696a6' '4d7cb398838de0d756c43a0c42dcd26eb88cc43a452e8f87bae665a10740f7d7743080d9112b8ac7dd4fd10fe51a7d90d5234302b795e8b5cc4a5105ee330570' '3a7867e77dfacabfd96e89a84c81ae6ce3d573e6fd5cf9f1634be0b7e8d846c85e5fc6c3015f314774705b52b27ec480a82c63b342bbff8bbb28612936f95ec1' 'ec3964044f303732abaf7cd804eeef0aa1d5c90fbbaebbe58479e4c0a1620f185e88181a4f877f1f3eb0d81c6e74058d5960f2933af1edc50cbb5d5ef4ca2220' 'fa7d3d6c1b0ed25a5ecb3d024b3293a4b2989da590f2bac4be82714fa4cf14a3964a07567a86279d2f1c1a89af385d24b325b1c2bf300448ff46928dff7dc5df' '1e6c45c4a5ea2846c3b311fb55eb8f869a2f39eef3fe00d02e77d3ceb8ade31cbbbb37edc796d2e690597c55fddfe5a42023b3d38d13f58d0fd9a0bd1ae18f29' '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-mm-vmscan-fix-extreme-overreclaim-and-swap-floods.patch patch -p1 -i ../0003-soundwire-intel-Initialize-clock-stop-timeout.patch patch -p1 -i ../0004-drm-sched-add-DRM_SCHED_FENCE_DONT_PIPELINE-flag.patch patch -p1 -i ../0005-drm-amdgpu-use-DRM_SCHED_FENCE_DONT_PIPELINE-for-VM-.patch patch -p1 -i ../0006-drm-amdgpu-Fix-VRAM-BO-swap-issue.patch patch -p1 -i ../0007-drm-amdgpu-Fix-for-BO-move-issue.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 $(