Compile the kernel in ubuntu

Source: Internet
Author: User
Compile the kernel under ubuntu-general Linux technology-Linux programming and kernel information. The following is a detailed description. After several hours of work last night, I finally finished compiling the Linux kernel in ubuntu. Now I want to write some of my feelings here and hope I can use it later. previously, it should be noted that there may be different compilation methods for different linux versions, even for the same version and machines, if you have any new users, please believe in yourself.

I have made some preparations before and downloaded and installed some necessary packages. The following packages are required on my machine: sudo apt-get intsall linux-source (I personally recommend you go to www.kernel.org to download the original code without modification ), sudo apt-get install libgt3-mt-dev (this package and its associated other packages are required to run make xconfig, of course you can also seem uneasy, then you can only use make config ), sudo apt-get install bootcd-mkinitrd (this tool is used to make initrd. img ).

Of course, the software configuration of the machine is different, and the required software packages may be different, which can only be grasped by yourself. after the above preparations, you can install it now. Some people on the internet think that you can use the existing config to configure your system. Although I am also a newbie, however, I think it is more comfortable to create a config file by myself, so I took the following steps:

Cd/usr/src/linux)
Sudo make mrproper (this is also the case in the README file, which is used to clear and recreate the previous preparation file)
Sudo make config (I didn't install some necessary packages at the beginning, so I can only use config. Of course you may choose xconfig and menuconfig, which may make the interface more friendly .)
Sudo make (compile and create an image file and wait patiently)
Sudo make modules_install install (module installation)

At this point, the compilation process is complete. Now you need to do the following:

Move System. map in this directory to/boot, and sudo System. map/boot/System. map-2.6.20.4

Then cd arch/i386/boot, see bzImage file, then sudo mv bzImage/boot/vmlinuz-2.6.20.4 and then cd/boot, execute sudo mkinitrd-o/boot/initrd. img-2.6.20.4 2.6.00004 (make a memory image );

Finally, modify/boot/grub/menu. list as follows (add the kernel boot menu ):

Title Ubuntu, kernel 2.6.00004 (I compiled this kernel)
Root (hd0, 0)
Kernel/vmlinuz-2.6.20.4 root =/dev/sda2 ro quiet splash
Initrd/initrd. img-2.6.20.4
Boot

It should be said that there will be no problem. If you are interested, please 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.