Yocto Raspberry Pi改变psplash图像

时间:2017-08-21 01:48:34

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

我已经使用这里的说明成功构建了一个覆盆子pi Yocto图像:http://www.jumpnowtek.com/rpi/Raspberry-Pi-Systems-with-Yocto.html。当系统启动时,我会看到带有加载栏的Raspberry Pi的默认psplash启动画面。

meta-raspberrypi图层有一个psplash bbappend配方文件,用于定义系统启动时看到的覆盆子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文件假装带有匹配的后缀raspberry pi的图像。

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 - 尝试使用我自己的图像覆盖用于覆盆子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.

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

我可以通过将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启动画面?感谢。

2 个答案:

答案 0 :(得分:1)

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

以下是有关如何获取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" 密钥的文件的映射。

+# 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-包(即psplash-one和psplash-two)。

  

splash:启用时显示启动画面。默认情况下,这个   屏幕由psplash提供,它允许自定义。如果你   喜欢使用另一种闪屏包,你可以这样做   将SPLASH变量设置为不同的包名称(或名称)   在图像配方或发行版配置级别。

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

{{1}}

答案 1 :(得分:1)

Charles 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"

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 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