闲来无聊,就去kde-look上逛逛看看有没有什么好的桌面资源,发现有一个分类是bootsplash,这才想起来一直没配置过bootsplash,所以花了点时间研究了下
bootsplash是形容计算机(操作系统)在启动过程中的图形界面的过程的专业术语,有关bootsplash的详细说明请看这里
在gentoo下,如果你想定制bootsplash,首先需要在内核编译的过程中,选择支持framebuffer,确认内核支持framebuffer后,在系统中安装splashutils:
下载完成后,去寻找一些你喜欢的bootsplash主题,下载主题包,比如我使用的是一个叫natural-gentoo的主题,我们来看一看这个主题包的目录结构:
# tree natural-gentoo/
natural-gentoo/
|-- boot
| `-- grub
| `-- gentoo.xpm.gz
|-- etc
| `-- splash
| `-- natural-gentoo
| |-- 1024x600.cfg
| |-- 1024x768.cfg
| |-- 1152x864.cfg
| |-- 1280x1024.cfg
| |-- 1280x800.cfg
| |-- 1400x1050.cfg
| |-- 1440x900.cfg
| |-- 1600x1200.cfg
| |-- 1680x1050.cfg
| |-- 1920x1200.cfg
| |-- 800x600.cfg
| `-- images
| |-- silent-1024x600.jpg
| |-- silent-1024x768.jpg
| |-- silent-1152x864.jpg
| |-- silent-1280x1024.jpg
| |-- silent-1280x800.jpg
| |-- silent-1400x1050.jpg
| |-- silent-1440x900.jpg
| |-- silent-1600x1200.jpg
| |-- silent-1680x1050.jpg
| |-- silent-1920x1200.jpg
| |-- silent-800x600.jpg
| |-- verbose-1024x600.jpg
| |-- verbose-1024x768.jpg
| |-- verbose-1152x864.jpg
| |-- verbose-1280x1024.jpg
| |-- verbose-1280x800.jpg
| |-- verbose-1400x1050.jpg
| |-- verbose-1440x900.jpg
| |-- verbose-1600x1200.jpg
| |-- verbose-1680x1050.jpg
| |-- verbose-1920x1200.jpg
| `-- verbose-800x600.jpg
`-- metadata.xml
6 directories, 35 files
可以看到,在一个bootsplash主题包中,boot的grub目录下存放的是grub界面的配套主题,而bootsplash的主题样式与规则存放在/etc/splash目录下,我们在主题包的目录中将这些包复制到系统中去:
# cp -nr ./boot/ /
# cp -nr ./etc/ /
注意cp命令千万别忘了加上命令选项n,意思是仅复制新的文件,忽略已存在的相同文件
现在,我们要生成一个initramfs的splash image文件,语法如下:
splash_geninitramfs --verbose --res NxN --generate /boot/initramfs-bootsplash theme
你所需要修改的只有res命令选项后的分辨率参数以及最后的theme名,我的X61是1024×768的分辨率(分辨率支持的前提是主题包内有相应的分辨率cfg文件),使用的主题包名为natural-gentoo,所以,在/etc目录下,执行:
# splash_geninitramfs --verbose --res 1024x768 --generate /boot/initramfs-bootsplash natural-gentoo/
这时,/boot目录下就会生成一个名为initramfs-bootsplash的splash image文件
很快来到了最后一步,也就是调整你的grub配置,这里直接帖出我的menu.lst,供大家参考:
# This is a sample grub.conf for use with Genkernel, per the Gentoo handbook
# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=10#doc_chap2
# If you are not using Genkernel and you need help creating this file, you
# should consult the handbook. Alternatively, consult the grub.conf.sample that
# is included with the Grub documentation.
default 0
timeout 3
#grub界面使用主题包里的图片
splashimage=(hd0,0)/boot/grub/gentoo.xpm.gz
title Gentoo Linux 2.6.32-r2
root (hd0,0)
#注意新加的内核load参数: splash=silent(或者verbose),theme:主题名 console=tty1
kernel /boot/ghosTkernel root=/dev/sda1 video=792 splash=silent,theme:natural-gentoo console=tty1
initrd /boot/initramfs-bootsplash
# vim:ft=conf:
来看看我的bootsplash效果吧 :)

参考资料:
1. http://en.gentoo-wiki.com/wiki/Fbsplash
2. http://en.wikipedia.org/wiki/Bootsplash