阅读内容

Fedora平台上怎样编译构建一个自定义内核

[日期:2007-06-14] 来源:Linux公社  作者:Linux


2.7 安装新内核
    现在去新的rpm内核包存在的目录(基于你的平台类型, 比如. ~/rpmbuild/RPMS/i386/)安装rpm包:
cd ~/rpmbuild/RPMS/i386
rpm -ivh kernel-2.6.18custom2.6.18.2-1.i386.rpm

(现在你甚至能够拷贝到其它的Fedora系统, 通过上面的方式安装. 你将不再需要编译内核.)

接下来我们为新内核创建一个ramdisk, 否则系统将不能引导新内核:
mkinitrd /boot/initrd-2.6.18-custom-2.6.18.2.img 2.6.18-custom-2.6.18.2

   然后编辑/boot/grub/menu.lst文件, 看一下你系统上已经存在(正在工作的)引导内核信息, 拷贝其中的一个实例, 替换为你新的内核和ramdisk:
vi /boot/grub/menu.lst

比如, 我的menu.lst, 在我添加新的内核信息前的情况:
# 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 Fedora Core (2.6.18-1.2798.fc6)
root (hd0,0)
kernel /vmlinuz-2.6.18-1.2798.fc6 ro root=/dev/VolGroup00/LogVol00
initrd /initrd-2.6.18-1.2798.fc6.img

修改后的情况:

# 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 Fedora Core (2.6.18-custom-2.6.18.2)
root (hd0,0)
kernel /vmlinuz-2.6.18-custom-2.6.18.2 ro root=/dev/VolGroup00/LogVol00
initrd /initrd-2.6.18-custom-2.6.18.2.img

title Fedora Core (2.6.18-1.2798.fc6)
root (hd0,0)
kernel /vmlinuz-2.6.18-1.2798.fc6 ro root=/dev/VolGroup00/LogVol00
initrd /initrd-2.6.18-1.2798.fc6.img

(你可以通过下面命令发现正确的vmlinuz和initrd文件:
ls -l /boot
)

现在重启系统:
shutdown -r now

如果一切进展顺利, 你的新内核正常工作. 你还可以通过运行下面命令来检查新内核是否运行:
uname -r

这将会显示如:
2.6.18-custom-2.6.18.2

如果系统没有起来, 重启一下, 你会看到:

上一页1234567下一页  GO
【内容导航】
第1页:Fedora平台上怎样编译构建一个自定义内核 第2页:Fedora平台上怎样编译构建一个自定义内核
第3页:Fedora平台上怎样编译构建一个自定义内核 第4页:Fedora平台上怎样编译构建一个自定义内核
第5页:Fedora平台上怎样编译构建一个自定义内核 第6页:Fedora平台上怎样编译构建一个自定义内核
第7页:Fedora平台上怎样编译构建一个自定义内核



相关资讯       Fedora 
本文评论       全部评论
发表评论
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款


点评: 字数
姓名:

L
I
N
U
X


GOOGLE搜索
Google