I am installing Debian squeeze on a brand-new Mac Mini, and the Broadcom NIC in it only works with the latest tg3 module from Broadcom. I can build this module easily enough, but performing a manual build and overwriting the tg3.ko that comes with the kernel packages seems like a kludge because:

  • the rather non-trivial steps I performed to build the module are not automated
  • kernel upgrades will break ethernet by overwriting my custom-built module

I've read How do I build debian packages of kernel modules?, but the techniques I've researched so far seem to deal with the case of packaging a module that isn't in the kernel packages. Given that I want to replace a module already provided by the kernel package, rather than add a new module, how can I accomplish this without resorting to fragile kludges?


I was able to get this working with DKMS. There was an additional problem of not clobbering the tg3.ko that already exists in the kernel packages. I learned that there can be an "updates" directory under /lib/modules/$KERNELVERSION. This way, I don't have to worry about overwriting another package's files and there's an easy way to go back to the default version. More here:


And here is a good tutorial on the DKMS process, which also describes some Ubuntu/Debian specific magic when DKMS modules put their modules in /updates:


The dkms.conf I used for this particular module:

MAKE[0]="'make' KVER=$kernelver"

The difficult part about this was knowing to quote 'make' in $MAKE, because if it's unquoted, DKMS will append KERNELRELEASE=... to make, and that breaks this particular build system.

I was able to do all the building in a squeeze chroot, run dkms mkdeb, then install the resulting deb package on the Mini for the win.


Check out DKMS. It can recompile kernel modules upon kernel upgrades. For example nvidia uses this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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