iMX8M mini开发板制作开机动画的思路

[复制链接]
672|0
手机看帖
扫描二维码
随时随地手机跟帖
柠檬籽儿|  楼主 | 2022-1-10 09:44 | 显示全部楼层 |阅读模式
​ 一、下载 psplash源码
1.下载psplash:gitclone git://git.yoctoproject.org/psplash,会下载到当前目录的psplash文件夹中forlinx@ubuntu:~$ git clone git://git.yoctoproject.org/psplash Cloning into 'psplash'... remote: Enumerating objects: 11, done. remote: Counting objects: 100% (11/11), done. remote: Compressing objects: 100% (11/11), done. remote: Total 306 (delta 2), reused 0 (delta 0), pack-reused 295 Receiving objects: 100% (306/306), 128.73 KiB | 74.00 KiB/s, done. Resolving deltas: 100% (192/192), done.
2.下载成功后会在当前目录下生成一个psplash文件夹,进入psplash文件夹
forlinx@ubuntu:~$ cd psplash/ forlinx@ubuntu:~/psplash$ ls
1797c4fc9591905d544f1c929ca9baab.png

会看到一个 make-image-header.sh 的脚本,等下会使用这个脚本来将图片转化成头文件。
3.在使用脚本之前,需要安装库,否则会报错。
forlinx@ubuntu:~/psplash$ sudo apt-get install libgdk-pixbuf2.0-dev [sudo] password for forlinx: Reading package lists... Done Building dependency tree Reading state information... Done The following package was automatically installed and is no longer required: linux-hwe-5.4-headers-5.4.0-84 Use 'sudo apt autoremove' to remove it. 【…】 forlinx@ubuntu:~/psplash$ sudo apt-get install build-essential libncurses5-dev Reading package lists... Done Building dependency tree Reading state information... Done 【…】
4.将想要替换的图片复制到psplash文件夹中,此处用的是我们公司的**,命名为**-1024x600.png ,外框照片命名为**-bar.png。
54acdcca52fab9d005cf5acf156c22ef.png

进度条的外框 **-bar.png。
40db6bb077ddc4263ca47f5f524ea65b.png

将这两张图片拷贝到 psplash 源码目录中,如下图所示。
b33f2d6c5ed7ec841c5bb8cf24e898cf.png

二 制作**
1.在 psplash 源码中执行以下指令来生成 **-1024x600-img.h
c464dfe751bbcc561823f09d3bed1936.png

可以看到它必须是要加 POKY 参数的,因为其他地方要用到这样的宏定义。
2.返回到 psplash 源码下,执行以下指令生成 **-bar-img.h
forlinx@ubuntu:~/psplash$ ./make-image-header.sh **-bar.png BAR forlinx@ubuntu:~/psplash$ ls
90f35cb53fdac4dd39ed48829cc586ec.png

同样我们打开 **-bar-img.h 这个文件。它必须是加 BAR 参数的,因为其他地方会 用到这样的宏定义。
forlinx@ubuntu:~/psplash$ vi **-bar-img.h
dde203d67902c5193b7588cadca4c27d.png

3.打开 psplash.c,将里面的 #include "psplash-poky-img.h" 修改成 #include "**-1024x600-img.h"。将里面的 #include " psplash-bar-img.h" 修改成 #include "**-bar-img.h"。修改完后如下图所示。
forlinx@ubuntu:~/psplash$ vi psplash.c
a1145bfd90da53a903cd7d6ae8ea4c96.png

修改完成后保存退出 psplash.c,返回到源码目录下。
4.制作 autogen.sh 脚本,用于生成 Makefile。
forlinx@ubuntu:~/psplash$ vi autogen.sh
内容如下:
#!/bin/bash aclocal autoheader automake --add-missing autoconf
制作完脚本后,赋予它可执行权限,再执行这个脚本。
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.修改 Makefile.am,将 psplash-poky-img.h 修改成**-1024x600-img.h,将 psplash-bar-img.h 修改成 **-bar-img.h。
forlinx@ubuntu:~/psplash$ vi Makefile.am
修改完后的 Makefile.am 如下图所示。
d0684f54e4d6b5b6117c5c14519fc635.png

修改完 Makefile.am 后保存退出,回到源码目录下。
6.执行以下指令,使能环境变量。
forlinx@ubuntu:~/psplash$ . /opt/fsl-imx-xwayland/4.14-sumo/environment-setup-aarch64-poky-linux
7.环境变量使能后,就可以执行以下指令配置交叉编译工具链。
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.执行 make 指令进行编译。
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 【…】
编译完成后会在源码目录下生成 psplash 和 psplash-write 文件。
14a9b7b0cf17819407afecd76e872b7d.png

三、替换出厂系统**
将编译生成的 psplash 和 psplash-write 文件拷贝到开发板出厂文件系统/usr/bin 目录下。
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
保存重启后可看到开机动画已替换完成。效果如下:
aa81189bbed41c4cd3a536397010fcca.png



使用特权

评论回复

相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

105

主题

106

帖子

0

粉丝