void-packages/srcpkgs/dkms/template
classabbyamp 98f0d74792
dkms: depend on pahole
CONFIG_DEBUG_INFO_BTF_MODULES is enabled on most/all void kernels, and
thus pahole is used when generating BTF information during compilation of
external modules. on cross-built kernels, the absence of pahole will
remove CONFIG_DEBUG_INFO_BTF_MODULES from
/usr/src/kernel-headers-$version/include/generated/autoconf.h when
the dkms kernel.d hook runs for the first time (because cross-built
kernels have their host tools removed).

When this is removed, part of the module struct in include/linux/module.h
is missing, resulting in a mismatch in the size of the __this_module
struct (.gnu.link_once.this_module section of the .ko) in external
modules of exactly 64 bytes.

	struct module {
	// ...
	#ifdef CONFIG_DEBUG_INFO_BTF_MODULES
	 unsigned int btf_data_size;
	 void *btf_data;
	#endif
	// ...
	}

fixes #51005
2024-06-26 13:02:54 -04:00

41 lines
1.3 KiB
Bash

# Template file for 'dkms'
pkgname=dkms
version=3.0.12
revision=2
conf_files="/etc/dkms/framework.conf /etc/default/dkms"
depends="bash kmod gcc bc make coreutils pahole xbps-triggers>=0.123_1"
short_desc="Dynamic Kernel Module Support"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2.0-or-later"
homepage="https://github.com/dell/dkms"
distfiles="https://github.com/dell/dkms/archive/v${version}.tar.gz"
checksum=b1b0205973371bda2f963d67056034d060001ab012f98a0dbf9fcb4145534302
# dkms does not create this directory, but needs it
# https://github.com/void-linux/void-packages/issues/39066
make_dirs="/var/lib/dkms 0755 root root"
case "$XBPS_TARGET_MACHINE" in
# Too many competing kernels for arm* to depend on linux-headers
arm*) ;;
*) depends+=" linux-headers" ;;
esac
if [ "$CROSS_BUILD" ]; then
depends+=" openssl-devel gmp-devel libada-devel libmpc-devel flex"
fi
do_build() {
make dkms dkms.8
}
do_install() {
# We are only interested in the bare minimum.
vbin dkms
vman dkms.8
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}/dkms.default" 644 etc/default dkms
}