# Maintainer: Jan Alexander Steffens (heftig) # Maintainer: Tobias Powalowski # Contributor: Thomas Baechler pkgbase=linux # Build stock -ARCH kernel #pkgbase=linux-custom # Build kernel with a different name _srcver=5.2-arch2 pkgver=${_srcver//-/.} pkgrel=1 arch=(x86_64) url="https://git.archlinux.org/linux.git/log/?h=v$_srcver" license=(GPL2) makedepends=( xmlto kmod inetutils bc libelf git python-sphinx python-sphinx_rtd_theme graphviz imagemagick ) options=('!strip') _srcname=archlinux-linux source=( "$_srcname::git+https://git.archlinux.org/linux.git?signed#tag=v$_srcver" config # the main kernel config file 60-linux.hook # pacman hook for depmod 90-linux.hook # pacman hook for initramfs regeneration linux.preset # standard config files for mkinitcpio ramdisk 0c3d7282233c7b02c74400b49981d6fff1d683a8.patch ) validpgpkeys=( 'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds '647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman '8218F88849AAC522E94CF470A5E9288C4FA415FA' # Jan Alexander Steffens (heftig) ) sha256sums=('SKIP' '013defd92c7530724105f323a22ae484cfc4a9053bbdc8eb2260134d873d7d86' 'ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21' 'c043f3033bb781e2688794a59f6d1f7ed49ef9b13eb77ff9a425df33a244a636' 'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65' 'cd106d38b19709d2ba690dce3ca47ee8bfd71931ecd948d9bffdb4ecb00d65ca') _kernelname=${pkgbase#linux} : ${_kernelname:=-ARCH} prepare() { cd $_srcname msg2 "Setting version..." scripts/setlocalversion --save-scmversion echo "-$pkgrel" > localversion.10-pkgrel echo "$_kernelname" > localversion.20-pkgname local src for src in "${source[@]}"; do src="${src%%::*}" src="${src##*/}" [[ $src = *.patch ]] || continue msg2 "Applying patch $src..." patch -Np1 < "../$src" done msg2 "Setting config..." cp ../config .config make olddefconfig make -s kernelrelease > ../version msg2 "Prepared %s version %s" "$pkgbase" "$(<../version)" } build() { cd $_srcname make bzImage modules htmldocs } _package() { pkgdesc="The ${pkgbase/linux/Linux} kernel and modules" [[ $pkgbase = linux ]] && groups=(base) depends=(coreutils linux-firmware kmod mkinitcpio) optdepends=('crda: to set the correct wireless channels of your country') backup=("etc/mkinitcpio.d/$pkgbase.preset") install=linux.install local kernver="$( "$startdir/$install.pkg" true && install=$install.pkg # fill in mkinitcpio preset and pacman hooks sed "$subst" ../linux.preset | install -Dm644 /dev/stdin \ "$pkgdir/etc/mkinitcpio.d/$pkgbase.preset" sed "$subst" ../60-linux.hook | install -Dm644 /dev/stdin \ "$pkgdir/usr/share/libalpm/hooks/60-$pkgbase.hook" sed "$subst" ../90-linux.hook | install -Dm644 /dev/stdin \ "$pkgdir/usr/share/libalpm/hooks/90-$pkgbase.hook" msg2 "Fixing permissions..." chmod -Rc u=rwX,go=rX "$pkgdir" } _package-headers() { pkgdesc="Header files and scripts for building modules for ${pkgbase/linux/Linux} kernel" local builddir="$pkgdir/usr/lib/modules/$(