【问题标题】:Yocto Raspberry Pi Change psplash imageYocto Raspberry Pi 更改 psplash 图像
【发布时间】:2018-01-29 00:20:27
【问题描述】:

我已经使用此处的说明成功构建了一个树莓派 Yocto 映像:http://www.jumpnowtek.com/rpi/Raspberry-Pi-Systems-with-Yocto.html。当系统启动时,我会看到带有加载栏的 Raspberry Pi 的默认 psplash 初始屏幕。

meta-raspberrypi 层有一个 psplash bbappend 配方文件,它定义了系统启动时看到的 raspberry pi 映像。

me@me:~/poky-morty/meta-raspberrypi$ grep -R SPLASH *
conf/machine/include/rpi-base.inc:SPLASH = "psplash-raspberrypi"
recipes-core/images/rpi-basic-image.bb:SPLASH = "psplash-raspberrypi"
recipes-core/psplash/psplash_git.bbappend:SPLASH_IMAGES += "file://psplash-raspberrypi-img.h;outsuffix=raspberrypi"

dpi-base.inc 中的 SPLASH 变量定义了要使用的启动画面(我认为...),psplash_git.bbappend 文件假装带有匹配的树莓派后缀的图像。

bbappend 看起来像这样:

me@me:~/poky-morty/meta-raspberrypi$ cat recipes-core/psplash/psplash_git.bbappend
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SPLASH_IMAGES += "file://psplash-raspberrypi-img.h;outsuffix=raspberrypi"

我有一个自定义层,我在该层中创建了另一个 psplash_git.bbappend,其中包含以下内容 - 尝试用我自己的图像覆盖用于树莓派启动画面的图像:

me@me:~/rpi/meta-me/recipes-me/psplash$ cat psplash_git.bbappend 
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SPLASH_IMAGES += "file://social.jpg-img.h;outsuffix=raspberrypi"

如果我尝试构建包含自定义 bbappend 的映像,则会收到以下错误:

Initialising tasks: 100% |##################################| Time: 0:00:05
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: psplash-0.1+gitAUTOINC+88343ad23c-r15 do_package: QA Issue: psplash-raspberrypi is listed in PACKAGES multiple times, this leads to packaging errors. [packages-list]
ERROR: psplash-0.1+gitAUTOINC+88343ad23c-r15 do_package: Fatal QA errors found, failing task.
ERROR: psplash-0.1+gitAUTOINC+88343ad23c-r15 do_package: Function failed: do_package
ERROR: Logfile of failure stored in: /home/me/rpi/build/tmp/work/arm1176jzfshf-vfp-poky-linux-gnueabi/psplash/0.1+gitAUTOINC+88343ad23c-r15/temp/log.do_package.63289
ERROR: Task (/home/me/poky-morty/meta/recipes-core/psplash/psplash_git.bb:do_package) failed with exit code '1'
NOTE: Tasks Summary: Attempted 3439 tasks of which 3430 didn't need to be rerun and 1 failed.

如果我将后缀更改为默认值,我会得到相同的错误(重复目标)。

我可以通过将我的 bbappend 更改为以下内容来解决此错误:

me@me:~/rpi/meta-me/recipes-me/psplash$ cat psplash_git.bbappend 
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SPLASH_IMAGES += "file://social.jpg-img.h;outsuffix=me"

然后我尝试像这样覆盖我的 local.conf 中的 SPLASH 配置变量:

# Set the Custom Splash screen
SPLASH = "psplash-me"

但无论我做什么,它总是呈现默认的树莓派。

如何用我自己的图像覆盖默认的 psplash 初始屏幕?谢谢。

【问题讨论】:

标签: linux raspberry-pi splash-screen yocto meta-raspberrypi


【解决方案1】:

文件名应与psplash-%s 格式匹配,其中%sraspberrypi,因此最快的方法是将social.jpg-img.h 更改为psplash-raspberrypi-img.h 并将其覆盖在原始raspberrypi psplash.bbappend 上。

以下是有关如何获取outsuffix 变量的信息;

for uri in splashfiles:
        fetcher = bb.fetch2.Fetch([uri], d)
        flocal = os.path.basename(fetcher.localpath(uri))
        fbase = os.path.splitext(flocal)[0]
        outsuffix = fetcher.ud[uri].parm.get("outsuffix")
        if not outsuffix:
            if fbase.startswith("psplash-"):
                outsuffix = fbase[8:]
            else:
                outsuffix = fbase
            if outsuffix.endswith('-img'):
                outsuffix = outsuffix[:-4]
        outname = "psplash-%s" % outsuffix
        if outname == '' or outname in oldpkgs:
            bb.fatal("The output name '%s' derived from the URI %s is not valid, please specify the outsuffix parameter" % (outname, uri))
        else:
            pkgs.append(outname)
        if flocal.endswith(".png"):
            haspng = True
        localpaths.append(flocal)

SPLASH_IMAGES 基本上是具有outsuffix 键的文件的映射。

SPLASH_IMAGES = "file://splash-file-one.h;outsuffix=one \
                       file://splash-file-two.h;outsuffix=two"

这将为每个启动图像条目(即 psplash-one 和 psplash-two)自动创建 psplash- 包。

splash:允许在启动过程中显示启动画面。默认情况下,这 screen 由 psplash 提供,它允许自定义。如果你 更喜欢使用替代启动屏幕包,您可以通过 将 SPLASH 变量设置为不同的包名称(或名称) 在图像配方或发行版配置级别。

raspberrypi 没有使用默认值,而是提供了在机器配置中选择启动图像的替代方法;此链接提供更多信息 https://lists.yoctoproject.org/pipermail/yocto/2013-May/013902.html

+# Set raspberrypi splash image
+SPLASH = "psplash-raspberrypi"
diff --git a/recipes-core/psplash/psplash_git.bbappend b/recipes-core/psplash/psplash_git.bbappend
index eea8dfb..65dc30f 100644
--- a/recipes-core/psplash/psplash_git.bbappend
+++ b/recipes-core/psplash/psplash_git.bbappend
@@ -1,2 +1,2 @@
 FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-SPLASH_IMAGES = "file://psplash-raspberrypi-img.h;outsuffix=default"
+SPLASH_IMAGES += "file://psplash-raspberrypi-img.h;outsuffix=raspberrypi"
-- 
1.8.2.2

【讨论】:

  • 假设我已经为 10" display resolution@800x600 和 splash-file-two.rpm 为 7" display resolution@800x480 构建了两个启动包 splash-file-one.rpm ,有没有根据找到的连接显示分辨率在目标上选择和加载这两个包运行时之一的方法[运行时包管理],或者只是手动安装&应该在下次启动时反映?
【解决方案2】:

正如Charles C. 提到的,一种方法是覆盖psplash-raspberrypi-img.h

然后我尝试像这样覆盖我的 local.conf 中的 SPLASH 配置变量:
# Set the Custom Splash screen
SPLASH = "psplash-me"
但无论我做什么,它总是呈现默认的树莓派。

理论上只要设置就足够了 psplash_%.bbappend:

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

SPLASH_IMAGES_append = " file://foo-img.png;outsuffix=bar"

conf/local.conf:

SPLASH = " psplash-bar"

就像it is done in meta-raspberry 一样,但似乎meta-raspberry is setting SPLASH inside image definition 类会覆盖local.conf 的值

此时值得看看它是如何评估的:

bitbake -e core-image-base | less

然后搜索^SPLASH,你会发现它的最终值为psplash-raspberrypi

解决方案

这就是我设法使它工作的方法:

psplash_%.bbappend:

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

SPLASH_IMAGES_append = " file://foo-img.png;outsuffix=bar"
ALTERNATIVE_PRIORITY_psplash-bar[psplash] = "200"

conf/local.conf:

PACKAGE_INSTALL_append = " psplash-bar"

这里发生了什么:

SPLASH_IMAGES_append = " file://foo-img.png;outsuffix=bar"
这将产生包psplash-bar。您可以提供.png,它将被转换为适当的头文件,但您也可以提供原始头文件。 psplash 收据会推断出来。

PACKAGE_INSTALL_append = " psplash-bar"
这将告诉 bitbake 将其安装在 rootfs 上,(如果 SPLASH 没有被覆盖,那么它将被评估 here

此时构建镜像后psplash-bar 将安装在rootfs 上,但psplash 不会链接到它:

ls -lh /usr/bin/psplash*
lrwxrwxrwx psplash -> /usr/bin/psplash-raspberrypi
-rwxr-xr-x psplash-raspberrypi
-rwxr-xr-x psplash-systemd
-rwxr-xr-x psplash-bar
-rwxr-xr-x psplash-write

这样:
ALTERNATIVE_PRIORITY_psplash-bar[psplash] = "200"
我们将告诉bibtake 使用psplash-bar 作为优先级为200 的替代包(提供者?)。

ls -lh /usr/bin/psplash*
lrwxrwxrwx psplash -> /usr/bin/psplash-bar
-rwxr-xr-x psplash-raspberrypi
-rwxr-xr-x psplash-systemd
-rwxr-xr-x psplash-bar
-rwxr-xr-x psplash-write

【讨论】:

  • 关注了这个答案,但运行ls -lh /usr/bin/psplash* 只给我:psplash -> /usr/bin/psplash-raspberrypi psplash-raspberrypi psplash-write 任何提示或想法?我使用build/conf/local.confmeta-my\recipes-my\my\psplash_%.bbappend 是否正确?
  • 据我了解,您根本无法在文件系统上看到您的 psplash。看起来SPLASH_IMAGES_append 没有生效,因为它应该触发自定义启动构建。您可以将一些日志记录添加到 psplash_%.bbappend 以查看它是否被正确解析/加载。总是值得通过 bitbake -e ... 输出来获取您的初始名称等
猜你喜欢
  • 2019-03-28
  • 1970-01-01
  • 2018-11-01
  • 2023-03-21
  • 2023-04-08
  • 2017-07-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多