0

我已经使用此处的说明成功构建了一个树莓派 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 初始屏幕?谢谢。

4

2 回答 2

3

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

以下是有关如何获取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:启用在启动过程中显示启动屏幕。默认情况下,此屏幕由 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
于 2017-08-21T23:20:48.633 回答
1

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

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

从理论上讲,只需设置就足够了 psplash_%.bbappend

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

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

conf/local.conf

SPLASH = " psplash-bar"

就像在其中完成的那样,meta-raspberry但似乎meta-raspberry SPLASH在图像定义类中设置,并且会覆盖您的值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"
这将产生 package psplash-bar。您可以提供.png并将其转换为适当的头文件,但您也可以提供原始头文件。psplash 收据会推断出来。

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

此时构建后的映像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
于 2020-09-03T22:43:37.260 回答