
Linux From Scratch - Version 7.0
222
8.3. Linux-3.1
The Linux package contains the Linux kernel.
Approximate build time: 1.0 - 5.0 SBU
Required disk space: 540 - 800 MB
8.3.1. Installation of the kernel
Building the kernel involves a few steps—configuration, compilation, and installation. Read the README file in the
kernel source tree for alternative methods to the way this book configures the kernel.
Prepare for compilation by running the following command:
make mrproper
This ensures that the kernel tree is absolutely clean. The kernel team recommends that this command be issued prior
to each kernel compilation. Do not rely on the source tree being clean after un-tarring.
Configure the kernel via a menu-driven interface. For general information on kernel configuration see http://
www.linuxfromscratch.org/hints/downloads/files/kernel-configuration.txt. BLFS has some information regarding
particular kernel configuration requirements of packages outside of LFS at http://www.linuxfromscratch.org/blfs/
view/svn/longindex.html#kernel-config-index:
make LANG=<host_LANG_value> LC_ALL= menuconfig
The meaning of the make parameters:
LANG=<host_LANG_value> LC_ALL=
This establishes the locale setting to the one used on the host. This is needed for a proper menuconfig ncurses
interface line drawing on UTF-8 linux text console.
Be sure to replace <host_LANG_value> by the value of the $LANG variable from your host. If not set, you
could use instead the host's value of $LC_ALL or $LC_CTYPE.
Alternatively, make oldconfig may be more appropriate in some situations. See the README file for more
information.
If desired, skip kernel configuration by copying the kernel config file, .config, from the host system (assuming it
is available) to the unpacked linux-3.1 directory. However, we do not recommend this option. It is often better
to explore all the configuration menus and create the kernel configuration from scratch.
Compile the kernel image and modules:
make
If using kernel modules, module configuration in /etc/modprobe.d may be required. Information pertaining to
modules and kernel configuration is located in Section 7.4, “Device and Module Handling on an LFS System” and
in the kernel documentation in the linux-3.1/Documentation directory. Also, modprobe.conf(5) may
be of interest.
Install the modules, if the kernel configuration uses them:
make modules_install
Comentarios a estos manuales