Use the source code to compile and install the kernel-go to Linux (1)

Source: Internet
Author: User
Environment: ubuntu11.04 tool: make, gcc, make-kpkg kernel source code: linux-2.6.38.8 steps, so after the claim...

 

Environment: ubuntu 11.04

Tools: make, gcc, and make-kpkg

Kernel Source: linux-2.6.38.8

Steps:

1. download the internal source code package to the official website (my next is linux-2.6.38.8.tar.bz2)

2. open the terminal and raise the permission (because the following operations are performed as administrators, so I will use the command line to perform various operations after obtaining the permission. I prefer command line operations ),

Run "sudo su" to raise the permission. enter the password and press enter,

If the permission is successfully raised, it will become a root user.

3. decompress the package to/usr/src, that is, all the kernel source code is in the/usr/src/linux-2.6.38.8,

(1)you can double-click linux-2.6.38.8.tar.bz2,

(2) then copy to/usr/src

Run cp-dir linux-2.6.38.8/usr/src/linux-2.6.38.8"

Note:

Because the directory is copied, rather than the file, you need to add the-dir option, if the copy is successful, then you can see the linux-2.6.38.8 directory under/usr/src,

4. go to the directory where the source code is located.

Run; "cd/usr/src/linux-2.6.38.8"

5. clear the temporary files left by the previous compilation. if the source code package is just unlocked, skip this step.

Execute; "make mrproper"

6. automatically streamline the kernel (this will make compilation faster)

Execute; "make localmodconfig"
7. start to compile the kernel. (This step will take a long time. it took me about an hour to compile the kernel)

Execute; "make-kpkg clean"

Run: "fakeroot make-kpkg -- initrd -- append-to-version =-yuanfan kernel_image"

Note: The "-yuanfan" can be changed to your favorite content, according to my compiled kernel name is "linux-image-2.6.38.8-yuanfan_2.6.38.8-yuanfan-10.00.Custom_i386.deb"

8. install the kernel

You can double-click to install the compiled kernel in the previous directory,

Note: Because I have already installed it, it is "Reinstall" or "install ".

9. restart the system

10. view the version number.

Run: "uname-r"

If you have "yuanfan", it means you have succeeded ~~

 

From Linuxer's Blog

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.