Preparing kernel headers
There will occasionally be times where we'll face the need to compile code which requires kernel headers. Kernel headers are the source code of the Linux kernel. In this first recipe, we'll explain the steps required to prepare kernel headers for later use.
Getting ready
An Internet connection is required to complete this recipe.
How to do it...
Let's begin the process of preparing kernel headers:
We begin first by updating our distribution by executing the following command:
apt-get update
Next, we must use
apt-get
again to prepare the kernel headers. Execute the following command:apt-get install linux-headers - `uname –r`
Copy the following directory and its entire contents:
cd /usr/src/linux cp -rf include/generated/* include/linux/
We're now ready to compile code that requires kernel headers.