Centos 內核升級

 
[root@localhost ~]# uname -r
2.6.18-194.el5
1.下載linux-2.6.30內核包到/usr/src目錄
cd /usr/src
wget ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.30.9.tar.gz
tar -xzvf linux-2.6.30.9.tar.gz -C /usr/src
cd linux-2.6.30.9
yum install gcc
yum install ncurses-devel
make mrproper   清除環境變量,即清除配置文件
make menuconfig 在菜單模式下選擇須要編譯的內核模塊:
 
networking support—>networking options—>network packet filtering framework(netfilter)
 
(1).core netfilter configuration
A 勾中」Netfilter connection tracking support」   -m state相關模塊是依賴它的,不選則沒有。
B 將netbios name service protocal support(new)    編譯成模塊,否則後面升級iptables後啓動時會出錯
C 勾中「Netfilter Xtables support (required for ip_tables)」
D 勾中 "TCPMSS" 選項
(2).IP: Netfilter Configuration
A 將 「IPv4 connection tracking support (require for NAT)」 編譯成模塊。
B 勾中IP tables support (required for filtering/masq/NAT) 。
C 將 「Full NAT」 下的 「MASQUERADE target support」 和 「REDIRECT target support」 編譯成模塊
(3).其它模塊能夠根據本身的須要進行選擇,若不懂能夠參考內核配置手冊.
 
make clean   確保全部東西均保持最新狀態.
make bzImage   生成內核文件
make modules 編譯模塊
make modules_install 安裝模塊
make install   安裝
 
2.在/etc/grub.conf添加以下2.6.30的信息,並把default=1改成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/sda
default=0
timeout=5
splashp_w_picpath=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-194.el5)
         root (hd0,0)
         kernel /vmlinuz-2.6.18-194.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
         initrd /initrd-2.6.18-194.el5.img
 
title CentOS (2.6.30)
         root (hd0,0)
         kernel /vmlinuz-2.6.30 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
         initrd /initrd-2.6.30.img
相關文章
相關標籤/搜索