Usage and syntax

$ bitbake --help
usage: bitbake [options] [package ...]

Executes the specified task (default is 'build') for a given set of BitBake files.
It expects that BBFILES is defined, which is a space separated list of files to
be executed.  BBFILES does support wildcards.
Default BBFILES are the .bb files in the current directory.

options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -b BUILDFILE, --buildfile=BUILDFILE
                        execute the task against this .bb file, rather than a
                        package from BBFILES.
  -k, --continue        continue as much as possible after an error. While the
                        target that failed, and those that depend on it,
                        cannot be remade, the other dependencies of these
                        targets can be processed all the same.
  -f, --force           force run of specified cmd, regardless of stamp status
  -i, --interactive     drop into the interactive mode also called the BitBake
                        shell.
  -c CMD, --cmd=CMD     Specify task to execute. Note that this only executes
                        the specified task for the providee and the packages
                        it depends on, i.e. 'compile' does not implicitly call
                        stage for the dependencies (IOW: use only if you know
                        what you are doing). Depending on the base.bbclass a
                        listtasks task is defined and will show available
                        tasks
  -r FILE, --read=FILE  read the specified file before bitbake.conf
  -v, --verbose         output more chit-chat 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
  -p, --parse-only      quit after parsing the BB files (developers only)
  -s, --show-versions   show current and preferred versions of all packages
  -e, --environment     show the global or per-package environment (this is
                        what used to be bbread)
  -g, --graphviz        emit the dependency trees of the specified packages in
                        the dot syntax
  -I IGNORED_DOT_DEPS, --ignore-deps=IGNORED_DOT_DEPS
                        Stop processing at the given list of dependencies when
                        generating dependency graphs. This can help to make
                        the graph more appealing
  -l DEBUG_DOMAINS, --log-domains=DEBUG_DOMAINS
                        Show debug logging for the specified logging domains
  -P, --profile         profile the command and print a report


Example 4.1. Executing a task against a single .bb

Executing tasks for a single file is relatively simple. You specify the file in question, and BitBake parses it and executes the specified task (or build by default). It obeys intertask dependencies when doing so.

clean task:

$ bitbake -b blah_1.0.bb -c clean

build task:

$ bitbake -b blah_1.0.bb


Example 4.2. Executing tasks against a set of .bb files

There are a number of additional complexities introduced when one wants to manage multiple .bb files. Clearly there needs to be a way to tell BitBake what files are available, and of those, which we want to execute at this time. There also needs to be a way for each .bb to express its dependencies, both for build time and runtime. There must be a way for the user to express their preferences when multiple .bb's provide the same functionality, or when there are multiple versions of a .bb.

The next section, Metadata, outlines how to specify such things.

Note that the bitbake command, when not using --buildfile, accepts a PROVIDER, not a filename or anything else. By default, a .bb generally PROVIDES its packagename, packagename-version, and packagename-version-revision.

$ bitbake blah
$ bitbake blah-1.0
$ bitbake blah-1.0-r0
$ bitbake -c clean blah
$ bitbake virtual/whatever
$ bitbake -c clean virtual/whatever


Example 4.3. Generating dependency graphs

BitBake is able to generate dependency graphs using the dot syntax. These graphs can be converted to images using the dot application from Graphviz. Two files will be written into the current working directory, depends.dot containing dependency information at the package level and task-depends.dot containing a breakdown of the dependencies at the task level. To stop depending on common depends, one can use the -I depend to omit these from the graph. This can lead to more readable graphs. This way, DEPENDS from inherited classes such as base.bbclass can be removed from the graph.

$ bitbake -g blah
$ bitbake -g -I virtual/whatever -I bloom blah