代码之家  ›  专栏  ›  技术社区  ›  md.jamal

通过元层覆盖yocto类

  •  2
  • md.jamal  · 技术社区  · 6 年前

    谢谢你的时间和支持

    我计划使用swupdate进行更新。所以,我需要创建一个额外的分区来存储恢复分区。

    poky/meta/classes/image-live.bbclass
    

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

    如何在自己的bsp层中重写这个类,我不想接触到错误的源代码。

    3 回复  |  直到 6 年前
        1
  •  7
  •   Sebastián lukaszgard    5 年前

    一般在 约克托 无法覆盖 BB类 文件,如 .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
    

    内容 示例.bb 食谱

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

    最后 非常重要的事情* ,配置文件 CONF/BBLAYE.S.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)
    

    *我不知道为什么要烤面包 layer priority 在这里不起作用,只修改层顺序 CONF/BBLAYE.S.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
    

    元测试/ 在下面 元/ 在里面 CONF/BBLAYE.S.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)
    
        2
  •  1
  •   WinoTu    6 年前

    2012年在Yocto邮件组讨论: https://lists.yoctoproject.org/pipermail/yocto/2012-January/004379.html

    只创建与astor555相同的类并重新排序层。您的bsp层将首先被解析/使用。

        3
  •  0
  •   User3219    6 年前

    另一种选择是复制原始的 image-live.bbclass 进入自己现有的层并将其重命名为有意义的东西( my-image-live.bbclass )然后在你需要的地方继承它 inherit my-image-live

    推荐文章