How to upgrade CentOS kernel

Source: Internet
Author: User
After eight months of RHEL6.0 release, CentOS6.0 was released. To test some software, the author needs kernels later than 2.6.30, and installs CentOS5.5 with the kernel 2.6.18-194. el5. Therefore, the author upgrades the CentOS kernel. To test some software, kernel 2.6.30 or above is required. CentOS5.5 is installed and kernel 2.6.18-194. el5. the upgrade is smooth.

Eight months after RHEL 6.0 was released, CentOS 6.0 was finally released. To test some software, the author needs kernels later than 2.6.30, and installs CentOS 5.5 with the kernel 2.6.18-194. el5. Therefore, the author upgrades the CentOS kernel.

 

To test some software, kernel 2.6.30 or later is required. after CentOS 5.5 is installed, kernel 2.6.18-194. el5. the upgrade is still smooth. the specific process is as follows:

[root@localhost ~]# uname -r2.6.18-194.el5

1. download the linux-2.6.30 kernel package to the/usr/src Directory

Cd/usr/srcwget ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.30.tar.gztar-xzvf linux-2.6.30.tar.bz2-C/usr/srccd linux-2.6.30make mrproper clear environment variables, that is, clear the configuration file make menuconfig select the kernel module to be compiled in menu mode:

Networking support-> networking options-> network packet filtering framework (netfilter)

(1). core netfilter configuration

"Netfilter connection tracking support"-m state-related modules depend on it. if this parameter is not selected, No.

B. compile netbios name service protocal support (new) into a module. Otherwise, an error will occur when iptables is upgraded later.

"Netfilter Xtables support (required for ip_tables)" in the C check box )"

(2). IP: Netfilter Configuration

A compiles "IPv4 connection tracking support (require for NAT)" into A module.

IP tables support (required for filtering/masq/NAT) in "B ).

C. Compile "MASQUERADE target support" and "REDIRECT target support" under "Full NAT" into a module.

(3) other modules can be selected based on their own needs. if not, refer to the kernel configuration manual.

Make clean make sure everything is up to date.

Make bzImage to generate the kernel file

Make modules compilation module

Make modules_install installation module

Make install installation

Mkinitrd/boot/initrd_2.6.30.img 2.6.30 generate an image file based on the kernel version and specified parameters

Cp arch/x86/boot/bzImage/boot/vmlinuz-2.6.30

Cp/usr/src/linux-2.6.30/System. map/boot/System. map-2.6.30

2. add the following 2.6.30 information in/etc/grub. conf and change default = 1 to default = 0.

[root@localhost ~]# cat /etc/grub.conf# grub.conf generated by anaconda## Note that you do not have to rerun grub after making changes to this file# NOTICE: You have a /boot partition. This means that# all kernel and initrd paths are relative to /boot/, eg.# root (hd0,0)# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00# initrd /initrd-version.img#boot=/dev/sdadefault=0timeout=5splashimage=(hd0,0)/grub/splash.xpm.gzhiddenmenutitle CentOS (2.6.18-194.el5)root (hd0,0)kernel /vmlinuz-2.6.18-194.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quietinitrd /initrd-2.6.18-194.el5.imgtitle CentOS (2.6.30)root (hd0,0)kernel /vmlinuz-2.6.30 ro root=/dev/VolGroup00/LogVol00 rhgb quietinitrd /initrd-2.6.30.img

3. if this step is not operated, restart will report the error "insmod: error inserting '/lib/dm-region-hash.ko':-1 File exits", the reason is repeated, according to the information found on the Internet, 2.6.x the self-compiled kernel has this small bug. I tested it and restarted it without modification. although there is an error, it can still enter the system.

[Root @ localhost] cp/boot/initrd-2.6.30.img/tmp [root @ localhost] cd/tmp/[root @ localhost tmp] mkdir newinitrd [root @ localhost tmp] cd newinitrd/[root @ localhost newinitrd] zcat .. /initrd-2.6.30.img | cpio-I [root @ localhost newinitrd] vi init delete duplicate of the following two rows: echo "Loading dm-region-hash.ko module" insmod/lib/dm-region-hash.ko [root @ localhost newinitrd] # find. | cpio-c-o> .. /initrd14765 blocks [root @ localhost newinitrd] # cd .. [root @ localhost tmp] # gzip-9 <initrd> initrd-2.6.30.img [root @ localhost tmp] # lsgconfd-root initrd initrd-2.6.30.img mapping-root newinitrd scim-panel-socket: 0-root [root @ localhost tmp] # mv/boot/initrd-2.6.30.img/home/[root @ localhost tmp] # cp initrd-2.6.30.img/boot/[root @ localhost tmp] # reboot

4. after the restart is successful, check whether the kernel is 2.6.30 or OK.

[root@localhost ~]# uname -r2.6.30

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.