Compile the Linux2.6 Kernel on X86 and Ubuntu. The basic knowledge is as follows: You must have a certain understanding of the kernel concepts before introducing how to compile the kernel. the introduction to Linuxkernel is vast. Here we will only introduce the related directories, files, and commands in the system. /boot/vmlinuz-: the compressed kernel image used for startup, which is the compressed image in/arch // boot. /boot/system. map-: Storage
Compile the Linux2.6 Kernel on X86 and Ubuntu, which is summarized as follows:
Basic knowledge
Before introducing how to compile the kernel, you need to have a certain understanding of the kernel-related concepts. The introduction of Linux kernel is vast. Here we will only introduce the related directories, files, and commands in the system.
/Boot
/Boot/vmlinuz-: the compressed kernel image used for startup, which is the compressed image in/arch // boot.
/Boot/system. map-: stores the kernel symbolic address.
/Boot/initrd. img-: used to store the modules required to mount the root file system when initializing the RAM hard disk.
/Boot/grub/menu. lst: configuration file of grub. (It may be located in different locations in Different releases.
/Lib/modules
This directory contains kernel modules and other files. note that there are usually multiple directories in modules: the built-in kernel modules are here. After you compile your own kernel modules, they will also be installed here. different directories are differentiated by kernel version numbers. that is, the directory name in modules is the kernel version number. (use $ uname-r to know the directory of the modules used by the current system kernel ).
/Lib/modules // build
Stores the files required to compile the new module for the kernel of this version. including Makefile ,. config, module. symVers (module Symbol Information), kernel header file (in include/, include/asm)
/Lib/modules // kernel
Stores the target kernel File (suffixed with. ko). Its Directory organization is the same as that in the kernel source code.
/Lib/modules:
Modules. alias: module alias definition. The module loading tool uses it to load the corresponding module.
Modules. dep: defines the dependency between modules.
Modules. symbols: Specifies the module to which the symbol belongs.
These files are all text files. You can view them.
$ Uname-r
Uname (1) is used to view system information. What is useful here is its "-r" option, which displays kernel version information.
Download the kernel, verify the signature, and decompress
To
Http://www.kernel.org/pub/linux/kernel/
Download the latest version of the 2.6 kernel. The speed is relatively fast. Here the linux-2.6.17.13 as an example:
1. Download the kernel compressed package
Bzip2 is more efficient than gzip. Generally, the bz2 compressed package is downloaded. after downloading the kernel package, you can also download the corresponding sign file. it is used to verify the openPGP signature of the kernel compression document. for more information, see
Here
.
$ Wget-c http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.17.13.tar.bz2
$ Wget-c http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.17.13.tar.bz2.sign