0

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.

PhilBot
  • 748
  • 18
  • 85
  • 173
  • This question is probably better asked on [**Raspberry pi StackExchange**](http://raspberrypi.stackexchange.com/). Though that is a judgment call since this is tangentially coding related. – David C. Rankin Aug 21 '17 at 23:38

3 Answers3

3

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
Charles C.
  • 3,725
  • 4
  • 28
  • 50
  • 1
    Lets say I've build two splash package splash-file-one.rpm for 10" display resolution@800x600 and splash-file-two.rpm for 7" display resolution@800x480 , is there a way to select & load one of these two package runtime on target according to connected display resolution found [Run time package management ], Or just install manually & should reflect on next boot ? – SK17 Jan 14 '20 at 18:50
3

As Charles C. mentioned, one way is to overwrite psplash-raspberrypi-img.h

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.

Theoretically it should be enough just to set psplash_%.bbappend:

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

SPLASH_IMAGES_append = " file://foo-img.png;outsuffix=bar"

conf/local.conf:

SPLASH = " psplash-bar"

just as it is done in meta-raspberry but it seems that meta-raspberry is setting SPLASH inside image definition class and that overwrites you value from local.conf

At this point it is worth to see how it is evalueated:

bitbake -e core-image-base | less

and search for ^SPLASH you will notice that it has final value psplash-raspberrypi.

solution

This is how I managed to make it work:

psplash_%.bbappend:

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

SPLASH_IMAGES_append = " file://foo-img.png;outsuffix=bar"
ALTERNATIVE_PRIORITY_psplash-bar[psplash] = "200"

conf/local.conf:

PACKAGE_INSTALL_append = " psplash-bar"

what happens here:

SPLASH_IMAGES_append = " file://foo-img.png;outsuffix=bar"
This will produce package psplash-bar. You can provide .png and it will be converted to appropriate header file, but you can also provide raw header. psplash receipe will deduce it.

PACKAGE_INSTALL_append = " psplash-bar"
This will tell bitbake to install it on rootfs, (if SPLASH weren't overwritten, then it would be evaluated here)

at this point after building image psplash-bar will be installed on rootfs, but psplash won't be linked to it:

ls -lh /usr/bin/psplash*
lrwxrwxrwx psplash -> /usr/bin/psplash-raspberrypi
-rwxr-xr-x psplash-raspberrypi
-rwxr-xr-x psplash-systemd
-rwxr-xr-x psplash-bar
-rwxr-xr-x psplash-write

So that with this:
ALTERNATIVE_PRIORITY_psplash-bar[psplash] = "200"
we will tell bibtake to use psplash-bar to be alternative package (provider?) with priority 200.

ls -lh /usr/bin/psplash*
lrwxrwxrwx psplash -> /usr/bin/psplash-bar
-rwxr-xr-x psplash-raspberrypi
-rwxr-xr-x psplash-systemd
-rwxr-xr-x psplash-bar
-rwxr-xr-x psplash-write
d21d3q
  • 365
  • 2
  • 10
  • Followed this answer, but running `ls -lh /usr/bin/psplash*` only give me: `psplash -> /usr/bin/psplash-raspberrypi psplash-raspberrypi psplash-write` Any tips or ideas? Am I correct to use `build/conf/local.conf` and `meta-my\recipes-my\my\psplash_%.bbappend`? – bac Mar 08 '21 at 13:46
  • As I understood you can't see your psplash on filesystem at all. It looks like `SPLASH_IMAGES_append` is not taking effect, because it should trigger custom splash build. you can add some logging to `psplash_%.bbappend` to see if it is parsed/loaded correctly. It is always worth to grep through `bitbake -e ...` output for your splash name etc – d21d3q Mar 10 '21 at 20:58
1

A simple solution

  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 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, check the meta-splash's README

Makame
  • 21
  • 3