Linux kernel compilation is a simple but troublesome thing to do.
But a separate build Linux kernel will help you understand how the Linux kernel works.
First compile the Linux kernel we need to install the GCC compiler under the current Linux operating system because I am the CentOS distribution version
Yum Install GCC
Next install the dependent environment:
Yum Install Ncurses-devel
Now let's compile with the linux-3.18.1 kernel as an example, assuming my current system version is 2.6.32
Then I first download the corresponding kernel version on the official web http:/kernel.org released by the Linux kernel
Then put it in the/usr/src folder and unzip it
1; command Make Menuconfig
Using the menu items to configure the kernel, some modules can be directly compiled into the kernel modules can be directly compiled into modules,
2 Command make
Compiling the kernel
3.make Modules_install
Installing kernel Modules
At this time, the corresponding version of the kernel module can be seen in/lib/modules
4.make Install
Install the kernel, you can see the corresponding version of the System.map and the corresponding kernel files under the/boot file
5. At this point we view vim/grub/grub.conf
See if the title item has the kernel version number we just compiled
At this point we reboot the system and we see a kernel version that has just been compiled in the boot entry.
Reprint please specify: Xiao Liu
Build Linux kernel under CentOS