summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Rifenbark <scott.m.rifenbark@intel.com>2014-01-16 16:00:13 -0600
committerScott Rifenbark <scott.m.rifenbark@intel.com>2014-01-16 16:00:13 -0600
commit9ab922a192d4da0328d802f215ee82d6d9002738 (patch)
tree0abd287a8edcceb973e6246f85472c8e4b16ffed
parent75648dfd0c888898b14a215156d5e4c880286afd (diff)
downloadbitbake-9ab922a192d4da0328d802f215ee82d6d9002738.tar.gz
user-manual-bitbakecommand.xml: Restored to wmat version.
Restored the version to match that of the wmat branch. Rather than investigate and replay a million commits, I simply edited the file to match the file in the wmat PDF version. Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
-rw-r--r--doc/user-manual/user-manual-bitbakecommand.xml521
1 files changed, 364 insertions, 157 deletions
diff --git a/doc/user-manual/user-manual-bitbakecommand.xml b/doc/user-manual/user-manual-bitbakecommand.xml
index 119c89299..96cdf9853 100644
--- a/doc/user-manual/user-manual-bitbakecommand.xml
+++ b/doc/user-manual/user-manual-bitbakecommand.xml
@@ -1,158 +1,365 @@
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
- "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
-
- <chapter>
- <title>The BitBake command</title>
- <section>
- <title>Introduction</title>
- <para>bitbake is the primary command in the system. It facilitates executing tasks in a single .bb file, or executing a given task on a set of multiple .bb files, accounting for interdependencies amongst them.</para>
- </section>
- <section>
- <title>Usage and syntax</title>
- <para>
- <screen><prompt>$ </prompt>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
-
-
-</screen>
- </para>
- <para>
- <example>
- <title>Executing a task against a single .bb</title>
- <para>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 <quote>build</quote> by default). It obeys intertask dependencies when doing so.</para>
- <para><quote>clean</quote> task:</para>
- <para><screen><prompt>$ </prompt>bitbake -b blah_1.0.bb -c clean</screen></para>
- <para><quote>build</quote> task:</para>
- <para><screen><prompt>$ </prompt>bitbake -b blah_1.0.bb</screen></para>
- </example>
- </para>
- <para>
- <example>
- <title>Executing tasks against a set of .bb files</title>
- <para>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.</para>
- <para>The next section, Metadata, outlines how to specify such things.</para>
- <para>Note that the bitbake command, when not using --buildfile, accepts a <varname>PROVIDER</varname>, not a filename or anything else. By default, a .bb generally PROVIDES its packagename, packagename-version, and packagename-version-revision.</para>
- <screen><prompt>$ </prompt>bitbake blah</screen>
- <screen><prompt>$ </prompt>bitbake blah-1.0</screen>
- <screen><prompt>$ </prompt>bitbake blah-1.0-r0</screen>
- <screen><prompt>$ </prompt>bitbake -c clean blah</screen>
- <screen><prompt>$ </prompt>bitbake virtual/whatever</screen>
- <screen><prompt>$ </prompt>bitbake -c clean virtual/whatever</screen>
- </example>
- <example>
- <title>Generating dependency graphs</title>
- <para>BitBake is able to generate dependency graphs using the dot syntax. These graphs can be converted
-to images using the <application>dot</application> application from <ulink url="http://www.graphviz.org">Graphviz</ulink>.
-Two files will be written into the current working directory, <emphasis>depends.dot</emphasis> containing dependency information at the package level and <emphasis>task-depends.dot</emphasis> containing a breakdown of the dependencies at the task level. To stop depending on common depends, one can use the <prompt>-I depend</prompt> to omit these from the graph. This can lead to more readable graphs. This way, <varname>DEPENDS</varname> from inherited classes such as base.bbclass can be removed from the graph.</para>
- <screen><prompt>$ </prompt>bitbake -g blah</screen>
- <screen><prompt>$ </prompt>bitbake -g -I virtual/whatever -I bloom blah</screen>
- </example>
- </para>
- </section>
- <section>
- <title>Special variables</title>
- <para>Certain variables affect BitBake operation:</para>
- <section>
- <title><varname>BB_NUMBER_THREADS</varname></title>
- <para> The number of threads BitBake should run at once (default: 1).</para>
- </section>
- </section>
- <section>
- <title>Metadata</title>
- <para>As you may have seen in the usage information, or in the information about .bb files, the <varname>BBFILES</varname> variable is how the BitBake tool locates its files. This variable is a space separated list of files that are available, and supports wildcards.
- <example>
- <title>Setting BBFILES</title>
- <programlisting><varname>BBFILES</varname> = "/path/to/bbfiles/*.bb"</programlisting>
- </example></para>
- <para>With regard to dependencies, it expects the .bb to define a <varname>DEPENDS</varname> variable, which contains a space separated list of <quote>package names</quote>, which themselves are the <varname>PN</varname> variable. The <varname>PN</varname> variable is, in general, set to a component of the .bb filename by default.</para>
- <example>
- <title>Depending on another .bb</title>
- <para>a.bb:
- <screen>PN = "package-a"
-DEPENDS += "package-b"</screen>
- </para>
- <para>b.bb:
- <screen>PN = "package-b"</screen>
- </para>
- </example>
- <example>
- <title>Using PROVIDES</title>
- <para>This example shows the usage of the <varname>PROVIDES</varname> variable, which allows a given .bb to specify what functionality it provides.</para>
- <para>package1.bb:
- <screen>PROVIDES += "virtual/package"</screen>
- </para>
- <para>package2.bb:
- <screen>DEPENDS += "virtual/package"</screen>
- </para>
- <para>package3.bb:
- <screen>PROVIDES += "virtual/package"</screen>
- </para>
- <para>As you can see, we have two different .bb's that provide the same functionality (virtual/package). Clearly, there needs to be a way for the person running BitBake to control which of those providers gets used. There is, indeed, such a way.</para>
- <para>The following would go into a .conf file, to select package1:
- <screen>PREFERRED_PROVIDER_virtual/package = "package1"</screen>
- </para>
- </example>
- <example>
- <title>Specifying version preference</title>
- <para>When there are multiple <quote>versions</quote> of a given package, BitBake defaults to selecting the most recent version, unless otherwise specified. If the .bb in question has a <varname>DEFAULT_PREFERENCE</varname> set lower than the other .bb's (default is 0), then it will not be selected. This allows the person or persons maintaining the repository of .bb files to specify their preference for the default selected version. In addition, the user can specify their preferred version.</para>
- <para>If the first .bb is named <filename>a_1.1.bb</filename>, then the <varname>PN</varname> variable will be set to <quote>a</quote>, and the <varname>PV</varname> variable will be set to 1.1.</para>
- <para>If we then have an <filename>a_1.2.bb</filename>, BitBake will choose 1.2 by default. However, if we define the following variable in a .conf that BitBake parses, we can change that.
- <screen>PREFERRED_VERSION_a = "1.1"</screen>
- </para>
- </example>
- <example>
- <title>Using <quote>bbfile collections</quote></title>
- <para>bbfile collections exist to allow the user to have multiple repositories of bbfiles that contain the same exact package. For example, one could easily use them to make one's own local copy of an upstream repository, but with custom modifications that one does not want upstream. Usage:</para>
- <screen>BBFILES = "/stuff/openembedded/*/*.bb /stuff/openembedded.modified/*/*.bb"
-BBFILE_COLLECTIONS = "upstream local"
-BBFILE_PATTERN_upstream = "^/stuff/openembedded/"
-BBFILE_PATTERN_local = "^/stuff/openembedded.modified/"
-BBFILE_PRIORITY_upstream = "5"
-BBFILE_PRIORITY_local = "10"</screen>
- </example>
- </section>
- </chapter>
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+
+<chapter>
+ <title>The BitBake Command</title>
+
+ <section id='bitbake-command-introduction'>
+ <title>Introduction</title>
+
+ <para>
+ Bitbake is the primary command in the system.
+ It facilitates executing tasks in a single <filename>.bb</filename>
+ file, or executing a given task on a set of multiple
+ <filename>.bb</filename> files, accounting for interdependencies
+ amongst them.
+ </para>
+ </section>
+
+ <section id='usage-and-syntax'>
+ <title>Usage and syntax</title>
+
+ <para>
+ Following is the usage and syntax for BitBake:
+ <literallayout class='monospaced'>
+ $ 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
+ Don't execute, just dump out the signature
+ construction information.
+ -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.
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='bitbake-examples'>
+ <title>Examples</title>
+
+ <para>
+ This section presents some examples showing how to use BitBake.
+ </para>
+
+ <section id='example-executing-a-task-against-a-single-recipe'>
+ <title>Executing a Task Against a Single Recipe</title>
+
+ <para>
+ Executing tasks for a single recipe file is relatively simple.
+ You specify the file in question, and BitBake parses
+ it and executes the specified task (or “build” by default).
+ BitBake obeys inter-task dependencies when doing
+ so.
+ </para>
+
+ <para>
+ The following command runs the clean task on the
+ <filename>foo_1.0.bb</filename> recipe file:
+ <literallayout class='monospaced'>
+ $ bitbake -b foo.bb -c clean
+ </literallayout>
+ The following command runs the build task, which is
+ the default task, on the <filename>foo_1.0.bb</filename>
+ recipe file:
+ <literallayout class='monospaced'>
+ $ bitbake -b foo_1.0.bb
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='executing-tasks-against-a-set-of-recipe-files'>
+ <title>Executing Tasks Against a Set of Recipe Files</title>
+
+ <para>
+ There are a number of additional complexities introduced
+ when one wants to manage multiple <filename>.bb</filename>
+ 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 <filename>.bb</filename>
+ to express its dependencies, both for build-time and
+ runtime.
+ There must be a way for the user to express their preferences
+ when multiple recipes provide the same functionality, or when
+ there are multiple versions of a <filename>.bb</filename> file.
+ </para>
+
+ <para>
+ The next section, Metadata, outlines how to specify such things.
+ </para>
+
+ <para>
+ The <filename>bitbake</filename> command, when not using
+ "--buildfile", accepts a PROVIDER, not a filename or
+ anything else.
+ By default, a <filename>.bb</filename> generally PROVIDES its
+ packagename, packagename-version, and packagename-version-revision.
+ <literallayout class='monospaced'>
+ $ bitbake foo
+
+ $ bitbake foo-1.0
+
+ $ bitbake foo-1.0-r0
+
+ $ bitbake -c clean foo
+
+ $ bitbake virtual/whatever
+
+ $ bitbake -c clean virtual/whatever
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='generating-dependency-graphs'>
+ <title>Generating Dependency Graphs</title>
+
+ <para>
+ BitBake is able to generate dependency graphs using
+ the dot syntax.
+ These graphs can be converted to images using the dot
+ application from
+ <ulink url='http://www.graphviz.org'>Graphviz</ulink>.
+ Two files will be written into the current working directory:
+ <filename>depends.dot</filename> containing dependency information
+ at the package level and <filename>task-depends.dot</filename>
+ containing a breakdown of the dependencies at the task level.
+ To stop depending on common depends, one can use the "-I" depend
+ option to omit these from the graph.
+ This can lead to more readable graphs.
+ This way, <filename>DEPENDS</filename> from inherited classes
+ such as <filename>base.bbclass</filename> can be removed from the
+ graph.
+ <literallayout class='monospaced'>
+ $ bitbake -g foo
+
+ $ bitbake -g -I virtual/whatever -I bloom foo
+ </literallayout>
+ </para>
+ </section>
+ </section>
+
+ <section id='special-variables'>
+ <title>Special Variables</title>
+
+ <para>
+ Certain variables affect BitBake operation:
+ </para>
+
+ <section id='bb-number-threads'>
+ <title><filename>BB_NUMBER_THREADS</filename></title>
+
+ <para>
+ The number of threads BitBake should run at once (default: 1).
+ </para>
+ </section>
+ </section>
+
+ <section id='bitbake-command-metadata'>
+ <title>Metadata</title>
+
+ <para>
+ As you may have seen in the usage information, or in the
+ information about <filename>.bb</filename> files, the
+ <filename>BBFILES</filename> variable is how the BitBake
+ tool locates its files.
+ This variable is a space-separated list of files
+ that are available, and supports wildcards.
+ </para>
+
+ <section id='setting-bbfiles'>
+ <title>Setting <filename>BBFILES</filename></title>
+
+ <para>
+ <literallayout class='monospaced'>
+ BBFILES="/path/to/bbfiles/*.bb"
+ </literallayout>
+ With regard to dependencies, it expects the
+ <filename>.bb</filename> to define a
+ <filename>DEPENDS</filename> variable, which contains a
+ space separated list of “package names”, which themselves
+ are the <filename>PN</filename> variable. The
+ <filename>PN</filename> variable is, in general,
+ set to a component of the <filename>.bb</filename>
+ filename by default.
+ </para>
+ </section>
+
+ <section id='depending-on-another-recipe-file'>
+ <title>Depending on Another Recipe File</title>
+
+ <para>
+ <literallayout class='monospaced'>
+ a.bb:
+
+ PN = "package-a" DEPENDS += "package-b"
+
+ b.bb:
+
+ PN = "package-b"
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='using-provides'>
+ <title>Using <filename>PROVIDES</filename></title>
+
+ <para>
+ This example shows the usage of the
+ <filename>PROVIDES</filename> variable, which allows a
+ given <filename>.bb</filename> to specify what
+ functionality it provides.
+ <literallayout class='monospaced'>
+ package1.bb:
+
+ PROVIDES += "virtual/package"
+
+ package2.bb:
+
+ DEPENDS += "virtual/package"
+
+ package3.bb:
+
+ PROVIDES += "virtual/package"
+ </literallayout>
+ As you can see, we have two different
+ recipes that provide the same functionality
+ (virtual/package).
+ Clearly, there needs to be a way for the person running
+ BitBake to control which of those providers
+ gets used.
+ There is, indeed, such a way.
+ </para>
+
+ <para>
+ The following would go into a <filename>.conf</filename>
+ file, to select package1:
+ <literallayout class='monospaced'>
+ PREFERRED_PROVIDER_virtual/package = "package1"
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='specifying-version-preference'>
+ <title>Specifying Version Preference</title>
+
+ <para>
+ When there are multiple “versions” of a given package,
+ BitBake defaults to selecting the most recent
+ version, unless otherwise specified.
+ If the <filename>.bb</filename> in question has a
+ <filename>DEFAULT_PREFERENCE</filename> set lower than
+ the other recipes (default is 0), then it will not be
+ selected.
+ This allows the person or persons maintaining
+ the repository of <filename>.bb</filename> files to specify
+ their preference for the default selected version.
+ In addition, the user can specify their preferred version.
+ </para>
+
+ <para>
+ If the first <filename>.bb</filename> is named
+ <filename>a_1.1.bb</filename>, then the
+ <filename>PN</filename> variable will be set to
+ “a”, and the <filename>PV</filename> variable will be
+ set to 1.1.
+ </para>
+
+ <para>
+ If we then have an <filename>a_1.2.bb</filename>, BitBake
+ will choose 1.2 by default.
+ However, if we define the following variable in a
+ <filename>.conf</filename> file that BitBake parses, we
+ can change that.
+ <literallayout class='monospaced'>
+ PREFERRED_VERSION_a = "1.1"
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='using-recipe-file-collections'>
+ <title>Using Recipe File Collections</title>
+
+ <para>
+ Recipe file collections exist to allow the user to
+ have multiple repositories of
+ <filename>.bb</filename> files that contain the same
+ exact package.
+ For example, one could easily use them to make one's
+ own local copy of an upstream repository, but with
+ custom modifications that one does not want upstream.
+ Here is an example:
+ <literallayout class='monospaced'>
+ BBFILES = "/stuff/openembedded/*/*.bb
+ /stuff/openembedded.modified/*/*.bb" \
+ BBFILE_COLLECTIONS = "upstream local" \
+ BBFILE_PATTERN_upstream = "^/stuff/openembedded/" \
+ BBFILE_PATTERN_local = "^/stuff/openembedded.modified/" \
+ BBFILE_PRIORITY_upstream = "5" BBFILE_PRIORITY_local = "10"
+ </literallayout>
+ </para>
+ </section>
+ </section>
+</chapter>