Upgrade Linux kernel from 2.4.20-8 to 2.6.0

Source: Internet
Author: User
Tags gtk

Upgrade Linux Kernel
Step 1: The current 2.6 kernel Installation
Step 2: familiarize yourself with existing files
Step 3: Upgrade the version of each change file in the system
Step 4: configure the new kernel
Step 5: Create a New Kernel
Step 6: install the new kernel
Step 7: Confirm Data Backup
As the last test version of 2.6.0, the 2.6 test version has gone through more detector tests, especially at present, it is of great significance for developers to further pursue kernel bugs and stability. Once the development tree of version 2.7 is launched, it will surely bring about a new feature research boom.

This article aims to provide readers with some tips for upgrading to the 2.4 kernel. Because the 2.6 kernel is still a developing kernel, you may encounter some problems during running, but its overall performance and stability are still very good.
 

TIPS: Linux uses a dual-tree system. One tree is a stable tree, and the other is a non-stable tree or a development tree ). Some new features and experimental improvements will be implemented in the Development tree first. If the improvements made in the Development tree can also be applied to the stability tree, the same improvements will be made in the stability tree after tests in the Development tree. Once the development tree has been sufficiently developed, the development tree will become a new stable tree.

Target User

This article is intended for lunix2.4 kernel users. (If not, see the Linux kernel howto)

Preparations: first, back up important data

Before you begin, make sure that all your data has been backed up.

Step 1: Install the 2.6 kernel (obtained)

First, all Linux kernel official versions can be found in http://kernel.org. You can download the kernel program from the image site quickly and quickly. Kernel.org mirror site list: http://kernel.org/mirrors.

Then download GnuPG, which is mainly used to verify the authenticity and legitimacy of the new kernel program. (Http://www.kernel.org/signature.html .)

Step 2: familiarize yourself with existing files

At least you need to be familiar with the change files in the top-level readme files and documentation directories. They are all distributed Linux kernel source code.

Because 2.6.0-test is a phase in kernel development (2.6.0 has no extension-test, that is, the initial version of 2.6), its top-level readme file is derived from the README file of the 2.5 development kernel. You will get a lot of tips for successfully compiling the Linux kernel from this file. (For details, see Appendix 1)

The "documentation/changes" file lists new requirements for developing the 2.5 kernel and a list of software for upgrading the new kernel program. (For the main content, see Appendix 2)

Step 3: Upgrade the version of each change file in the system

The upgrade of the new 2.6 kernel involves upgrading many utilities. Do not worry about the utilities listed in some change files. They may be just a special example of a file system. However, the following files must meet at least the minimum version given in the following table:

Name: Minimum Version: how to find version:
Gnu c compiler 2.95.3 GCC -- version
GNU make 3.78 make -- version
Binutils 2.12 LD-V
Util-Linux 2.10o fdformat -- version
Module-init-tools 0.9.9 depmod-V
Procps 2.0.9 PS -- version
[Procps 2.x] [procps. x]

(If there is any change, see the latest update in "Documentation/change. For details, see Appendix 2)

The following Utility is a special program in the file system. If you run ext2 or ext3, you must upgrade e2fsprogs. To run JFS, you must upgrade jfsutils. For example:

Name: Minimum Version: how to find version:
E2fsprogs 1.29 tune2fs
Jfsutils 1.0.14 fsck. JFS-V
Reiserfsprogs 3.6.3 reiserfsck-V 2> & 1 | grep reiserfsprogs
Xfsprogs 2.1.0 xfs_db-V
Nfs-utils 1.0.5 showmount -- version

In addition, a few utilities need to be upgraded when you use them:

Name: Minimum Version: how to find version:
PCMCIA-CS 3.1.21 cardmgr-V
Quota-tools 3.09 quota-V
PPP 2.4.0 PPD -- version
Isdn4k-utils 3.1pre1 isdnctrl 2> & 1 | grep version
Oprofile 0.5.3 oprofiled -- version

If you run ALSA for the first time, visit http://www.alsa-project.org/to obtain the latest alsa-lib and ALSA-utils.

Step 4: configure the new kernel

Here, one of the first changes you have noticed is the formation of a new structural system. The old tk/TCL "xconfig" structure is replaced by the new QT "xconfig. Of course, GTK "gconfig" is fine.

2.6 kernel configurations include:

Make config

Similar to the 2.4 kernel configuration "Config", as a simple configuration method, it only requires you to select each configuration option. Bash is required ".

Make menuconfig

Similar to the "menuconfig" configured in the 2.4 kernel.

Make xconfig

The new default graphical configuration system uses the QT library. It is very convenient and easy to use.

Make gconfig

This option is a new clone of xconfig, replacing the QT library with the GTK library. Unfortunately, a bug was found during the test. The same error message will be repeatedly displayed during running.

Make oldconfig

This option is very useful in kernel upgrade. At first glance, it is a bit like a simple "make config". In fact, oldconfig is used to read and automatically respond to the current. config settings. It prompts you about the new configuration option function. To use this function, simply copy your old. config file and run "make oldconfig.

(Note: When you configure the 2.6 kernel for the first time, pay attention to the following tips when viewing the top-level readme file of Linux code: ① excessive drivers will increase the kernel, which may cause problems under certain conditions.

② The selection of kernel hacking configuration information often leads to a larger and slower kernel, and even leads to unstable kernel. Therefore, when answering the "development", "experimental", or "debugging" features, most choose "N ".)

ALSA:

From version 2.4 to version 2.6, you need to use ALSA (Advanced Linux sound architecture: New Linux audio architecture ). It replaces OSS (Open Sound System ). When configuring the kernel, select the oss api imitation options (snd_ossemul, snd_mixer_oss and snd_pcm_oss) and appropriate audio driver (pCI driver) for ALSA ). Finally, download and install the latest ALSA-lib and ALSA-utils.

Step 5: Create a New Kernel

It is easier to create a 2.6 kernel than a 2.4 kernel. You do not need to perform the "make Dep" step. Create a new kernel and run "make bzlmage ". If you select the compilation module, you also need to run "make modules" and "make modules_install ". "Make bzlmage & make modules & make modules_install" can be performed together ".

Step 6: install the new kernel

After the kernel is created, you need to copy it to a location. If the x86 host is located, the path is "arch/i386/Boot ". Copy the file and the new system. map it to the root directory/boot. For example:

# Pwd
/Usr/src/linux-2.6.0-test4
# Mv ARCH/i386/boot/bzimage/boot/bzImage-2.6.0-test4
# Mv system. MAP/boot/system. map-2.6.0-test4
# Cd/boot
# Rm system. Map
# Ln-S system. map-2.6.0-test4 system. Map

After the new kernel is copied, configure the root loader using grub and Lilo. It is found that the new 2.6 kernel is larger than the 2.4 kernel compiled with the same version of GCC, maybe because more options are selected during compilation.

-RW-r -- 1 Root 1094390 Aug 12 bzImage-2.4.21-ck3
-RW-r -- 1 Root 1639129 Aug 27 bzImage-2.6.0-test4

Step 7: Confirm Data Backup

In this step, you do not need to do anything that may damage the hard disk data, but the next step is to start the new kernel. The last time please confirm that the important data on the hard disk has been backed up. Step 8: try the new kernel

Now, restart the computer and test the newly compiled 2.6 kernel. If all the steps are correct, the kernel startup information will appear: initstate = 3, and the new kernel will soon appear. If ALSA is installed, you can check the sound driver: 'cat/proc/asound/CARDS '. For example:

$ CAT/proc/asound/cards
0 [live]: emu10k1-sound blster live!
Sound Blaster live! (Rev.5) at 0x18e0, IRQ 11

If the above information appears, it indicates that the sound program is not running, start "alsamixer" and confirm that the driver is enabled. In addition, it is found that the "master" and "PCM" (/dev/DSP) must be enabled for sound Programs to operate normally.

Appendix 1

Readme -- Linux kernel 2.5.xx (partial data)

Describes the kernel installation and error handling methods.

Kernel Installation

After all necessary resources are installed, decompress the kernel in the license directory (such as the main directory ):

Gzip-CD linux-2.5.XX.tar.gz | tar xvf-(XX is the new kernel version)

Note:/usr/src/Linux is not allowed.

Upgrade 2.5.xx with patches.

Gzip-CD ../patch-2.5.xx.gz | patch-P1 or bzip2-dc ../patch-2.5.xx.bz2 | patch-pl or Linux/scripts/patch-kernel Linux
Delete old. O files and their affiliated files
CD Linux
Make mrproper

Software requirements

To compile and run the 2.5.xx kernel, you must upgrade the new versions of various software packages. See the minimum version required in./documentation/change.

Compile the kernel

(1) Determine GCC 2.95.3 or later

(2) Make bzimage (if it is started with a disk, Insert disk A and then make bzdisk)

(3) make modules (if some modules are compiled, execute the command after "make modules_install)

(4) Keep a kernel backup file

⑸ Start new kernel

Copy of the new kernel. The new kernel after compilation can be found in ../Linux/ARCH/i386/boot/bzimage and copied to the start location. If it is a floppy drive, copy the bzimage file of the kernel to/dev/fd0 to form a bootable soft drive. If the hard disk is started, use LILO (/etc/Lilo. conf ). Kernel image files are often/vmlinuz,/boot/vmlinuz,/bzimage, or/boot/bzimage. Save the new kernel image file and overwrite the old one. Then run lilo to enable the new kernel.

Resetting lilo is the key to running/sbin/Lilo. You can edit/etc/Lilo. conf to specify the exit of the old kernel image (that is,/vmlinux. Old) to avoid problems in running the new kernel. After lilo resetting, all preparations are done, and then the system is shut down and the computer is restarted.

Note: If you need to change the default root driver, video mode, ramdisk size, and so on, you can use the "rdev" Program (or lilo boot option) in the kernel image ). You do not have to re-compile the kernel to change these parameters.

Restart to restart the new kernel.

 

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.