`
zhongzhihua
  • 浏览: 312417 次
  • 来自: ...
社区版块
存档分类
最新评论

安装linux

阅读更多

1.准备: 
下载2.6内核linux-2.6.2-rc2.tar.gz 
http://www.kernel.org/pub/linux/kernel/v2.6/testing/linux-2.6.2-rc2.tar.gz 
不需要下载http://www.kernel.org/pub/linux/kernel/v2.6/testing/patch-2.6.2-rc2.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内核的启动项,现在就用新的核心试试吧。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics