Using psplash to customize a startup sequence - cu-ecen-aeld/buildroot-assignments-base GitHub Wiki
Overview
This page describes how to use a Buildroot package called PSPLASH to customize boot sequence and display a custom static image with a loading bar
Implementation
The implementation is straightforward and just requires 3 main steps
- Adding psplash from make menuconfig
- Adding psplash image from make menuconfig (which specifies the path to your custom image)
- A Simple script (boot script placed in /etc/init.d through a rootfs overlay) to draw the boot page
Buildroot Modifications
- These packages can be found under make menuconfig and searching psplash (to initiate the search press "/")
- The path to source image can be added as below
- It is recommended to do a clean specifically for psplash with
make psplash-dirclean
- followed by
make psplash
- this avoids stale images from previous runs
Startup Script
- An example script is linked here.
- This script can be placed under /etc/init.d with the help of a rootfs overlay
- The command psplash draws the image on the screen
- Next the idea is to create an effect of a loading bar with the for loop and displaying a message on top of the loading bar.
- To control the progress bar we can use the command
psplash-write "PROGRESS $i"
this sets the progress bar % as the current value of i - To display a message above the progress lets say the current percentage we can use
MSG Loading... $i%
- Also the stop section of the script can have a different message to indicate reboot.
Example
- After following above steps and burning the image on your sd card , you should see your custom image on boot like below
https://github.com/user-attachments/assets/9a385aa1-415d-420d-b12c-995f1a623d46
- To get a more cleaner boot experience and disabling boot time logs you can disable them by adding 'quiet' in the cmdline.txt file post burning the image on your sd card
root=/dev/mmcblk0p2 rootwait quiet console=tty1 console=ttyAMA0,115200
References
- https://github.com/buildroot/buildroot/blob/master/package/psplash/Config.in
- The official technical chat groups of buildroot are also a great resource