Ubuntu10.04 kernel upgrade practices

Source: Internet
Author: User
Ubuntu10.04 kernel is Llinux2.6.32. In fact, upgrading to the latest version 2.6.34 does not make much sense. It mainly integrates some new drivers and features not available to common users, so basically, this article is purely tossing, but now it is not a popular saying: "Life is tossing", so let's make fun together! Prerequisites: (1) one machine with Ubuntu10.04 installed; (2) root permission; (3) download Linux kernel 2.6.34 source code,

The Ubuntu 10.04 kernel is Llinux 2.6.32. In fact, upgrading to the latest version 2.6.34 does not make much sense. It mainly integrates some new drivers and features not available to common users, so basically, this article is purely tossing, but now it is not a popular saying: "Life is tossing", so let's make fun together!

Prerequisites:

(1) There is a machine with Ubuntu 10.04 installed.

(2) root permission

(3) download the linux kernel 2.6.34 source code and decompress it to/usr/src. Run the following command:

$ Bunzip2 linux-2.6.34.tar.bz2

$ Tar xvf linux-2.6.34.tar

So you can get a linux-2.6.34 named

Okay. Now everything is ready. Next, configure, compile, and install the new kernel!

1, enter the folder/usr/src/linux-2.6.34 just now, enter the command:

$ Make mrproper

The function of this command is to clear the residual. config and. o files in the current directory. These files are usually left after compilation. For the code compiled for the first time, there are no residual files, so you can skip this step. However, if the source code has been compiled before, we strongly recommend that you execute this command, otherwise, an unknown problem may occur.

2. Configure compilation options

As the operating system kernel, its content and functions must be very complex, including Processor Scheduling, memory management, file system management, process communication, and device management. For different hardware, the configuration options are also different, so you must set the compilation options before compiling the source code. In fact, I think this step is the most technical in the entire process of kernel upgrade, because you need to select yes or no according to your own needs, and you need to understand all aspects of computer knowledge. However, there are too many options here, probably hundreds of items. I tried to select one item before, but I finally gave up, because there are many options that I don't quite understand.

In this case, is there no easy way? Of course! Make menuconfig or make xconfig. I use make menuconfig, But the precondition is that ncurse is installed.

In addition, some options need to be set in the make menuconfig process *, y, n, or m. Selecting * indicates that the content in the option is directly compiled into the kernel, selecting m indicates that the content in the option is not compiled into the kernel, but is compiled into an independent module, which is called only when used.

OK. In the current file path, enter the following command:

Make menuconfig

Select the compilation configuration option according to the menu prompt, and save the configuration file as. config.

3. Determine the dependency

Based on past experience, this step is required, but during this compilation, the system reminds me that I do not have to execute this command:

Make dep

4. Clear the intermediate compilation File

Enter the command: make clean

5. generate a new kernel

During the configuration process, we select the program compiled into the kernel to compile the link to generate the Linux kernel and enter the following command:

Make bzImage

6. Generate modules

Similar to the previous step, we will compile the program compiled into modules during the configuration process and enter the following command:

Make modules

7. Install modules

Copy the compiled and produced modules to the system folder for the new kernel to call. Enter the following command:

Make modules_install

Everything is done automatically.

8. Create an image file for loading ramdisk

If the linux system is on a scsi disk, this is required; otherwise, it can be skipped. My linux is installed on vmware and uses a virtual scsi disk, so this step is required. Enter the following command:

Mkinitramfs-o/boot/initrd-linux2.6.34.img 2.6.34

If your linux is not ubuntu but another release version, the command used may not be mkinitramfs, but mkinitrd, but the function and usage are similar.

9. Install the kernel

Enter the command: make install

At this time, the System will test the Linux kernel image file and System. map to/boot.

10. Configure the grub boot program

Since the new kernel has been compiled and installed, We need to configure the boot program of the system to boot correctly with the new kernel. This step is manual and the object is/boot/grub. cfg: Use chmod to change the read-only attribute of the file. Then add a new startup Item according to the existing content in it. My new startup items are:

Menuentry 'ubuntu, with Linux 2.6.34-generic '-- class Ubuntu -- class gnu-linux -- class gnu -- class OS {
Recordfail
Insmod ext2
Set root = '(hd0, 1 )'
Search -- no-floppy -- fs-uuid -- set 140c9813-9b08-4f92-bc5f-93b2050ecca1
Linux/boot/vmlinuz-2.6.34 root = UUID = 140c9813-9b08-4f92-bc5f-93b2050ecca1 ro quiet splash
Initrd/boot/initrd-custom2.6.34.img
}

In bold text above, the path of the new kernel image file is specified after linux, and the path of the ramdisk image file is specified after initrd.

Last, do not forget to set the menu timeout time to 10 seconds because the default timeout value is 0 and the system is started from the original kernel image.

Everything is OK. Click reboot. After the system is started, select the new kernel from the grub menu to guide linux!

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.