Our social:

Preparing kernel headers

There will be occasional times where we'll face the need to compile code, which requires the kernel headers. Kernel headers are the source code of the Linux kernel. In this first recipe, we'll explain the steps required to accomplish the task of preparing the kernel headers for compilation.
Getting ready
A connection to the Internet is required to complete this recipe.
How to do it...
Let's begin the process of preparing the kernel headers:
1. Execute the following script to prepare the kernel sources:

prepare-kernel-sources


2. Copy the following directory and its entire contents:

cd /usr/src/linux
cp -rf include/generated/* include/linux/
3. Now we're ready to compile code that requires the kernel headers.