LINUX Kernel compilation method and steps (run successfully on read hat linux 5.0)

Source: Internet
Author: User

Step 1: Download the Linux kernel source code (URL: http://www.kernel.org /)

Step 2: deploy the kernel source code to the relevant directory of the Linux system.

Start Linux, open the terminal interface, and change the permission to root user. Enter Su on the terminal and then the password. Then, move the downloaded Linux kernel source code to the following directory:

,/Usr/src, the specific command is: MV linux-2.6.36.tar.gz/usr/src.

Input tar zxvf linux-2.6.36.tar.gz to decompress the kernel package and place the generated source code under the linux-2.6.36 directory.

Enter the CD linux-2.6.36 and switch to the directory.

Step 3: configure the kernel

There are many Kernel configuration methods, including the following:

Make menuconfig // graphic tool interface based on the ncurse Library

Make config // based on the text command line tool, not recommended

Make xconfig // X11-based graphical tool interface

Make gconfig // graphical tool-based interface

Since Linux is still in the beginner stage, we chose the simple Kernel configuration method, make menuconfig

Enter make menuconfig on the terminal. After a few seconds, the terminal will become a Graphical Kernel configuration interface. Most of the configuration uses the default value, which is only a small part.

You need to select based on your needs.

Step 4: Compile the kernel. This step takes about 1 hour.

Enter the command, make bzimage

Step 5: Compile and install the kernel module

Enter the command: Make modules_install

Step 6: Install the kernel

Run the following command: copy the compiled kernel image file to the correct directory and automatically rewrite the Linux Startup File. Grub configuration file.

The changed. Grub configuration file is as follows:

Step 7: restart the system. When you start the interface, you will find the LINUX system that we just compiled successfully. When you enter this system, the compilation of the entire system is complete.

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.