bitbake

bitbake

参考连接:

Yocto Project Reference Manual

简单整理如下:

和bitbake相关的命令如下:

bitbake bitbake-hashclient bitbake-prserv bitbake-server
bitbake-diffsigs bitbake-hashserv bitbake-prserv-tool bitbake-whatchanged
bitbake-dumpsig bitbake-layers bitbake-selftest bitbake-worker

这写命令都是python脚本实现。

[penghu4x@bmcdev-S2600WF0bmcweb$ bitbake
bitbake              bitbake-hashclient   bitbake-prserv       bitbake-server
bitbake-diffsigs     bitbake-hashserv     bitbake-prserv-tool  bitbake-whatchanged
bitbake-dumpsig      bitbake-layers       bitbake-selftest     bitbake-worker
[penghu4x@bmcdev-S2600WF0dsg-openbmc-openbmc$ ls bitbake -alh
lrwxrwxrwx 1 penghu4x penghu4x 13  46 21:20 bitbake -> poky/bitbake/
[penghu4x@bmcdev-S2600WF0dsg-openbmc-openbmc$ cd poky/bitbake/
[penghu4x@bmcdev-S2600WF0bitbake$ ls
AUTHORS  bin  ChangeLog  contrib  doc  lib  LICENSE  LICENSE.GPL-2.0-only  LICENSE.MIT  README  toaster-requirements.txt
[penghu4x@bmcdev-S2600WF0bitbake$ ls bin/ -alh
total 92K
drwxrwxr-x 2 penghu4x penghu4x 4.0K  46 21:20 .
drwxrwxr-x 6 penghu4x penghu4x 4.0K  46 21:20 ..
-rwxrwxr-x 1 penghu4x penghu4x 1.4K  46 21:20 bitbake
-rwxrwxr-x 1 penghu4x penghu4x 7.6K  46 21:20 bitbake-diffsigs
lrwxrwxrwx 1 penghu4x penghu4x   16  46 21:20 bitbake-dumpsig -> bitbake-diffsigs
-rwxrwxr-x 1 penghu4x penghu4x 5.3K  46 21:20 bitbake-hashclient
-rwxrwxr-x 1 penghu4x penghu4x 2.3K  46 21:20 bitbake-hashserv
-rwxrwxr-x 1 penghu4x penghu4x 3.5K  46 21:20 bitbake-layers
-rwxrwxr-x 1 penghu4x penghu4x 2.2K  46 21:20 bitbake-prserv
-rwxrwxr-x 1 penghu4x penghu4x 1.9K  46 21:20 bitbake-selftest
-rwxrwxr-x 1 penghu4x penghu4x 1.7K  46 21:20 bitbake-server
-rwxrwxr-x 1 penghu4x penghu4x  19K  46 21:20 bitbake-worker
-rwxrwxr-x 1 penghu4x penghu4x 5.8K  46 21:20 git-make-shallow
-rwxrwxr-x 1 penghu4x penghu4x 9.0K  46 21:20 toaster
-rwxrwxr-x 1 penghu4x penghu4x 3.5K  46 21:20 toaster-eventreplay
[penghu4x@bmcdev-S2600WF0bin$ file bitbake*
bitbake:            Python script, ASCII text executable
bitbake-diffsigs:   Python script, ASCII text executable
bitbake-dumpsig:    symbolic link to bitbake-diffsigs
bitbake-hashclient: Python script, ASCII text executable
bitbake-hashserv:   Python script, ASCII text executable
bitbake-layers:     Python script, ASCII text executable
bitbake-prserv:     Python script, ASCII text executable
bitbake-selftest:   Python script, ASCII text executable
bitbake-server:     Python script, ASCII text executable
bitbake-worker:     Python script, ASCII text executable

1.1 bitbake-layers

查看layers和recipes相关的东西。

[penghu4x@bmcdev-S2600WF0bitbake$ bitbake-layers -h
NOTE: Starting bitbake server...
WARNING: Duplicate inclusion for /media/disk3/penghu4x/work/EGS/dsg-openbmc-openbmc/meta/conf/distro/include/security_flags.inc in /media/disk3/penghu4x/work/EGS/dsg-openbmc-openbmc/meta-phosphor/conf/distro/include/phosphor-defaults.inc
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.
    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.
    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.
    create-layer        Create a basic layer

Use bitbake-layers <subcommand> --help to get help on a specific command
[penghu4x@bmcdev-S2600WF0bitbake$ bitbake-layers show-recipes | grep gdb
cgdb:
gdb:
gdb-cross-arm:
gdb-cross-canadian-arm:
gdbm:
wireless-regdb:
[penghu4x@bmcdev-S2600WF0bitbake$

[penghu4x@bmcdev-S2600WF0bmcweb$ bitbake-layers show-cross-depends -h
NOTE: Starting bitbake server...
WARNING: Duplicate inclusion for /media/disk3/penghu4x/work/EGS/dsg-openbmc-openbmc/meta/conf/distro/include/security_flags.inc in /media/disk3/penghu4x/work/EGS/dsg                  -openbmc-openbmc/meta-phosphor/conf/distro/include/phosphor-defaults.inc
usage: bitbake-layers show-cross-depends [-h] [-f] [-i LAYERNAME]

Figure out the dependencies between recipes that cross layer boundaries.

NOTE: .bbappend files can impact the dependencies.

optional arguments:
  -h, --help            show this help message and exit
  -f, --filenames       show full file path
  -i LAYERNAME, --ignore LAYERNAME
                        ignore dependencies on items in the specified layer(s) (split multiple layer names with commas, no spaces)
[penghu4x@bmcdev-S2600WF0bmcweb$ bitbake-layers show-cross-depends | grep gdb
meta-networking/recipes-support/openipmi/openipmi_2.0.31.bb DEPENDS meta/recipes-support/gdbm/gdbm_1.19.bb
meta-networking/recipes-connectivity/crda/crda_3.18.bb RDEPENDS meta/recipes-kernel/wireless-regdb/wireless-regdb_2020.11.20.bb
meta-oe/recipes-support/satyr/satyr_0.36.bb DEPENDS meta/recipes-devtools/gdb/gdb_10.1.bb
meta-oe/recipes-shells/zsh/zsh_5.4.2.bb DEPENDS meta/recipes-support/gdbm/gdbm_1.19.bb
meta-oe/recipes-devtools/cgdb/cgdb_0.7.1.bb DEPENDS meta/recipes-devtools/autoconf/autoconf_2.71.bb
...

1.2 bitbake-diffsigs

比较签名

[penghu4x@bmcdev-S2600WF0bin$ bitbake-diffsigs -h
usage: bitbake-diffsigs [-h] [-D] [-c color] [-d] [-t recipename taskname] [-s fromsig tosig] [sigdatafile1] [sigdatafile2]

Compares siginfo/sigdata files written out by BitBake

positional arguments:
  sigdatafile1          First signature file to compare (or signature file to dump, if second not specified). Not used when using -t/--task.
  sigdatafile2          Second signature file to compare

optional arguments:
  -h, --help            show this help message and exit
  -D, --debug           Enable debug output
  -c color, --color color
                        Colorize the output (where color is auto, always, never)
  -d, --dump            Dump the last signature data instead of comparing (equivalent to using bitbake-dumpsig)
  -t recipename taskname, --task recipename taskname
                        find the signature data files for the last two runs of the specified task and compare them
  -s fromsig tosig, --signature fromsig tosig
                        With -t/--task, specify the signatures to look for instead of taking the last two

1.3 bitbake-dumpsig

[penghu4x@bmcdev-S2600WF0dsg-openbmc-openbmc$ bitbake-dumpsig -h
usage: bitbake-dumpsig [-h] [-D] [-t recipename taskname] [sigdatafile]

Dumps siginfo/sigdata files written out by BitBake

positional arguments:
  sigdatafile           Signature file to dump. Not used when using -t/--task.

optional arguments:
  -h, --help            show this help message and exit
  -D, --debug           Enable debug output
  -t recipename taskname, --task recipename taskname
                        find the signature data file for the last run of the specified task

[penghu4x@bmcdev-S2600WF0build$ bitbake-dumpsig tmp/stamps/armv7ahf-vfpv4d16-openbmc-linux-gnueabi/license-manager/1.0+git999-r0.do_compile.sigdata.f7a2ae1cde441975057d83cab5189c0350e00bd3f35ff54c70b40c6a7d48e2d9

注意sigdata存放路径:${BUILDDIR}/tmp/stamps/armv7ahf-vfpv4d16-openbmc-linux-gnueabi/

1.4 bitbake-server & bitbake-worker & bitbake-prserv & bitbake-prserv-tool

[penghu4x@bmcdev-S2600WF0build$ bitbake-server -h
bitbake-server is meant for internal execution by bitbake itself, please don't use it standalone.
[penghu4x@bmcdev-S2600WF0build$ bitbake-worker -h
bitbake-worker is meant for internal execution by bitbake itself, please don't use it standalone.
[penghu4x@bmcdev-S2600WF0build$ bitbake-prserv -h
Usage: bitbake-prserv < --start | --stop > [options]

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -f DBFILE, --file=DBFILE
                        database filename(default: prserv.sqlite3)
  -l LOGFILE, --log=LOGFILE
                        log filename(default: prserv.log)
  --loglevel=LOGLEVEL   logging level, i.e. CRITICAL, ERROR, WARNING, INFO,
                        DEBUG
  --start               start daemon
  --stop                stop daemon
  --host=HOST           ip address to bind
  --port=PORT           port number(default: 8585)
[penghu4x@bmcdev-S2600WF0build$ bitbake-prserv-tool -h
ERROR: must end with .conf or .inc!

1.5 bitbake-hashserv & bitbake-hashclient

[penghu4x@bmcdev-S2600WF0dsg-openbmc-openbmc$ bitbake-hashserv -h
usage: bitbake-hashserv [-h] [-b BIND] [-d DATABASE] [-l LOG] [-u UPSTREAM] [-r]

Hash Equivalence Reference Server. Version=1.0.0

optional arguments:
  -h, --help            show this help message and exit
  -b BIND, --bind BIND  Bind address (default "unix://./hashserve.sock")
  -d DATABASE, --database DATABASE
                        Database file (default "./hashserv.db")
  -l LOG, --log LOG     Set logging level
  -u UPSTREAM, --upstream UPSTREAM
                        Upstream hashserv to pull hashes from
  -r, --read-only       Disallow write operations from clients

The bind address is the path to a unix domain socket if it is prefixed with "unix://". Otherwise, it is an IP address and port in form ADDRESS:PORT. To bind to all addresses, leave
the ADDRESS empty, e.g. "--bind :8686". To bind to a specific IPv6 address, enclose the address in "[]", e.g. "--bind [::1]:8686"
[penghu4x@bmcdev-S2600WF0dsg-openbmc-openbmc$
[penghu4x@bmcdev-S2600WF0dsg-openbmc-openbmc$ bitbake-hashclient -h
usage: bitbake-hashclient [-h] [--address ADDRESS] [--log LOG] {stats,stress} ...

Hash Equivalence Client

positional arguments:
  {stats,stress}
    stats            Show server stats
    stress           Run stress test

optional arguments:
  -h, --help         show this help message and exit
  --address ADDRESS  Server address (default "unix://./hashserve.sock")
  --log LOG          Set logging level

1.6 bitbake-whatchanged

[penghu4x@bmcdev-S2600WF0dsg-openbmc-openbmc$ bitbake-whatchanged -h
usage: bitbake-whatchanged [options] [package ...]
print what will be done between the current and last builds, for example:

    $ bitbake core-image-sato
    # Edit the recipes
    $ bitbake-whatchanged core-image-sato

The changes will be printed"

Note:
    The amount of tasks is not accurate when the task is "do_build" since
    it usually depends on other tasks.
    The "nostamp" task is not included.

arguments:
  recipe         recipe to check

options:
  -h, --help     show this help message and exit
  -v, --verbose  print the verbose changes
[penghu4x@bmcdev-S2600WF0dsg-openbmc-openbmc$ bitbake-whatchanged license-manager
Figuring out the STAMPS_DIR ...
Generating the new stamps ... (need several minutes)
=== Newly added tasks: (39 tasks)
  os-release: do_package do_prepare_recipe_sysroot do_install do_packagedata do_configure do_package_write_rpm do_compile
  phosphor-dbus-interfaces: do_write_config do_packagedata do_configure do_fetch do_package do_package_write_rpm do_unpack do_prepare_recipe_sysroot do_compile do_populate_sysroot do_install
  phosphor-software-manager: do_fetch do_package_write_rpm do_packagedata do_install do_prepare_recipe_sysroot do_compile do_package do_unpack do_configure
  license-manager: do_package_write_rpm do_prepare_recipe_sysroot do_install do_configure do_package do_packagedata do_populate_lic do_generate_toolchain_file do_build do_populate_sysroot do_compile do_package_qa

=== Summary: (39 changed, 3 unchanged)
Newly added: 39
PV changed: 0
PR changed: 0
Dependencies changed: 0

Removing the newly generated stamps dir ...

1.7 bitbake-selftest

[penghu4x@bmcdev-S2600WF0dsg-openbmc-openbmc$ bitbake-selftest -h
usage: bitbake-selftest [-h] [-v] [-q] [--locals] [-f] [-c] [-k TESTNAMEPATTERNS] [tests [tests ...]]

positional arguments:
  tests                a list of any number of test modules, classes and test methods.

optional arguments:
  -h, --help           show this help message and exit
  -v, --verbose        Verbose output
  -q, --quiet          Quiet output
  --locals             Show local variables in tracebacks
  -f, --failfast       Stop on first fail or error
  -c, --catch          Catch Ctrl-C and display results so far
  -k TESTNAMEPATTERNS  Only run tests which match the given substring

Examples:
  bitbake-selftest                           - run default set of tests
  bitbake-selftest MyTestSuite               - run suite 'MyTestSuite'
  bitbake-selftest MyTestCase.testSomething  - run MyTestCase.testSomething
  bitbake-selftest MyTestCase                - run all 'test*' test methods
                                       in MyTestCase

Environment variables:
  BB_SKIP_NETTESTS      set to 'yes' in order to skip tests using network
                        connection
  BB_TMPDIR_NOCLEAN     set to 'yes' to preserve test tmp directories

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
bitbake是OpenEmbedded构建系统的引擎,用于构建嵌入式Linux系统。它通过解析一系列配置文件(主要为recipes,即.bb和.bbappend文件)来创建任务列表,并根据依赖关系依次执行。下面是bitbake的执行流程: 1. 源码获取及处理阶段:bitbake首先会根据配置文件中指定的源码仓库地址,从远程仓库或本地仓库中获取源码。然后,它会根据配置文件中的指令对源码进行处理,例如解压、打补丁等。 2. 配置阶段:在这个阶段,bitbake会根据配置文件中的指令对源码进行配置。它会根据不同的目标平台和编译选项生成相应的配置文件。 3. 编译阶段:在这个阶段,bitbake会根据任务列表逐个执行编译任务。每个任务对应一个recipe文件,其中包含了编译的具体指令和依赖关系。bitbake会根据依赖关系自动解析任务的执行顺序,并执行相应的编译指令。 4. 打包阶段:在编译完成后,bitbake会根据配置文件中的指令对编译结果进行打包。它会将编译生成的二进制文件、库文件、配置文件等打包成一个完整的映像文件或软件包。 5. 清理阶段:在需要清理编译结果时,可以使用bitbake的清理指令。例如,使用"bitbake -c clean -v u-boot"可以清理u-boot的编译结果;使用"bitbake -c cleanall xx-image"可以清理整个映像的编译中间结果;使用"bitbake -c cleansstate xx-image"可以清理映像的编译状态。 总结起来,bitbake的执行流程包括源码获取及处理、配置、编译、打包和清理等阶段,通过解析配置文件和依赖关系来自动化构建嵌入式Linux系统。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值