dkms: allow limiting jobs, add missing dep
some less-powerful platforms may be overwhelmed by the default `-j$(nproc)`. Allow overriding this by setting `DKMS_JOBS` in `/etc/default/dkms` `bc` is needed for `make prepare0` on kernel 6.1+, which is run on cross.
This commit is contained in:
parent
2d90f29aca
commit
6cb5dcabf9
2
srcpkgs/dkms/files/dkms.default
Normal file
2
srcpkgs/dkms/files/dkms.default
Normal file
@ -0,0 +1,2 @@
|
||||
# number of parallel jobs to use for DKMS compilation (default: $(nproc))
|
||||
#DKMS_JOBS=
|
@ -17,10 +17,13 @@ if [ ! -e /lib/modules/${VERSION}/build/include ] ; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
[ -r /etc/default/dkms ] && . /etc/default/dkms
|
||||
: "${DKMS_JOBS:=$(nproc)}"
|
||||
|
||||
export IGNORE_CC_MISMATCH=1
|
||||
|
||||
if [ ! -f /lib/modules/${VERSION}/build/scripts/basic/fixdep ] || [ ! -f /lib/modules/${VERSION}/build/scripts/mod/modpost ]; then
|
||||
yes "" | make -j $(nproc) -C /lib/modules/${VERSION}/build prepare0
|
||||
yes "" | make -j "${DKMS_JOBS}" -C /lib/modules/${VERSION}/build prepare0
|
||||
fi
|
||||
|
||||
# Check available DKMS modules
|
||||
@ -68,7 +71,7 @@ while [ $# -gt 1 ]; do
|
||||
fi
|
||||
# Build the module
|
||||
echo -n "Building DKMS module: ${module}-${modulever}... "
|
||||
/usr/bin/dkms build -q -m ${module} -v ${modulever} -k ${VERSION} -a ${ARCH}
|
||||
/usr/bin/dkms build -j "${DKMS_JOBS}" -q -m ${module} -v ${modulever} -k ${VERSION} -a ${ARCH}
|
||||
rval=$?
|
||||
# If the module was skipped or failed, go to the next module.
|
||||
if [ $rval -eq 0 ]; then
|
||||
@ -87,7 +90,7 @@ while [ $# -gt 1 ]; do
|
||||
if [ $(echo "$status"|grep -c ": built") -eq 1 ] &&
|
||||
[ $(echo "$status"|grep -c ": installed") -eq 0 ]; then
|
||||
echo -n "Installing DKMS module: ${module}-${modulever}... "
|
||||
/usr/bin/dkms install --force -q -m ${module} -v ${modulever} -k ${VERSION} -a ${ARCH}
|
||||
/usr/bin/dkms install --force -j "${DKMS_JOBS}" -q -m ${module} -v ${modulever} -k ${VERSION} -a ${ARCH}
|
||||
rval=$?
|
||||
# If the module failed installation, go to the next module.
|
||||
if [ $rval -eq 0 ]; then
|
||||
|
@ -1,9 +1,9 @@
|
||||
# Template file for 'dkms'
|
||||
pkgname=dkms
|
||||
version=3.0.10
|
||||
revision=2
|
||||
conf_files="/etc/dkms/framework.conf"
|
||||
depends="bash kmod gcc make coreutils xbps-triggers>=0.123_1"
|
||||
revision=3
|
||||
conf_files="/etc/dkms/framework.conf /etc/default/dkms"
|
||||
depends="bash kmod gcc bc make coreutils xbps-triggers>=0.123_1"
|
||||
short_desc="Dynamic Kernel Module Support"
|
||||
maintainer="Orphaned <orphan@voidlinux.org>"
|
||||
license="GPL-2.0-or-later"
|
||||
@ -35,6 +35,7 @@ do_install() {
|
||||
vcompletion dkms.bash-completion bash dkms
|
||||
vinstall dkms_framework.conf 644 etc/dkms framework.conf
|
||||
# Kernel hooks.
|
||||
vinstall ${FILESDIR}/kernel.d/dkms.postinst 754 etc/kernel.d/post-install 10-dkms
|
||||
vinstall ${FILESDIR}/kernel.d/dkms.prerm 754 etc/kernel.d/pre-remove 10-dkms
|
||||
vinstall "${FILESDIR}/kernel.d/dkms.postinst" 754 etc/kernel.d/post-install 10-dkms
|
||||
vinstall "${FILESDIR}/kernel.d/dkms.prerm" 754 etc/kernel.d/pre-remove 10-dkms
|
||||
vinstall "${FILESDIR}/dkms.default" 644 etc/default dkms
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user