# Maintainer: David Cohen # Contributor: Jan Alexander Steffens (heftig) # This PKGBUILD script and the config file are based on official Arch's linux package # Refer to config file to get the exact versions it's based on. Any changes to the config # will be on config.extra file. pkgbase=linux-mainline-git pkgver=v5.17.r11138.f022814633e1 pkgrel=1 pkgdesc="Linus Torvalds' Mainline Linux" url="https://www.kernel.org" arch=(x86_64) license=(GPL2) _userconfig="/etc/${pkgbase}/config" backup=("${_userconfig##/}") makedepends=( bc kmod libelf pahole cpio perl tar xz xmlto python-sphinx python-sphinx_rtd_theme graphviz imagemagick git ) options=('!strip') _srcname=linux-torvalds source=( "$_srcname::git+https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux" config # the main kernel config file config.extra # additional configs config.user # user custom config ) validpgpkeys=( 'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds '647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman ) sha256sums=('SKIP' '05381b085c83737922a85fa6f42aa61b3d1400840a7952bf8524726e1d8f74f8' '6e41a729c2f2946d3606ca2c0cb3a058c9700b0f73110eed36dcba91a271e50f' 'b5ced6ad1f03a5cfe6dccc0b2b31f91420cfe97823e5d15d5b94b7224362daa9') export KBUILD_BUILD_HOST=archlinux export KBUILD_BUILD_USER=$pkgbase export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})" pkgver() { cd "$srcdir/$_srcname" printf "%s" "$(git describe --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')" } prepare() { cd $_srcname echo "Setting version..." scripts/setlocalversion --save-scmversion echo "-$pkgrel" > localversion.10-pkgrel echo "${pkgbase#linux}" > localversion.20-pkgname local src for src in "${source[@]}"; do src="${src%%::*}" src="${src##*/}" [[ $src = *.patch ]] || continue echo "Applying patch $src..." patch -Np1 < "../$src" done echo "Setting config..." cat ../config ../config.extra > .config if [[ -f "$_userconfig" ]]; then cat $_userconfig >> .config fi make olddefconfig diff -u ../config .config || : make -s kernelrelease > version echo "Prepared $pkgbase version $(