DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Cover image for Customize boot splash screen in Yocto
Makame Makame
Makame Makame

Posted on

Customize boot splash screen in Yocto

My first wish as beginner in Yocto, once I managed to build my first Linux image, was to to replace the Yocto logo on the boot splash screen with my own logo. From this seemingly simple task I managed to learn a lot about Bitbake.

The default Yocto splash screen is rendered with the help of a recipe called psplash. This recipe is included in the Poky source directory and located at meta/recipes-core/psplash.

The rendered Yocto logo image is located in meta/recipes-core/psplash/files/psplash-poky-img.h in as a header file.

There are several ways to change the psplash logo. The following are some of them:

1. Replace the psplash-poky-img.h with a .png file

You can achieve this by replacing the psplash-poky-img.h image header file in the files directory with a logo in png format. Then add your logo path to the SRC_URI through the SPLASH_IMAGES by changing the variable assignment:

From

SPLASH_IMAGES = "file://psplash-poky-img.h;outsuffix=default"
Enter fullscreen mode Exit fullscreen mode

to

SPLASH_IMAGES = "file://my-logo-image.png;outsuffix=default"
Enter fullscreen mode Exit fullscreen mode

assuming that your image is named my-logo-image.png in this case.

When the image is baked, the new logo will be added to the boot splash screen.

This approach is very simple, but the drawback is that the modifications are done in the Poky original source files which is not a good approach.

2. Create a recipe to extend psplash

The proper alternative is to create a new recipe that will append the same changes mentioned in the first approach above using .bbappend file.

The recipe will include a psplash_%.bbappend which in this case will contain

SPLASH_IMAGES:forcevariable = "file://my-logo-image.png;outsuffix=default"
Enter fullscreen mode Exit fullscreen mode

:forcevariable is important to prevent machine specific overrides from overriding your logo such as in case of raspberry pi layers.

Furthermore, the logo image is placed in the files directory located in the same folder as the psplash_%.bbappend file. The files directory is then included to psplash's SRC_URI paths by adding the following line in the psplash_%.bbappend file.

FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
Enter fullscreen mode Exit fullscreen mode

Do not forget to make the layer containing this recipe with higher priority (using BBFILE_PRIORITY variable) than any other layer providing or overriding the psplash recipe.

3. meta-splash

meta-splash is a layer created using the second approach.

Using meta-splash all you need to do is:

  1. Clone meta-splash layer in your Poky project: git clone https://github.com/hamzamac/meta-splash.git

  2. Replace the default logo.png image in meta-splash/recipes-core/psplash/files with your logo image with name logo.png (the name can be customized in customize.bb)

  3. Bake your image

That is all

To customize the colors and progress bar, check the meta-splash's README

Top comments (0)

Tired of sifting through your feed?

Find the content you want to see.

Change your feed algorithm by adjusting your experience level and give weights to the tags you follow.