Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1920328
  • 博文数量: 261
  • 博客积分: 8073
  • 博客等级: 中将
  • 技术积分: 2363
  • 用 户 组: 普通用户
  • 注册时间: 2006-04-10 15:23
文章分类

全部博文(261)

文章存档

2013年(1)

2012年(1)

2011年(50)

2010年(34)

2009年(4)

2008年(17)

2007年(55)

2006年(99)

分类:

2006-04-16 21:18:40

1.准备:
下载2.6内核linux-2.6.2-rc2.tar.gz

不需要下载
这个补丁是给以前的内核版本升级到2.6.2-rc2用的

2.本人系统为redhat8.0
解压到目录/usr/src
#cp linux-2.6.2-rc2.tar.gz /usr/src
#cd /usr/src
#tar -zxvf linux-2.6.2-rc2.tar.gz

建立链接文件
#cd /usr/src
#ln –s linux-2.6.2-rc2 linux-2.6
#ln –s linux-2.6 linux

检查原代码
#cd /usr/src/linux
#make mrproper
这步是为确保原代码目录下没有不正确的.o文件及文件的相互依赖。

配置核心选项
#make menuconfig
基本上保持默认选项就可以了,但是要注意的是必须把ext2和ext3文件系统支持编进内核,否则升级内核重新启动是会有错误:
Kernel panic: No init found. Try passing init= option to kernel
ext2和ext3文件系统配置为:
File systems -
<*>; Second extended fs support
  • Ext2 extended attributes
  • Ext2 POSIX Access Control Lists
  • Ext2 Security Labels
    <*>; Ext3 journalling file system support
  • Ext3 extended attributes
  • Ext3 POSIX Access Control Lists
  • Ext3 Security Labels
  • JBB (ext3) debugging support

    编译内核

    确保所有文件都处于最新的版本状态下
    #make clean

    编译模块
    #make modules

    安装模块
    #make modules_install
    此时在/lib/modules下出现新内核模块文件夹2.6.2-rc2

    使用新内核
    #cp System.map /boot/System.map-2.6.2-rc2
    #rm /boot/System.map
    #ln –s /boot/System.map-2.6.2-rc2 /boot/System.map
    #cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.2-rc2
    #rm /boot/vmlinuz
    #ln –s /boot/vmlinuz-2.6.2-rc2 /boot/vmlinuz
    #new-kernel-pkg –install –mkinitrd –depmod 2.6.2-rc2
    执行完new-kernel-pkg命令后在/boot下生成新印象文件initrd-2.6.2-rc2,同时/etc/grub.conf中增加了新核心的启动项,
    例如:
    Tilte linux (2.6.20-rc2)
    Root(hd0,0)
    Kernel /boot/vmlinuz-2.6.2-rc2 ro root=LABEL=/
    Initrd /boot/initrd-2.6.2-rc2
    将kernel项中的root=LABEL=/ 改成 root=/dev/hda7 (/dev/hda7是本人linux的根分区),否则重启动后会有错误:
    Kernel panic: No init found. Try passing init= option to kernel

    #reboot
    重启后Grub中出现2.6内核的启动项,现在就用新的核心试试吧。
  • 阅读(793) | 评论(0) | 转发(0) |
    给主人留下些什么吧!~~