Fedora 19和18一样,grub开机引导界面默认无背景图片,需要自己手动添加。 操作很简单,只需要两步:
在/etc/default/grub中加入两行:
GRUB_TERMINAL_OUTPUT=gfxterm GRUB_BACKGROUND=/home/Dotcra/Pictures/wow.jpg #"/home/Dotcra/Pictures/wow.jpg"修改为你的图片路径。
然后重新生成grub配置文件:
[[email protected] /]# grub2-mkconfig -o /boot/grub2/grub.cfg
重启即可看到效果:
这个界面已经挺漂亮了,但我们还可以通过grub2主题对其进一步美化:
安装主题starfield:
[[email protected] /]# yum install grub2-starfield-theme.x86_64
这个安装包会安装fireworks和starfield两个主题,前者在/boot/grub2/themes/system/里,后者在/usr/share/grub/themes/starfield/里,可以通过如下指令查看,结果太长,我就不贴出来了:
[[email protected] ~]$ rpm -ql grub2-starfield-theme
两个主题大同小异,这里以fireworks为例说明,其相关文件在/boot/grub2/themes/system/里:
[[email protected] /]$ cd boot/grub2/themes/system/;ls background.png boot_menu_s.png README terminal_box_nw.png blob_w.png boot_menu_sw.png slider_c.png terminal_box_se.png boot_menu_c.png boot_menu_w.png slider_n.png terminal_box_s.png boot_menu_e.png COPYING.CC-BY-SA-3.0 slider_s.png terminal_box_sw.png boot_menu_ne.png DejaVuSans-10.pf2 terminal_box_c.png terminal_box_w.png boot_menu_n.png DejaVuSans-12.pf2 terminal_box_e.png theme.txt boot_menu_nw.png DejaVuSans-Bold-14.pf2 terminal_box_ne.png unicode.pf2 boot_menu_se.png fireworks.png terminal_box_n.png #其中的theme.txt即是主题的配置文件 #fireworks.png则是默认背景图片(theme.txt中第34行定义,desktop-image: "fireworks.png") #尽管如此,fireworks.png及background.png两张图片是系统自带的,并非主题包里的 #如果你想更改背景图片,两个办法 #把自己准备的图片重命名为fireworks.png并覆盖进来 #或者把自己准备的图片cp进来,然后修改theme.txt第34行,desktop-image: "mypicture.png" #图片倒不一定要png格式(比如jpg我试过是可以的),但一定要放在与theme.txt相同文件夹下
接下来在/etc/default/grub中加入一行:
GRUB_THEME=/boot/grub2/themes/system/theme.txt #如果你要用starfield主题,就改成/usr/share/grub/themes/starfield/theme.txt #GRUB_THEME的优先级大于GRUB_BACKGROUND,所以你不用删掉"GRUB_BACKGROUND=XXX"一行
然后重新生成grub配置文件:
[[email protected] /]# grub2-mkconfig -o /boot/grub2/grub.cfg
重启即可看到效果:
很遗憾,启动项的黑色背景遮住了Emma的脸——真让人抓狂。可以解决么?
当然!只要修改下刚刚提到的theme.txt就行了。
[[email protected] ~]# vim /boot/grub2/themes/system/theme.txt
在下面这一段中找到menu_pixmap_style = "boot_menu_*.png",并将其注释掉:
#boot menu + boot_menu { left = 60% width = 40% top = 1% height = 20% item_font = "DejaVu Sans Regular 12" item_color = "#3c6eb4" selected_item_font = "DejaVu Sans Bold 14" selected_item_color= "#fff" #selected_item_pixmap_style = "blob_*.png" #icon_height = 25 icon_width = 0 item_height = 30 item_padding = 0 #item_icon_space = 0 item_spacing = 0 scrollbar = true scrollbar_width = 20 scrollbar_thumb = "slider_*.png" #启动项的黑色背景就是由下面一行形成,注释掉即可 #menu_pixmap_style = "boot_menu_*.png" } #你可以顺便修改left/width/top/height的值以调整启动项的显示位置 #本段中的就是被我修改过的
你可以顺便修改left/width/top/height的值以调整启动项的显示位置。 这回只是修改/boot/grub2/themes/system/theme.txt,只要/etc/default/grub或者/etc/grub.d/里的文件没有被改动,就不用grub2-mkconfig。 那么直接重启。
Add new comment