在Debian中启用Bootsplash

此页由Linux Wiki用户Chenxing于2012年12月18日 (星期二) 08:02的最后更改。 在Ehzhou小猪和Linux Wiki用户Yhlfh的工作基础上。

出自Linux Wiki

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

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)

参考资料

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

反馈与讨论

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