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.
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.
CLFS_ARCH=i386 echo export CLFS_ARCH=i386 >> ~/.bashrc
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
cp arch/x86/configs/i386_defconfig .config yes "" | make ARCH=${CLFS_ARCH} oldconfig cp .config ${CLFS}/boot/config-3.0.80