Bitbake - 工具bitbake-layers介绍

在OpenEmbedded的发布套件中,使用bitbake-layers命令可以显示出现有的layers和priority:

$ bitbake-layers show-layers

layer                 path                                      priority

==========================================================================

meta                  /local/openstlinux-18-01-23/layers/openembedded-core/meta  5

meta-oe               /local/openstlinux-18-01-23/layers/meta-openembedded/meta-oe  6

这个bitbake-layers工具位于openembedded-core这个layer中,用来进行与layers相关的操作。

比如可以执行下列操作:

  • 查看当前配置中的layers列表

  • 将一个已存在的layer加入到现有配置中

  • 创建一个新layer

此工具的help信息:

$ bitbake-layers --help

NOTE: Starting bitbake server...

usage: bitbake-layers [-d] [-q] [-F] [--color COLOR] [-h] <subcommand> ...

BitBake layers utility

optional arguments:

  -d, --debug           Enable debug output

  -q, --quiet           Print only errors

  -F, --force           Force add without recipe parse verification

  --color COLOR         Colorize output (where COLOR is auto, always, never)

  -h, --help            show this help message and exit

subcommands:

  <subcommand>

    show-layers         show current configured layers.

    show-overlayed      list overlayed recipes (where the same recipe exists in another layer)

    show-recipes        list available recipes, showing the layer they are provided by

    show-appends        list bbappend files and recipe files they apply to

    show-cross-depends  Show dependencies between recipes that cross layer boundaries.

    layerindex-fetch    Fetches a layer from a layer index along with its dependent layers, and adds them to conf/bblayers.conf.

    layerindex-show-depends

                        Find layer dependencies from layer index.

    add-layer           Add one or more layers to bblayers.conf.

    remove-layer        Remove one or more layers from bblayers.conf.

    flatten             flatten layer configuration into a separate output directory.

    create-layer        Create a basic layer

Use bitbake-layers <subcommand> --help to get help on a specific command

创建新layer后的建议操作:

  • 更新README文件

  • 更新conf/layer.conf文件中一些配置项,比如priority优先级

  • 针对你的发布需要进行修改或添加组件

创建一个新layer:

要创建的话,需要指定新layer的位置,名字,而layer的priority设置是可选的。

举例,以priority 7创建一个layer:

$ bitbake-layers create-layer --priority 7 ../layers/meta-st/meta-my-custo-layer

NOTE: Starting bitbake server...

Add your new layer with 'bitbake-layers add-layer ../layers/meta-st/meta-my-custo-layer'

$ cd ../layers/meta-st

$ tree meta-my-custo-layer

meta-my-custo-layer

├── conf

│   └── layer.conf

├── COPYING.MIT

├── README

└── recipes-example

    └── example

        └── example.bb

3 directories, 4 files

添加完成,可以使用show-layers来查看添加是否成功。

其他使用方式:

1,删除一个layer,使用remove-layer。

2,添加一个已有layer,使用add-layer。

3,查看当前配置中的recipes:show-recipes

列出所有的targets/recipes(.bb files):

$ bitbake-layers show-recipes

列出符合筛选条件的recipes:

$ bitbake-layers show-recipes "*libc*"

参考:

1,How to create a new open embedded layer - stm32mpu

猜你喜欢

转载自blog.csdn.net/guoqx/article/details/130377912