Wednesday, August 19, 2009

DKMS Configuration for Creative X-Fi Linux Driver

I've been a bit annoyed lately by having to recompile/reinstall the kernel module for my Creative X-Fi soundcard every time Ubuntu updates the kernel. Thinking it should be possible to automate this process, I recalled seeing something about compiling and installing modules (nvidia and vbox) every time a kernel is booted for the first time. Surely enough, there's DKMS! DKMS stands for Dynamic Kernel Module Support, and will basically compile and install kernel modules automatically every time the kernel is updated, keeping things consistent and easy to use for the end user. Following is how to set it up for the X-Fi driver.
  1. If you don't have DKMS installed, install it. You know best how to do so for your system :)
  2. Download the source from Creative's support site. At the time of this writing, I get a file called XFiDrv_Linux_Public_US_1.00.tar.gz. If you get a different file, make a note of the version, which will be used in the next step.
  3. As root, extract the contents of the archive to /usr/src/ctxfi-1.00. DKMS is a bit peculiar about location/structure, so help yourself out and go by the flow, which is to use /usr/src/<module>-<version> as the main directory for the module's source code. To clarify; /usr/src/ctxfi-1.00 should contain a bunch of source files and a Makefile.
  4. Create a file /usr/src/ctxfi-1.00/dkms.conf with the following contents:
    PACKAGE_NAME=ctxfi
    PACKAGE_VERSION=1.00
    BUILT_MODULE_NAME=ctxfi
    DEST_MODULE_LOCATION=/kernel/drivers/ssound
    
  5. Now all you need to do (if I recall correctly) is to add the module to DKMS by issuing this command: dkms add -m ctxfi -v 1.00
Okay, that should be it. The next time you boot a new kernel, you shouldn't have to manually compile/install the X-Fi driver.

No comments:

Post a Comment