Yocto Raspberry Pi 更改 psplash 图像

Yocto Raspberry Pi Change psplash image

我已经使用此处的说明成功构建了 raspberry pi 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 文件假装具有 [=44= 匹配输出后缀的图像].

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,内容如下 - 试图用我自己的图像覆盖用于 raspberry pi 初始屏幕的图像:

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"

但无论我做什么,它总是呈现默认的 Raspberry Pi 一个。

如何用我自己的图片覆盖默认的 psplash 启动画面?谢谢。

文件名应符合格式 psplash-%s,其中 %sraspberrypi,因此最快的方法是将 social.jpg-img.h 更改为 psplash-raspberrypi-img.h并在原来的树莓派上覆盖它 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: Enables showing a splash screen during boot. By default, this screen is provided by psplash, which does allow customization. If you prefer to use an alternative splash screen package, you can do so by setting the SPLASH variable to a different package name (or names) within the image recipe or at the distro configuration level.

raspberrypi 没有使用默认值,而是提供了在机器配置中选择启动图像的替代方法; link 提供了更多信息 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

所述,一种方法是覆盖psplash-raspberrypi-img.h

And then I try to override the SPLASH configuration variable in my local.conf like this:
# Set the Custom Splash screen
SPLASH = "psplash-me"
But no matter what I seem to do, it always renders the default Raspberry Pi one.

理论上设置一下就够了 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 but it seems that meta-raspberry is setting SPLASH inside image definition class 一样,这会覆盖 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 receipe 会推断出来。

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