Search by Tags

Splash Screen on the Linux Kernel

 

Article updated at 24 Mar 2021
Compare with Revision




Introduction

The kernel splash screen is a picture loaded by the Linux kernel during the early boot process. By default, Toradex images display our logo.

TorizonCore

The customization of the kernel splash screen on Torizon is currently not covered as a use case. Although the instructions provided in this article might work, Toradex does not encourage you to re-build the components of TorizonCore from source. We do support custom splash screen on TorizonCore as early as the initramfs is loaded, see the article Splash Screen Customization on TorizonCore for more details.

Yocto Project Reference Images

This article has been written with the customization of the Toradex Yocto Project Reference Images in mind.

Installing the Tools

To create and convert a picture, download the packages:

  • Gimp

Install Gimp on Fedora:

sudo yum install gimp

Install Gimp on Ubuntu:

sudo apt-get install gimp
  • 2-D Drawing Tools (netpbm)

Install tgif and fonts on Fedora:

sudo yum install tgif xorg-x11-fonts-ISO8859-1-75dpi xorg-x11-fonts-ISO8859-1-100dpi

Install tgif and fonts on Ubuntu:

sudo apt-get install tgif xfonts-100dpi xfonts-75dpi

Creating a Picture

Create a new image with Gimp fitting the size of your display. Attention: The image must be 29 pixels smaller than the resolution of the display to be displayed at boot time.

In my case I will create an image for the capacitive 10 inch display with a resolution of 1024x600. Please check the Display Output, Resolution and Timings (Linux) article for more information about resolutions.

Open the gimp application and create a new picture:

File -> New...

Configure the desired Width x Height and click OK.


  • new_image

    new_image

Draw whatever is desired on the newly created canvas.


  • gimp

    gimp

After the picture is finished, export it in raw format:

File -> Export As.. Change the name to ppm format like "toradexlogo_1024x600.ppm". Choose RAW format and click Export.


  • export

    export

The file really needs to be in ppm format even though above dialog may actually be named PNM!

Converting the Picture to ASCII Format

Now using the terminal, find the exported picture and convert to ASCII using the commands below:

$ find . -name "*toradexlogo*.ppm"
./toradexlogo_1024x600.ppm

$ ppmquant 224 toradexlogo_1024x600.ppm > toradexlogo_1024x600_224.ppm
pnmcolormap: making histogram...
pnmcolormap: Scanning image 0
pnmcolormap: 271527 colors so far
pnmcolormap: 271527 colors found
pnmcolormap: choosing 224 colors...
pnmremap: 224 colors found in colormap

$ pnmnoraw toradexlogo_1024x600_224.ppm > toradexlogo_1024x600_ascii_224.ppm

Adding our Picture to the Kernel Sources and Compiling a Custom Kernel

To get the source code, toolchain and the instructions how to build a custom kernel, follow the Build U-Boot and Linux Kernel from Source Code article.

Basically you have to download the toolchain and the correct Linux kernel from the Toradex git server.

Rename the ASCII file to "logo_custom_clut224.ppm" and copy to the folder "drivers/video/logo" located in the kernel directory.

cp toradexlogo_1024x600_ascii_224.ppm logo_custom_clut224.ppm
mv logo_custom_clut224.ppm ~/linux-toradex/drivers/video/logo/

Select the custom logo using make menuconfig :

make menuconfig

In menuconfig, go to: Device Drivers -> Graphics support -> Bootup logo -> Select just "Custom 224-color Linux logo".


Compile the kernel image and deploy the kernel according to the Build U-Boot and Linux Kernel from Source Code.

Disabling the Framebuffer Console

Enter the U-Boot console by pressing any key while powering the board.

Set the correct resolution configuration as explained in the Framebuffer (Linux) article and disable the framebuffer console, see below an example:

setenv vidargs video=tegrafb0:1024x600-16@60

Remove the framebuffer console tty1 from the boot arguments and disable the blinking cursor by adding vt.global_cursor_default=0:

Colibri T20 # printenv setup
setup=setenv setupargs asix_mac=${ethaddr} no_console_suspend=1 console=tty1 console=ttyS0,${baudrate}n8 debug_uartport=lsport,0 ${memargs}
Colibri T20 # setenv setup 'setenv setupargs asix_mac=${ethaddr} no_console_suspend=1 vt.global_cursor_default=0 console=ttyS0,${baudrate}n8 debug_uartport=lsport,0 ${memargs}'
Colibri T20 # saveenv
Saving Environment to NAND...
Erasing Nand...
Erasing at 0x9c0000 -- 100% complete.
Writing to Nand... done
Colibri T20 #

Note: Make sure consoleblank is kept at its default of 0 aka zero as otherwise it will blank the framebuffer after the configured amount of seconds.

Reboot, wait and see.

Disabling Logging between Splash Screen and X

Between splash screen and X, the login prompt can appear and you can see something like this on your display:

.---O---.                                           
|       |                  .-.           o o        
|   |   |-----.-----.-----.| |   .----..-----.-----.
|       |     | __  |  ---'| '--.|  .-'|     |     |
|   |   |  |  |     |---  ||  --'|  |  |  '  | | | |
'---'---'--'--'--.  |-----''----''--'  '-----'-'-'-'
                -'  |
                '---'

The Angstrom Distribution colibri-t20 ttyS0

Angstrom v2013.12 - Kernel 3.1.10

colibri-t20 login:

To disable the login prompt on tty1 execute this command:

systemctl disable getty@tty1.service

Final Example

This is how the splash screen looks at the end:


  • spashscreen

    splashscreen

And the subsequent regular desktop:


  • desktop-spash

    desktopslash