Translation(s): English - Русский
Building Debian kernel modules with DKMS
Originally discussed: http://lists.debian.org/debian-kernel/2009/10/msg00683.html
Please improve these notes.The instructions need to be tested and verified.
Package Configuration
Write a configuration file. This is documented in the dkms manual page and there are examples in /usr/share/doc/dkms/examples. A typical configuration file would be:
PACKAGE_NAME=test PACKAGE_VERSION=0.1 BUILT_MODULE_NAME[0]="$PACKAGE_NAME" MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build" CLEAN="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build clean" DEST_MODULE_LOCATION[0]=/extra REMAKE_INITRD=yes AUTOINSTALL=yes
Note: DEST_MODULE_LOCATION[0] is used only when the module replaces an in-tree module, so its value is not important for you, but you need to specify it anyway.
Add to your postinst:
dkms add -m <name> -v <version> dkms build -m <name> -v <version> && dkms install -m <name> -v <version> || true
The configuration file is assumed to be installed as /usr/src/<name>-<version>/dkms.conf and the source is assumed to be installed under /usr/src/<name>-<version>. You must specify additional options to dkms add to override this.
Add to your prerm:
dkms remove -m <name> -v <version> --all || true
To-Do
Write about dh_dkms(1)
- Other documentation that might need changes:
External Links
http://lists.alioth.debian.org/mailman/listinfo/pkg-dkms-maint - Debian DKMS maintainers mailing list
http://qa.debian.org/developer.php?login=pkg-dkms-maint%40lists.alioth.debian.org - QA page