As an update to my “hello world” kernel module article, there is a much easier way to set up your Debian-based Linux (including Ubuntu) to build kernel modules, without manually getting the relevant kernel headers using apt-get.
I’ve tested this process with Ubuntu 8.04, 9.04 and 9.10 and it works great. Do the following to set up your Debian-based Linux environment for building kernel modules.
sudo suapt-get install module-assistantm-a prepare
m-a (module assistant), will set up the appropriate build environment for you (including correct
build-essential) You can now skip to code part of the original article :)