Bitbake备忘录

命令行选项

以下是一些常用的命令行选项。

OptionMeaning
-c <task>execute <task> for the image or recipe being built. ex: bitbake -c fetch busybox.

Some of the possible tasks are: fetch, configure, compile, package, clean

-fforce execution of the operation, even if not required
-vshow verbose output
-DDDshow lots of debug information
-sshow recipe version information
--helpget usage help
-c listtasks <image-or-recipe-name>show the tasks associated with an image or individual recipe
-g <recipe>output dependency tree in graphviz format
用户界面
Bitbake可以与几个不同的用户界面一起使用。 以下是一些选项:

User interfaceTypeNOTES
bitbake <recipe-or-image> or
"bitbake -u knotty <recipe-or-image>"
scrolling text interfaceThis is the default user interface
bitbake -u ncurses <recipe-or-image>text-window based interfaceI couldn't figure out how to control or exit this interface
bitbake -u hobgraphical interfaceThis is a full graphical interface which includes selecting machine, distro, etc. and performing a build
bitbake -u goggle <recipe-or-image>simple graphical interfaceThis is a simple graphical wrapper over the streaming text output of bitbake. It's nice in that it shows collapsible trees for the logs for sub-tasks for each recipe.
.bb文件语法
该表列出了在配方(.bb)文件中找到的一些语法。

SyntaxMeaningNOTES
VAR = "foo"simple assignment 
VAR ?= "foo"assign if no other value is already assigned (default assignment) 
VAR ??=fooweak default assignmenttakes lower precedence than ?=
VAR = "stuff ${OTHER_VAR} more"variable expansionOTHER_VAR expanded at time of reference to VAR
VAR := "stuff ${OTHER_VAR} more"immediate variable expansionOTHER_VAR expanded at time of parsing this line
VAR += "foo"append with space 
VAR =+ "foo"prepend with space 
VAR .= "foo"append without space 
VAR =. "foo"prepend without space 
VAR_append = "foo"append without space 
OVERRIDES="string1:string2"

VAR = "foo"
VAR_string1 = "bar"

alternate/override valueif string1 is listed in OVERRIDES, use "bar" for value of VAR, otherwise use "foo"
OVERRIDES="string1:string2"

VAR = "foo"
VAR_append_string1 = " bar"

conditional appendif string1 is in OVERRIDES, then append " bar" to the value of VAR
BBVERSIONS="1.0 1.8 string"

VAR="foo"
VAR_string="bar"

range-specific conditionalIf the version of the package is in the specified range (1.0-1.8 in this example), then perform an override on the indicated variable
VAR = "foo ${@<line-of-python-code>}"python code expansionex: VAR = "the date is: ${@time.strftime(’%Y%m%d’,time.gmtime())}"
include fooinclude fileinclude file named "foo", search BBPATH
require [<path>]foorequire fileinclude file named "foo", failing if not found exactly where specified
inherit fooinherit classesinclude definitions from foo.bbclass
do_sometask() {
   <shell code>

}

define a task using shell code 
python do_sometask {
   <python code>

}

define a task using python code 
addtask sometask (before|after) other_taskadd a taskadds a defined task to the list of tasks, with the ordering specified. Zero or more 'before' or 'after' clauses can be used.
VAR[some_flag]="foo"associate a subsidiary flag value to a variablea few subsidiary flag value names are well-defined: "dirs", "cleandirs", "noexec", "nostamp", "fakeroot", "umask", "deptask", "rdeptask", "recdeptask", "recrdeptask"

Flag values appear to be used exclusively with task definitions (i.e. do_sometask)

inherit externalsrc
EXTERNALSRC = "/some/path"
# EXTERNALSRC_BUILD = "/some/path"
Fetch source from /some/pathYou can place this at the bottom of a .bb or .bbappend file to override where the source will be fetched from. This is very convenient if you are currently working on the source code. Depending on the type of build (eg, 'inherit module' for out of tree Linux kernel modules) you may or may not need to set EXTERNALSRC_BUILD.
额外的bitbake相关的命令

CommandDescriptionNOTES
bitbake-layersShow information about layers and recipesIncluded in the bitbake/bin directory in yocto.
bitbake-envShow invidividual bitbake variable valuessee:  http://www.crashcourse.ca/wiki/index.php/OE_bitbake-env_utility
bitbake -g -u taskexp <recipe-or-image-name>Show dependency information in a graphical interface


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值