blob: 48e39212a54af42234a53f7f6f437505f5dda49e [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
2"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
3[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
4
5<chapter id='ref-structure'>
6
7<title>Source Directory Structure</title>
8
9<para>
10 The <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink> consists of several components.
11 Understanding them and knowing where they are located is key to using the Yocto Project well.
12 This chapter describes the Source Directory and gives information about the various
13 files and directories.
14</para>
15
16<para>
17 For information on how to establish a local Source Directory on your development system, see the
18 "<ulink url='&YOCTO_DOCS_DEV_URL;#getting-setup'>Getting Set Up</ulink>"
19 section in the Yocto Project Development Manual.
20</para>
21
22<note>
23 The OpenEmbedded build system does not support file or directory names that
24 contain spaces.
25 Be sure that the Source Directory you use does not contain these types
26 of names.
27</note>
28
29<section id='structure-core'>
30 <title>Top-Level Core Components</title>
31
32 <para>
33 This section describes the top-level components of the
34 <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
35 </para>
36
37 <section id='structure-core-bitbake'>
38 <title><filename>bitbake/</filename></title>
39
40 <para>
41 This directory includes a copy of BitBake for ease of use.
42 The copy usually matches the current stable BitBake release from
43 the BitBake project.
44 BitBake, a
45 <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink>
46 interpreter, reads the Yocto Project Metadata and runs the tasks
47 defined by that data.
48 Failures are usually from the Metadata and not from BitBake itself.
49 Consequently, most users do not need to worry about BitBake.
50 </para>
51
52 <para>
53 When you run the <filename>bitbake</filename> command, the
54 main BitBake executable, which resides in the
55 <filename>bitbake/bin/</filename> directory, starts.
56 Sourcing an environment setup script (e.g.
57 <link linkend="structure-core-script"><filename>&OE_INIT_FILE;</filename></link>
58 or
59 <link linkend="structure-memres-core-script"><filename>oe-init-build-env-memres</filename></link>)
60 places the <filename>scripts</filename> and
61 <filename>bitbake/bin</filename> directories (in that order) into
62 the shell's <filename>PATH</filename> environment variable.
63 </para>
64
65 <para>
66 For more information on BitBake, see the
67 <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>.
68 </para>
69 </section>
70
71 <section id='structure-core-build'>
72 <title><filename>build/</filename></title>
73
74 <para>
75 This directory contains user configuration files and the output
76 generated by the OpenEmbedded build system in its standard configuration where
77 the source tree is combined with the output.
78 The <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
79 is created initially when you <filename>source</filename>
80 the OpenEmbedded build environment setup script
81 (i.e.
82 <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>
83 or
84 <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>).
85 </para>
86
87 <para>
88 It is also possible to place output and configuration
89 files in a directory separate from the
90 <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
91 by providing a directory name when you <filename>source</filename>
92 the setup script.
93 For information on separating output from your local
94 Source Directory files, see the
95 "<link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>
96 and
97 "<link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>"
98 sections.
99 </para>
100 </section>
101
102 <section id='handbook'>
103 <title><filename>documentation/</filename></title>
104
105 <para>
106 This directory holds the source for the Yocto Project documentation
107 as well as templates and tools that allow you to generate PDF and HTML
108 versions of the manuals.
109 Each manual is contained in a sub-folder.
110 For example, the files for this manual reside in
111 the <filename>ref-manual/</filename> directory.
112 </para>
113 </section>
114
115 <section id='structure-core-meta'>
116 <title><filename>meta/</filename></title>
117
118 <para>
119 This directory contains the OpenEmbedded Core metadata.
120 The directory holds recipes, common classes, and machine
121 configuration for emulated targets (<filename>qemux86</filename>,
122 <filename>qemuarm</filename>, and so forth.)
123 </para>
124 </section>
125
126 <section id='structure-core-meta-yocto'>
127 <title><filename>meta-yocto/</filename></title>
128
129 <para>
130 This directory contains the configuration for the Poky
131 reference distribution.
132 </para>
133 </section>
134
135 <section id='structure-core-meta-yocto-bsp'>
136 <title><filename>meta-yocto-bsp/</filename></title>
137
138 <para>
139 This directory contains the Yocto Project reference
140 hardware Board Support Packages (BSPs).
141 For more information on BSPs, see the
142 <ulink url='&YOCTO_DOCS_BSP_URL;'>Yocto Project Board Support
143 Package (BSP) Developer's Guide</ulink>.
144 </para>
145 </section>
146
147 <section id='structure-meta-selftest'>
148 <title><filename>meta-selftest/</filename></title>
149
150 <para>
151 This directory adds additional recipes and append files
152 used by the OpenEmbedded selftests to verify the behavior
153 of the build system.
154 </para>
155
156 <para>
157 You do not have to add this layer to your
158 <filename>bblayers.conf</filename> file unless you want to run the
159 selftests.
160 </para>
161 </section>
162
163 <section id='structure-meta-skeleton'>
164 <title><filename>meta-skeleton/</filename></title>
165
166 <para>
167 This directory contains template recipes for BSP and kernel development.
168 </para>
169 </section>
170
171 <section id='structure-core-scripts'>
172 <title><filename>scripts/</filename></title>
173
174 <para>
175 This directory contains various integration scripts that implement
176 extra functionality in the Yocto Project environment (e.g. QEMU scripts).
177 The <link linkend="structure-core-script"><filename>&OE_INIT_FILE;</filename></link>
178 and
179 <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>
180 scripts append this directory to the shell's
181 <filename>PATH</filename> environment variable.
182 </para>
183
184 <para>
185 The <filename>scripts</filename> directory has useful scripts that assist in contributing
186 back to the Yocto Project, such as <filename>create-pull-request</filename> and
187 <filename>send-pull-request</filename>.
188 </para>
189 </section>
190
191 <section id='structure-core-script'>
192 <title><filename>&OE_INIT_FILE;</filename></title>
193
194 <para>
195 This script is one of two scripts that set up the OpenEmbedded build
196 environment.
197 For information on the other script, see the
198 "<link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>"
199 section.
200 </para>
201
202 <para>
203 Running this script with the <filename>source</filename> command in
204 a shell makes changes to <filename>PATH</filename> and sets other
205 core BitBake variables based on the current working directory.
206 You need to run an environment setup script before running BitBake
207 commands.
208 The script uses other scripts within the
209 <filename>scripts</filename> directory to do the bulk of the work.
210 </para>
211
212 <para>
213 When you run this script, your Yocto Project environment is set
214 up, a
215 <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
216 is created, your working directory becomes the Build Directory,
217 and you are presented with a list of common BitBake targets.
218 Here is an example:
219 <literallayout class='monospaced'>
220 $ source oe-init-build-env
221
222 ### Shell environment set up for builds. ###
223
224 You can now run 'bitbake &lt;target&gt;'
225
226 Common targets are:
227 core-image-minimal
228 core-image-sato
229 meta-toolchain
230 adt-installer
231 meta-ide-support
232
233 You can also run generated qemu images with a command like 'runqemu qemux86'
234 </literallayout>
235 The script gets its default list of common targets from the
236 <filename>conf-notes.txt</filename> file, which is found in the
237 <filename>meta-yocto</filename> directory within the
238 <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
239 Should you have custom distributions, it is very easy to modify
240 this configuration file to include your targets for your
241 distribution.
242 See the
243 "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-a-custom-template-configuration-directory'>Creating a Custom Template Configuration Directory</ulink>"
244 section in the Yocto Project Development Manual for more
245 information.
246 </para>
247
248 <para>
249 By default, running this script without a
250 <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
251 argument creates the <filename>build</filename> directory
252 in your current working directory.
253 If you provide a Build Directory argument when you
254 <filename>source</filename> the script, you direct the OpenEmbedded
255 build system to create a Build Directory of your choice.
256 For example, the following command creates a Build Directory named
257 <filename>mybuilds</filename> that is outside of the
258 <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>:
259 <literallayout class='monospaced'>
260 $ source &OE_INIT_FILE; ~/mybuilds
261 </literallayout>
262 The OpenEmbedded build system uses the template configuration
263 files, which are found by default in the
264 <filename>meta-yocto/conf</filename> directory in the
265 <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
266 See the
267 "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-a-custom-template-configuration-directory'>Creating a Custom Template Configuration Directory</ulink>"
268 section in the Yocto Project Development Manual for more
269 information.
270 <note>
271 The OpenEmbedded build system does not support file or directory names that
272 contain spaces.
273 If you attempt to run the <filename>&OE_INIT_FILE;</filename> script
274 from a Source Directory that contains spaces in either the filenames
275 or directory names, the script returns an error indicating no such
276 file or directory.
277 Be sure to use a Source Directory free of names containing spaces.
278 </note>
279 </para>
280 </section>
281
282 <section id='structure-memres-core-script'>
283 <title><filename>oe-init-build-env-memres</filename></title>
284
285 <para>
286 This script is one of two scripts that set up the OpenEmbedded
287 build environment.
288 Aside from setting up the environment, this script starts a
289 memory-resident BitBake server.
290 For information on the other setup script, see the
291 "<link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>"
292 section.
293 </para>
294
295 <para>
296 Memory-resident BitBake resides in memory until you specifically
297 remove it using the following BitBake command:
298 <literallayout class='monospaced'>
299 $ bitbake -m
300 </literallayout>
301 </para>
302
303 <para>
304 Running this script with the <filename>source</filename> command in
305 a shell makes changes to <filename>PATH</filename> and sets other
306 core BitBake variables based on the current working directory.
307 One of these variables is the
308 <link linkend='var-BBSERVER'><filename>BBSERVER</filename></link>
309 variable, which allows the OpenEmbedded build system to locate
310 the server that is running BitBake.
311 </para>
312
313 <para>
314 You need to run an environment setup script before using BitBake
315 commands.
316 Following is the script syntax:
317 <literallayout class='monospaced'>
318 $ source oe-init-build-env-memres <replaceable>port_number</replaceable> <replaceable>build_dir</replaceable>
319 </literallayout>
320 Following are some considerations when sourcing this script:
321 <itemizedlist>
322 <listitem><para>
323 The script uses other scripts within the
324 <filename>scripts</filename> directory to do the bulk of
325 the work.
326 </para></listitem>
327 <listitem><para>
328 If you do not provide a port number with the script, the
329 BitBake server starts at a randomly selected port.
330 </para></listitem>
331 <listitem><para>
332 The script's parameters are positionally dependent.
333 Consequently, you cannot run the script and provide a
334 <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
335 name without also providing a port number.
336 In other words, the following syntax is illegal:
337 <literallayout class='monospaced'>
338 $ source oe-initbuild-env-memres <replaceable>build_dir</replaceable>
339 </literallayout>
340 <note>
341 The previous restriction might be resolved in the
342 future.
343 See
344 <ulink url='https://bugzilla.yoctoproject.org/show_bug.cgi?id=7555'>Bug 7555</ulink>
345 for more information.
346 </note>
347 </para></listitem>
348 </itemizedlist>
349 </para>
350
351 <para>
352 When you run this script, your Yocto Project environment is set
353 up, a Build Directory is created, your working directory becomes
354 the Build Directory, and you are presented with a list of common
355 BitBake targets.
356 Here is an example:
357 <literallayout class='monospaced'>
358 $ source oe-init-build-env-memres
359 No port specified, using dynamically selected port
360
361 ### Shell environment set up for builds. ###
362
363 You can now run 'bitbake &lt;target&gt;'
364
365 Common targets are:
366 core-image-minimal
367 core-image-sato
368 meta-toolchain
369 adt-installer
370 meta-ide-support
371
372 You can also run generated qemu images with a command like 'runqemu qemux86'
373 Bitbake server address: 127.0.0.1, server port: 53995
374 Bitbake server started on demand as needed, use bitbake -m to shut it down
375 </literallayout>
376 The script gets its default list of common targets from the
377 <filename>conf-notes.txt</filename> file, which is found in the
378 <filename>meta-yocto</filename> directory within the
379 <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
380 Should you have custom distributions, it is very easy to modify
381 this configuration file to include your targets for your
382 distribution.
383 See the
384 "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-a-custom-template-configuration-directory'>Creating a Custom Template Configuration Directory</ulink>"
385 section in the Yocto Project Development Manual for more
386 information.
387 </para>
388
389 <para>
390 By default, running this script without a
391 <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
392 argument creates a build directory named
393 <filename>build</filename>.
394 If you provide a Build Directory argument and port number when you
395 <filename>source</filename> the script, the Build Directory is
396 created using that name.
397 For example, the following command starts the BitBake server using
398 port 53995 and creates a Build Directory named
399 <filename>mybuilds</filename> that is outside of the
400 <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>:
401 <literallayout class='monospaced'>
402 $ source oe-init-build-env-memres 53995 ~/mybuilds
403 </literallayout>
404 The <filename>oe-init-build-env-memres</filename> script starts a
405 memory resident BitBake server.
406 This BitBake instance uses the
407 <filename>bitbake-cookerdaemon.log</filename> file, which is
408 located in the Build Directory.
409 </para>
410
411 <para>
412 The OpenEmbedded build system uses the template configuration
413 files, which are found by default in the
414 <filename>meta-yocto/conf</filename> directory in the
415 <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
416 See the
417 "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-a-custom-template-configuration-directory'>Creating a Custom Template Configuration Directory</ulink>"
418 section in the Yocto Project Development Manual for more
419 information.
420 <note>
421 The OpenEmbedded build system does not support file or
422 directory names that contain spaces.
423 If you attempt to run the
424 <filename>oe-init-build-env-memres</filename> script
425 from a Source Directory that contains spaces in either the
426 filenames or directory names, the script returns an error
427 indicating no such file or directory.
428 Be sure to use a Source Directory free of names containing
429 spaces.
430 </note>
431 </para>
432 </section>
433
434 <section id='structure-basic-top-level'>
435 <title><filename>LICENSE, README, and README.hardware</filename></title>
436
437 <para>
438 These files are standard top-level files.
439 </para>
440 </section>
441</section>
442
443<section id='structure-build'>
444 <title>The Build Directory - <filename>build/</filename></title>
445
446 <para>
447 The OpenEmbedded build system creates the
448 <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
449 when you run one of the build environment setup scripts (i.e.
450 <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>
451 or
452 <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>).
453 </para>
454
455 <para>
456 If you do not give the Build Directory a specific name when you run
457 a setup script, the name defaults to <filename>build</filename>.
458 </para>
459
460 <para>
461 The
462 <link linkend='var-TOPDIR'><filename>TOPDIR</filename></link> variable
463 points to the Build Directory.
464 </para>
465
466 <section id='structure-build-buildhistory'>
467 <title><filename>build/buildhistory</filename></title>
468
469 <para>
470 The OpenEmbedded build system creates this directory when you
471 enable the build history feature.
472 The directory tracks build information into image, packages, and
473 SDK subdirectories.
474 For information on the build history feature, see the
475 "<link linkend='maintaining-build-output-quality'>Maintaining Build Output Quality</link>"
476 section.
477 </para>
478 </section>
479
480 <section id='structure-build-conf-local.conf'>
481 <title><filename>build/conf/local.conf</filename></title>
482
483 <para>
484 This configuration file contains all the local user configurations
485 for your build environment.
486 The <filename>local.conf</filename> file contains documentation on
487 the various configuration options.
488 Any variable set here overrides any variable set elsewhere within
489 the environment unless that variable is hard-coded within a file
490 (e.g. by using '=' instead of '?=').
491 Some variables are hard-coded for various reasons but these
492 variables are relatively rare.
493 </para>
494
495 <para>
496 Edit this file to set the
497 <filename><link linkend='var-MACHINE'>MACHINE</link></filename>
498 for which you want to build, which package types you wish to use
499 (<link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link>),
500 and the location from which you want to access downloaded files
501 (<filename><link linkend='var-DL_DIR'>DL_DIR</link></filename>).
502 </para>
503
504 <para>
505 If <filename>local.conf</filename> is not present when you
506 start the build, the OpenEmbedded build system creates it from
507 <filename>local.conf.sample</filename> when
508 you <filename>source</filename> the top-level build environment
509 setup script (i.e.
510 <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>
511 or
512 <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>).
513 </para>
514
515 <para>
516 The source <filename>local.conf.sample</filename> file used
517 depends on the <filename>$TEMPLATECONF</filename> script variable,
518 which defaults to <filename>meta-yocto/conf</filename>
519 when you are building from the Yocto Project development
520 environment and defaults to <filename>meta/conf</filename> when
521 you are building from the OpenEmbedded Core environment.
522 Because the script variable points to the source of the
523 <filename>local.conf.sample</filename> file, this implies that
524 you can configure your build environment from any layer by setting
525 the variable in the top-level build environment setup script as
526 follows:
527 <literallayout class='monospaced'>
528 TEMPLATECONF=<replaceable>your_layer</replaceable>/conf
529 </literallayout>
530 Once the build process gets the sample file, it uses
531 <filename>sed</filename> to substitute final
532 <filename>${</filename><link linkend='var-OEROOT'><filename>OEROOT</filename></link><filename>}</filename>
533 values for all <filename>##OEROOT##</filename> values.
534 <note>
535 You can see how the <filename>TEMPLATECONF</filename> variable
536 is used by looking at the
537 <filename>scripts/oe-setup-builddir</filename> script in the
538 <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
539 You can find the Yocto Project version of the
540 <filename>local.conf.sample</filename> file in the
541 <filename>meta-yocto/conf</filename> directory.
542 </note>
543 </para>
544 </section>
545
546 <section id='structure-build-conf-bblayers.conf'>
547 <title><filename>build/conf/bblayers.conf</filename></title>
548
549 <para>
550 This configuration file defines
551 <ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>layers</ulink>,
552 which are directory trees, traversed (or walked) by BitBake.
553 The <filename>bblayers.conf</filename> file uses the
554 <link linkend='var-BBLAYERS'><filename>BBLAYERS</filename></link>
555 variable to list the layers BitBake tries to find.
556 </para>
557
558 <para>
559 If <filename>bblayers.conf</filename> is not present when you
560 start the build, the OpenEmbedded build system creates it from
561 <filename>bblayers.conf.sample</filename> when
562 you <filename>source</filename> the top-level build environment
563 setup script (i.e.
564 <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>
565 or
566 <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>).
567 </para>
568
569 <para>
570 The source <filename>bblayers.conf.sample</filename> file used
571 depends on the <filename>$TEMPLATECONF</filename> script variable,
572 which defaults to <filename>meta-yocto/conf</filename>
573 when you are building from the Yocto Project development
574 environment and defaults to <filename>meta/conf</filename> when
575 you are building from the OpenEmbedded Core environment.
576 Because the script variable points to the source of the
577 <filename>bblayers.conf.sample</filename> file, this implies that
578 you can base your build from any layer by setting the variable in
579 the top-level build environment setup script as follows:
580 <literallayout class='monospaced'>
581 TEMPLATECONF=<replaceable>your_layer</replaceable>/conf
582 </literallayout>
583 Once the build process gets the sample file, it uses
584 <filename>sed</filename> to substitute final
585 <filename>${</filename><link linkend='var-OEROOT'><filename>OEROOT</filename></link><filename>}</filename>
586 values for all <filename>##OEROOT##</filename> values.
587 <note>
588 You can see how the <filename>TEMPLATECONF</filename> variable
589 <filename>scripts/oe-setup-builddir</filename> script in the
590 <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
591 You can find the Yocto Project version of the
592 <filename>bblayers.conf.sample</filename> file in the
593 <filename>meta-yocto/conf</filename> directory.
594 </note>
595 </para>
596 </section>
597
598 <section id='structure-build-conf-sanity_info'>
599 <title><filename>build/conf/sanity_info</filename></title>
600
601 <para>
602 This file indicates the state of the sanity checks and is created
603 during the build.
604 </para>
605 </section>
606
607 <section id='structure-build-downloads'>
608 <title><filename>build/downloads/</filename></title>
609
610 <para>
611 This directory contains downloaded upstream source tarballs.
612 You can reuse the directory for multiple builds or move
613 the directory to another location.
614 You can control the location of this directory through the
615 <filename><link linkend='var-DL_DIR'>DL_DIR</link></filename> variable.
616 </para>
617 </section>
618
619 <section id='structure-build-sstate-cache'>
620 <title><filename>build/sstate-cache/</filename></title>
621
622 <para>
623 This directory contains the shared state cache.
624 You can reuse the directory for multiple builds or move
625 the directory to another location.
626 You can control the location of this directory through the
627 <filename><link linkend='var-SSTATE_DIR'>SSTATE_DIR</link></filename> variable.
628 </para>
629 </section>
630
631 <section id='structure-build-tmp'>
632 <title><filename>build/tmp/</filename></title>
633
634 <para>
635 The OpenEmbedded build system creates and uses this directory
636 for all the build system's output.
637 The
638 <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>
639 variable points to this directory.
640 </para>
641
642 <para>
643 BitBake creates this directory if it does not exist.
644 As a last resort, to clean up a build and start it from scratch
645 (other than the downloads), you can remove everything in the
646 <filename>tmp</filename> directory or get rid of the
647 directory completely.
648 If you do, you should also completely remove the
649 <filename>build/sstate-cache</filename> directory.
650 </para>
651 </section>
652
653 <section id='structure-build-tmp-buildstats'>
654 <title><filename>build/tmp/buildstats/</filename></title>
655
656 <para>
657 This directory stores the build statistics.
658 </para>
659 </section>
660
661 <section id='structure-build-tmp-cache'>
662 <title><filename>build/tmp/cache/</filename></title>
663
664 <para>
665 When BitBake parses the metadata, it creates a cache file of the result that can
666 be used when subsequently running commands.
667 BitBake stores these results here on a per-machine basis.
668 </para>
669 </section>
670
671 <section id='structure-build-tmp-deploy'>
672 <title><filename>build/tmp/deploy/</filename></title>
673
674 <para>
675 This directory contains any "end result" output from the
676 OpenEmbedded build process.
677 The <link linkend='var-DEPLOY_DIR'><filename>DEPLOY_DIR</filename></link>
678 variable points to this directory.
679 For more detail on the contents of the <filename>deploy</filename>
680 directory, see the
681 "<link linkend='images-dev-environment'>Images</link>" and
682 "<link linkend='sdk-dev-environment'>Application Development SDK</link>"
683 sections.
684 </para>
685 </section>
686
687 <section id='structure-build-tmp-deploy-deb'>
688 <title><filename>build/tmp/deploy/deb/</filename></title>
689
690 <para>
691 This directory receives any <filename>.deb</filename> packages produced by
692 the build process.
693 The packages are sorted into feeds for different architecture types.
694 </para>
695 </section>
696
697 <section id='structure-build-tmp-deploy-rpm'>
698 <title><filename>build/tmp/deploy/rpm/</filename></title>
699
700 <para>
701 This directory receives any <filename>.rpm</filename> packages produced by
702 the build process.
703 The packages are sorted into feeds for different architecture types.
704 </para>
705 </section>
706
707 <section id='structure-build-tmp-deploy-ipk'>
708 <title><filename>build/tmp/deploy/ipk/</filename></title>
709
710 <para>
711 This directory receives <filename>.ipk</filename> packages produced by
712 the build process.
713 </para>
714 </section>
715
716 <section id='structure-build-tmp-deploy-licenses'>
717 <title><filename>build/tmp/deploy/licenses/</filename></title>
718
719 <para>
720 This directory receives package licensing information.
721 For example, the directory contains sub-directories for <filename>bash</filename>,
722 <filename>busybox</filename>, and <filename>glibc</filename> (among others) that in turn
723 contain appropriate <filename>COPYING</filename> license files with other licensing information.
724 For information on licensing, see the
725 "<ulink url='&YOCTO_DOCS_DEV_URL;#maintaining-open-source-license-compliance-during-your-products-lifecycle'>Maintaining Open Source License Compliance During Your Product's Lifecycle</ulink>"
726 section.
727 </para>
728 </section>
729
730 <section id='structure-build-tmp-deploy-images'>
731 <title><filename>build/tmp/deploy/images/</filename></title>
732
733 <para>
734 This directory receives complete filesystem images.
735 If you want to flash the resulting image from a build onto a device, look here for the image.
736 </para>
737
738 <para>
739 Be careful when deleting files in this directory.
740 You can safely delete old images from this directory (e.g.
741 <filename>core-image-*</filename>, <filename>hob-image-*</filename>,
742 etc.).
743 However, the kernel (<filename>*zImage*</filename>, <filename>*uImage*</filename>, etc.),
744 bootloader and other supplementary files might be deployed here prior to building an
745 image.
746 Because these files are not directly produced from the image, if you
747 delete them they will not be automatically re-created when you build the image again.
748 </para>
749
750 <para>
751 If you do accidentally delete files here, you will need to force them to be
752 re-created.
753 In order to do that, you will need to know the target that produced them.
754 For example, these commands rebuild and re-create the kernel files:
755 <literallayout class='monospaced'>
756 $ bitbake -c clean virtual/kernel
757 $ bitbake virtual/kernel
758 </literallayout>
759 </para>
760 </section>
761
762 <section id='structure-build-tmp-deploy-sdk'>
763 <title><filename>build/tmp/deploy/sdk/</filename></title>
764
765 <para>
766 The OpenEmbedded build system creates this directory to hold
767 toolchain installer scripts, which when executed, install the
768 sysroot that matches your target hardware.
769 You can find out more about these installers in the
770 "<ulink url='&YOCTO_DOCS_ADT_URL;#optionally-building-a-toolchain-installer'>Optionally Building a Toolchain Installer</ulink>"
771 section in the Yocto Project Application Developer's Guide.
772 </para>
773 </section>
774
775 <section id='structure-build-tmp-sstate-control'>
776 <title><filename>build/tmp/sstate-control/</filename></title>
777
778 <para>
779 The OpenEmbedded build system uses this directory for the
780 shared state manifest files.
781 The shared state code uses these files to record the files
782 installed by each sstate task so that the files can be removed
783 when cleaning the recipe or when a newer version is about to
784 be installed.
785 The build system also uses the manifests to detect and produce
786 a warning when files from one task are overwriting those from
787 another.
788 </para>
789 </section>
790
791 <section id='structure-build-tmp-sysroots'>
792 <title><filename>build/tmp/sysroots/</filename></title>
793
794 <para>
795 This directory contains shared header files and libraries as well as other shared
796 data.
797 Packages that need to share output with other packages do so within this directory.
798 The directory is subdivided by architecture so multiple builds can run within
799 the one Build Directory.
800 </para>
801 </section>
802
803 <section id='structure-build-tmp-stamps'>
804 <title><filename>build/tmp/stamps/</filename></title>
805
806 <para>
807 This directory holds information that BitBake uses for accounting purposes
808 to track what tasks have run and when they have run.
809 The directory is sub-divided by architecture, package name, and
810 version.
811 Following is an example:
812 <literallayout class='monospaced'>
813 stamps/all-poky-linux/distcc-config/1.0-r0.do_build-2fdd....2do
814 </literallayout>
815 Although the files in the directory are empty of data,
816 BitBake uses the filenames and timestamps for tracking purposes.
817 </para>
818 </section>
819
820 <section id='structure-build-tmp-log'>
821 <title><filename>build/tmp/log/</filename></title>
822
823 <para>
824 This directory contains general logs that are not otherwise placed using the
825 package's <filename><link linkend='var-WORKDIR'>WORKDIR</link></filename>.
826 Examples of logs are the output from the
827 <filename>do_check_pkg</filename> or
828 <filename>do_distro_check</filename> tasks.
829 Running a build does not necessarily mean this directory is created.
830 </para>
831 </section>
832
833 <section id='structure-build-tmp-work'>
834 <title><filename>build/tmp/work/</filename></title>
835
836 <para>
837 This directory contains architecture-specific work sub-directories
838 for packages built by BitBake.
839 All tasks execute from the appropriate work directory.
840 For example, the source for a particular package is unpacked,
841 patched, configured and compiled all within its own work directory.
842 Within the work directory, organization is based on the package group
843 and version for which the source is being compiled
844 as defined by the
845 <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>.
846 </para>
847
848 <para>
849 It is worth considering the structure of a typical work directory.
850 As an example, consider <filename>linux-yocto-kernel-3.0</filename>
851 on the machine <filename>qemux86</filename>
852 built within the Yocto Project.
853 For this package, a work directory of
854 <filename>tmp/work/qemux86-poky-linux/linux-yocto/3.0+git1+&lt;.....&gt;</filename>,
855 referred to as the
856 <filename><link linkend='var-WORKDIR'>WORKDIR</link></filename>, is created.
857 Within this directory, the source is unpacked to
858 <filename>linux-qemux86-standard-build</filename> and then patched by Quilt.
859 (See the
860 "<ulink url='&YOCTO_DOCS_DEV_URL;#using-a-quilt-workflow'>Using Quilt in Your Workflow</ulink>"
861 section in the Yocto Project Development Manual for more information.)
862 Within the <filename>linux-qemux86-standard-build</filename> directory,
863 standard Quilt directories <filename>linux-3.0/patches</filename>
864 and <filename>linux-3.0/.pc</filename> are created,
865 and standard Quilt commands can be used.
866 </para>
867
868 <para>
869 There are other directories generated within <filename>WORKDIR</filename>.
870 The most important directory is <filename>WORKDIR/temp/</filename>,
871 which has log files for each task (<filename>log.do_*.pid</filename>)
872 and contains the scripts BitBake runs for each task
873 (<filename>run.do_*.pid</filename>).
874 The <filename>WORKDIR/image/</filename> directory is where "make
875 install" places its output that is then split into sub-packages
876 within <filename>WORKDIR/packages-split/</filename>.
877 </para>
878 </section>
879
880 <section id='structure-build-work-shared'>
881 <title><filename>build/tmp/work-shared/</filename></title>
882
883 <para>
884 For efficiency, the OpenEmbedded build system creates and uses
885 this directory to hold recipes that share a work directory with
886 other recipes.
887 In practice, this is only used for <filename>gcc</filename>
888 and its variants (e.g. <filename>gcc-cross</filename>,
889 <filename>libgcc</filename>, <filename>gcc-runtime</filename>,
890 and so forth).
891 </para>
892 </section>
893</section>
894
895<section id='structure-meta'>
896 <title>The Metadata - <filename>meta/</filename></title>
897
898 <para>
899 As mentioned previously,
900 <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink> is the core
901 of the Yocto Project.
902 Metadata has several important subdivisions:
903 </para>
904
905 <section id='structure-meta-classes'>
906 <title><filename>meta/classes/</filename></title>
907
908 <para>
909 This directory contains the <filename>*.bbclass</filename> files.
910 Class files are used to abstract common code so it can be reused by multiple
911 packages.
912 Every package inherits the <filename>base.bbclass</filename> file.
913 Examples of other important classes are <filename>autotools.bbclass</filename>, which
914 in theory allows any Autotool-enabled package to work with the Yocto Project with minimal effort.
915 Another example is <filename>kernel.bbclass</filename> that contains common code and functions
916 for working with the Linux kernel.
917 Functions like image generation or packaging also have their specific class files
918 such as <filename>image.bbclass</filename>, <filename>rootfs_*.bbclass</filename> and
919 <filename>package*.bbclass</filename>.
920 </para>
921
922 <para>
923 For reference information on classes, see the
924 "<link linkend='ref-classes'>Classes</link>" chapter.
925 </para>
926 </section>
927
928 <section id='structure-meta-conf'>
929 <title><filename>meta/conf/</filename></title>
930
931 <para>
932 This directory contains the core set of configuration files that start from
933 <filename>bitbake.conf</filename> and from which all other configuration
934 files are included.
935 See the include statements at the end of the
936 <filename>bitbake.conf</filename> file and you will note that even
937 <filename>local.conf</filename> is loaded from there.
938 While <filename>bitbake.conf</filename> sets up the defaults, you can often override
939 these by using the (<filename>local.conf</filename>) file, machine file or
940 the distribution configuration file.
941 </para>
942 </section>
943
944 <section id='structure-meta-conf-machine'>
945 <title><filename>meta/conf/machine/</filename></title>
946
947 <para>
948 This directory contains all the machine configuration files.
949 If you set <filename>MACHINE = "qemux86"</filename>,
950 the OpenEmbedded build system looks for a <filename>qemux86.conf</filename> file in this
951 directory.
952 The <filename>include</filename> directory contains various data common to multiple machines.
953 If you want to add support for a new machine to the Yocto Project, look in this directory.
954 </para>
955 </section>
956
957 <section id='structure-meta-conf-distro'>
958 <title><filename>meta/conf/distro/</filename></title>
959
960 <para>
961 The contents of this directory controls any distribution-specific
962 configurations.
963 For the Yocto Project, the <filename>defaultsetup.conf</filename> is the main file here.
964 This directory includes the versions and the
965 <filename>SRCDATE</filename> definitions for applications that are configured here.
966 An example of an alternative configuration might be <filename>poky-bleeding.conf</filename>.
967 Although this file mainly inherits its configuration from Poky.
968 </para>
969 </section>
970
971 <section id='structure-meta-conf-machine-sdk'>
972 <title><filename>meta/conf/machine-sdk/</filename></title>
973
974 <para>
975 The OpenEmbedded build system searches this directory for
976 configuration files that correspond to the value of
977 <link linkend='var-SDKMACHINE'><filename>SDKMACHINE</filename></link>.
978 By default, 32-bit and 64-bit x86 files ship with the Yocto
979 Project that support some SDK hosts.
980 However, it is possible to extend that support to other SDK hosts
981 by adding additional configuration files in this subdirectory
982 within another layer.
983 </para>
984 </section>
985
986 <section id='structure-meta-files'>
987 <title><filename>meta/files/</filename></title>
988
989 <para>
990 This directory contains common license files and several text files
991 used by the build system.
992 The text files contain minimal device information and
993 lists of files and directories with known permissions.
994 </para>
995 </section>
996
997 <section id='structure-meta-lib'>
998 <title><filename>meta/lib/</filename></title>
999
1000 <para>
1001 This directory contains OpenEmbedded Python library code
1002 used during the build process.
1003 </para>
1004 </section>
1005
1006 <section id='structure-meta-recipes-bsp'>
1007 <title><filename>meta/recipes-bsp/</filename></title>
1008
1009 <para>
1010 This directory contains anything linking to specific hardware or hardware
1011 configuration information such as "u-boot" and "grub".
1012 </para>
1013 </section>
1014
1015 <section id='structure-meta-recipes-connectivity'>
1016 <title><filename>meta/recipes-connectivity/</filename></title>
1017
1018 <para>
1019 This directory contains libraries and applications related to communication with other devices.
1020 </para>
1021 </section>
1022
1023 <section id='structure-meta-recipes-core'>
1024 <title><filename>meta/recipes-core/</filename></title>
1025
1026 <para>
1027 This directory contains what is needed to build a basic working Linux image
1028 including commonly used dependencies.
1029 </para>
1030 </section>
1031
1032 <section id='structure-meta-recipes-devtools'>
1033 <title><filename>meta/recipes-devtools/</filename></title>
1034
1035 <para>
1036 This directory contains tools that are primarily used by the build system.
1037 The tools, however, can also be used on targets.
1038 </para>
1039 </section>
1040
1041 <section id='structure-meta-recipes-extended'>
1042 <title><filename>meta/recipes-extended/</filename></title>
1043
1044 <para>
1045 This directory contains non-essential applications that add features compared to the
1046 alternatives in core.
1047 You might need this directory for full tool functionality or for Linux Standard Base (LSB)
1048 compliance.
1049 </para>
1050 </section>
1051
1052 <section id='structure-meta-recipes-gnome'>
1053 <title><filename>meta/recipes-gnome/</filename></title>
1054
1055 <para>
1056 This directory contains all things related to the GTK+ application framework.
1057 </para>
1058 </section>
1059
1060 <section id='structure-meta-recipes-graphics'>
1061 <title><filename>meta/recipes-graphics/</filename></title>
1062
1063 <para>
1064 This directory contains X and other graphically related system libraries
1065 </para>
1066 </section>
1067
1068 <section id='structure-meta-recipes-kernel'>
1069 <title><filename>meta/recipes-kernel/</filename></title>
1070
1071 <para>
1072 This directory contains the kernel and generic applications and libraries that
1073 have strong kernel dependencies.
1074 </para>
1075 </section>
1076
1077 <section id='structure-meta-recipes-lsb4'>
1078 <title><filename>meta/recipes-lsb4/</filename></title>
1079
1080 <para>
1081 This directory contains recipes specifically added to support
1082 the Linux Standard Base (LSB) version 4.x.
1083 </para>
1084 </section>
1085
1086 <section id='structure-meta-recipes-multimedia'>
1087 <title><filename>meta/recipes-multimedia/</filename></title>
1088
1089 <para>
1090 This directory contains codecs and support utilities for audio, images and video.
1091 </para>
1092 </section>
1093
1094 <section id='structure-meta-recipes-qt'>
1095 <title><filename>meta/recipes-qt/</filename></title>
1096
1097 <para>
1098 This directory contains all things related to the Qt application framework.
1099 </para>
1100 </section>
1101
1102 <section id='structure-meta-recipes-rt'>
1103 <title><filename>meta/recipes-rt/</filename></title>
1104
1105 <para>
1106 This directory contains package and image recipes for using and testing
1107 the <filename>PREEMPT_RT</filename> kernel.
1108 </para>
1109 </section>
1110
1111 <section id='structure-meta-recipes-sato'>
1112 <title><filename>meta/recipes-sato/</filename></title>
1113
1114 <para>
1115 This directory contains the Sato demo/reference UI/UX and its associated applications
1116 and configuration data.
1117 </para>
1118 </section>
1119
1120 <section id='structure-meta-recipes-support'>
1121 <title><filename>meta/recipes-support/</filename></title>
1122
1123 <para>
1124 This directory contains recipes used by other recipes, but that are
1125 not directly included in images (i.e. dependencies of other
1126 recipes).
1127 </para>
1128 </section>
1129
1130 <section id='structure-meta-site'>
1131 <title><filename>meta/site/</filename></title>
1132
1133 <para>
1134 This directory contains a list of cached results for various architectures.
1135 Because certain "autoconf" test results cannot be determined when cross-compiling due to
1136 the tests not able to run on a live system, the information in this directory is
1137 passed to "autoconf" for the various architectures.
1138 </para>
1139 </section>
1140
1141 <section id='structure-meta-recipes-txt'>
1142 <title><filename>meta/recipes.txt</filename></title>
1143
1144 <para>
1145 This file is a description of the contents of <filename>recipes-*</filename>.
1146 </para>
1147 </section>
1148</section>
1149
1150</chapter>
1151<!--
1152vim: expandtab tw=80 ts=4
1153-->