Compile the Linux kernel in Centos

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.