本文出自:鍵盤語言

 


個性化GRUB開始菜單

每個人都想把自己的電腦裝扮得有個性點,比如在操作系統中選擇主題啊什麼的.而Linux則將個性化發揮到了極至,甚至從操作系統的選擇界面開始就可以加入自己的想法.這就要依賴一個小個頭,大本事的程序: GRUB (Grand Unified Boot Loader),它負責裝入和引導內核.首先,我們得先瞭解一下計算機是如何啟動的.

1. 一旦接通計算機電源,計算機中的ROM BIOS(存放base input output system的只讀存儲器)就開始工作.首先BIOS檢查硬件,屏幕上顯示出內存容量和正在檢查的外部設備的連接情況.

2. 硬件檢查結束後,BIOS中的一條指令就會控制將硬盤(或者其它外存)最開始的只有512K的扇區(主引導扇區MBR)中的小程序讀入內存.這個小程序就負責找出操作系統的內核(kernel),把它從硬盤調出,並且執行.接下來要做的事情就由內核全權代理了.
而GRUB的駐留版本就在MBR裡,配置部分則在Linux的/boot/grub/grub.conf中.

3. 解讀GRUB配置文件
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz // 我們就是要修改這句話。
hiddenmenu
title CentOS (2.6.9-42.0.8.EL)
root (hd0,0)
kernel /vmlinuz-2.6.9-42.0.8.EL ro root=/dev/VolGroup00/LogVol00
initrd /initrd-2.6.9-42.0.8.EL.img
title CentOS_ServerCD (2.6.9-42.EL)
root (hd0,0)
kernel /vmlinuz-2.6.9-42.EL ro root=/dev/VolGroup00/LogVol00
initrd /initrd-2.6.9-42.EL.img

4. 個性GRUB界面
把圖片轉化成分辨率為640x480的xpm格式
#convert mypic.jpg -colors 14 -geometry 640x480! mypic.xpm
壓縮圖片
#gzip -9 mypic.xpm
cp到/boot/grub下 然後在/boot/grub/grub.conf中加入/修改
splashimage=(hd0,0)/grub/mypic.xpm.gz

 

arrow
arrow
    全站熱搜

    正義的胖虎 發表在 痞客邦 留言(0) 人氣()