EDA365电子论坛网

标题: 利用i.MX8MM开发板制作开机动画 [打印本页]

作者: 罗罗诺亚    时间: 2024-5-30 16:21
标题: 利用i.MX8MM开发板制作开机动画

一、下载 psplash源码

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

8 ]5 @( o! ?& T5 U8 _9 r

3 c. t% Y0 C9 i: }5 }/ M

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


) ?0 R5 m) H. l6 d) G6 P- v5 ?& p% {: q


) k: H& [! {; @9 N

会看到一个 make-image-header.sh 的脚本,等下会使用这个脚本来将图片转化成头文件。

' I; G  [3 ?* S! i( @9 v9 H( M

3.在使用脚本之前,需要安装库,否则会报错。

* G$ N8 O) c& \$ k

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

" q, J; g  Q: X3 Z4 S: \4 q/ n

, s6 I$ Y1 N* R+ y% p$ q

* e: w9 C5 T3 `: d6 M3 }& M, h1 N

进度条的外框 logo-bar.png。


/ k- m% M  z# ?0 V. n  C! e- o0 W6 x

  D1 x$ K% m; `* M

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


% Z+ |6 S! C5 K( b. {6 V& t+ H- R5 A) n$ z* o' [, W
5 d: K3 i# |* T; f


1 I8 @8 J% V# S2 f1 m7 _! C9 ]7 j. f4 c+ ^$ Q9 S

二 制作logo

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


& \6 E- o4 d- x2 R* \
6 T# T. y) S, m  A


5 o! {& i" V8 n2 U. ]8 d8 _

可以看到它必须是要加 POKY 参数的,因为其他地方要用到这样的宏定义


  t( }6 u. d- z; k8 {6 k

2.返回到 psplash 源码下,执行以下指令生成 logo-bar-img.h

3 H! `5 ^, a0 w& {+ F0 r% S

+ R- t4 h# ^+ w6 M5 g8 p
: E# |, D. p4 n7 N$ \

1 \& N6 ~/ \% L: R

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

1 J% j: P  p: S7 t( Q8 w
forlinx@ubuntu:~/psplash$ vi logo-bar-img.h
  U7 C; d8 G: Z8 a# {9 K6 i2 \9 R$ L6 j" ?7 c. x


8 @+ d; x8 D9 C3 C

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

forlinx@ubuntu:~/psplash$ vi psplash.c6 ?! H( y" p: k

2 P9 }: U& m) b$ Y4 Y


) x( w; x5 S& B

修改完成后保存退出 psplash.c,返回到源码目录下。


: I* b3 P; _9 s4 |% {( w& W- p  G

4.制作 autogen.sh 脚本,用于生成 Makefile。


8 X7 J# z8 {& Sforlinx@ubuntu:~/psplash$ vi autogen.sh
# E5 ]; U* {2 C9 {5 g' H

内容如下:

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

- V7 C* f: P) z$ l
  Y; M% ~! G" z# `6 I- O

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

forlinx@ubuntu:~/psplash$ vi Makefile.am
* G$ S0 o3 a, G: H  d

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


: a1 G" S8 ]% O- Y" D4 r
5 j8 m2 y/ K+ P


9 A% W! V$ t' A* [/ I" x/ R

修改完 Makefile.am 后保存退出,回到源码目录下。

3 n+ C5 N9 X9 c! R

6.执行以下指令,使能环境变量。


* a" I: s+ b! q. K( G1 x& j
5 G, D4 g0 u4 A; ^0 I8 P+ _3 J

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


; z7 b& S9 D. D* c1 Uforlinx@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 【…】! ^- x$ e% i/ a. ^! U+ W4 P

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 【…】
3 P, e8 _. Q) `+ c/ w% e& f6 K

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


) {- W' D2 U* H) p
7 y' D) Q% w7 c$ i6 ~9 X

% z3 N! u: a. P+ h

三、替换出厂系统logo

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

) u. D- y0 }' X7 f

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

6 i0 Z, S- a, N" @2 e6 A! `

7 @  a" Q% Z# ?
8 U- Y# l7 `' ~, ]4 N


4 B( X' D0 @6 J) k
作者: fgjhtjbfem    时间: 2024-5-31 18:05
程序写的很有水平




欢迎光临 EDA365电子论坛网 (https://bbs.eda365.com/) Powered by Discuz! X3.2