Compile the Linux kernel in Centos
Linux Kernel compilation is a simple but troublesome task.
However, compiling the Linux kernel independently will help you understand the working mechanism of the Linux kernel.
First, compile the linux kernel. We need to install the gcc compiler in the current linux operating system, because I am a Centos distribution version.
Yum install gcc
Next, install the dependent environment:
Yum install ncurses-devel
Now we take the linux-3.18.1 kernel as an example to compile, assuming that my current system version is 2.6.32
First, download the corresponding kernel version at http:/kernel.org on the official website of the Linux kernel.
Put it in the/usr/src folder and decompress it.
1; command make menuconfig
Use menu items to configure the kernel. Some modules can be directly compiled into the kernel. Some modules can be directly compiled into modules,
2 command make
Compile the kernel
3. make modules_install
Install the kernel module
At this time, you can see the kernel module of the corresponding version in/lib/modules.
4. make install
Install the kernel. You can see the corresponding version of system. map and the corresponding Kernel File under the/boot file.
5. Check vim/grub. conf.
Check whether the title item has the kernel version we just compiled.
At this point, we will see a compiled kernel version in the boot item after restarting the system.
Reprinted, please note: Xiao Liu