I never got the Splash functionality to work. But I found a solution to change the static startup logo for both u-boot and kernel.
Create boot images
I created a script that converted a jpg image to the two different images that is needed for u-boot and kernel.
#!/bin/bash
IMAGE_JPG_INPUT=<YOUR_IMAGE_NAME>.jpg
IMAGE_UBOOT=toradex.bmp
IMAGE_KERNEL=logo_custom_clut224.ppm
echo "Converting $IMAGE_JPG_INPUT"
jpegtopnm $IMAGE_JPG_INPUT | ppmquant 224 > tmp.ppm
pnmnoraw tmp.ppm > $IMAGE_KERNEL
echo ">> Kernel image created: $IMAGE_KERNEL"
ppmtobmp -bpp 8 tmp.ppm > $IMAGE_UBOOT
echo ">> U-boot image created: $IMAGE_UBOOT"
rm tmp.ppm
U-boot logo
The solution is to replace the default boot image (toradex.bmp in my case) in u-boot/tools/logos
. I created a bbappend file, u-boot-toradex_2016.11.bbappend, in <MY_CUSTOM_LAYER>/recipes-bsp/u-boot/u-boot-toradex/
.
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://toradex.bmp"
do_unpack_append() {
os.system("cp ${PWD}/toradex.bmp ${PWD}/git/tools/logos/")
}
The copy operation needs to be done in this function, because when you reach do_patch_prepend() the location of additional files is different if you run bitbake directly or working with devtool (then files are moved to sources/u-boot-toradex/oe-local-files/
).
According to the recipe I added the boot image to <MY_CUSTOM_LAYER>/recipes-bsp/u-boot/u-boot-toradex/u-boot-toradex
Kernel logo
For the kernel logo the solution is similar. I created a bbappend file, linux-toradex_4.1-2.0.x.bbappend, in <MY_CUSTOM_LAYER>/recipes-kernel/linux
FILESEXTRAPATHS_prepend := "${THISDIR}/linux-toradex-4.1-2.0.x:"
SRC_URI += "file://logo_custom_clut224.ppm \
file://enable-custom-logo \
"
do_unpack_append() {
os.system("cp ${PWD}/logo_custom_clut224.ppm ${PWD}/git/drivers/video/logo/")
os.system("patch -s < enable-custom-logo")
}
Boot image is added to <MY_CUSTOM_LAYER>/recipes-kernel/linux/linux-toradex-4.1-2.0.x
. I also added a patch to enable custom logo to the kernel config file and also disabled the other logo image options. In my case there was a default defconfig file from the original recipe in the $PWD directory that I had to patch.
CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+# CONFIG_LOGO_LINUX_CLUT224 is not set
+CONFIG_LOGO_CUSTOM_CLUT224=y
U-boot and kernel was then updated on the target.