在 grub 內要显示背景图片,有以下几个限制:
1. 图片大小限制在 640x480
2. 顏色限制在 14 色
3. 文件格式为 xpm,且需经过 gzip 压缩为 gz 的文件
4. /boot/menu.lst 中设定背景文件的路径,grub能读取的格式,例如(hd0,6)/boot/grup/bg.xpm.gz
制作过程
~$convert -colors 14 xxx.jpg bg.xpm
~$gzip bg.xpm产生 bg.xpm.gz
~$sudo cp bg.xpm.gz /boot/grub/
~$sudo vi /boot/grub/menu.lst
## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu
# Pretty colours
color cyan/blue white/blue
#splashimage info
splashimage (hd0,6)/boot/grub/bg.xpm.gz
## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
注:其中(hd0,6)是你的grub的根目录,在启动时,按c进入grub的command line
使用find /boot/grub/menu.lst
显示的内容就是你的grub的安装位置
例如我的显示(hd0,6)
那么说明我的grub安装在第一个硬盘的第七个分区上。(grub对分区从0开始计数)
最后就去欣赏你的成果吧
1. 图片大小限制在 640x480
2. 顏色限制在 14 色
3. 文件格式为 xpm,且需经过 gzip 压缩为 gz 的文件
4. /boot/menu.lst 中设定背景文件的路径,grub能读取的格式,例如(hd0,6)/boot/grup/bg.xpm.gz
制作过程
~$convert -colors 14 xxx.jpg bg.xpm
~$gzip bg.xpm产生 bg.xpm.gz
~$sudo cp bg.xpm.gz /boot/grub/
~$sudo vi /boot/grub/menu.lst
## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu
# Pretty colours
color cyan/blue white/blue
#splashimage info
splashimage (hd0,6)/boot/grub/bg.xpm.gz
## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
注:其中(hd0,6)是你的grub的根目录,在启动时,按c进入grub的command line
使用find /boot/grub/menu.lst
显示的内容就是你的grub的安装位置
例如我的显示(hd0,6)
那么说明我的grub安装在第一个硬盘的第七个分区上。(grub对分区从0开始计数)
最后就去欣赏你的成果吧