How To Make Boot Animation OKMX8MM-C SBC

Recently, some customers have asked About how to add or change the boot animation of Forlinx i.MX8M series development board, the following is sorted out with OKMX8MM-C single board computer as an example, which can be tried by customers.

First,download the psplash source code

1. Download psplash: gitclone git://git.yoctoproject.org/psplash and will be downloaded to the psplash folder in the current directory

Download psplash

Note: The code can be swiped left and right, the same below

2. After successful download, a psplash folder will be generated in the current directory and enter the psplash folder

enter the psplash folder

enter the psplash folder

You will see a script make-image-header.sh, which will be used later to convert the image into a header file.

3. Before using the script, you need to install the library, otherwise an error will be reported.

install the library

4. Copy the picture you want to replace into the psplash folder, here is our company's logo, named logo-1024x600.png, frame photo named logo-bar.png.

replace into the psplash folder

The outer box of the progress bar logo-bar .png.

Copy the two images into the ppplash source directory, as shown in the following figure.

Second, make a logo

1. Execute the following instructions in the psplash source code to generate logo-1024x600-img.h

POKY parameter is just a variable, it will be passed into the logo-1024x600-img.h file, which can be opened for viewing.

As you can see, it must be with a POKY parameter, because such a macro definition is used elsewhere.

2. Return to the psplash source code and execute the following instructions to generate logo-bar-img.h

Similarly we open the logo-bar-img.h file. It must be with the BAR parameter, as such macro definitions will be used elsewhere.

3. Open the .c of psplash and change the #include "psplash-poky-img.h" to #include "logo-1024x600-img.h". Change #include" psplash-bar-img.h to #include"logo-bar-img.h". After the modification is completed, it is shown in the following figure.

After the modification is completed, save the exit .c and return to the source directory.

4. Make autogen.sh script for generating Makefile.

  • forlinx@ubuntu:~/psplash$ vi autogen.sh
  • The content is as follows:
  • #!/bin/bash
  • aclocal
  • autoheader
  • automake --add-missing
  • autoconf

After the script is made, give it execute permissions and execute the script.

  • forlinx@ubuntu:~/psplash$ chmod 777 autogen.sh
  • forlinx@ubuntu:~/psplash$ ./autogen.sh
  • configure.ac:7: installing './compile'
  • configure.ac:3: installing './install-sh'
  • configure.ac:3: installing './missing'
  • Makefile.am: installing './INSTALL'
  • Makefile.am: installing './depcomp'

5. Modify the Makefile.am, modify the psplash-poky-img.h to logo-1024x600-img.h, and modify the psplash-bar-img.h to logo-bar-img.h.

forlinx@ubuntu:~/psplash$ vi Makefile.am

The modified Makefile.am is shown in the following figure.

After modifying the Makefile.am, save and exit, and return to the source code directory.

6. Execute the following instructions to enable the environment variables.

forlinx@ubuntu:~/psplash$ . /opt/fsl-imx-xwayland/4.14-sumo/environment-setup-aarch64-poky-linux

7. After the environment variables are enabled, you can execute the following instructions to configure the cross-compilation toolchain.

  • forlinx@ubuntu:~/psplash$ ./configure --host=aarch64-poky-linux
  • configure: loading site script /opt/fsl-imx-xwayland/4.14-sumo/site-config-aarch64-poky-linux
  • checking for a BSD-compatible install... /usr/bin/install -c
  • checking whether build environment is sane... yes
  • checking for aarch64-poky-linux-strip... aarch64-poky-linux-strip
  • checking for a thread-safe mkdir -p... /bin/mkdir -p
  • checking for gawk... no
  • checking for mawk... mawk
  • checking whether make sets $(MAKE)... yes
  • checking whether make supports nested variables... yes
  • checking for style of include used by make... GNU
  • 【…】

8. Execute the make directive to compile.

  • forlinx@ubuntu:~/psplash$ make
  • cd . && /bin/bash /home/forlinx/psplash/missing automake-1.15 --gnu Makefile
  • cd . && /bin/bash ./config.status Makefile depfiles
  • config.status: creating Makefile
  • config.status: executing depfiles commands
  • ./make-image-header.sh base-images/psplash-bar.png BAR
  • make  all-am
  • make[1]: Entering directory '/home/forlinx/psplash'
  • aarch64-poky-linux-gcc
  • --sysroot=/opt/fsl-imx-xwayland/
  • 4.14-sumo/sysroots/aarch64-poky-linux -DHAVE_CONFIG_H -I
  • .    -g -Wall -Wextra
  • -D_GNU_SOURCE -DFONT_HEADER=\"radeon-font.h\"
  • -DFONT_DEF=radeon_font -O2 -pipe -g
  • -feliminate-unused-debug-types
  • -MT psplash-psplash.o -MD -MP -MF
  • .deps/psplash-psplash.Tpo -c -o psplash-psplash.o
  • `test -f 'psplash.c' || echo './'`psplash.c
  • 【…】

After compiling, the files will be generated in the source directory for pseudosh and pseudosh-write.

Third, replace the factory system logo

Copy the compiled and generated psplash and psplash-write files to the board's factory file system/usr/bin directory.

  • okmx8mm login:root
  • Last login: Thu Jun 20 10:00:15 UTC 2019 on tty7
  • root@okmx8mm:~# cd /usr/bin/
  • root@okmx8mm:/usr/bin# ls psp*
  • psplash  psplash-default  psplash-write
  • root@okmx8mm:/usr/bin# rm psplash
  • root@okmx8mm:/usr/bin# rm psplash-write
  • root@okmx8mm:/usr/bin# cp /run/media/sda1/psplash ./
  • root@okmx8mm:/usr/bin# cp /run/media/sda1/psplash-write ./
  • root@okmx8mm:/usr/bin# sync

After saving the reboot, you can see that the boot animation has been replaced. The effect is as follows:

Note: At present, our OKMX8MM-C development board has a continuous boot display, so there is no boot animation by default. If the customer needs it, you can add it in the above way. At the same time, this method is also applicable to OKMX8MQ-C and OKMX8MP-C.