void-packages/srcpkgs/dkms/template
Andrew J. Hesford 2bec57b671 dkms: improvements to kernel post-install hook
When force-reinstalling kernel packages, `dkms install` is not run in
the kernel post-install hook because the modules are already installed.
This prevents `dkms install` from running `depmod -a` as it normally
does, but the forced reinstallation clobbers `modules.dep{,.bin}` with
the packaged versions that do not include DKMS-installed modules. The
post-install hook now tracks whether `depmod -a` should be run and does
so when necessary.

Other changes, courtesy of @ericonr, address issue #23124 wherein a DKMS
failure will terminate the script, preventing building or installation
of subsequent modules. The fix follows logic similar to that in the DKMS
xbps-trigger.
2020-07-10 22:18:04 -04:00

29 lines
1,000 B
Bash

# Template file for 'dkms'
pkgname=dkms
reverts="2.8.2_1"
version=2.8.1
revision=4
conf_files="/etc/dkms/framework.conf"
depends="bash kmod gcc make coreutils linux-headers"
short_desc="Dynamic Kernel Modules System"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2.0-or-later"
homepage="https://github.com/dell/dkms"
distfiles="${homepage}/archive/v${version}.tar.gz"
checksum=751e5dbc30a8cda26e379ff1940a80183145e77dab60914f160e037086177513
if [ "$CROSS_BUILD" ]; then
depends+=" libressl-devel gmp-devel libada-devel libmpc-devel flex"
fi
do_install() {
# We are only interested in the bare minimum.
vbin dkms
vman dkms.8
vinstall dkms_dbversion 644 var/lib/dkms
vinstall dkms.bash-completion 644 usr/share/bash-completion/completions dkms
vinstall dkms_framework.conf 644 etc/dkms framework.conf
# Kernel hooks.
vinstall ${FILESDIR}/kernel.d/dkms.postinst 750 etc/kernel.d/post-install 10-dkms
vinstall ${FILESDIR}/kernel.d/dkms.prerm 750 etc/kernel.d/pre-remove 10-dkms
}