LinuxCommandLibrary

dh_dkms

Build DKMS modules during Debian package creation

SYNOPSIS

dh_dkms [debhelper options]

PARAMETERS

--no-act
    Do not actually do anything; just print the commands that would be executed.

-v, --verbose
    Enable verbose output, showing more details about the operations.

-Npkg, --no-package=pkg
    Do not operate on the specified package, even if it is built by the source package.

-ppkg, --package=pkg
    Operate only on the specified package. This is often used when a source package builds multiple binary packages.

-a, --arch-indep
    Act only on architecture independent packages.

-A, --arch-dep
    Act only on architecture dependent packages.

DESCRIPTION

dh_dkms is a debhelper program designed to streamline the packaging of Dynamic Kernel Module Support (DKMS) modules for Debian-based systems. It typically runs as part of the standard dh command sequence during the package build process, automating the steps required to properly integrate a kernel module with DKMS. Its primary role is to process the dkms.conf file found in the source directory, which specifies how the kernel module should be built, installed, and uninstalled by the dkms framework.

The command ensures that the module's source code is correctly placed within the Debian package structure, allowing the dkms system on the end-user's machine to automatically rebuild and install the module whenever a new kernel version is installed or updated. This dramatically simplifies maintenance for kernel module packages, as it eliminates the need for manual recompilation or separate package updates for each new kernel. dh_dkms handles the necessary interactions with the dkms(8) utility, ensuring the module is correctly registered and managed by the system.

CAVEATS

A well-formed dkms.conf file is mandatory in the source directory for dh_dkms to function correctly. The dkms package itself must be listed as a Build-Depends in debian/control. It is primarily designed to be used within the dh command sequence; direct manual invocation is rarely needed or recommended.

<B>IMPORTANT FILES</B>

dh_dkms primarily looks for a file named dkms.conf in the source directory. This configuration file is essential for instructing the dkms(8) utility on how to build, install, and remove the kernel module. It may also utilize optional scripts like dkms_mkdeb and dkms_mkdsc for custom package creation.

<B>INTEGRATION WITH DH</B>

Most users will not explicitly call dh_dkms. Instead, it is implicitly executed by the dh(1) command as part of its default sequence (e.g., dh --with dkms or automatically if debian/control lists dkms in Build-Depends). This design philosophy allows package maintainers to use a simpler debian/rules file.

HISTORY

dh_dkms emerged as part of the debhelper suite to address the increasing complexity of packaging kernel modules for Debian that relied on the DKMS framework. Before its introduction, maintaining such packages across multiple kernel versions often required intricate manual scripting within debian/rules. Its integration into debhelper significantly streamlined the process, providing a standardized and automated way to manage DKMS module packaging, thus simplifying the lives of package maintainers and ensuring robust kernel module support for users.

SEE ALSO

dkms(8), debhelper(7), dh(1), dpkg-buildpackage(1)

Copied to clipboard