- 论坛徽章:
- 0
|
刚刚新装了ubuntu9.10,发现里面到grub跟以前到不一样了,没有menu.lst菜单了,搜索了一下,才知道换成新的grub2了,这里是这个grub2详细到介绍和用法:
https://help.ubuntu.com/community/Grub2
总结一下,大概就是说到这些东西。
1. 好处。 能够支持模块动态加载,能够支持启动时候有背景图,字体设置等等,变漂亮了,能支持启动硬盘上到Linux LiveCD ISO文件了(好像grub1也是可以到哦),支持非X86平台了等等。
2. 改动还是很大到,grub2 新到文件组织方式是这样的。
/boot/grub/grub.cfg 这个是用脚本生成的文件,最好不要手工去更改它。
/etc/default/grub 文本文件,可以更改,比如设置启动超时等,在这里改。
/etc/grub.d/ 下面有一堆文件,都是可执行的脚本。使用 update-grub时候,就是根据这堆文件生成grub.cfg.
重要的,里面有一个40_custom,一般我们要添加新的启动菜单时,都是改动这个文件。
比如,要加入新到内核启动菜单,修改如下:
@ubuntu:/etc/grub.d$ cat 40_custom
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry "Ubuntu,New Linux kernel 2.6.32" {
set root=(hd0,3)
search --no-floppy --fs-uuid --set 8896fc88-0d14-49a6-8221-c728feb37b64
linux /boot/vmlinuz-2.6.32.2 root=UUID=8896fc88-0d14-49a6-8221-c728feb37b64 ro quiet splash
initrd /boot/initrd.img-2.6.32.2
}
3. 更改背景图片。 背景图片格式需要是png或者tga的。
打开/etc/grub.d/05_debian_theme这个文件,看这一行
for i in {/boot/grub,/usr/share/images/desktop-base}/moreblue-orbit-grub.{png,tga} ; do
这里,就是在/boot/grub和/usr/share/images/desktop-base目录下面搜索moreblue-orbit-grub.png或者moreblue-orbit-grub.tga文件,这里我们改成我们自己设置的背景图片到名字。
for i in {/boot/grub,/usr/share/images/desk top-base}/gnome-pic.{png,tga} ; do
然后,使用sudo update-grub更新,如果看到
Found Debian background: gnome-pic.png 基本就成功了.
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/93140/showart_2139427.html |
|