6.3. Linux-Headers-3.0.80

6.3.1. Introduction

The Linux Kernel contains a make target that installs “sanitized” kernel headers. The Linux Kernel is itself a C program consisting of a number of separate source files. Header files are separate files used to keep variable definitions consistent between multiple source files. These header files are also required during the compilation of cros-compiler toolchain. We will need to know which architecture we are developing for to install the proper header files. To determine this we need what platform we are developing for.

The Linux Kernel uses a config file to determine which of the source files to compile into the final kernel or modules. The kernel source contains a number of configurations. Or in some cases the Linux Support Package for the platform will contain a custom source file with a configuration. This config file is in part determined by the platform and additionally by the users choice of features to enable or disable. Typically the config file is incomplete and requires additional process to make suitable for compiling a kernel. In this chapeter will shall do four things: identify the platform, determine the architecture, install the appropriate headers, and make the config file for the platform.

6.3.2. Platform

This is the first section requiring knowledge of the target platform. For this book we will be using the a standard pc. The initial config file is at arch/x86/configs/i386_defconfig. The primary information we need at this time is the architecture i386 for this platform.

6.3.3. Set Architecture



CLFS_ARCH=i386
echo export  CLFS_ARCH=i386 >> ~/.bashrc


6.3.4. Installation of Linux Headers

For this step you will need the kernel tarball.

Install the header files that are common to all Platforms with this architecture:


make mrproper
make ARCH=${CLFS_ARCH} headers_check
make ARCH=${CLFS_ARCH} INSTALL_HDR_PATH=dest headers_install
cp -rv dest/include/* ${CLFS}/usr/include

6.3.5. Make Config



cp arch/x86/configs/i386_defconfig .config

yes "" | make ARCH=${CLFS_ARCH} oldconfig

cp .config ${CLFS}/boot/config-3.0.80


6.3.6. Contents of Linux-Headers

Installed headers: /usr/include/{asm,asm-generic,drm,linux,mtd,rdma,scsi,sound,video,xen}/*.h

Short Descriptions

/usr/include/{asm,asm-generic,drm,linux,mtd,rdma,scsi,sound,video,xen}/*.h

The Linux API headers