From bd4140578ebf3150691e453232ba9dc8fbcd96bc Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sat, 18 Jan 2014 16:25:25 +0000 Subject: bitbake: user-manual-bitbakecommand: Various edits/cleanups (Bitbake rev: f079e0886b1b191d84621057f9752cc32bfabb44) Signed-off-by: Richard Purdie --- .../doc/user-manual/user-manual-bitbakecommand.xml | 162 +++++++++++---------- 1 file changed, 88 insertions(+), 74 deletions(-) diff --git a/bitbake/doc/user-manual/user-manual-bitbakecommand.xml b/bitbake/doc/user-manual/user-manual-bitbakecommand.xml index c8163331be..78da71d069 100644 --- a/bitbake/doc/user-manual/user-manual-bitbakecommand.xml +++ b/bitbake/doc/user-manual/user-manual-bitbakecommand.xml @@ -2,16 +2,16 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - The BitBake command + The BitBake Command
Introduction - bitbake is the primary command in the system. - It facilitates executing tasks in a single .bb + 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 + .bb files, accounting for interdependencies amongst them.
@@ -20,8 +20,9 @@ Usage and syntax + Following is the usage and syntax for BitBake: -$ bitbake --help + $ bitbake -h Usage: bitbake [options] [recipename/target ...] Executes the specified task (default is 'build') for a given set of target recipes (.bb files). @@ -99,23 +100,30 @@ Options:
Examples + + This section presents some examples showing how to use BitBake. + +
- Executing a task against a single .bb + Executing a Task Against a Single Recipe - 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. + 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. - clean task: + The following command runs the clean task on the + foo_1.0.bb recipe file: $ bitbake -b foo.bb -c clean - - build task: + The following command runs the build task, which is + the default task, on the foo_1.0.bb + recipe file: $ bitbake -b foo_1.0.bb @@ -123,20 +131,21 @@ Options:
- Executing tasks against a set of .bb files + Executing Tasks Against a Set of Recipe Files + There are a number of additional complexities introduced - when one wants to manage multiple .bb + 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 + 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. + when multiple recipes provide the same functionality, or when + there are multiple versions of a .bb file. @@ -144,10 +153,10 @@ Options: - Note that the bitbake command, when not using - --buildfile, accepts a PROVIDER, not a filename or + The bitbake command, when not using + "--buildfile", accepts a PROVIDER, not a filename or anything else. - By default, a .bb generally PROVIDES its + By default, a .bb generally PROVIDES its packagename, packagename-version, and packagename-version-revision. $ bitbake foo @@ -166,22 +175,23 @@ Options:
- Generating dependency graphs - - BitBake is able to generate dependency graphs using + 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 + 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. + 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, DEPENDS from inherited classes - such as base.bbclass can be removed from the + This way, DEPENDS from inherited classes + such as base.bbclass can be removed from the graph. $ bitbake -g foo @@ -193,14 +203,14 @@ Options:
- Special variables + Special Variables Certain variables affect BitBake operation:
- <varname>BB_NUMBER_THREADS</varname> + <filename>BB_NUMBER_THREADS</filename> The number of threads BitBake should run at once (default: 1). @@ -211,34 +221,35 @@ Options:
Metadata - - As you may have seen in the usage information, or in the - information about .bb files, the - BBFILES variable is how the BitBake - tool locates its files. - This variable is a space separated list of files - that are available, and supports wildcards. + + As you may have seen in the usage information, or in the + information about .bb files, the + BBFILES variable is how the BitBake + tool locates its files. + This variable is a space-separated list of files + that are available, and supports wildcards. +
- Setting BBFILES + Setting <filename>BBFILES</filename> BBFILES = "/path/to/bbfiles/*.bb" With regard to dependencies, it expects the - .bb to define a - DEPENDS variable, which contains a - space separated list of package names, which themselves - are the PN variable. The - PN variable is, in general, - set to a component of the .bb + .bb to define a + DEPENDS variable, which contains a + space separated list of “package names”, which themselves + are the PN variable. The + PN variable is, in general, + set to a component of the .bb filename by default.
- Depending on another .bb + Depending on Another Recipe File @@ -255,10 +266,13 @@ Options:
- Using PROVIDES + Using <filename>PROVIDES</filename> -This example shows the usage of the PROVIDES variable, which allows a given .bb to specify what functionality it provides. + This example shows the usage of the + PROVIDES variable, which allows a + given .bb to specify what + functionality it provides. package1.bb: @@ -273,7 +287,7 @@ This example shows the usage of the PROVIDES variable, which PROVIDES += "virtual/package" As you can see, we have two different - .bb's that provide the same functionality + 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 @@ -282,7 +296,8 @@ This example shows the usage of the PROVIDES variable, which -The following would go into a .conf file, to select package1: + The following would go into a .conf + file, to select package1: PREFERRED_PROVIDER_virtual/package = "package1" @@ -290,27 +305,27 @@ The following would go into a .conf file, to select package1:
- Specifying version preference + Specifying Version Preference - When there are multiple versions of a given package, - BitBake defaults to selecting the most recent version, - unless otherwise specified. - If the .bb in question has a - DEFAULT_PREFERENCE set lower than - the other .bb's (default is 0), then it will not be + When there are multiple “versions” of a given package, + BitBake defaults to selecting the most recent + version, unless otherwise specified. + If the .bb in question has a + DEFAULT_PREFERENCE 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 .bb files to specify + the repository of .bb files to specify their preference for the default selected version. In addition, the user can specify their preferred version. - If the first .bb is named + If the first .bb is named a_1.1.bb, then the - PN variable will be set to - a, and the PV variable will be + PN variable will be set to + “a”, and the PV variable will be set to 1.1. @@ -318,27 +333,26 @@ The following would go into a .conf file, to select package1: If we then have an a_1.2.bb, BitBake will choose 1.2 by default. However, if we define the following variable in a - .conf that BitBake parses, we + .conf file that BitBake parses, we can change that. PREFERRED_VERSION_a = "1.1" -
- Using <quote>bbfile collections</quote> + Using Recipe File Collections - bbfile collections exist to allow the user to + Recipe file collections exist to allow the user to have multiple repositories of - bbfiles that contain the same + .bb 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. - Usage: + Here is an example: BBFILES = "/stuff/openembedded/*/*.bb /stuff/openembedded.modified/*/*.bb" BBFILE_COLLECTIONS = "upstream local" -- cgit v1.2.3-54-g00ecf