# 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=16 _gccpatchver='20221104' _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 0003-drm-sched-add-DRM_SCHED_FENCE_DONT_PIPELINE-flag.patch 0004-drm-amdgpu-use-DRM_SCHED_FENCE_DONT_PIPELINE-for-VM-.patch 0005-drm-i915-improve-the-catch-all-evict-to-handle-lock-.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=('842071bca611c1f080cbc39c7ab3a6b58d7951f4f41e553b3db4fbe3e0705ce4' 'SKIP' 'e490737c0007da7bf9275e4d5f0162b64bb27d31169c9a24c2258c56c76fa43f' '2f4d03a8bb21357f88d694b62fc3299944fa1738652dfe888ac0320d5d21f351' '671c3852d1adf7095cf82fdecf197c65df4d3003c917b56cee2fc9845cd06883' '3d00e39c53c107c87925eaeade32fc7d78e916e588ab5d8e4dd84c33ae748a96' '753576c6bc05bab969c5824fdb8dd8e6e1131d4c7f805dbaf5c529aafd2a1b6b' '3a8f397b89bad95c46f42c0f80ede7536a4a45a28621e00ed486918a55f905ed' 'e9e0d289170b7fb598b572d9c892ae8d1420952034aa415e8b3334f20a58edcc' '6ab863c8cfe6e0dd53a9d6455872fd4391508a8b97ab92e3f13558a6617b12a6') b2sums=('9e7b042e1f8fefd5b84aa867a0dfc3d86da8e531fdbdf84aed81dfe987c01bf2b4d4df13fcad5ceca0fec206032268c5324ce1dfefc8611016e44c3ddb50584d' 'SKIP' '02755ec326bde2703f0019d9fa214f6a7db52af43d47dde9ba87cd95bdc40fc4cc47f678a677640e4a472ec46790ba31ac36c37ded650740a1ef4f23b3f5e92b' '9d9dd78748f901b9be5876e1b34f4f13cae51384fbbfa653678924c6c8d90fdddf71b8c524aa2bc24548c6111adf160153753bd8a738866a2473459a338df6a0' 'd7b384645d39201c43871e3c6067012b8bb2b30bcce3217dbfdd6cc9437e1cf1ab7dbbbcd333cc5b9e04a986a6d1aefa9659cab73fdd308878621104285138b8' 'bc9d55712dbcb69a6220ffa98da46ac8ed78c2901e74aa65d4a5f35796a7cc17f2bd87d9d62924c18266f703bea67debf120d5ceff7a21963d1b35e022391252' 'c819f6054da048c136d058e2925dcce4fab694917bd0608aee7f616a74c2464176b9c842764af49589bcbf298bb267528c7607f81137415cfccde2fa51b4beea' '05bddc2b57189d7e302f32041079bcf60a06938e9afcfd02a0085a1430255286a5b663eed7cdb7f857717c65e9e27af4d15625b17e0a36d1b4ce1cbda6baee2b' '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 ../0003-drm-sched-add-DRM_SCHED_FENCE_DONT_PIPELINE-flag.patch patch -p1 -i ../0004-drm-amdgpu-use-DRM_SCHED_FENCE_DONT_PIPELINE-for-VM-.patch patch -p1 -i ../0005-drm-i915-improve-the-catch-all-evict-to-handle-lock-.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 $(