最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 正文

linux kernel 升级

来源:动视网 责编:小OO 时间:2025-09-29 23:29:12
文档

linux kernel 升级

在RHEL6.0发布整整8个月之后,CentOS6.0终于发布了。: [root@localhost~]#uname-r2.6.34-194.el51.下载linux-3.0.3内核包到/usr/src目录cd/usr/srcwgetftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.30.tar.gztar-xzvflinux-2.6.30.tar.bz2-C/usr/srccdlinux-2.6.30makemrproper清除环境变量
推荐度:
导读在RHEL6.0发布整整8个月之后,CentOS6.0终于发布了。: [root@localhost~]#uname-r2.6.34-194.el51.下载linux-3.0.3内核包到/usr/src目录cd/usr/srcwgetftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.30.tar.gztar-xzvflinux-2.6.30.tar.bz2-C/usr/srccdlinux-2.6.30makemrproper清除环境变量
在RHEL 6.0发布整整8个月之后,CentOS 6.0终于发布了。:

 [root@localhost ~]# uname -r

2.6.34-194.el5

  1.下载linux-3.0.3内核包到/usr/src目录

cd /usr/src

wget ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.30.tar.gz

tar -xzvf linux-2.6.30.tar.bz2 -C /usr/src

cd linux-2.6.30

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)”

  (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 编译模块’z]

  make modules_install 安装模块

  make install 安装

  mkinitrd /boot/initrd_2.6.30.img 2.6.30 根据内核版本和指定参数生成映像文件

  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.在/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

splashimage=(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
  3.此步若没有操作,重启会报错”insmod: error inserting ‘/lib/dm-region-hash.ko’: –1 File exits”,原因是重复了,根据网上查到的资料,2.6.x自编译内核会有这个小bug,我测试过不修改直接重启,虽然有报错,但仍然可以进入系统的.

[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 删掉重复的如下两行:

echo “Loading dm-region-hash.ko module”

insmod /lib/dm-region-hash.ko

[root@localhost newinitrd]# find .|cpio -c -o > ../initrd

14765 blocks

[root@localhost newinitrd]# cd ..

[root@localhost tmp]# gzip -9 < initrd > initrd-2.6.30.img

[root@localhost tmp]# ls

gconfd-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.重启成功后,再看看内核,是2.6.30,ok了。

  [root@localhost ~]# uname -r

2.6.30

文档

linux kernel 升级

在RHEL6.0发布整整8个月之后,CentOS6.0终于发布了。: [root@localhost~]#uname-r2.6.34-194.el51.下载linux-3.0.3内核包到/usr/src目录cd/usr/srcwgetftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.30.tar.gztar-xzvflinux-2.6.30.tar.bz2-C/usr/srccdlinux-2.6.30makemrproper清除环境变量
推荐度:
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top