LinuxKernel implements Kconfig, Kbuild, and Makefile to assist in Kernel configuration and compilation, making the compilation process of linuxkernel quite simple. (1) decompress linux-3.5.4.tar.bz2 to & rdquo;/usr/src/kernel & ldquo; directory cd/usr/src/kernels/tar-jxvflinux-3.5.4.tar.bz
Linux Kernel implements Kconfig, Kbuild, and Makefile to assist in kernel configuration and compilation, making the compilation process of linux Kernel quite simple.
(1) kernel Compilation
1. Extract linux-3.5.4.tar.bz2 to the "/usr/src/kernel" directory.
Cd/usr/src/kernels/
Tar -jxvflinux-3.5.4.tar.bz2
Note: because the target folder is the current directory, so omitted, in charge of should be added after the Command Space + absolute path of the target folder; secondly:-there is no space in the middle of the jxvflinux-3.5.4, this command is used to extract the linux-3.5.4 in the current directory. If you are not executing the preceding command to switch the working directory, the command should be:
Path of the tar-jxvf compressed file: Path of the target file
2. copy the current Kernel configuration file as the configuration file compiled by the kernel.
# Cp/boot/config-3.3.4-5.fc17.i686.PAE/usr/src/kernels/The linux-3.5.4/. config
3. Switch the current directory to/usr/src/kernels/linux-3.5.4/
4. install some library files required for compilation
# Yum install ncurses-devel _ * gcc * gcc_c ++ * aclocal
5. make menuconfig
# Make menucofig
Generate the configuration file. config required for the compilation phase
6. make all
This command will generate the kernel ELF File vmlinux, which corresponds to the binary kernel image file of the target architecture. (BzImage image file under the x86 architecture), The make all command will compile all device driver modules and Dynamic Loading modules according to the configuration file.
7. make modules_install
Install modules to/lib/modules/linux-3.5.4
8. make install
Copy the vmlinuz-3.5.4, System. map-3.5.4 initramfs-3.5.4.img to the/boot directory and automatically save the changes
9. Restart and check whether there are 3.5.4 kernel add-ons