tutorial on how to compile Linux kernel under CentOS

Source: Internet
Author: User

Linux kernel compilation is a simple but cumbersome thing. But a standalone build Linux kernel will help you understand the Linux kernel's working mechanism well.

First compile the Linux kernel we need to install the GCC compiler under the current Linux operating system because I am centos distribution version

Yum Install GCC

Next Install dependent environment:

Yum Install Ncurses-devel

Now we compile with the linux-3.18.1 kernel as an example, assuming that my current system version is 2.6.32

Then I first download the corresponding kernel version on the official web http:/kernel.org Linux kernel


Then put it in the/usr/src folder and unzip it.

1; command make Menuconfig

Using the menu item configuration kernel, some modules can be directly compiled into the kernel of the module can be directly compiled into a module,

2 Command make

Compiling the kernel

3.make Modules_install

Install kernel module

At this point, you can see the corresponding version of the kernel module in/lib/modules

4.make Install

Install the kernel, you can see the corresponding version of the system.map and corresponding kernel files in the/boot file

5. Now we look at the vim/grub/grub.conf


See if the title item has the kernel version number we just compiled

By the time we restart the system we will see a newly compiled kernel version appearing in the boot entry.

Related Article

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.