Kernel compilation for 2.6.24 in Ubuntu

Source: Internet
Author: User
Linux general technology-Linux programming and kernel information for Kernel compilation in Ubuntu 2.6.24. The following is a detailed description. Step 1 install necessary tools

Install necessary packages first.

Includes: libncurses5-dev (required by menuconfig) and essential
Sudo apt-get install build-essential bin86 kernel-package
Sudo apt-get install libqt3-headers libqt3-mt-dev //
Sudo apt-get install make
Sudo apt-get install gcc

In addition, check whether the system has two such commands
Mkinitramfs mkisofs

These two tools are used to generate *. imgfile during kernel compilation. If not, install it. Step 2 download the kernel to www.kernel.org and download the new kernel to/usr/src. What I download is linux-2.6.24.tar.gz (the original kernel is 2.6.20-15-generic)

Step 3: Check the current kernel version before compilation.
Uname-
It is recommended to download linux-2.6.24.tar.gz to the linux-2.6.24 with a high internal decompressed ratio that has been installed before
Cd/usr/src
Sudo tar zxvf linux-2.6.24.tar
Cd linux-2.6.24/

Step 4 start Compilation
Cd/usr/src/linux-2.6.24 // all of the following work is done under/usr/src/linux-2.6.24
Sudo make menuconfig // Ncurses is required if menuconfig is used, or
Sudo make xconfig

Sudo make menuconfig // menuconfig is generally used

Save after configuration (A Kernel configuration file saved in the system is named at/usr/src/linux-2.6.24. config, you can save another copy in other places) You can also cp the original config-2.6.xx under the/boot directory to the current directory, in make menuconfig is to use this configuration file.

Sudo make dep // maybe the system will prompt that make dep is unnecessary now, so I will not use the next 2.6.24 compilation.
Sudo make clean // clear the old data. This step is not required for the unzipped kernel source code.
Sudo make? J2 can be compiled in two threads, but I use make? J4 found that nine make processes are working in the system. Therefore, this parameter may not work.
Sudo make bzImage // compile the kernel and save it to/usr/src/linux-2.6.24/arch/i386/boot/
Sudo make modules // compilation Module
Sudo make modules_install // installation Module
Sudo mkinitramfs-o/boot/initrd-2.6.24.img 2.6.24

At this time, you may be prompted to not find such a folder "/lib/firmware/2.6.24". You need to create such a folder manually.

Sudo mkdir/lib/firmware/2.6.24

Sudo install // After the kernel is installed, add the following files under/boot (use ls-l * 24 * for details)

Helight @ helight-desktop:/boot $ ls-l * 24 *
-Rw-r -- 1 root 85203 config-2.6.24
-Rw-r -- 1 root 85203 config-2.6.24.old
-Rw-r -- 1 root 37968871 initrd-2.6.24.img
-Rw-r -- 1 root 4014080 initrd. img-2.6.24
-Rw-r -- 1 root 932315 System. map-2.6.24
-Rw-r -- 1 root 932315 System. map-2.6.24.old
-Rw-r -- 1 root 1858864 vmlinuz-2.6.24
-Rw-r -- 1 root 1858864 vmlinuz-2.6.24.old
Helight @ helight-desktop:/boot $

Add a new startup Item to/boot/grub/menu. lst. For example, add the following text to my menu. lst:

Title Ubuntu, kernel 2.6.24
Root (hd0, 0)
Kernel/boot/vmlinuz-2.6.24 root = UUID = d7e2cf74-ebf5-4c78-ac2c-9f85a9809eae ro
Initrd/boot/initrd-2.6.24.img

Restart.

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.