自定义Ubuntu的bootsplash

本文介绍如何自定义Ubuntu启动时的Usplash画面,包括背景图片、进度条颜色等元素的个性化设置方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Want to change what you see while Ubuntu boots up? Learn how to put your own image on that splash screen.

When Ubuntu starts up, it displays a progress bar, the Ubuntu logo, and scrolling messages showing what service is being started. Usplash, the userspace bootsplash system, allows you to customize the background, text, and progress bar of the splash screen.

To customize your splash screen, install GCC and the BOGL framebuffer library development package:

$ sudo apt-get install gcc libbogl-dev

Then create a PNG file to use as the splash-screen background. This is trickier than it sounds because there are some very severe restrictions on the format of the image: it must be 640x480 pixels in size and only 16 colors, so forget about using a nice photograph! Some of the colors are used for special purposes, such as to draw the text messages that appear onscreen as services are started, so the usable palette is even more restricted.

The special palette entries are shown in Table 5-1.

Table Special palette entries
Index Use
0 Main and text backgrounds
1 Progress bar color
2 "OK" text color
4 Progress bar background color
8 Description text color
13 "Failed" text color


Make a directory to work in, copy your PNG in, and rename it to something like usplash-mine.png:

$ mkdir usplash
$ cp myimage.png usplash/usplash-mine.png

Enter the working directory and convert the PNG to a hexadecimal source file, then "compile" it into a shared object file:

$ pngtobogl usplash-mine.png > usplash-mine.c
$ gcc -Os -g -I/usr/include/bogl -fPIC -c usplash-mine.c -o usplash-mine.o
$ gcc -shared -Wl,-soname,usplash-mine.so usplash-mine.o -o usplash-mine.so

In this case, the resulting object file is called usplash-mine.so, but you can give it a different name, as long as you don't call it usplash-artwork.so. That name is used by the system to find the current bootsplash artwork, so the safest thing to do is give all the object files unique names and reference the current file with a symlink:

$ sudo cp usplash-mine.so /usr/lib/usplash/usplash-mine.so
$ sudo ln -sf /usr/lib/usplash/usplash-mine.so //
/usr/lib/usplash/usplash-artwork.so

To give the kernel access to the splash image early in the boot process, it needs to be stored in the initramfs (initial RAM filesystem). The initramfs is built when the kernel package is installed, so force the currently installed kernel package to be reconfigured:

$ sudo dpkg-reconfigure linux-image-/Quname -r/Q 

Once they have been created and installed in /usr/lib/usplash, you can switch between various splash screens, including the original Ubuntu splash, simply by updating the symlink and regenerating the initramfs. For example, to return to the original splash screen:

$ sudo ln -sf /usr/lib/usplash/usplash-default.so //
/usr/lib/usplash/usplash-artwork.so
$ sudo dpkg-reconfigure linux-image-/Quname -r/Q



Change Ubuntu Bootsplash Theme

- Usplash customization guide

By: Marius Nestor, Linux Editor

<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript" style="display: none;"> </script>
Actually, this guide is for all flavors of Ubuntu including Kubuntu, Xubuntu or Edubuntu and it will help you to easily change the boot splash of your operating system. I think you should know that this boot splash you see every time you start your Ubuntu OS is named Usplash and is a userspace bootsplash system. Usplash allows you to customize the progress bar, text, logo and the background of your boot splash.


Requirements:

You will need to install some development packages first, so open Synaptic and search for:

gcc
libbogl-dev
usplash-dev


and install them. Or, if you prefer the "geek" method, please open a console and type:

CODE

sudo apt-get install gcc libbogl-dev usplash-dev


You will also need the following tools:

SUM - Start-up Manager
Usplash Switch (optional)

Get the deb packages and install them by simply right-clicking on each one, and then go to Kubuntu Package Menu -> Install Package (if you have Kubuntu). In Ubuntu, open a terminal and type:

CODE

sudo dpkg -i startupmanager_1.0.4-1_all.deb usplash-switcher_0.0.0svn20070519-1~getdeb1_i386.deb


Create the background:

This is actually the hard part of the whole process, because you must create a nice PNG image with maximum 256 colors. The resolution should be no higher than 800x600. Also, because some of the colors are used for special purposes, like drawing the text messages of the services that are started during the boot process, the color palette is restricted. The special palette entries are shown below:

Index
Usage
0
Background color
0
Text background color
1
Progress bar color
2
Text foreground color (right)
4
Progress bar background color
8
Text foreground color (left)
13
Failure text color

For the creation of this PNG image, I suggest to use the latest development version of GIMP, as it will allow you to rearrange the palette with a nice included plugin, called 'Rearrange Colormap' (Colors -> Map -> Rearrange Colormap). Remember that you must use a different file format than PNG after you've used the 'Rearrange Colormap' plugin and then convert it back to PNG with another software, because the PNG plugin may rearrange the colormap.

Compile and install the new boot splash

Once you are done with the artwork, you must create a file with the .so extension. In order to achieve this you must open a console and type the following commands, but first create a folder called usplash, put the image you've just created and rename it to usplash-artwork.png.

CODE

pngtobogl usplash-artwork.png > usplash-artwork.c
gcc -Os -g -I/usr/include/bogl -fPIC -c usplash-artwork.c -o usplash-artwork.ogcc -shared -Wl,-soname,usplash-artwork.so usplash-artwork.o -o yourimage-splash.so


Open the StartUp-Manager application (in Kubuntu you'll find it in KMenu -> System and in Ubuntu you can find in Applications -> System Tools), switch to second tab (Appearance) and hit the 'Manage usplash themes...' button, then click on Add and search for the folder where you've created the .so file. Open the .so file, click 'Close' and then select your own usplash theme from the drop-down menu above the 'Manage usplash themes...' button. Close the StartUp-Manager and wait a few seconds before the window disappears.
Review imageReview image

Optional, whenever you want to switch to another usplash theme, you can open the Usplash Switcher application, which will show you a preview of the installed usplash themes; just click on the desired one and then on the 'Switch' button.

Review image
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值