Centos kernel compilation configuration and centos kernel Compilation
1. Download the kernel, the following is the kernel official website address: https://www.kernel.org/
- Tar. xz is the complete kernel package (the complete kernel package is obtained through two compression times, one is xz and the other is tar)
Pgp is a file suffixed with .tar. sign. It is used to verify files similar to MD5.
Patch is a patch package
2. decompress the file to the/usr/src/directory: xz-d file name .tar. xz secondary decompression: tar-zxvf file name .tar
3. If the kernel is compiled for the first time and there is no residual file in the last time, you can skip it:
Make mrproper
Make clean deletes most of the compilation and generation files, but retains the Kernel configuration file. config. There is enough compilation support to create extension modules.
Make mrproper deletes all compilation files, Kernel configuration files, and various backup files.
Make distclean mrproper deleted files, and edit Backup files and patch files.
4. Do not rush to make at this time. Because the ngcc command is required to compile the kernel, first install the ngcc module and select the simplest yum to install the following two packages:
Yum-y install gcc
Yum install ncurses-devel (which comes with centos6 and does not need to be installed)
5. Configure kernel parameters:
Make config (via command line configuration) make menuconfig (simple menu command line configuration, relatively easier), make oldconfig (using the past configuration file, the premise is that the system already has a configuration file). Next, there are a bunch of options. If you do not understand English, you can directly press enter to ignore them, note that you must select "y" for the CONFIG_CROSS_COMPILE configuration item. Otherwise, the ngcc cannot find the command error. If you have missed it, you can find one in the kernel folder. config File, change this parameter to CONFIG_CROSS_COMPILE = "n" to CONFIG_CROSS_COMPILE = ""
6. Officially compile the kernel:
Make and make modules_install (the command must enter/usr/src/linux-x/here, otherwise an error will be reported) Note: The 2.6 kernel is optimized, run make dep and make bzImage (less than 2.6) without displayingMake bzImage reports image too bigSelect sound and usb as modules, or remove unnecessary options.) You only need to execute make directly, and the system will automatically complete make dep and make bzImage. PS: this process takes a long time.
7. Install the kernel
Make install (because some modules fail to be compiled, the module cannot be found, but you can ignore it if it is not important)
8. modify the default start kernel (change the default value at the cursor to 0 to start by default, and the default value is 1 after compilation), and then reboot. Do not miss the manual selection of the kernel menu during startup, select your own kernel options, and press enter to enter the terminal. Enter uname-r to check whether it is your own version. This is the entire centos Kernel configuration process.
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.