Friday, December 02, 2011

Setting up a driver as dkms in Debian 6

So I have this weird intel 4-port network card. It uses the igb driver. Now after switching from Ubuntu to Debian 6, I could not get any traffic over the ports. It seems the version delivered with Debian is too old to correctly support my card. So I decided to add the current driver, which can be downloaded here, as a dkms package. This means that the driver is automatically recompiled every time the kernel is updated. Here's how I did this:

  • first prepare the driver source. In this case, the tar.gz contains a src directory, so I moved everything from the src directory to the main directory: cd igb-3.2.10; mv src/* .
  • next, we need a dkms.conf file (place this inside the source code's tree), here's mine:
    CLEAN="make clean"
  • from the directory where you extracted the source (and added the dkms.conf file), execute the command to 'add' this source as a dkms:dkms add -m igb -v 3.2.10
  • now build and install the source: dkms build -m igb -v 3.2.10; dkms install -m igb -v 3.2.10
  • finally, create the dsc and the .deb file: dkms mkdsc -m igb -v 3.2.10 --source-only; dkms mkdeb -m igb -v 3.2.10 --source-only
  • now we need to install the dkms on the local machine. But before we do that, we need to remove the created dkms from the system as it conflicts with the created package. mv the .deb file and install it: cp /var/lib/dkms/igb/3.2.10/deb/igb-dkms_3.2.10_all.deb ~; rm -r /var/lib/dkms/igb; dpkg -i ~/igb-dkms_3.2.10_all.deb


Post a Comment

<< Home