1. Installation dependencies
yum-y install gcc BC gcc-c++ ncurses ncurses-devel cmake elfutils-libelf-devel openssl-devel
2. Download the kernel version to extract and enter the Extract directory (4.12.3 version)
wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.12.3.tar.xz && tar-xvf Linux-4.12.3.tar.xz & & CD linux-4.12.3
3. Clean up the kernel source directory
Make Mrproper
4. Use the Make Menuconfig menu to customize the kernel function (here we use the default direct save)
Make Menuconfig
5. Compile (time is long, can eat a few chickens to come again)
Make
6. Install the module (enter the decompression directory installation module, after installation can be viewed in the/lib/modules directory)
Make Modules_install
View/lib/modules
7. Execute make install kernel-related files
Make install
8. Modify the default kernel boot entry after installation is complete
cat/boot/grub2/grub.cfg | grep menuentry//view system available cores
Grub2-set-default ' CentOS Linux (4.12.3) 7 (CORE) '//modify the kernel used by default on boot
9. After restarting the computer Uname-r view the kernel version
Reboot
Uname-r
It's done.
centos7.5 Kernel Compilation Installation