5.4. Linux-Headers-2.6.30.1

The Linux Kernel contains a make target that installs “sanitized” kernel headers.

5.4.1. Installation of Linux Headers

For this step you will need the kernel tarball.

Install the kernel header files:

make mrproper
make ARCH=x86 headers_check
make ARCH=x86 INSTALL_HDR_PATH=dest headers_install
cp -rv dest/include/* ${CLFS}/usr/include
find ${CLFS}/usr/include -name .install -or -name ..install.cmd | xargs rm -fv

The meaning of the make commands:

make mrproper

Ensures that the kernel source dir is clean.

make ARCH=[arch] headers_check

Sanitizes the raw kernel headers so that they can be used by userspace programs.

make ARCH=[arch] INSTALL_HDR_PATH=dest headers_install

Normally the headers_install target removes the entire destination directory (default /usr/include) before installing the headers. To prevent this, we tell the kernel to install the headers to a directory inside the source dir.

5.4.2. Contents of Linux-Headers

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

Short Descriptions

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

The Linux API headers