OKMX8MM-C开发板制作开机动画的思路

描述

近期有部分客户询问飞凌嵌入式i.MX8M系列开发板如何添加或更改开机动画,下文以OKMX8MM-C为例整理出如下思路,可供客户尝试。

一、下载 psplash源码

1.下载psplash:gitclone git://git.yoctoproject.org/psplash,会下载到当前目录的psplash文件夹中

 
  1. forlinx@ubuntu:~$ git clone git://git.yoctoproject.org/psplash

  2. Cloning into 'psplash'...

  3. remote: Enumerating objects: 11, done.

  4. remote: Counting objects: 100% (11/11), done.

  5. remote: Compressing objects: 100% (11/11), done.

  6. remote: Total 306 (delta 2), reused 0 (delta 0), pack-reused 295

  7. Receiving objects: 100% (306/306), 128.73 KiB | 74.00 KiB/s, done.

  8. Resolving deltas: 100% (192/192), done.

注:代码可左右滑动,下同

2.下载成功后会在当前目录下生成一个psplash文件夹,进入psplash文件夹


 
  1. forlinx@ubuntu:~$ cd psplash/

  2. forlinx@ubuntu:~/psplash$ ls

会看到一个make-image-header.sh的脚本,等下会使用这个脚本来将图片转化成头文件。3.在使用脚本之前,需要安装库,否则会报错。

 
  1. forlinx@ubuntu:~/psplash$ sudo apt-get install libgdk-pixbuf2.0-dev

  2. [sudo] password for forlinx:

  3. Reading package lists... Done

  4. Building dependency tree      

  5. Reading state information... Done

  6. The following package was automatically installed and is no longer required:

  7.  linux-hwe-5.4-headers-5.4.0-84

  8. Use 'sudo apt autoremove' to remove it.

  9. 【…】

  10. forlinx@ubuntu:~/psplash$ sudo apt-get install build-essential libncurses5-dev

  11. Reading package lists... Done

  12. Building dependency tree      

  13. Reading state information... Done

  14. 【…】

4.将想要替换的图片复制到psplash文件夹中,此处用的是我们公司的logo,命名为logo-1024x600.png,外框照片命名为logo-bar.png。

进度条的外框logo-bar.png。将这两张图片拷贝到psplash源码目录中,如下图所示。

 

二、制作logo

1.在psplash源码中执行以下指令来生成logo-1024x600-img.h

 
  1. forlinx@ubuntu:~/psplash$ ./make-image-header.sh logo-1024x600.png POKY

  2. forlinx@ubuntu:~/psplash$ ls

POKY参数只是一个变量,它会传入到logo-1024x600-img.h文件里面,可以打开查看。


 
  1. forlinx@ubuntu:~/psplash$ vi logo-1024x600-img.h

可以看到它必须是要加POKY参数的,因为其他地方要用到这样的宏定义。2.返回到psplash源码下,执行以下指令生成 logo-bar-img.h

 
  1. forlinx@ubuntu:~/psplash$ ./make-image-header.sh logo-bar.png BAR

  2. forlinx@ubuntu:~/psplash$ ls

同样我们打开logo-bar-img.h这个文件。它必须是加BAR参数的,因为其他地方会用到这样的宏定义。

 
  1. forlinx@ubuntu:~/psplash$ vi logo-bar-img.h

 

3.打开psplash.c,将里面的#include"psplash-poky-img.h" 修改成#include"logo-1024x600-img.h"。将里面的#include" psplash-bar-img.h" 修改成#include"logo-bar-img.h"。修改完后如下图所示。

 
  1. forlinx@ubuntu:~/psplash$ vi psplash.c

修改完成后保存退出psplash.c,返回到源码目录下。4.制作autogen.sh脚本,用于生成Makefile。

 
  1. forlinx@ubuntu:~/psplash$ vi autogen.sh

内容如下:


 
  1. #!/bin/bash

  2. aclocal

  3. autoheader

  4. automake --add-missing

  5. autoconf

制作完脚本后,赋予它可执行权限,再执行这个脚本。


 
  1. forlinx@ubuntu:~/psplash$ chmod 777 autogen.sh

  2. forlinx@ubuntu:~/psplash$ ./autogen.sh

  3. configure.ac:7: installing './compile'

  4. configure.ac:3: installing './install-sh'

  5. configure.ac:3: installing './missing'

  6. Makefile.am: installing './INSTALL'

  7. Makefile.am: installing './depcomp'

5.修改Makefile.am,将psplash-poky-img.h修改成logo-1024x600-img.h,将psplash-bar-img.h修改成logo-bar-img.h。


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

修改完后的Makefile.am如下图所示。

修改完Makefile.am后保存退出,回到源码目录下。6.执行以下指令,使能环境变量。

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

7.环境变量使能后,就可以执行以下指令配置交叉编译工具链。


 
  1. forlinx@ubuntu:~/psplash$ ./configure --host=aarch64-poky-linux

  2. configure: loading site script /opt/fsl-imx-xwayland/4.14-sumo/site-config-aarch64-poky-linux

  3. checking for a BSD-compatible install... /usr/bin/install -c

  4. checking whether build environment is sane... yes

  5. checking for aarch64-poky-linux-strip... aarch64-poky-linux-strip

  6. checking for a thread-safe mkdir -p... /bin/mkdir -p

  7. checking for gawk... no

  8. checking for mawk... mawk

  9. checking whether make sets $(MAKE)... yes

  10. checking whether make supports nested variables... yes

  11. checking for style of include used by make... GNU

  12. 【…】

8.执行make指令进行编译。


 
  1. forlinx@ubuntu:~/psplash$ make

  2. cd . && /bin/bash /home/forlinx/psplash/missing automake-1.15 --gnu Makefile

  3. cd . && /bin/bash ./config.status Makefile depfiles

  4. config.status: creating Makefile

  5. config.status: executing depfiles commands

  6. ./make-image-header.sh base-images/psplash-bar.png BAR

  7. make  all-am

  8. make[1]: Entering directory '/home/forlinx/psplash'

  9. aarch64-poky-linux-gcc  

  10. --sysroot=/opt/fsl-imx-xwayland/

  11. 4.14-sumo/sysroots/aarch64-poky-linux -DHAVE_CONFIG_H -I

  12. .    -g -Wall -Wextra  

  13. -D_GNU_SOURCE -DFONT_HEADER=\"radeon-font.h\"

  14. -DFONT_DEF=radeon_font -O2 -pipe -g

  15. -feliminate-unused-debug-types

  16. -MT psplash-psplash.o -MD -MP -MF

  17. .deps/psplash-psplash.Tpo -c -o psplash-psplash.o

  18. `test -f 'psplash.c' || echo './'`psplash.c

  19. 【…】

编译完成后会在源码目录下生成psplash和psplash-write文件。

 

三、替换出厂系统logo

将编译生成的psplash和psplash-write文件拷贝到开发板出厂文件系统/usr/bin目录下。

 
  1. okmx8mm login:root

  2. Last login: Thu Jun 20 10:00:15 UTC 2019 on tty7

  3. root@okmx8mm:~# cd /usr/bin/

  4. root@okmx8mm:/usr/bin# ls psp*

  5. psplash  psplash-default  psplash-write

  6. root@okmx8mm:/usr/bin# rm psplash

  7. root@okmx8mm:/usr/bin# rm psplash-write

  8. root@okmx8mm:/usr/bin# cp /run/media/sda1/psplash ./

  9. root@okmx8mm:/usr/bin# cp /run/media/sda1/psplash-write ./

  10. root@okmx8mm:/usr/bin# sync

保存重启后可看到开机动画已替换完成。效果如下:

注意:目前我们的OKMX8MM-C做了开机连续显示,所以默认没有开机动画,若客户有需要可按上述方式进行添加。同时此方法在OKMX8MQ-C和OKMX8MP-C上也同样适用。

打开APP阅读更多精彩内容
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉
  • 相关推荐

全部0条评论

快来发表一下你的评论吧 !

×
20
完善资料,
赚取积分