在Debian中啟用Bootsplash

此頁由 Linux Wiki用戶Chenxing 於 2012年12月18日 (星期二) 08:02 的最後更改。 在Ehzhou小猪和Linux Wiki用戶Yhlfh的工作基礎上。

出自Linux Wiki

提示:此文已超过 11 年(4147 天)未更新,如发现内容过时或有误,欢迎改进:)

Debian的啟動界面和終端實在有些難看,本文介紹使用bootsplash美化啟動界面。

由於bootsplash需要給內核打補丁,並重新編譯內核,所以可能消耗不少時間,不過需要人工操作的東西不多,也不需要了解關於編譯內核的知識。相反,如果你以前沒有編譯過內核,通過設置bootsplash,你會對編譯內核的操作過程有所了解。

啟動後終端截圖

目錄

準備內核補丁

儘管Debian提供了內核補丁,但版本似乎和當前內核版本不匹配。所以推薦從官方網站下載與內核版本相應的補丁。

先獲取當前內核版本。在終端下執行:

uname -r

得到的結果即內核的版本,如: 2.6.21-686 ,這裡2.6.21就是版本號。

接着到 ftp://ftp.bootsplash.org/pub/bootsplash/kernel/ 下載相應版本的內核補丁。並存在 /usr/src/。本文假設下載到的文件是:bootsplash-3.1.6-2.6.21.diff.gz。

Hint.gif
提示:
由於bootsplash.org上說bootsplash已經被splashy取代,所以它不再發布新的內核補丁了,但splashy的效果明顯欠佳……如果你仍想下載 2.6.22 、 2.6.23 版本內核的bootsplash補丁,請到:http://fatcat.ftj.agh.edu.pl/~przyboro/other/bootsplash/http://people.open-minds.org/laurent/linux-bootsplash/此站的說明(法文)

如果下載到的是壓縮過的(文件名以.gz結尾),先解壓:

gunzip bootsplash-3.1.6-2.6.21.diff.gz

編譯內核

本節將指導您以Debian的方式,用簡單的方法編譯內核。如果要了解Debian編譯內核的更多說明,請參考在Debian中編譯內核。 先安裝內核源碼和必要的軟件:

apt-get install debhelper modutils kernel-package libncurses5-dev
apt-get install linux-source-2.6.21  # 请修改为您的内核版本
apt-get install fakeroot

解壓源碼並應用補丁:以下均假設內核版本為2.6.21,如不是請注意修改。

cd /usr/src # 创建目录
tar -xjvf linux-source-2.6.21.tar.bz2
cd linux-source-2.6.21
patch -p1 < ../bootsplash-3.1.6-2.6.21.diff

複製當前內核的配置文件,並進行必要的配置:

cp /boot/config-2.6.12-1-686 .config
make menuconfig

如果你只想在默認配置上做少數的改動,通過只需要把Device Drivers->Graphics support->Bootsplash configuration->Bootup splash screen選中即可。如果您要自己配置內核,注意以下選項:

Code maturity level options --->
   [*] Prompt for development and/or incomplete code/drivers
Processor type and features --->
   [*] MTRR (Memory Type Range Register) support
Device Drivers --->
   Block devices --->
       <*> Loopback device support
       <*> RAM disk support
       (8192) Default RAM disk size
   Graphics support --->
       [*] Support for frame buffer devices
       [*] VESA VGA graphics support
       Console display driver support --->
           --- Video mode selection support
           <*> Framebuffer Console support
       Logo configuration --->
           [ ] Bootup logo(注意,这项是不要选)
       Bootsplash configuration --->
           [*] Bootup splash screen

使用Debian的方式編譯內核,可能需要近一個小時的時間,你可以干點別的:

make-kpkg clean # 必须执行这步
fakeroot make-kpkg --initrd --revision=myKernel --stem \
  linux kernel_image modules_image kernel_headers 

上面的命令最後的kernel_headers不要略去,特別是用ati顯卡的朋友,不然可能在安裝顯卡驅動的時候會遇上大麻煩的

安裝內核

cd /usr/src
dpkg -i *.deb

安裝軟件

直接:

apt-get install bootsplash bootsplash-theme-debian

Debian Sid版本有sysv-rc-bootsplash,用來控制進度條的:

 sysv-rc-bootsplash

Debian Testing和Stable在我寫這個How-to時還沒有sysv-rc-bootsplash,可以到bootsplash.org去下載:

ftp://ftp.bootsplash.org/pub/bootsplash/init-scripts/rc-debian-etch.txt

用它覆蓋 /etc/init.d/rc即可,為安全考慮,請先備份。

配置Grub、享受BootSplash

/boot/grub/menu.lst中找到與下面類似的部分,並將/boot/vmlinuz-2.6.21-686和/boot/initrd.img-2.6.21-686更換成新內核的名字(可以ls -l看一下日期,哪個是新的)。並添加參數vga=791(表示1024x768的分辨率),splash=silent(表示不顯示詳細信息,也可以取0,即不顯示splash,或取值verbose,即顯示詳細的信息)。

title           Debian GNU/Linux, kernel 2.6.21-686
root            (hd0,8)
kernel          /boot/vmlinuz-2.6.21-686 root=/dev/hda9 ro vga=791 splash=silent
initrd          /boot/initrd.img-2.6.21-686

重新啟動,並在Grub中選則新加的這一項,應該就可以看到BootSplash了(如果看不到,後面的幾個終端美化也應已成功,而BootSplash在按照下面更換Splash的辦法操作之後,仍可以被啟用)。

更換Splash

由於Debian的內核建立時使用了壓縮,和其它的不太一樣,導致更換BootSplash稍有麻煩。 具體更換步驟,請參考更換Debian的Bootsplash


--Chenxing 23:35 2007年7月9日 (CST)

參考資料

本文对您有帮助?分享给更多朋友!

反馈与讨论

发现文档不全面、有错误却没时间编辑文档?想分享自己的经验或见解?欢迎在此留言、讨论。
简体繁体转换