# Maintainer: Jan Alexander Steffens (heftig) # Maintainer: Tobias Powalowski # Maintainer: Thomas Baechler pkgbase=linux # Build stock kernel #pkgbase=linux-custom # Build kernel with a different name _srcver=4.17.11-arch1 pkgver=${_srcver//-/.} pkgrel=1 arch=(x86_64) url="https://github.com/archlinux/linux/commits/v$_srcver" license=(GPL2) makedepends=(xmlto kmod inetutils bc libelf git) options=('!strip') _srcname=archlinux-linux source=( "$_srcname::git+https://github.com/archlinux/linux?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 ) validpgpkeys=( 'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds '647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman '8218F88849AAC522E94CF470A5E9288C4FA415FA' # Jan Alexander Steffens (heftig) ) sha256sums=('SKIP' 'aa7b6756f193f3b3a3fc4947e7a77b09e249df2e345e6495292055d757ba8be6' '36e326d8a88b4087a3a0ee0d47643fc03baeda487659980d0e9d08791e4c729c' '75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919' 'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65') prepare() { cd $_srcname msg2 "Setting version..." scripts/setlocalversion --save-scmversion echo "${pkgbase#linux}" > localversion.10-pkgname echo "-$pkgrel" > localversion.20-pkgrel 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 } _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/$(