summaryrefslogtreecommitdiffstats
path: root/bitbake/doc/user-manual/user-manual-bitbakecommand.xml
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/doc/user-manual/user-manual-bitbakecommand.xml')
-rw-r--r--bitbake/doc/user-manual/user-manual-bitbakecommand.xml164
1 files changed, 69 insertions, 95 deletions
diff --git a/bitbake/doc/user-manual/user-manual-bitbakecommand.xml b/bitbake/doc/user-manual/user-manual-bitbakecommand.xml
index e895c6b3f0..5c301a56f3 100644
--- a/bitbake/doc/user-manual/user-manual-bitbakecommand.xml
+++ b/bitbake/doc/user-manual/user-manual-bitbakecommand.xml
@@ -4,17 +4,22 @@
4<chapter id="user-manual-command"> 4<chapter id="user-manual-command">
5 <title>The BitBake Command</title> 5 <title>The BitBake Command</title>
6 6
7 <section id='bitbake-command-introduction'> 7 <para>
8 <title>Introduction</title> 8 BitBake is the underlying piece of the build system.
9 9 Two excellent examples are the Yocto Project and the OpenEmbedded
10 <para> 10 build systems.
11 Bitbake is the primary command in the system. 11 Each provide an environment in which to develop embedded Linux
12 It facilitates executing tasks in a single <filename>.bb</filename> 12 images, and each use BitBake as their underlying build engine.
13 file, or executing a given task on a set of multiple 13 </para>
14 <filename>.bb</filename> files, accounting for interdependencies 14
15 amongst them. 15 <para>
16 </para> 16 BitBake facilitates executing tasks in a single <filename>.bb</filename>
17 </section> 17 file, or executing a given task on a set of multiple
18 <filename>.bb</filename> files, accounting for interdependencies
19 amongst them.
20 This chapter presents the BitBake syntax, provides some execution
21 examples, and shows you how to control BitBake with key metadata.
22 </para>
18 23
19 <section id='usage-and-syntax'> 24 <section id='usage-and-syntax'>
20 <title>Usage and syntax</title> 25 <title>Usage and syntax</title>
@@ -110,7 +115,9 @@ Options:
110 <para> 115 <para>
111 Executing tasks for a single recipe file is relatively simple. 116 Executing tasks for a single recipe file is relatively simple.
112 You specify the file in question, and BitBake parses 117 You specify the file in question, and BitBake parses
113 it and executes the specified task (or “build” by default). 118 it and executes the specified task.
119 If you do not specify a task, BitBake executes the default
120 task, which is "build”.
114 BitBake obeys inter-task dependencies when doing 121 BitBake obeys inter-task dependencies when doing
115 so. 122 so.
116 </para> 123 </para>
@@ -138,38 +145,36 @@ Options:
138 when one wants to manage multiple <filename>.bb</filename> 145 when one wants to manage multiple <filename>.bb</filename>
139 files. 146 files.
140 Clearly there needs to be a way to tell BitBake what 147 Clearly there needs to be a way to tell BitBake what
141 files are available, and of those, which we 148 files are available, and of those, which you
142 want to execute at this time. 149 want to execute.
143 There also needs to be a way for each <filename>.bb</filename> 150 There also needs to be a way for each recipe
144 to express its dependencies, both for build-time and 151 to express its dependencies, both for build-time and
145 runtime. 152 runtime.
146 There must be a way for the user to express their preferences 153 There must be a way for you to express recipe preferences
147 when multiple recipes provide the same functionality, or when 154 when multiple recipes provide the same functionality, or when
148 there are multiple versions of a <filename>.bb</filename> file. 155 there are multiple versions of a recipe.
149 </para>
150
151 <para>
152 The next section, Metadata, outlines how to specify such things.
153 </para> 156 </para>
154 157
155 <para> 158 <para>
156 The <filename>bitbake</filename> command, when not using 159 The <filename>bitbake</filename> command, when not using
157 "--buildfile", accepts a PROVIDER, not a filename or 160 "--buildfile" or "-b" only accepts a "PROVIDER".
158 anything else. 161 You cannot provide anything else.
159 By default, a <filename>.bb</filename> generally PROVIDES its 162 By default, a recipe file generally "PROVIDES" its
160 packagename, packagename-version, and packagename-version-revision. 163 "packagename", "packagename-version", and
164 "packagename-version-revision" as shown in the following
165 example:
161 <literallayout class='monospaced'> 166 <literallayout class='monospaced'>
162 $ bitbake foo 167 $ bitbake foo
163 168
164 $ bitbake foo-1.0 169 $ bitbake foo-1.0
165 170
166 $ bitbake foo-1.0-r0 171 $ bitbake foo-1.0-r0
167 172 </literallayout>
173 This next example "PROVIDES" the package name and also uses
174 the "-c" option to tell BitBake to just excute the
175 <filename>do_clean</filename> task:
176 <literallayout class='monospaced'>
168 $ bitbake -c clean foo 177 $ bitbake -c clean foo
169
170 $ bitbake virtual/whatever
171
172 $ bitbake -c clean virtual/whatever
173 </literallayout> 178 </literallayout>
174 </para> 179 </para>
175 </section> 180 </section>
@@ -180,88 +185,57 @@ Options:
180 <para> 185 <para>
181 BitBake is able to generate dependency graphs using 186 BitBake is able to generate dependency graphs using
182 the dot syntax. 187 the dot syntax.
183 These graphs can be converted to images using the dot 188 You can convert these graphs into images using the dot
184 application from 189 application from
185 <ulink url='http://www.graphviz.org'>Graphviz</ulink>. 190 <ulink url='http://www.graphviz.org'>Graphviz</ulink>.
186 Two files will be written into the current working directory:
187 <filename>depends.dot</filename> containing dependency information
188 at the package level and <filename>task-depends.dot</filename>
189 containing a breakdown of the dependencies at the task level.
190 To stop depending on common depends, one can use the "-I" depend
191 option to omit these from the graph.
192 This can lead to more readable graphs.
193 This way, <filename>DEPENDS</filename> from inherited classes
194 such as <filename>base.bbclass</filename> can be removed from the
195 graph.
196 <literallayout class='monospaced'>
197 $ bitbake -g foo
198
199 $ bitbake -g -I virtual/whatever -I bloom foo
200 </literallayout>
201 </para> 191 </para>
202 </section>
203 </section>
204
205 <section id='special-variables'>
206 <title>Special Variables</title>
207
208 <para>
209 Certain variables affect BitBake operation:
210 </para>
211
212 <section id='bb-number-threads'>
213 <title><filename>BB_NUMBER_THREADS</filename></title>
214 192
215 <para> 193 <para>
216 The number of threads BitBake should run at once (default: 1). 194 When you generate a dependency graph, BitBake writes two files
195 to the current working directory:
196 <filename>depends.dot</filename>, which contains dependency information
197 at the package level, and <filename>task-depends.dot</filename>,
198 which contains a breakdown of the dependencies at the task level.
217 </para> 199 </para>
218 </section>
219 </section>
220
221 <section id='bitbake-command-metadata'>
222 <title>Metadata</title>
223 200
224 <para> 201 <para>
225 As you may have seen in the usage information, or in the 202 To stop depending on common depends, use use the "-I" depend
226 information about <filename>.bb</filename> files, the 203 option and BitBake omits them from the graph.
227 <filename>BBFILES</filename> variable is how the BitBake 204 Leaving this information out can produce more readable graphs.
228 tool locates its files. 205 This way, you can remove from the graph
229 This variable is a space-separated list of files 206 <filename>DEPENDS</filename> from inherited classes
230 that are available, and supports wildcards. 207 such as <filename>base.bbclass</filename>.
231 </para> 208 </para>
232
233 <section id='setting-bbfiles'>
234 <title>Setting <filename>BBFILES</filename></title>
235 209
236 <para> 210 <para>
211 Here are two exmples that create dependency graphs.
212 The second example omits common depends from the graph:
237 <literallayout class='monospaced'> 213 <literallayout class='monospaced'>
238 BBFILES = "/path/to/bbfiles/*.bb" 214 $ bitbake -g foo
215
216 $ bitbake -g -I virtual/whatever -I bloom foo
239 </literallayout> 217 </literallayout>
240 With regard to dependencies, it expects the
241 <filename>.bb</filename> to define a
242 <filename>DEPENDS</filename> variable, which contains a
243 space separated list of “package names”, which themselves
244 are the <filename>PN</filename> variable. The
245 <filename>PN</filename> variable is, in general,
246 set to a component of the <filename>.bb</filename>
247 filename by default.
248 </para> 218 </para>
249 </section> 219 </section>
220 </section>
250 221
251 <section id='depending-on-another-recipe-file'> 222 <section id='controlling-bitbake'>
252 <title>Depending on Another Recipe File</title> 223 <title>Controlling BitBake</title>
253
254 <para>
255 <literallayout class='monospaced'>
256 a.bb:
257 224
258 PN = "package-a" 225 <para>
259 DEPENDS += "package-b" 226 Including variables in your recipe and class files help control
227 how BitBake operates.
228 </para>
260 229
261 b.bb: 230 <section id='execution-threads'>
231 <title>Execution Threads</title>
262 232
263 PN = "package-b" 233 <para>
264 </literallayout> 234 You can control how many thread BitBake supports by using the
235 <link linkend='var-BB_NUMBER_THREADS'><filename>BB_NUMBER_THREADS</filename></link>
236 variable.
237 You would set this in your <filename>local.conf</filename>
238 configuration file.
265 </para> 239 </para>
266 </section> 240 </section>
267 241