# Maintainer: # Contributor: éclairevoyant # Contributor: Mark Weiman (markzz) # Contributor: Katelyn Schiesser (slowbro) # Contributor: Dan Ziemba # Upstream: Jan Alexander Steffens (heftig) ## options : ${_build_patch:=true} : ${_build_clang:=false} : ${_build_v3:=false} [[ "${_build_v3::1}" == "t" ]] && _pkgtype+="-v3" ## basic info _gitname="linux" _pkgname="$_gitname-vfio" pkgbase="$_pkgname${_pkgtype:-}" pkgver=6.7 pkgrel=2 pkgdesc='Linux' url='https://www.kernel.org' arch=(x86_64) license=(GPL-2.0-or-later) makedepends=( bc cpio gettext libelf pahole perl python tar xz # htmldocs graphviz imagemagick python-sphinx texlive-latexextra ) options=('!strip') _srcname=linux-$pkgver source=( https://cdn.kernel.org/pub/linux/kernel/v${pkgver%%.*}.x/${_srcname}.tar.{xz,sign} config # the main kernel config file 1001-add-acs-overrides.patch # updated from https://lkml.org/lkml/2013/5/30/513 1002-i915-vga-arbiter.patch # updated from https://lkml.org/lkml/2014/5/9/517 ) sha256sums=( 'ef31144a2576d080d8c31698e83ec9f66bf97c677fa2aaf0d5bbb9f3345b1069' 'SKIP' '45a44ff0e957cd562d2ceb60c1c90fc19c19e808209cebb46bfacfccfb56ad96' 'f342986bd27980c96c952b0dd8103d3e21a942d87f18df1308fab370e20010fb' '2a3c732d4d61a631c98b2a3e4afb1fa5dbf8be5c43519b2a59d0e65170c9d8db' ) validpgpkeys=( ABAF11C65A2970B130ABE3C479BE3E4300411886 # Linus Torvalds 647F28654894E3BD457199BE38DBBDC86092693E # Greg Kroah-Hartman 83BC8889351B5DEBBB68416EB8AC08600F108CDF # Jan Alexander Steffens (heftig) ) if [[ ${_build_patch::1} == "t" ]] ; then _srctag=v$pkgver-arch1 _dl_url_arch='https://github.com/archlinux/linux' 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 CC=clang export CXX=clang++ export LDFLAGS+=" -fuse-ld=lld" export HOSTCC=clang export LLVM=1 export LLVM_IAS=1 fi export KBUILD_BUILD_HOST=archlinux export KBUILD_BUILD_USER=$pkgbase export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})" _prep_v3() { [[ "${_build_v3::1}" != "t" ]] && return export CFLAGS="$(echo "$CFLAGS" | sed -E 's@(\s*-(march|mtune)=\S+\s*)@ @g;s@\s*-O[0-9]\s*@ @g;s@\s+@ @g') -march=x86-64-v3 -mtune=generic -O3" export CXXFLAGS="$(echo "$CXXFLAGS" | sed -E 's@(\s*-(march|mtune)=\S+\s*)@ @g;s@\s*-O[0-9]\s*@ @g;s@\s+@ @g') -march=x86-64-v3 -mtune=generic -O3" } prepare() { _prep_v3 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 # 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 # disable tracers scripts/config \ --disable CONFIG_FTRACE \ --disable CONFIG_FUNCTION_TRACER \ --disable CONFIG_STACK_TRACER # disable numa scripts/config --disable CONFIG_NUMA fi echo "Setting config..." cp ../config .config make olddefconfig diff -u ../config .config || : make -s kernelrelease > version echo "Prepared $pkgbase version $(