bitbake

概念

Recipes
后缀名为.bb

Configuration Files
后缀名为.conf

Classes
后缀名为.bbclass
bitbake现在处理一种class叫base.bbclass,存在于classes目录。base.bbclass比较特殊,因为他自动被所有的recipes和classed包括了,这个class定义了标准的基本task,比如fetching, unpacking, configuring(empty by default), compiling(runs any Makefile present), installing(empty default) and packaging(empty by default). 这些任务通常都被在项目开发过程中的其他class覆盖或者扩展

Layers

Append Files
后缀名为.bbappend


bitbake Command

$ bitbake -h
     Usage: bitbake [options] [recipename/target ...]

         Executes the specified task (default is 'build') for a given set of target recipes (.bb files).
         It is assumed there is a conf/bblayers.conf available in cwd or in BBPATH which
         will provide the layer, BBFILES and other configuration information.

     Options:
       --version             show program's version number and exit
       -h, --help            show this help message and exit
       -b BUILDFILE, --buildfile=BUILDFILE
                             Execute tasks from a specific .bb recipe directly.
                             WARNING: Does not handle any dependencies from other
                             recipes.
       -k, --continue        Continue as much as possible after an error. While the
                             target that failed and anything depending on it cannot
                             be built, as much as possible will be built before
                             stopping.
       -a, --tryaltconfigs   Continue with builds by trying to use alternative
                             providers where possible.
       -f, --force           Force the specified targets/task to run (invalidating
                             any existing stamp file).
       -c CMD, --cmd=CMD     Specify the task to execute. The exact options
                             available depend on the metadata. Some examples might
                             be 'compile' or 'populate_sysroot' or 'listtasks' may
                             give a list of the tasks available.
       -C INVALIDATE_STAMP, --clear-stamp=INVALIDATE_STAMP
                             Invalidate the stamp for the specified task such as
                             'compile' and then run the default task for the
                             specified target(s).
       -r PREFILE, --read=PREFILE
                             Read the specified file before bitbake.conf.
       -R POSTFILE, --postread=POSTFILE
                             Read the specified file after bitbake.conf.
       -v, --verbose         Output more log message data to the terminal.
       -D, --debug           Increase the debug level. You can specify this more
                             than once.
       -n, --dry-run         Don't execute, just go through the motions.
       -S DUMP_SIGNATURES, --dump-signatures=DUMP_SIGNATURES
                             Dump out the signature construction information, with
                             no task execution. Parameters are passed to the
                             signature handling code, use 'none' if no specific
                             handler is required.
       -p, --parse-only      Quit after parsing the BB recipes.
       -s, --show-versions   Show current and preferred versions of all recipes.
       -e, --environment     Show the global or per-package environment complete
                             with information about where variables were
                             set/changed.
       -g, --graphviz        Save dependency tree information for the specified
                             targets in the dot syntax.
       -I EXTRA_ASSUME_PROVIDED, --ignore-deps=EXTRA_ASSUME_PROVIDED
                             Assume these dependencies don't exist and are already
                             provided (equivalent to ASSUME_PROVIDED). Useful to
                             make dependency graphs more appealing
       -l DEBUG_DOMAINS, --log-domains=DEBUG_DOMAINS
                             Show debug logging for the specified logging domains
       -P, --profile         Profile the command and save reports.
       -u UI, --ui=UI        The user interface to use (e.g. knotty, hob, depexp).
       -t SERVERTYPE, --servertype=SERVERTYPE
                             Choose which server to use, process or xmlrpc.
       --revisions-changed   Set the exit code depending on whether upstream
                             floating revisions have changed or not.
       --server-only         Run bitbake without a UI, only starting a server
                             (cooker) process.
       -B BIND, --bind=BIND  The name/address for the bitbake server to bind to.
       --no-setscene         Do not run any setscene tasks. sstate will be ignored
                             and everything needed, built.
       --remote-server=REMOTE_SERVER
                             Connect to the specified server.
       -m, --kill-server     Terminate the remote server.
       --observe-only        Connect to a server as an observing-only client.
       --status-only         Check the status of the remote bitbake server.

bitbake在tmp目录下生成的目录

cache: bitbake内部使用的缓存目录
work: 所有软件包的解包、打补丁、配置、编译、安装等工作都是在work目录进行的。所以work目录包含了整个嵌入式系统的完整源代码。work目录下按照硬件平台、发行人、目标平台的不同又分了几个子目录。所有软件包都被放在对应子目录中。每个软件包都有一个独立的目录。因为软件包总是 根据一个配方(recipes)文件构建的,所以软件包所在的目录就是对应配方(recipes)文件的工作目录。
deploy: 这是保存输出成果的目录。其中images目录保存构建成功后产生的文件系统映像、内核映像。
stamp: 和work目录类似,stamps目录也按照硬件平台、发行人、目标平台的不同又分了几个子目录。软件包在完成每个bitbake任务后都会在对应子目录里touch一个对应任务的时间戳。有时我们会手工删除某个软件包的时间戳,强制bitbake重新构建这个软件包。


参考文章

  1. BitBake User Manual
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

luckywang1103

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值