2.4-> 2.6 Core Upgrade Guide

xiaoxiao2021-03-06  55

Lunuxorg reproduced: Linux-2.6.x After the lab release, the brothers in the jap must be essential to upgrade the original 2.4.x kernel. However, due to the 2.6.x kernel supporting system programs, there is no corresponding time and update, The upgrade process will encounter a lot of problems, so I feel that I need to put my experience with everyone :-) When I encountered similar problems in the future, please read this article, not to blindly post it.

PS, You are Welcome to FIX ME.

1. Backup important data

This is a good habit, don't say more :-)

2. Download the latest 2.6.x kernel source package

Of course, I want to download the official website www.kernel.org or its mirror site, it is best not to go to those UNKNOWN websites, because those source packs may be malicious to do hand feet. The latest Linux-2. * **. Tar.bz2 source package is about 33m or so. You can make a cup of coffee when downloading, then point the fire ......

Unlock the source package in / usr / src / directory, get the source code directory /usr/src/linux-2.***/. Before doing anything to KERNEL, I suggest you look at its readme file and Documentation. / Changes file, from you will get a lot of useful information. This information will allow you to avoid many unnecessary troubles in subsequent upgrade processes.

The minimum system software required to be successfully upgraded to kernel-2.6.x is given in document Documentation / Changes, such as the kernel-2. *** is:

O GNU C 2.95.3 # GCC --Version

o GNU Make 3.79.1 # make --Version

o binutils 2.12 # ld -v

o Util-linux 2.10o # fdformat --Version

o Module-init-Tools 0.9.10 # depmod -v

o E2FSPROGS 1.29 # Tune2FS

o jfsutils 1.1.3 # fsck.jfs -v

o Reiserfsprogs 3.6.3 # Reiserfsck -v 2> & 1 | GREP Reiserfsprogs

o Xfsprogs 2.6.0 # xfs_db -v

o PCMCIA-CS 3.1.21 # cardmgr -v

o Quota-Tools 3.09 # quota -v

o PPP 2.4.0 # pppd --version

o ISDN4K-Utils 3.1pre1 # isdnctrl 2> & 1 | GREP VERSION

o NFS-Utils 1.0.5 # Showmount --Version

o Procps 3.2.0 # ps --Version

o oprofile 0.5.3 # oprofiled --Version

For users of RH8 / 9, the above requirements are basically satisfied. Probably only two programs need to be updated: ModuTils Toolkit and Mkinitrd programs.

3. Install module-init-tools-3.0.tar.gz kit

The Module processing process of the Linux-2.6.x kernel has changed (many originally in the user's work is done in the kernel), so the ModuTils kit under 2.4.x is not suitable for new 2.6 .x kernel, it is necessary to upgrade it to the Module-Init-Tools kit. The latest version of the toolkit is 3.0 (PS, the version of the toolkit is jumped from 0.9.15 to 3.0, the span is large ... HOHO ). There are two places where module-init-tools-3.0.tar.gz source package:

o Rusty's Linux Kernel Page:

Http://www.kernel.org/pub/linux/ker...ools-3.0.tar.gz

o

http://www.kernel.org/pub/linux/uti...ools-3.0.tar.gz

Next, install the Module-Init-Tools Kit according to the following steps:

# Configure --Prefix = /

# Make Moveold

# make all install

# ./generate-modprobe.conf /etc/modprobe.conf

The command "make moveold" will rename the original ModuTils tool program "* .old" (for example, lsmod.old, etc.). Note! This is a very important step, don't omit, this will make you can continue Using the original Linux-2.4.x system, because in 2.4.x system, the new module-init-tools toolkit is actually relying on the original "* .old" program to load the kernel module. If you forget this step Don't be nervous, you can download and install the original MODUTILS package, then follow the steps above.

The new module-init-tools kit no longer uses the original /etc/modules.conf configuration file, but uses new configuration files /etc/modprobe.conf. Therefore, you must use the command "./generate-modprobe.conf /etc/modprobe.conf "Generates a new profile /etc/modprobe.conf. But it is uncomfortable that this generated new configuration file exists, and we will mention below.

4. Update Mkinitrd Programs

Can go to the site

http://people.redhat.com/arjanv/2.6...1-2.i386.rpm package. Because the Mkinitrd package depends on the device-mapper package, the device-mapper package is dependent on the LVM2 package, so you still To download the device-mapper-1.00.07-1.i386.rpm package and LVM2-2.00.08-2.i386.rpm package.

5. Configure, compile and install Linux-2.6.x kernel

The new kernel changes in makefile, "Make MenuConfig" and "Make Xconfig" continue to exist, but "make Xconfig" is rewritten, no longer use the original TCL / TK language, but based on the QT library. New increase "Make gconfig", it is based on GTK library. "Make Xconfig" and "make gconfig" are more powerful and easier to use than original. But unfortunately, they seem to be less stable ... therefore Or use my favorite "make menuconfig" :-)

About the configuration of the new kernel wants to mention a few:

o About "Loadable Module Support" option, you must select two options that "Module Unloading" and "Automatic Keernel Module Loading".

o About the "Processor Type and Features" option, be sure to select the "preemptible kernel" option, which is one of the important reasons for the 2.6.x core than 2.4.x core.

o About the configuration of "Block Devices", be sure to select support for loopback and ramdisk.

o About "Multi-Device Support (RAID AND LVM)", you want to select "Device Mapper".

o About "Input Device Support", remember to select "Keyboards" and "mice" support.

o About "Graphics Support", choose to support Frame Buffer.

o About ALSA, choose the "OSS API Emulation" option. OSS can not be used.

o About USB, you can choose all :-)

o About the file system, selecting the commonly used types. If you want to experience Sysfs, you should choose the support for Sysfs. After formulating the kernel, you can directly compile, "make DEP" steps have been displayed. Need.

# Make Bzimage

# Make Modules

# Make Modules_Install

# make install

The above command "make install" will: (1) copy the compressed kernel image to the / boot directory, and create the corresponding system.map symbol link; (2) Modify the BootLoader configuration file; (3) call Mkinitrd program creation Initrd image of the kernel. For GRUB, the following is similar to the following configuration lines in /boot/grub/grub.conf profile:

Title Red Hat Linux (2. ***)

Root (HD0, 1)

Kernel /Boot/Vmlinuz-2.*** Ro root = label = /

Initrd /boot/initrd-2.***.img

Unfortunately, the new kernel does not identify "root = label = /" startup parameters. If you restart the new kernel, the kernel PANIC error will occur. Therefore, you must start this "root = label = /" startup parameters Remove, it is OK.

Here, you can restart the machine, start with kernel-2. ***. Of course, most of you will not succeed, not no mouse is no keyboard :-)

6. Support HotPlug

Of course, you must first configure the support for HotPlug when the kernel configuration is configured. Then, since the / proc / ksyms is renamed to / proc / kallsyms, it is necessary to modify the startup script /etc/rc.sinit. In order to compatibility with the original Linux-2.4.x System, you can add the following line:

#

# ----- kernel 2.6.x support ------

# This is for Compatibility Between kernel-2.4.x and kernel-2.6.x

#

Uname = `uname -r`

Kernel = $ {UNAME: 0: 3}

IF [$ kernelver "=" 2.6 "]; then

#

# This is kernel-2.6.x

#

Ksyms = / proc / kallsyms

Else

#

# This is kernel-2.4.x

#

Ksyms = / proc / ksyms

Fi

Then, all the places in the rc.sysinit file are changed to "$ ksyms" variable reference. After configuration, you must also download the HOTPLUG's user-mate accessibility kit:

http://www.kernel.org/pub/linux/uti...4_03_11.tar.gz. After unlocking this package, "make install" can be "make install". It will generate the / etc / hotplug / configuration directory.

7. Experience SYSFS

First, create a directory / SYS:

# MKDIR / SYS

Then, follow these steps to modify the startup script /etc/rc.sysinit file:

o Find the line: mount -f / proc ", increasing below:

IF [$ kernelver "=" 2.6 "]; then

Mount -f / sys

Fi

o Find the line: Action $ "Mounting Proc FileSystem:" Mount -n -t Proc / Proc / Proc, add such a line below:

#

# Mount / sys for kernel-2.6.x

#

IF [$ kernelver "=" 2.6 "]; then

Action $ "Mounting Sysfs FileSystem:" Mount -n -t sysfs / sys / sysfi

Next, in the / etc / fstab file, join this line:

None / Sys sysfs defaults 0 0

Finally, modify the HALT_GET_REMAINING function in the /etc/init.d/halt script:

will:

AWK '$ 2 ~ / ^ // $ | ^ // Proc | ^ // dev / {next}

Change to:

AWK '$ 2 ~ / ^ // $ | ^ // Proc | ^ // Sys | ^ // dev / {next}

8. Support USB device

The name of the Linux-2.6.x USB driver module has changed, so there is a lot of problems caused by this ..., the name of the kernel module corresponding to the USB-2.0 Host controller is still EHCI-HCD, corresponding USB -1.1 The kernel module name of the HOST controller has been changed from USB-OHCI to Ochi-HCD, and the name of the kernel module corresponding to the General USB HOST controller has been UHCI-HCD from USB-UHCI.

Unfortunately, the /etc/modprobe.conf configuration file generated when installing the Module-IT-Tools package is still using USB-OHCI. For example:

Alias ​​USB-Controller USB-OHCI

Alias ​​USB-Controller1 EHCI-HCD

Therefore, to change it to:

Alias ​​USB-Controller OHCI-HCD

Alias ​​USB-Controller1 EHCI-HCD

If such modifications are not done, the machine using the USB-1.1 Host controller will not be able to drive the corresponding drive module when the kernel is started.

The module name supporting the USB keyboard is also changed from the keybdev to USBKBD, and the module name of the USB mouse is also changed from MouseDev to USBMOUSE. Therefore, we must modify the startup script /etc/rc.sysinit file. At the same time, in order to compatible 2.4.x System, we define two variables at the beginning of the script:

#

# ----- kernel 2.6.x support ------

# This is for Compatibility Between kernel-2.4.x and kernel-2.6.x

#

Uname = `uname -r`

Kernel = $ {UNAME: 0: 3}

IF [$ kernelver "=" 2.6 "]; then

#

# This is kernel-2.6.x

#

Ksyms = / proc / kallsyms

KeyBDEV_NAME = USBKBD

MouseDev_name = USBMOMSE

Else

#

# This is kernel-2.4.x

#

Ksyms = / proc / ksyms

KeyBDEV_NAME = KeybDev

MouseDev_name = MouseDev

Fi

Then, the list of keybdev_name and $ mouseDev_name will be changed to $ KeyBDEV_NAME and $ MouseDev_name in the /etc/rc.sinit script file. Send the NEEDUSBSTORAGE section in the script file /etc/rc.sinit from:

Needusbstorage =

IF [$ usb = "1"]; then

NeedusbStorage = `lc_all = c grep -e" ^ i.1 * CLS = 08 "/ proc / bus / usb / devices 2> / dev / null`

LC_ALL = C grep 'hid' / proc / bus / usb / drivers || action $ "Initializing USB HID interface:" modprobe hid 2> / dev / nullaction $ "Initializing USB keyboard:" modprobe $ KEYBDEV_NAME 2> / dev / null

Action $ "Initializing USB Mouse:" Modprobe $ mousedev_name 2> / dev / null

Fi

Change to:

Needusbstorage =

IF [$ usb = "1"]; then

IF [$ kernelver "=" 2.6 "]; then

NeedusbStorage = `lc_all = c grep -e" ^ i.1 * CLS = 08 "/ sys / bus / usb / defices 2> / dev / null`

LC_all = c grep 'hid' / sys / bus / usb / drivers || Action $ "Initializing USB HID Interface:" Modprobe Hid 2> / dev / null

Else

NeedusbStorage = `lc_all = c grep -e" ^ i.1 * CLS = 08 "/ proc / bus / usb / devices 2> / dev / null`

Lc_all = c grep 'hid' / proc / bus / usb / drivers || Action $ "Initializing USB HID Interface:" Modprobe Hid 2> / dev / null

Fi

Action $ "Initializing USB Keyboard:" Modprobe $ Keybdev_Name 2> / dev / null

Action $ "Initializing USB Mouse:" Modprobe $ mousedev_name 2> / dev / null

Fi

Ok, until this, we should be able to restart the machine, hurry to experience the latest kernel-2. *** :-)

9. Others

o For questions about using rpm commands in Linux-2.6.x systems, see Documents [2] and [6].

o For questions about the sound card, you can refer to the reference document [2] and [6].

o For questions about running VMware on Linux-2.6.x systems, see Reference documents [2] and [6].

10. Reference documentation

[1] kernel 2.6.x, The new break:

Http://linuxbooks.pananix.com/kernel2.6.html

[2] Upgrading RH9 to 2.6.0-Test4:

Http://www.fearthecow.net/index.pl?..a aP;page=kernel

[3] HOWTO UPGRADE to the 2.6 kernel:

http://kerneltrap.org/node/view/799

[4] Building Linux kernel 2.6 on Red Hat 8:

http://www.sabalsoftware.com/articl...26onredhat8.php

[5] migrating to linux kernel 2.6 on Recent Redhat Systems:

http://linux-sxs.org/upgrading/migration26.html[6] migrating to linux kernel 2.6:

http://thomer.com/linux/migrate-to-2.6.html

转载请注明原文地址:https://www.9cbs.com/read-72711.html

New Post(0)