Customized boot screen based on Bootsplash embedded Linux

Source: Internet
Author: User
Article title: customized boot screen based on Bootsplash embedded Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

In the development of a linux-based embedded simulation platform, the appearance and customization of terminals are an important issue. The string and monotonous penguin icons that scroll on the screen at startup make embedded devices unable to break away from the traces of pc. the monotonous "white paper and black text" style on the linux console can be described as a great deal. Transforming the linux console to display boot information and logos in a beautiful and customizable manner has become an important task of embedded linux applications.

The open source project bootsplash (http://www.bootsplash.org/) provides a perfect solution to this problem. Boot-
Splash patches the kernel to change the linux framebuffer console's support for graphic display. You can use a user space program to customize the startup logo, set the console background, and display the hidden characters during startup, or even support animated display of the boot screen. This article describes how to use splashboot to create a boot screen, including kernel patches and user space settings.

  1. kernel patch and control tools

1.1 kernel patches supporting bootsplash

For different kernel versions, corresponding kernel patches are provided on the bootsplash site. The kernel version we use is 2.4.23. download and patch the kernel:

Cd/usr/src/linux
Make mrproper
Patch-Np1-I ../bootsplash-3.0.7-2.4.23.diff
Re-compile the kernel:
Make menuconfig
The following parameters are selected:
Code maturity level options --->
Prompt for development and/or incomplete code/drivers
Block devices ---> RAM disk support
Block devices ---> Initial RAM disk (initrd) support
Console drivers ---> Video mode selection support
Console drivers ---> Frame-buffer support --->
Support for frame buffer devices
Vesa vga graphics console
Use splash screen instead of boot logo
Then compile the kernel:
Make dep & make bzImage
Then copy the generated kernel to/boot:
Cp arch/i386/boot/bzImage/boot/linux-bootsplash
In this way, the new kernel bzImage is the kernel supporting bootsplash, and the rest is the customization of bootsplash.

1.2 install the user space program

Download the bootsplash tool, decompress it, and install it:
Tar? Bootsplash-3.0.7.tar.gz zxf
Cd bootsplash-3.0.7/Utilities
Make
Cp fbresolution fbmngplay fbtruetype splash/sbin/

In this way, the installation of the user space tool is completed. In fact, bootsplash uses the following four programs: the splash program creates the image resources that need to be displayed under framebuffer into a tool for starting the ramdisk; fbmngplay reads mng files and plays animations; fbtruetype displays truetype fonts; fbresolution checks resolution. The script mentioned later only reads the configuration file using different parameters and calls the above programs.

  2 boot LOGO customization

2.1 set the theme of the splash screen

The preceding splash User space program has a program splash, which requires a configuration file to specify which image to use and whether to hide the output of text information. We can see that "theme" is a collection of configuration files, images, and other required files required by the splash tool. There are many theme options available, and we can also customize theme. For convenience, we download theme-linux.tar.bz2 and use it as theme.

Create the/etc/bootsplash/themes directory and decompress Theme-Linux.tar.bz2 to the directory. the current directory structure should be:
/Etc/bootsplash/themes/Linux

Readers can look at the bootsplash-1024x768.cfg under the Directory to observe the configuration file format. This simple file contains few options. In fact, it only clearly shows the image to be displayed, the color and background color of the text displayed on the console, and the location of the text information output. In addition, do not forget that it can also specify the location of the file to be displayed in verbose and silent modes. In Silent mode, do not display the startup information. replace it with an optional progress bar (this requires more settings about A Outsourcing script ). Based on this configuration file, you can modify it to display your favorite images and use your favorite mode.

2.2 Use the splash tool to install the splash theme to initrd

In the early stages of system startup, the kernel cannot read or write the hard disk. To display images at this stage, where should the images be placed? The answer is to write the image into ramdisk so that it can be read at startup, because partition has not been loaded yet. Of course, you don't have to worry about making initrd. the splash tool can be easily done. The Splash tool automatically generates an initrd based on the selected configuration file (theme. All you need to do is execute the following command:

Splash-s-f/etc/bootsplash/themes/arch/config/arch-1024-boot.cfg/boot/initrd. splash
The generated initrd. splash is a new initrd. Add it to GRUB or LILO.
Modify GRUB or LILO as follows:
Add or modify the following lines in GRUB:
Kernel (hd0, 3)/boot/vmlinuz −2.4.21 −melenas root =/dev/hda4 vga = 791 splash = silent
Initrd (hd0, 3)/boot/initrd. splash
Add or modify the following lines in LILO:
Vga = 1, 791
Initrd =/boot/initrd. splash
Append = "splash = silent"
Let's take a look at the meanings of these rows:
Vga = 791: boot splash is displayed in 1024x768 resolution and 65000 (16-bit color. The Framebuffer settings should be based on the resolution and color depth of the theme we use.
Splash = silent: boot splash is displayed in silent mode. if you want to use vebose mode, you only need to delete this line. Verbose mode is the default mode.
Initrd =/boot/initrd. splash ).
After you update LILO or GRUB, you can see the beautiful startup screen.

[1] [2] [3] Next page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.