Red Hat Linux 9.0 kernel upgrade algorithm (2.4.20-8 ~ 2.6.20)

Source: Internet
Author: User

Red Hat Linux 9.0 kernel upgrade algorithm (2.4.20-8 ~ 2.6.20)

The kernel of Red Hat Linux 9.0 was upgraded from 2.4.20-8 to 2.6.20 a few days ago.

The upgrade process is tortuous and difficult, but it is still successful after hard work. We hope to share it with you.

This upgrade process is not limited to upgrading from 2.4.20-8 to 2.6.20. It can be used by users who upgrade the kernel from 2.4.x to 2.6.x.

First of all, make preparations. You must have at least four software packages in your hands:

1、2.6.2.6.20 internal package (linux-2.6.20.tar.gz): The function is not much to say, naturally it is the source package of the kernel;

2. modutils 3.2 tool package (module-init-tools-3.2.tar.gz): The Toolkit under 2.4.x is not applicable to 2.6.x and must be upgraded;

3. mkinitrd 4.1.18-2 Toolkit (mkinitrd-4.1.18-2.i386.rpm): use this tool when making install;

4. device mapper Development Kit (device-mapper-1.00.19-2.i386.rpm): mkinitrd toolkit depends on this package;

5. LVM Development Kit (lvm2-2.00.25-1.01.i386.rpm): Device mapper depends on this package;

6. binutils Development Kit (binutils-2.17.tar.gz): this package is required if you want to upgrade Red Hat Linux installed on a virtual machine.

Are you ready? I didn't give it here because different machines are in different regions and networks, and the download speed may vary greatly. In the past, I used what others provided, and the download was very slow. Therefore, I am here to tell you how to quickly get these Toolkit: you must search on Google (recommended) or Baidu, and use the full name of the file name to search for the Toolkit, if you want to search for the LVM Development Kit, you need to write the lvm2-2.00.25-1.01.i386.rpm when entering the keyword, and then select "index of…" in the result that you find ......" The webpage with the title. There will be a lot of such Web pages. In the selection, you should select the page closest to your geographic location based on the domain name given in the last line of each record. For example, a webpage under a domain name such as "* .ch.kernel.org. This can effectively ensure the download speed, so that you will not be able to upgrade the kernel while playing the game. When all the software packages have been downloaded, your mind will go to the game. :)

Install the toolkit now! First, install the modutils 3.2 tool package, switch the current directory to the download directory of module-init-tools-3.2.tar.gz, and execute the following commands in sequence:

Tar zxf module-init-tools-3.2.tar.gz

CD module-init-tools-3.2

./Configure -- prefix =/

Make moveold (rename the original tool program so that you can continue to use the original 2.4.x kernel)

Make all install

./Generate-modprobe.conf/etc/modprobe. conf (new configuration file for 2.6.x kernel generation)

Install the mkinitrd 4.1.18-2 toolkit below, switch the current directory to the download directory for the mkinitrd-4.1.18-2.i386.rpm, device-mapper-1.00.19-2.i386.rpm, and lvm2-2.00.25-1.01.i386.rpm (the three files should preferably be in the same directory), and execute the following commands in turn:

Rpm-IVH -- nodeps -- force lvm2-2.00.25-1.01.i386.rpm

Rpm-IVH -- nodeps -- force device-mapper-1.00.19-2.i386.rpm

Rpm-IVH -- nodeps -- force mkinitrd-4.1.18-2.i386.rpm

If you run red hat linux 9.0 on a virtual machine or the bzimage compilation error occurs after the kernel is installed, you must install the binutils development kit. The error message of this type on the virtual machine is generally:

Objcopy ARCH/i386/boot/compressed/vmlinux. Bin
BFD: Warning: writing section '. bss' to huge (ie negative) file offset 0xc025d000.
Objcopy: ARCH/i386/boot/compressed/vmlinux. Bin: file truncated
Make [2]: *** [ARCH/i386/boot/compressed/vmlinux. Bin] Error 1
Make [1]: *** [ARCH/i386/boot/compressed/vmlinux] Error 2
Make: *** [bzimage] Error 2

Switch the current directory to the binutils-2.17.tar.gz download directory and execute the following commands in sequence:

Tar zxf binutils-2.17.tar.gz

CD binutils-2.17

./Configure

Make

Make install

All right, All installation packages are ready. Compile the new kernel now!

Switch the current directory to the linux-2.6.20.tar.gz download directory and execute the following commands in sequence:

CP./linux-2.6.20.tar.gz/usr/src

Tar zxf linux-2.6.20.tar.gz

CD linux-2.6.20

Make mrproper

Make menuconfig

In this case, a graphical interface is displayed, listing all Kernel configuration options. The following items are required:

In "loadable module support", select "module unloading" and "automatic kernel module loading ";

In "device drivers" → "Block devices", select "loopback device support ";

Select "device mapper support" from "device drivers" → "Multi-Device Support (raid and LVM ";

In "device drivers" → "graphics support", select "Support for frame buffer devices ";

In "device drivers" → "USB support", if not in the virtual machine environment, select all to support USB;

Select "amd pcnet32 PCI support" from "device drivers" → "network device support" → "Ethernet (10 or 100 Mbit ";

Because Red Hat 9.0 uses ext3 as the file system, all options related to ext2 and ext3 in "File System" are required;

If the kernel and SCSI hard disk are compiled under the vmwarevm, the following three options are required:

"Device Drivers" → "SCSI device support ";

"Device Drivers" → "SCSI Device Support" → "SCSI disk support ";

"Device Drivers" → "SCSI Device Support" → "SCSI low-level drivers" → "buslogic SCSI support ";

Developers who require the system to provide a variety of network protocols should also make corresponding settings in "network support.

The settings are complete! Start to compile the kernel. Execute the following commands in sequence:

Make

Make modules

Make modules_install

Make install

If you are using a vmwarevm + SCSI hard disk, run the following command before make install:

CP/usr/src/linux-2.6.20/Drivers/SCSI/buslogic. O/lib/modules/2.6.20/kernel/Drivers/SCSI

The kernel compilation ends completely. If you want to start the kernel successfully, you need to do some subsequent work. Execute the following commands in sequence:

CP/usr/src/linux-2.6.20/ARCH/i386/boot/bzimage/boot/vmlinuz-2.6.20 (required for VMware Users)

CP/usr/src/linux-2.6.20/system. MAP/boot/system. Map-2.6.20

CD/boot

Rm-RF system. Map (delete the original kernel startup connection)

Ln-S system. Map-2.6.20 system. Map (set the new kernel to start the connection)

If grub is enabled for Linux, modify the corresponding Startup file:

CD/boot

New-kernel-PKG -- mkinitrd -- depmod -- install 2.6.20

DF (this command is used to view the root partition, that is, the partition marked as "/". remember its name after optimistic about it,Assume/dev/sda2)

Gedit/boot/GRUB/grub. conf

In the pop-up editing window, change "default = 1" to "default = 0", and change "label =/" in the "kernel" line to the partition viewed in the previous step, based on our previous assumptions, the "kernel" line after the change should look like the following:

Kernel/vmlinuz-2.6.20 RoRoot =/dev/sda2

Because I use a virtual machine for installation, the above content may be slightly different from the actual environment, but the blue bold part must be like this.

If you want to support hotplug, USB devices, or experience the sysfs File System under the new kernel, you also need to install the corresponding toolkit and change the configuration file. I will not discuss these issues here. I will open new posts for you to study and discuss.

All right, the entire kernel upgrade is complete! After the restart, the following two items are displayed in the Operating System Selection bar:

Red Hat Linux (2.6.20)
Red Hat Linux (2.4.20-8)

Select the first option to use Linux 2.6.20. Enjoy the new kernel!

Related Article

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.