I tried to upgrade the system to 2.6.31 before, but the result failed. I didn't try again because I was too busy. Recently, I was a little blank and thought about it again. Go to www.kernel.org and check that all the latest kernel versions are 2.6.33, So we plan to upgrade 2.6.33 directly.
I. Environment
The redhat5.3 installed on VMWare is used. The following operations are performed by the root user.
# Uname-R
2.6.18-53. EL5
Ii. Upgrade process
1)
Download Kernel
Before upgrading to www.kernel.org to see if there is any latest kernel, so far the latest is 2.6.33, is: http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.33.tar.bz2
2)
Copy linux-2.6.33.tar.bz2 to the/usr/local/src directory and decompress the following command to get the folder linux-2.6.33
Tar xjvf
Linux-2.6.33.tar.bz2
3)
Make distclean
This step can be omitted if it is the first compilation.
4)
Copy the original config file to the linux-2.6.33 directory
# Cd/usr/local/src/linux-2.6.33
# Cp
/Boot/config-2.6.18-53.el5. config
5)
Make menuconfig
Select load
Alternate configuration file: imports the. config file, and adds or simplifies functions.
Note: There are two Kernel configuration methods: one is directly placed into the kernel *; the other is compiled into the module m; the two methods have their own advantages; directly compiled into the kernel, for example, when a device starts, the module does not need to be loaded; when compiled into a module, the module supported by the kernel of the device needs to be loaded; however, it is not feasible to directly compile everything into the kernel. The kernel size will increase and the system load will be too heavy. When compiling the kernel, it is best to compile the extremely important data into the kernel. If you do not understand anything else, it is best to use the default [3].
Select after modificationSave an alternate configuration fileAnd then exit the configuration.
6)
Modify the. config file
Search config_sysfs_deprecated_v2 in the. config file and you will find # config_sysfs_deprecated_v2.
Is not set, change this row to config_sysfs_deprecated_v2 = y
If this row is not modified, the following error is reported after the upgrade is restarted, resulting in startup failure.
Volume group "volgroup00" not
Found
Unalbe to access resume Device
(/Dev/volgroup00/logvol00)
Mount: cocould not find filesystem
'/Dev/root'
Setuproot: Moving/dev failed: no such
File or directory
Setuproot: Error mounting/proc: no such
File or directory
Setuproot: Error mounting/sys: no such
File or directory
Switchroot: Mount failed: no such file
Or directory
Kernel panic-not syncing: attempted
Kill Init!
7)
Compile the kernel
# Make all
It takes about half an hour to an hour.
8)
# Make modules_install
9)
# Make install
At this time, three warnings will appear [2].
Warning: No module DM-Mem-Cache found for Kernel 2.6.33, continuing
Anyway
Warning: No module DM-message found for Kernel 2.6.33, continuing
Anyway
Warning: No module dm-raid45
Found for Kernel 2.6.33, continuing anyway
After testing, these three warnings do not affect kernel upgrades. See [2] for relevant instructions.
10)
Modify the initrd File
If the error insmod: Error inserting '/lib/dm-region-hash.ko':-1 file exits is reported after the upgrade and restart, this is because the init in initrd contains a duplicate of the dm-region-hash.ko module, therefore, you need to modify the generated initrd file (not all machines will encounter this error). The modification method is as follows [1]. For details, refer to reference 1:
A)
Decompress initrd
#
CP, Boot, initrd-2.6.33.img, TMP
#
CD/tmp/
#
Ls
Initrd-2.6.33.img
#
Mkdir newinitrd
#
CD newinitrd/
#
Zcat./initrd-2.6.33.img | cpio-I
#
Ls
Bin Dev etc
Init lib proc
Sbin sys sysroot
B)
Edit init and delete the duplicate two rows.
Echo "loading dm-region-hash.ko module"
Insmod/lib/dm-region-hash.ko
Echo "loading dm-region-hash.ko module"
Insmod/lib/dm-region-hash.ko
C)
Repackage initrd
#
Find. | cpio-c-o> ../initrd
#
CD ..
# Gzip-9 <
Initrd> initrd-2.6.33.img
D)
Copy initrd to the/boot directory again
# Cp
Initrd-2.6.33.img/boot
11)
Restart
Started successfully.
# Uname-R
2.6.33
Iii. Issues to be resolved
1)
Iptables startup failed
The following error message is displayed when the operating system is started:
Applying
Ip6tables firewall rules: ip6tables-restore v1.3.5: ip6tables-restore: Unable
Initalizetable 'filter'
Error
Accurred at line: 3
Try
"Ip6tables-restore-H 'or 'ip6tables-Restore -- help' for more information.
Applying
Iptables firewall rules: iptables-Restore v1.3.5: iptables-restore: Unable to initalizetable
'Filter'
Error
Accurred at line: 3
Try
"Iptables-restore-H' or 'iptables-Restore -- help' for more information.
Try to manually start the firewall after it is started:
#Service iptables status
Firewall stopped
#Service iptables start
Uninstalling the iiptables module: [OK]
Apply iptables firewall rules: iptables-Restore
V1.3.5: iptables-restore: Unable to initializetable 'filter'
Error
Occurred at line: 3
Try
'Iptables-restore-H' or 'iptables-Restore -- help' for more information.
[Failed]
2)
Hidd (Bluetooth hid Daemon) startup failed
Starting hidd:
Can't open hidp control socket: address family not supported by Protocol
[Failed]
#Service hidd status
Hidd is dead, but subsys is locked
#Service hidd start
Starting hidd: Can't open
Hidp control socket: address family not supported by Protocol
[Failed]
Iv. Description
I am also a newbie. I have successfully upgraded the kernel for the first time. Many details are still unclear. There are still two problems that have not been solved. As a result, you may encounter many problems during the upgrade process, I will share this information and hope that the above upgrade process will help you. If there are any omissions or errors, or do you have any good solutions to the problems above, I hope you will not be enlightened.
The following documents help me a lot. Thank you!
Email: haifengwang1987 # gmail.com
References:
[1] compiling kernel 2.6.30 Problems and Solutions http://blog.csdn.net/polisan/archive/2009/11/16/4818921.aspx
[2]
Centos kernel upgrade kernel 2.6.30 http://hi.baidu.com/rhca/blog/item/2be78c01bcf5d9df267fb5e7.html
[3] http://linux.chinaunix.net/bbs/viewthread.php? Tid = 1147827 & page = 1 & extra = # pid7171483