Compile the kernel of UBUNTU7.04 system-general Linux technology-Linux programming and kernel information. The following is a detailed description. 1. Install the necessary toolkit
Includes: libncurses5-dev (required by menuconfig) and essential
Sudo aptitude install build-essential bin86 kernel-package
Sudo aptitude install libqt3-headers libqt3-mt-dev
Sudo aptitude install make
Sudo aptitude install gcc // it is best to update the gcc even if it has been installed.
In addition, enter sudo mki on the terminal and press "Tab" twice to check whether the terminal displays
Mkinitramfs mkisofs
These two tools are used to generate *. imgfile during kernel compilation. If not, install them.
Step 2 download the kernel
Download the new kernel to/home at www.kernel.org.
Download linux-2.6.21.1.tar.bz2 (the original kernel is 2.6.21.1)
Step 3 preparations before Compilation
View the current kernel version
Uname-
2.6.15-26-server
If the downloaded kernel version is the same as the current kernel version:
Cd/lib/modules
Rename the folder under it
At the same time, you need to modify some items under/boot, and then modify/boot/grub/menu. lst.
It is troublesome. It is recommended to download a kernel higher than the current installed version.
Extract the linux-2.6.16.2 folder from linux-2.6.16.2.tar.bz2 and put it under/usr/src.
Sudo ln-s linux-2.6.16.2 linux // If the folder already has a link named linux, change it to linux. old first
Step 4 start Compilation
Cd/usr/src/linux // all the following work is completed in/usr/src/linux
Sudo make mrproper // remove. o compiled files
Sudo make menuconfig // If menuconfig is used, two other toolkit support is required. What is the name I forgot, Ncurses? Or use
Sudo make xconfig
Next, you can configure it slowly and save it after configuration. (The Kernel configuration file saved in the system is named in/usr/src/linux. config, you can save another copy in another place)
Sudo make dep // The system may prompt that make dep is not necessary now, so proceed to the next step.
Sudo make clean // clear old data
Sudo make bzImage // compile the kernel. bzImage is the name you give to the new kernel and will be saved to/usr/src/linux/arch/i386/boot /.
Sudo make modules // compilation Module
Sudo bzImage install // install the kernel
Sudo make modules_install // installation Module
Sudo mkinitramfs-o/boot/initrd. img-2.6.16.2 2.6.16.2
After the installation is complete, add the following files under/boot (use ls-l to view the files)
Lrwxrwxrwx 1 root 19 Aug 18 System. map-> System. map-2.6.16.2
Lrwxrwxrwx 1 root 15 Aug 18 config-> config-2.6.16.2
-Rw-r -- 1 root 40323 Aug 18 config-2.6.16.2
-Rw-r -- 1 root 6775383 Aug 18 initrd. img-2.6.16.2
Lrwxrwxrwx 1 root 16 Aug 18 vmlinuz-> vmlinuz-2.6.16.2
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.16.2
Root (hd0, 0)
Kernel/boot/vmlinuz-2.6.16.2 root =/dev/sda1 ro
Initrd/boot/initrd. img-2.6.16.2
Boot
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