通过元层覆盖Yocto类 [英] Overwriting Yocto Classes through meta-layer

查看:83
本文介绍了通过元层覆盖Yocto类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

感谢您的时间和支持

我计划使用swupdate进行更新.因此,我需要创建一个额外的分区,其中需要存储恢复分区.

I am planning to use swupdate for updates. So, I need to create an additional partition in which I need to store the recovery partition.

poky/meta/classes/image-live.bbclass

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

is the class which creates partitions and flashes the root file system. I have updated the above file to create one more partition and store the swupdate root filesystem.

如何在我自己的BSP层中重写该类,我不想触碰一些拙劣的源代码.

How can I override this class in my own BSP layer, I don't want to touch poky source code..

推荐答案

通常在 Yocto 中,无法像 .bb那样覆盖 .bbclass 文件. 文件(使用 .bbappend ),以存档复制整个类文件并移至另一层所需的文件,我能够使用以下配置进行管理:

Generally in Yocto there is no way to override .bbclass files like with .bb files (using .bbappend), to archive that it is needed to copy whole class file and move to another layer, I was able to manage that with this configuration:

层结构:

$ tree ../meta-test/
../meta-test/
├── classes
│   └── image-live.bbclass
├── conf
│   └── layer.conf
├── COPYING.MIT
├── README
└── recipes-example
    └── example.bb

3 directories, 5 files

example.bb 食谱的

内容:

content of example.bb recipe:

$ cat ../meta-test/recipes-example/example/example.bb 
LICENSE = "CLOSED"
inherit image-live

最后是真正重要的事情* ,需要按以下顺序配置配置文件 conf/bblayers.conf meta/层上方:

and finally really important thing*, the configuration file conf/bblayers.conf needs to be configured with this order meta-test/ above meta/ layer:

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

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

*I don't know why bitbake layer priority doesn't work here, only modifying layers order in conf/bblayers.conf allows me to achieve the main goal:

$ 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

conf/bblayers.conf 中的 meta/下面的

meta-test/层:

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

这篇关于通过元层覆盖Yocto类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆