Compile Linux kernel in Ubuntu

Source: Internet
Author: User
Root permission is required for the following operations. sudosu (this is more convenient, and the root permission is obtained at one time) 1: Download linux-2.6.39.tar. bz (Kernel File) 2: tar-jxvf/path/to/linux-2.6.39.tar.bz-C/usr/src/(unzip to the/usr/src folder, boss linus said it would be okay to decompress the package to any directory ^ _ ^. The boss said so. It should be true. but I have not tried,

The following operations require the root permission. sudo su (this is more convenient, and the root permission is obtained at one time)

1: Download linux-2.6.39.tar. bz (Kernel File)

2: tar-jxvf/path/to/linux-2.6.39.tar.bz-C/usr/src/(decompress to the/usr/src folder, boss linus said it would be okay to decompress the package to any directory ^ _ ^. The boss said so. It should be true. however, I have not tried it. All online tutorials are extracted to the * _ * directory *_*)

3: apt-get install buile-essential (install the compilation environment)

Apt-get install ncurses5-dev (library files required for the menu environment under the installation Terminal)

Apt-get install glibc6 (same as above)

4: cd/usr/src/linux-2.6.39/(enter the unzipped Kernel Directory)

5: make menuconfig ...... the function of the operating system is determined from here !!!)

6: After selecting the function, remember to save it... that is, the last menu item ......

7: make-j4 (start compilation,-j4 this option depends on your computer configuration, if the hardware is good, it can accelerate compilation ...., this process is very long. I have waited several times. ^ _ ^, about two hours each time ....... my configuration is i3CPU + 2 GB memory + H55 motherboard)

8: make install (officially install the kernel)

9: make modues !!!! ^_^ I don't know either .......)

10: make modules_install (installation module ......)

11: mkinitramfs-v-o/boot/initrd. img-2.3.39 (where-o is English o, the options in linux are almost all English, I have not seen the numbers ....... it indicates the directory to which you want the file to be generated, and-v indicates the detailed output of the file generation process. this file is required ......... to learn more, google it... I personally suggest using search engines for research and learning. I personally think it is best to use goole .......)

12: Modify/boot/grub. cfg, otherwise, you are at your own risk... ^_^)

13: Last. update-grub2

If the output shows the version of your compiled kernel, it means it is correct ......

Then select your new kernel for reboot ............................... ........

My personal compilation is now the latest stable version of the internal kernel (linux-2.6.39.tar. bz) (developer or test version, I personally think there is no compilation value. These are the bugs tested by linus or their team, which we compile and use, so select the stable version to compile it .........)

Reminder:

At the end of the kernel version in, you can add some instructions to the end of the kernel version when selecting the function (for example, I added yangzhiyong) ^_^

Note: The red lines in are all essential Oh ...... these are automatically generated during make install, update-grub2 ......

After compilation, check whether the files in the file contain such files. Pay attention to the differences between kernel version numbers ......

In fact, compiling the kernel is not as difficult as we think?

You never know what you can do, till you try it !!!

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.