Kernel Headers


From SynCE-Wiki

Kernel headers are files that a required to compile your own kernel modules. Look at the following corresponding sections:

Contents

Pre-build Kernel from Distribution

If you have compiled and are using your own kernel, you'd know about it!

First, run:

uname -r

This will give an output like: 2.4.27-2-686. In this example, it means you are running the 2.4.27 kernel. Now follow your distro-specific instructions:

Debian, Ubuntu and other APT-based distros

Install the package kernel-headers-VERSION, where VERSION is your output to uname -r. In the previous example, I would have to install the package kernel-headers-2.4.27-2-686. This can be done using a graphical repository browser, or simply on the command line execute, as root:

apt-get install kernel-headers-2.4.27-2-686

following on from the previous example of 2.4.27-2-686 being the output to uname -r.

Gentoo

Make sure you have linux headers and make sure that you have a a link in /lib/modules/kernel version/build to the correct headers. If not, you can create one using this (make sure you use the kernel version you got above with uname -r!)

ln -sf /usr/src/linux-<kernel version> /lib/modules/<kernel version>/build

All other distros

Find and install the package that looks like kernel-headers-VERSION, where VERSION is your output to uname -r

Custom-compiled Kernel

The kernel headers will already be installed. /lib/modules/`uname -r`/build/ will be a symbolic link to /usr/src/linux-`uname -r`/ or simply /usr/src/linux/.