Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Specifically, I want to build a package for debian/lenny using the latest uvc drivers. I can compile and install them, but I want them packaged in the normal debian fashion. I imagine I want to use make-kpkg somehow, but I don't know how. module-assistant seems no good, because that seems to only use sources available in debian.

share|improve this question
up vote 6 down vote accepted

There is a better solution than m-a: dkms

It actually makes it easier to distribute external kernel modules and automatically compiles them for newer kernel-versions (think installing a new package of linux-headers).

share|improve this answer
I'll give dkms a try. Glad to see it's in backports. – Jayen Oct 28 '10 at 5:38
You could take a look at the backfire-dkms or ndiswrapper-dkms packages for an example on how to build such a package. They are relatively simple and easy to understand in their structure. – Fladi Oct 28 '10 at 6:33
I'm trying to follow this walkthrough: – Jayen Oct 29 '10 at 9:17

There's no easy answer. To create a real Debian package from scratch is not just a matter of sticking files into an archive, you'll need the control file and installation scripts and everything else that makes it a package rather than just a tarball.

To learn about using dh-make and debhelper to create packages, start with the New Maintainers' Guide, then read the Developer's Guide on packaging "best practices".

Then, /usr/share/doc/module-assistant/README.gz and HOWTO-DEVEL.gz covers how to use the packaging tools to create source packages that module-assistant can understand.

I think if you're packaging a module that exists in the default kernel package you'll have more work to prevent conflicts. If you're just doing this for yourself, it would probably be best to build and install a custom kernel package with the "old" driver disabled so that the files don't conflict (note the instructions in README.gz regarding KVERS).

share|improve this answer
:( I was really hoping there was something already specifically for kernel module packages. Two years ago, I used dh_make and a dodgy Makefile to make a e1000e package, which would install to /lib/modules/uname -r/updates, overriding the included kernel modules. I was hoping there was a lazier, more proper protocol now. – Jayen Oct 28 '10 at 5:44

You can use module-assistant for that. See

share|improve this answer
As mentioned on the page, module-assistant uses source code from apt repositories. That page doesn't go into details about getting the source code into an apt repository (or a format m-a understands). – Jayen Oct 28 '10 at 5:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.