怎样调整GRUB2设置

启动讨论 grub/grub2/syslinux/grub4dos/Lilo
回复
头像
Sunmover
帖子: 2339
注册时间: 2010-05-24 13:02
来自: 星城长沙

怎样调整GRUB2设置

#1

帖子 Sunmover » 2010-10-20 18:06

昨天根据网上的帖子修改了下GRUB2的设置,加了张图片,然后结果就如附图了.
下面有几个问题希望大家帮忙解决下,在下谢过了! :em56 :em54

Q1. 下面的grub.cfg中加了颜色的部分是配置什么内容的? (
Q2. 要修改1的字体大小(调大些),要在哪调?怎么调? (不能影响背景图片的显示)
Q3. 怎样更改2,3的颜色为绿色? (/能不能让2,3透明?)
Q4. 怎样设置1高亮色为浅灰?
Q5. 要删除第二个菜单项,需删除grub.cfg中的哪些内容?

my_grub_menu.jpg
grub.cfg 写了: #
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
set saved_entry=${prev_saved_entry}
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z ${boot_once} ]; then
saved_entry=${chosen}
save_env saved_entry
fi
}

function recordfail {
set recordfail=1
if [ -n ${have_grubenv} ]; then if [ -z ${boot_once} ]; then save_env recordfail; fi; fi
}
insmod ext2
set root='(hd0,12)'
search --no-floppy --fs-uuid --set ca34b426-7f13-41a6-afb1-9118d6d6cc6e
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=1024x768
insmod gfxterm
insmod vbe
insmod png
insmod jpeg
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
insmod ext2
set root='(hd0,11)'
search --no-floppy --fs-uuid --set a2100f82-ae5b-4e61-ad01-7a8621f71ca7
set locale_dir=($root)/grub/locale
set lang=zh
insmod gettext
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=3
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
insmod ext2
set root='(hd0,12)'
search --no-floppy --fs-uuid --set ca34b426-7f13-41a6-afb1-9118d6d6cc6e
insmod jpeg
if background_image /usr/share/images/desktop-base/1.png ; then
set color_normal=magenta/black
set color_highlight=magenta/black

else
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue

fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'linux Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,11)'
search --no-floppy --fs-uuid --set a2100f82-ae5b-4e61-ad01-7a8621f71ca7
linux /vmlinuz-2.6.32-25-generic root=UUID=ca34b426-7f13-41a6-afb1-9118d6d6cc6e ro quiet vga=791 splash
initrd /initrd.img-2.6.32-25-generic
}
menuentry 'Ubuntu Recovery Mode' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,11)'
search --no-floppy --fs-uuid --set a2100f82-ae5b-4e61-ad01-7a8621f71ca7
echo '载入 Linux ...'
linux /vmlinuz-2.6.32-25-generic root=UUID=ca34b426-7f13-41a6-afb1-9118d6d6cc6e ro single vga=773
echo '载入引导虚拟磁盘 ...'
initrd /initrd.img-2.6.32-25-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows 7 " {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 9486446686444ac6
chainloader +1
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# 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.
### END /etc/grub.d/40_custom ###
头像
leeaman
帖子: 30702
注册时间: 2007-02-02 18:14
系统: debian sid

Re: 怎样调整GRUB2设置

#2

帖子 leeaman » 2010-10-20 18:25

这个版块的smallaplle置顶有教程的
醉了星星,醉月亮●●●●●The Long Way To Go(*^_^*)
头像
Sunmover
帖子: 2339
注册时间: 2010-05-24 13:02
来自: 星城长沙

Re: 怎样调整GRUB2设置

#3

帖子 Sunmover » 2010-10-20 21:11

自己探索了一下,修改了部分内容,但仍有问题没有解决.
修改:
set color_normal=magenta/black
set color_highlight=magenta/black
为:
set color_normal=white/black
set color_highlight=light-blue/black

另外尝试在menuentry的首字母前加空格,使menuentry的位置推到屏幕中央.
我修改后的效果如下图:
pic1.JPG
遗憾的是:
1.字体大小未能调整(本想把menuentry的字体调大两号).
2.grub2的标题和方框没有去除.
3.menuentry没有被调到屏幕的最中间.

总的来说,与下面两张图的差距还很大.
图片 图片
头像
leeaman
帖子: 30702
注册时间: 2007-02-02 18:14
系统: debian sid

Re: 怎样调整GRUB2设置

#4

帖子 leeaman » 2010-10-20 21:18

你看那个教程有改字体大小的,不过我没有成功 :em06
醉了星星,醉月亮●●●●●The Long Way To Go(*^_^*)
jiyuyan
帖子: 257
注册时间: 2007-08-26 18:51

Re: 怎样调整GRUB2设置

#5

帖子 jiyuyan » 2010-10-22 8:46

Sunmover 写了:自己探索了一下,修改了部分内容,但仍有问题没有解决.
修改:
set color_normal=magenta/black
set color_highlight=magenta/black
为:
set color_normal=white/black
set color_highlight=light-blue/black

另外尝试在menuentry的首字母前加空格,使menuentry的位置推到屏幕中央.
我修改后的效果如下图:
pic1.JPG
遗憾的是:
1.字体大小未能调整(本想把menuentry的字体调大两号).
2.grub2的标题和方框没有去除.
3.menuentry没有被调到屏幕的最中间.

总的来说,与下面两张图的差距还很大.
图片 图片
人家用了burg,当然和你不一样了!
传送门http://forum.ubuntu.org.cn/viewtopic.php?f=139&t=240837
头像
Sunmover
帖子: 2339
注册时间: 2010-05-24 13:02
来自: 星城长沙

Re: 怎样调整GRUB2设置

#6

帖子 Sunmover » 2010-10-22 11:16

jiyuyan 写了: 人家用了burg,当然和你不一样了!
传送门http://forum.ubuntu.org.cn/viewtopic.php?f=139&t=240837
原来如此,谢谢!
回复