Wednesday, February 2, 2022

[SOLVED] Yocto Raspberry Pi Change psplash image

Issue

I've successfully built a raspberry pi Yocto image using the instructions here: http://www.jumpnowtek.com/rpi/Raspberry-Pi-Systems-with-Yocto.html. When the system boots, I see the default psplash splash screen of a Raspberry Pi with a loading bar.

The meta-raspberrypi layer has a psplash bbappend recipe file that defines the raspberry pi image seen when the system boots.

me@me:~/poky-morty/meta-raspberrypi$ grep -R SPLASH *
conf/machine/include/rpi-base.inc:SPLASH = "psplash-raspberrypi"
recipes-core/images/rpi-basic-image.bb:SPLASH = "psplash-raspberrypi"
recipes-core/psplash/psplash_git.bbappend:SPLASH_IMAGES += "file://psplash-raspberrypi-img.h;outsuffix=raspberrypi"

The SPLASH variable in dpi-base.inc defines the splash screen to use ( I think... ) and the psplash_git.bbappend file pretends the image with the matching out suffix of raspberry pi.

The bbappend looks like this:

me@me:~/poky-morty/meta-raspberrypi$ cat recipes-core/psplash/psplash_git.bbappend
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SPLASH_IMAGES += "file://psplash-raspberrypi-img.h;outsuffix=raspberrypi"

I have a custom layer and I made another psplash_git.bbappend in that layer with the following contents - attempting to override the image used for the raspberry pi splash screen with my own image:

me@me:~/rpi/meta-me/recipes-me/psplash$ cat psplash_git.bbappend 
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SPLASH_IMAGES += "file://social.jpg-img.h;outsuffix=raspberrypi"

If I try to build my image with my custom bbappend included, I get the following error:

Initialising tasks: 100% |##################################| Time: 0:00:05
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: psplash-0.1+gitAUTOINC+88343ad23c-r15 do_package: QA Issue: psplash-raspberrypi is listed in PACKAGES multiple times, this leads to packaging errors. [packages-list]
ERROR: psplash-0.1+gitAUTOINC+88343ad23c-r15 do_package: Fatal QA errors found, failing task.
ERROR: psplash-0.1+gitAUTOINC+88343ad23c-r15 do_package: Function failed: do_package
ERROR: Logfile of failure stored in: /home/me/rpi/build/tmp/work/arm1176jzfshf-vfp-poky-linux-gnueabi/psplash/0.1+gitAUTOINC+88343ad23c-r15/temp/log.do_package.63289
ERROR: Task (/home/me/poky-morty/meta/recipes-core/psplash/psplash_git.bb:do_package) failed with exit code '1'
NOTE: Tasks Summary: Attempted 3439 tasks of which 3430 didn't need to be rerun and 1 failed.

I get the same error ( duplicate target ) if I change the outsuffix to default.

I can get around this error by changing my bbappend to this:

me@me:~/rpi/meta-me/recipes-me/psplash$ cat psplash_git.bbappend 
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SPLASH_IMAGES += "file://social.jpg-img.h;outsuffix=me"

And then I try to override the SPLASH configuration variable in my local.conf like this:

# Set the Custom Splash screen
SPLASH = "psplash-me"

But no matter what I seem to do, it always renders the default Raspberry Pi one.

How can I override the default psplash splash screen with my own image? Thanks.


Solution

The name of the file should match the format psplash-%s where %s is raspberrypi so the quickest way is to change your social.jpg-img.h to psplash-raspberrypi-img.h and overwrite it on the original raspberrypi psplash.bbappend.

Below is information on how it gets the outsuffix variable;

for uri in splashfiles:
        fetcher = bb.fetch2.Fetch([uri], d)
        flocal = os.path.basename(fetcher.localpath(uri))
        fbase = os.path.splitext(flocal)[0]
        outsuffix = fetcher.ud[uri].parm.get("outsuffix")
        if not outsuffix:
            if fbase.startswith("psplash-"):
                outsuffix = fbase[8:]
            else:
                outsuffix = fbase
            if outsuffix.endswith('-img'):
                outsuffix = outsuffix[:-4]
        outname = "psplash-%s" % outsuffix
        if outname == '' or outname in oldpkgs:
            bb.fatal("The output name '%s' derived from the URI %s is not valid, please specify the outsuffix parameter" % (outname, uri))
        else:
            pkgs.append(outname)
        if flocal.endswith(".png"):
            haspng = True
        localpaths.append(flocal)

SPLASH_IMAGES is basically map of files that has key with outsuffix.

SPLASH_IMAGES = "file://splash-file-one.h;outsuffix=one \
                       file://splash-file-two.h;outsuffix=two"

This will automatically create psplash- packages for each splash image entry (i.e. psplash-one and psplash-two).

splash: Enables showing a splash screen during boot. By default, this screen is provided by psplash, which does allow customization. If you prefer to use an alternative splash screen package, you can do so by setting the SPLASH variable to a different package name (or names) within the image recipe or at the distro configuration level.

Instead of using default, raspberrypi provides alternative to choose the splash image in the machine configuration; This link gives more information https://lists.yoctoproject.org/pipermail/yocto/2013-May/013902.html

+# Set raspberrypi splash image
+SPLASH = "psplash-raspberrypi"
diff --git a/recipes-core/psplash/psplash_git.bbappend b/recipes-core/psplash/psplash_git.bbappend
index eea8dfb..65dc30f 100644
--- a/recipes-core/psplash/psplash_git.bbappend
+++ b/recipes-core/psplash/psplash_git.bbappend
@@ -1,2 +1,2 @@
 FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-SPLASH_IMAGES = "file://psplash-raspberrypi-img.h;outsuffix=default"
+SPLASH_IMAGES += "file://psplash-raspberrypi-img.h;outsuffix=raspberrypi"
-- 
1.8.2.2


Answered By - Charles C.
Answer Checked By - Timothy Miller (WPSolving Admin)