Add PKGBUILD file for building development kernels as an Arch package

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
Anna Schumaker 2022-01-27 10:49:42 -05:00
parent 75635c2de8
commit 1aa5f29ae9
1 changed files with 45 additions and 0 deletions

45
PKGBUILD Normal file
View File

@ -0,0 +1,45 @@
# Maintainer: Anna Schumaker <anna.schumaker@netapp.com>
pkgname=linux-nfs
#pkgname="linux-$(git symbolic-ref --short HEAD | sed 's/\//./')"
pkgver=5.16.0.rc8.ANNA+
pkgrel=1
arch=(x86_64)
license=(GPL2)
options=('!strip')
pkgver() {
cd $startdir && make -s kernelrelease | sed 's/-/./g'
}
prepare() {
cd $startdir && makelinux.zsh olddefconfig
}
build() {
cd $startdir && makelinux.zsh all
}
package() {
pkgdesc="The Linux kernel and modules"
depends=(coreutils kmod initramfs)
cd $startdir
local kernver="$(make -s kernelrelease)"
local modulesdir="$pkgdir/usr/lib/modules/$kernver"
echo "Installing boot image..."
# systemd expects to find the kernel here to allow hibernation
# https://github.com/systemd/systemd/commit/edda44605f06a41fb86b7ab8128dcf99161d2344
install -Dm644 "$(make -s image_name)" "$modulesdir/vmlinuz"
# Used by mkinitcpio to name the kernel
echo "$pkgname" | install -Dm644 /dev/stdin "$modulesdir/pkgbase"
echo "Installing modules..."
makelinux.zsh INSTALL_MOD_PATH="$pkgdir/usr" INSTALL_MOD_STRIP=1 modules_install
# remove build and source links
rm -f "$modulesdir"/{source,build}
}
## vim:set ts=8 sts=2 sw=2 et: