通过元层覆盖Yocto类

md.*_*mal 2 linux bsp embedded-linux yocto

感谢您的时间和支持

我打算使用swupdate进行更新.所以,我需要创建一个额外的分区,我需要在其中存储恢复分区.

poky/meta/classes/image-live.bbclass
Run Code Online (Sandbox Code Playgroud)

是创建分区并闪烁根文件系统的类.我已经更新了上面的文件以创建另一个分区并存储swupdate根文件系统.

如何在我自己的BSP层中覆盖此类,我不想触及poky源代码..

luk*_*ard 7

通常在Yocto中,没有办法覆盖.bbclass文件,如.bb文件(使用.bbappend),归档需要复制整个类文件并移动到另一层,我能够通过此配置管理它:

层结构:

$ tree ../meta-test/
../meta-test/
??? classes
?   ??? image-live.bbclass
??? conf
?   ??? layer.conf
??? COPYING.MIT
??? README
??? recipes-example
    ??? example.bb

3 directories, 5 files
Run Code Online (Sandbox Code Playgroud)

example.bb配方的内容:

$ cat ../meta-test/recipes-example/example/example.bb 
LICENSE = "CLOSED"
inherit image-live
Run Code Online (Sandbox Code Playgroud)

最后非常重要*,配置文件conf/bblayers.conf需要使用此订单元测试/上面的元/层配置:

$ tail -n6 conf/bblayers.conf 
BBLAYERS ?= " \
  /home/user/poky/meta-test \
  /home/user/poky/meta \
  /home/user/poky/meta-poky \
  /home/user/poky/meta-yocto-bsp \
  "

$ bitbake -e example -D | grep ^DEBUG:\\sInheriting\\s.*image-live.bbclass\\s\(from
DEBUG: Inheriting /home/user/poky/meta-test/classes/image-live.bbclass (from /home/user/poky/meta-test/recipes-example/example/example.bb:3)
Run Code Online (Sandbox Code Playgroud)

*我不知道为什么bitbake 图层优先级在这里不起作用,只有修改conf/bblayers.conf中的排序层才能实现主要目标:

$ bitbake-layers show-layers
NOTE: Starting bitbake server...
layer                 path                                      priority
==========================================================================
meta                  /home/user/poky/meta        5
meta-test             /home/user/poky/meta-test   10
meta-poky             /home/user/poky/meta-poky   5
meta-yocto-bsp        /home/user/poky/meta-yocto-bsp  5
Run Code Online (Sandbox Code Playgroud)

layer meta-test /下面的meta /conf/bblayers.conf中:

$ tail -n6 conf/bblayers.conf 
BBLAYERS ?= " \
  /home/user/poky/meta \
  /home/user/poky/meta-test \
  /home/user/poky/meta-poky \
  /home/user/poky/meta-yocto-bsp \
  "    

$ bitbake -e example -D | grep ^DEBUG:\\sInheriting\\s.*image-live.bbclass\\s\(from
DEBUG: Inheriting /home/user/poky/meta/classes/image-live.bbclass (from /home/user/poky/meta-test/recipes-example/example/example.bb:3)
Run Code Online (Sandbox Code Playgroud)