在 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開始計數)
最後就去欣賞你的成果吧