%general-entities; ]> kernel &linux-version;
&linux-url;
Linux-&linux-version; Linux tools <para>The Linux package contains the Linux kernel.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem> <seg>&linux-tmp-sbu;</seg> <seg>&linux-tmp-du;</seg> </seglistitem> </segmentedlist> </sect2> <sect2 role="installation"> <title>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. There are several ways to configure the kernel options. Usually, This is done through a menu-driven interface, for example: make ARCH=x86 CROSS_COMPILE=$LFS_TGT- menuconfig The meaning of make environment variables: ARCH=x86 Configure the kernel for running on the target machine. Replace x86 with a value suitable for your target machine if it's not a 32-bit or 64-bit x86. CROSS_COMPILE=$LFS_TGT- Build the kernel with Binutils and GCC built in . menuconfig This launches an ncurses menu-driven interface. For other (graphical) interfaces, type make help. (optional) LANG=<host_LANG_value> LC_ALL= This establishes the locale setting to the one used on the host. This may be needed for a proper menuconfig ncurses interface line drawing on a UTF-8 linux text console. If used, be sure to replace <host_LANG_value> by the value of the $LANG variable from your host. You can alternatively use instead the host's value of $LC_ALL or $LC_CTYPE. A good starting place for setting up the kernel configuration is to run make ARCH=x86 CROSS_COMPILE=$LFS_TGT- defconfig. This will set the base configuration to a good state that takes your target system architecture into account. Read for more information about kernel configuration. You should enable or disable some kernel configuration options now: Kernel configuration options and explanation: Set CONFIG_MODULES=n Modular kernel needs modprobe tool from Kmod to load modules, which is not installed in the temporary system. Enable CONFIG_EXT2, CONFIG_EXT4, and CONFIG_VFAT_FS They are needed to access the filesystems we'll make for the target system. Compile the kernel image: make ARCH=x86 CROSS_COMPILE=$LFS_TGT- Install the kernel image into the $LFS/boot directory: install -vm644 arch/x86/boot/bzImage $LFS/boot/vmlinuz <para>Details on this package are located in <xref linkend="contents-kernel" role="."/></para> </sect2> </sect1>