# Maintainer: # Contributor: éclairevoyant # Contributor: Mark Weiman (markzz) # Contributor: Katelyn Schiesser (slowbro) # Contributor: Dan Ziemba ## options : ${_build_arch_patch:=true} : ${_build_clang:=false} : ${_build_tracer:=true} : ${_build_numa:=true} : ${_build_vfio:=true} : ${_build_lts:=false} : ${_build_v3:=false} unset _pkgtype [[ "${_build_vfio::1}" == "t" ]] && _pkgtype+="-vfio" [[ "${_build_lts::1}" == "t" ]] && _pkgtype+="-lts" [[ "${_build_v3::1}" == "t" ]] && _pkgtype+="-v3" ## basic info _gitname="linux" _pkgname="$_gitname${_pkgtype:-}" pkgbase="$_pkgname" pkgver=6.8.5 pkgrel=1 pkgdesc='Linux' url='https://www.kernel.org' license=('GPL-2.0-or-later') arch=('x86_64') makedepends=( bc cpio gettext libelf pahole perl python tar xz # htmldocs graphviz imagemagick python-sphinx python-yaml texlive-latexextra ) options=('!strip') _srcname=linux-$pkgver source+=( https://cdn.kernel.org/pub/linux/kernel/v${pkgver%%.*}.x/${_srcname}.tar.{xz,sign} "config-$pkgver"::https://gitlab.archlinux.org/archlinux/packaging/packages/linux/-/raw/main/config ) sha256sums+=( '138923e5d73748b4bdbe9b5a0b8f36dfac9fcc16753a9222928dc6c963effa89' 'SKIP' 'SKIP' ) validpgpkeys=( ABAF11C65A2970B130ABE3C479BE3E4300411886 # Linus Torvalds 647F28654894E3BD457199BE38DBBDC86092693E # Greg Kroah-Hartman 83BC8889351B5DEBBB68416EB8AC08600F108CDF # Jan Alexander Steffens (heftig) ) if [[ ${_build_vfio::1} == "t" ]] ; then source+=( 1001-6.8.0-add-acs-overrides.patch # updated from https://lkml.org/lkml/2013/5/30/513 1002-6.8.0-i915-vga-arbiter.patch # updated from https://lkml.org/lkml/2014/5/9/517 ) sha256sums+=( 'b35c26d5dc31fb9cfac68292de7b1ee8ca93b4647e4958efc77e2c77f586f1f2' '966c15da4044a9a3b5f9d362c2cf08303f1265ad4489c9835c95973b71255d07' ) fi if [[ ${_build_arch_patch::1} == "t" ]] ; then _srctag=v${pkgver}-arch1 _dl_url_arch='https://github.com/archlinux/linux' # if no new patch, use previous one if grep 404 <(curl -sI $_dl_url_arch/releases/download/$_srctag/linux-$_srctag.patch.zst | head -1) > /dev/null ; then _srctag=v${pkgver::4}$(( ${pkgver##*.} -1 ))-arch1 fi source+=( $_dl_url_arch/releases/download/$_srctag/linux-$_srctag.patch.zst{,.sig} ) sha256sums+=( 'SKIP' 'SKIP' ) fi if [[ ${_build_clang::1} == "t" ]] ; then makedepends+=(clang llvm lld) export LLVM=1 export LLVM_IAS=1 fi if [[ "${_build_v3::1}" == "t" ]] ; then export KCFLAGS="-march=x86-64-v3 -mtune=generic -O3" export HOSTCFLAGS="-march=x86-64-v3 -mtune=generic -O3" export HOSTCXXFLAGS="-march=x86-64-v3 -mtune=generic -O3" fi export KBUILD_BUILD_HOST=archlinux export KBUILD_BUILD_USER=$pkgbase export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})" _prepare_extra() { # remove extra version suffix sed -E 's&^(EXTRAVERSION =).*$&\1&' -i Makefile if [[ "${_build_clang::1}" == "t" ]] ; then scripts/config --disable LTO_CLANG_FULL scripts/config --enable LTO_CLANG_THIN fi if [[ "${_build_clang::1}" == "t" ]] || [[ "${_build_tracer::1}" != "t" ]] ; then echo "Disabling Tracers..." scripts/config \ --disable CONFIG_FTRACE \ --disable CONFIG_FUNCTION_TRACER \ --disable CONFIG_STACK_TRACER fi if [[ "${_build_numa::1}" != "t" ]] ; then echo "Disabling NUMA..." scripts/config --disable CONFIG_NUMA fi } prepare() { cp "config-$pkgver" "config" cd $_srcname echo "Setting version..." echo "-$pkgrel" > localversion.10-pkgrel echo "${pkgbase#linux}" > localversion.20-pkgname local src for src in "${source[@]}"; do src="${src%%::*}" src="${src##*/}" src="${src%.zst}" [[ $src = *.patch ]] || continue echo echo "Applying patch $src..." patch -Np1 -F100 -i "../$src" done echo "Setting config..." cp ../config .config make olddefconfig diff -u ../config .config || : _prepare_extra make -s kernelrelease > version echo "Prepared $pkgbase version $(