# 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 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=17 _minver=7 _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 kmod 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-random-treat-bootloader-trust-toggle-the-same-way-as.patch 0003-tick-Detect-and-fix-jiffies-update-stall.patch 0004-tick-rcu-Remove-obsolete-rcu_needs_cpu-parameters.patch 0005-tick-rcu-Stop-allowing-RCU_SOFTIRQ-in-idle.patch 0006-lib-irq_poll-Declare-IRQ_POLL-softirq-vector-as-ksof.patch 0007-NFSv4.1-provide-mount-option-to-toggle-trunking-disc.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=('22f67ef6b12ef6c0c0353be4b90b4bf4b9b18b858c16c346fa495b67ec718c99' 'SKIP' 'c603b522eaf21f9a4e937645798bec4d6939eb5149b55fd487b87ca41454e108' 'f1a5d1b1830c630313e3283c6dcc870be0f4f23cbdfe514c435dfdbc705b615e' '6ab72cc873bb00b8719435b370a2f4af6d9d22c83e59e84595021f39780b73f3' '10d85461ff413b7df600c9a4715e84fe7aa0515dfbc1e1dcecf43c3a642405c8' '4d539c730b90be03cf1ee2cdfcec9801b3ffcff571b3bf8f5d7f711bc6c6026e' '4a52a207f7183f4a2f59457896fff09bd2ec4e3be9207ecd281a98926dbcb455' '132393d3dfc185d3bb1d5c9b92e77222cec73c0314aa8f09da186a6622aa2d6d' '24790cf2e78dbed5cef3c8be275b4c564573b8f22a1b05014d29c0b1cf3f37eb' '5a29d172d442a3f31a402d7d306aaa292b0b5ea29139d05080a55e2425f48c5c' 'e9e0d289170b7fb598b572d9c892ae8d1420952034aa415e8b3334f20a58edcc' '6ab863c8cfe6e0dd53a9d6455872fd4391508a8b97ab92e3f13558a6617b12a6') b2sums=('1c1b1f59404becef201c28d6677a2a52a828a51903d0fe5b38a931fa25694d766eeb222b02f674d95ea8c67c29e0f3420b88f94bdccfc2f9bd575c2605e8f229' 'SKIP' 'f9b876591ae41bf7d92f610d8b9a29bd6ec53b2a3b88aa1bb5e51df9debc244b9a98c4c9b917e463be517c8e10675a46866604e19b3dbc415b779cf7428b3415' '086702550147990472eb990fa8d5aac0f1e89ec592d66f12ba146a7b8a78438835a247d13986252f2b1356727e48075276729bc33787a10d451b7afae2dc0d3c' 'fc2484c417e237d531833158deca0a82e40cc660122bd19d1dd326719d5e216390074de502fd01d2d26913978bb8175188de59ceb76b62c19eb7079ea8c898b0' 'dd32268ebe42108f487e1aff7d762d60fa192d4b5827a1f55c6d7bc0fa5020981e5fc76a979296e1c11caf077b4203fb0892c0e383079f646dbba4b3a4604fe1' 'f0b96a0c38519b6a761a67fde8174f884a493722198b82c5b8fb7627fec86cc5438191b4a267f24315bc29515942d6b138a70ae5eedf5e705486f89892ec6b57' 'e2757b7dd92835a987e83aa3d94091d977d5d8d58cb666ef0439d91f22a8b8de8cd8d48bbfa07ed91c01300781e8808e2c2a8a962977d53e927c2c7b381595ee' 'e9e3fa451a9c8a65a4fb0d42ae463b08f1092e3d8e11b0449291fe7a355dd75ee474e0eccc9538ccddbd173cdcba4afec5dfad2f3aa4c7f8babe093171f3beb8' '514580d351d616b0ca8d134e501c8920ad753a028cf986e525f993460ce593e7f7ec53e4c52f39ed2a0b19e0df8409ebd289cdfb91afcf95dd77c04197351e17' '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-random-treat-bootloader-trust-toggle-the-same-way-as.patch patch -p1 -i ../0003-tick-Detect-and-fix-jiffies-update-stall.patch patch -p1 -i ../0004-tick-rcu-Remove-obsolete-rcu_needs_cpu-parameters.patch patch -p1 -i ../0005-tick-rcu-Stop-allowing-RCU_SOFTIRQ-in-idle.patch patch -p1 -i ../0006-lib-irq_poll-Declare-IRQ_POLL-softirq-vector-as-ksof.patch patch -p1 -i ../0007-NFSv4.1-provide-mount-option-to-toggle-trunking-disc.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 $(