How to Add a Custom Splash Screen (Linux)
Introduction
This article will guide you on how to add a custom splash screen to a Linux image built with Yocto using the Plymouth application. Plymouth supports several themes, allowing you to create a unique and personalized splash theme for your system. For information on further customization for your splash screen, refer to the Plymouth official documentation.
Plymouth Overview
Plymouth is an application that runs early in the boot process and displays a graphical animation while the kernel boots in the background. It is designed specifically for systems equipped with DRM modesetting drivers, and sets the native mode early to avoid flickering, but will fall back to test mode if DRM drivers are not available.
Prerequisites
- Setup the build environment for Yocto Project as described in Build a Reference Image with Yocto Project/OpenEmbedded
Adding a Custom Splash Screen
-
On the build directory, open the
conf/local.conffile and proceed with the following addition:conf/local.confCORE_IMAGE_EXTRA_INSTALL += "plymouth" -
On the layers directory, create and configure a custom layer for adding your custom recipes with
bitbake-layersor manually, at your will. If you have already set your custom layer up, you can skip this step. -
Inside the custom layer, which will be called
meta-customin this article, create arecipes-coredirectory with aplymouthfolder.$ cd layers/meta-custom
$ mkdir recipes-core && mkdir recipes-core/plymouth
$ tree
.
├── conf
│ └── layer.conf
├── COPYING.MIT
├── README
└── recipes-core
└── plymouth -
Create a
filesfolder with the image to be added as a splash screen and, inside/files, add the spinner.plymouth file:.
├── conf
│ └── layer.conf
├── COPYING.MIT
├── README
└── recipes-core
└── plymouth
└── files
├── spinner.plymouth
└── torizonlogo-white.png -
Create an append file (
plymouth_%.bbappend) with the following content:recipes-core/plymouth/plymouth_%.bbappendFILESEXTRAPATHS:prepend := "${THISDIR}/files:"
SRC_URI += " \
file://torizonlogo-white.png \
file://spinner.plymouth \
"
PLYMOUTH_THEMES = "spinner"
PACKAGECONFIG = "drm udev ${PLYMOUTH_THEMES} ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
do_install:append () {
install -m 0644 ${WORKDIR}/torizonlogo-white.png ${D}${datadir}/plymouth/themes/spinner/watermark.png
install -m 0644 ${WORKDIR}/spinner.plymouth ${D}${datadir}/plymouth/themes/spinner/spinner.plymouth
}Make sure to properly edit the
SRC_URIcontent with the desired splash theme.After all the steps, the meta-custom layer might look simillar to this:
.
├── conf
│ └── layer.conf
├── COPYING.MIT
├── README
└── recipes-core
└── plymouth
├── files
│ ├── spinner.plymouth
│ └── torizonlogo-white.png
└── plymouth_%.bbappend -
Bitbake the image:
$ bitbake tdx-reference-multimedia-imageYou can check if Plymouth was correctly installed on the image by adding the flag
-eto bitbake:$ bitbake -e tdx-reference-multimedia-image | grep plymouth -
Deploy the image using Toradex Easy Installer.