手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

Ubuntu内核的重新编译安装

[日期:2009-12-26] 来源:blog.sina.com.cn/csanycall  作者:csanycall [字体: ]
下面是关键的一步,就是将我们新编译的内核加到启动项,Ubuntu9.10没有采用menu.lst,而是grub2,修改grub.cfg就可以了。
root@hker-laptop:/lib/modules/#chmod +w /boot/grub/grub.cfg
root@hker-laptop:/lib/modules/#gedit /boot/grub/grub.cfg

### BEGIN /etc/grub.d/10_linux ###

### END /etc/grub.d/10_linux ###
之间加入,我们的内核部分。具体如下:
### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-14-generic" {
        recordfail=1
        if [ -n ${have_grubenv} ]; then save_env recordfail; fi
 set quiet=1
 insmod ext2
 set root=(hd0,1)
 search --no-floppy --fs-uuid --set 81cd49dd-4c54-4f9c-b915-ed559a3e5c85
 linux /boot/vmlinuz-2.6.31-14-generic root=UUID=81cd49dd-4c54-4f9c-b915-ed559a3e5c85 ro   quiet splash
 initrd /boot/initrd.img-2.6.31-14-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode)" {
        recordfail=1
        if [ -n ${have_grubenv} ]; then save_env recordfail; fi
 insmod ext2
 set root=(hd0,1)
 search --no-floppy --fs-uuid --set 81cd49dd-4c54-4f9c-b915-ed559a3e5c85
 linux /boot/vmlinuz-2.6.31-14-generic root=UUID=81cd49dd-4c54-4f9c-b915-ed559a3e5c85 ro single
 initrd /boot/initrd.img-2.6.31-14-generic
}
menuentry "Ubuntu, Linux 2.6.31.8" {
        recordfail=1
        if [ -n ${have_grubenv} ]; then save_env recordfail; fi
 set quiet=1
 insmod ext2
 set root=(hd0,1)
 search --no-floppy --fs-uuid --set 81cd49dd-4c54-4f9c-b915-ed559a3e5c85
 linux /boot/vmlinuz-2.6.31.8 root=UUID=81cd49dd-4c54-4f9c-b915-ed559a3e5c85 ro   quiet splash
 initrd /boot/initrd.img-2.6.31.8
}
menuentry "Ubuntu, Linux 2.6.31.8(recovery mode)" {
        recordfail=1
        if [ -n ${have_grubenv} ]; then save_env recordfail; fi
 insmod ext2
 set root=(hd0,1)
 search --no-floppy --fs-uuid --set 81cd49dd-4c54-4f9c-b915-ed559a3e5c85
 linux /boot/vmlinuz-2.6.31.8 root=UUID=81cd49dd-4c54-4f9c-b915-ed559a3e5c85 ro single
 initrd /boot/initrd.img-2.6.31.8
}
### END /etc/grub.d/10_linux ###

最后一步,也是关键的一步,就是修改default变量:
set default="3"
这里是3,因为总共4个选项,以0开始。
到这里也就安装完毕了!重启看看是不是变成2.6.31.8了 :)

注意:root=UUID=81cd49dd-4c54-4f9c-b915-ed559a3e5c85 要拷贝你原来的版本的值!

linux
相关资讯       Ubuntu知识 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

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