# 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 IME/PSP and SGX/SEV and TXT/TEE/TDX and PXP # set _custom to 0 when using mkchrootpkg _custom=0 # set _nodocs to 1 to disable compiling kernel docs. _nodocs=0 pkgbase=linux _supver=6 _majver=6 _minver=14 _gccpatchver='20230105' _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 cpio gettext libelf pahole perl python tar xz # htmldocs graphviz imagemagick python-sphinx 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 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=('fbe96b2db3f962cd2a96a849d554300e7a4555995160082d4f323c2a1dfa1584' 'SKIP' 'a0e6644eabbae8a74cffb32e95d2bb7be880e5419ef2963b285c1ffa18704d5e' '602a2fd8d11f86824889318ec33cdb20030cbd713d63514126e9c11dcb78ccf3' '802946f623c69ae1a636b63697c23ca48af31a099415ed837d2c1e168a272d23' 'e9e0d289170b7fb598b572d9c892ae8d1420952034aa415e8b3334f20a58edcc' '6ab863c8cfe6e0dd53a9d6455872fd4391508a8b97ab92e3f13558a6617b12a6') b2sums=('d4c804f804562db0439e75d0a9605e0da55f80103d11087ced20486cc0813e4840ec928dc55e33ae654509e593236d6a62fc1a0d4b911a1d943b5e13b525267e' 'SKIP' '6d14e7e959735cccc663ded9c16aaf8ebf3654ebeb2eaa032e7b5c888968a020833b68a847f20aad1b27eb68604b3817801eb05a20d1e41285cafb7e76dd6cff' '62b993e415186acc54f11c79f140f9f4df0c62658fa45e4895d131a3729810c181bfd7f13c6059ed882aa1d8ce79651acc30ab42077bae5497b4f0a1d05bf1aa' 'd178dad69501967382d5c841f65e4f57651042bee8117041a9baa35ab3fa73af8174b8b999ae9e72ec381c52744ccaaabb77944d59f123c04b6ed5626432d843' '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 # 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..." 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 $(