blob: e919bd7eb36356dead492e6148bec91c611f9897 [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-classes'>
6<title>Classes</title>
7
8<para>
9 Class files are used to abstract common functionality and share it amongst
10 multiple recipe (<filename>.bb</filename>) files.
11 To use a class file, you simply make sure the recipe inherits the class.
12 In most cases, when a recipe inherits a class it is enough to enable its
13 features.
14 There are cases, however, where in the recipe you might need to set
15 variables or override some default behavior.
16</para>
17
18<para>
19 Any <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink> usually
20 found in a recipe can also be placed in a class file.
21 Class files are identified by the extension <filename>.bbclass</filename>
22 and are usually placed in a <filename>classes/</filename> directory beneath
23 the <filename>meta*/</filename> directory found in the
24 <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
25 Class files can also be pointed to by
26 <link linkend='var-BUILDDIR'><filename>BUILDDIR</filename></link>
27 (e.g. <filename>build/</filename>) in the same way as
28 <filename>.conf</filename> files in the <filename>conf</filename> directory.
29 Class files are searched for in
30 <link linkend='var-BBPATH'><filename>BBPATH</filename></link>
31 using the same method by which <filename>.conf</filename> files are
32 searched.
33</para>
34
35<para>
36 This chapter discusses only the most useful and important classes.
37 Other classes do exist within the <filename>meta/classes</filename>
38 directory in the
39 <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
40 You can reference the <filename>.bbclass</filename> files directly
41 for more information.
42</para>
43
44<section id='ref-classes-allarch'>
45 <title><filename>allarch.bbclass</filename></title>
46
47 <para>
48 The <filename>allarch</filename> class is inherited
49 by recipes that do not produce architecture-specific output.
50 The class disables functionality that is normally needed for recipes
51 that produce executable binaries (such as building the cross-compiler
52 and a C library as pre-requisites, and splitting out of debug symbols
53 during packaging).
54 <note>
Patrick Williamsf1e5d692016-03-30 15:21:19 -050055 <para>Unlike some distro recipes (e.g. Debian), OpenEmbedded recipes
56 that produce packages that depend on tunings through use of the
Patrick Williamsc124f4f2015-09-15 14:41:29 -050057 <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>
Patrick Williamsf1e5d692016-03-30 15:21:19 -050058 and
Patrick Williamsc124f4f2015-09-15 14:41:29 -050059 <link linkend='var-TUNE_PKGARCH'><filename>TUNE_PKGARCH</filename></link>
Patrick Williamsf1e5d692016-03-30 15:21:19 -050060 variables, should never be configured for all architectures
61 using <filename>allarch</filename>.
62 This is the case even if the recipes do not produce
63 architecture-specific output.</para>
64 <para>Configuring such recipes for all architectures causes the
65 <link linkend='ref-tasks-package_write_deb'><filename>do_package_write_*</filename></link>
66 tasks to have different signatures for the machines with different
67 tunings.
68 Additionally, unnecessary rebuilds occur every time an
69 image for a different <filename>MACHINE</filename> is built
70 even when the recipe never changes.</para>
Patrick Williamsc124f4f2015-09-15 14:41:29 -050071 </note>
72 </para>
73
74 <para>
75 By default, all recipes inherit the
76 <link linkend='ref-classes-base'><filename>base</filename></link> and
77 <link linkend='ref-classes-package'><filename>package</filename></link>
78 classes, which enable functionality
79 needed for recipes that produce executable output.
80 If your recipe, for example, only produces packages that contain
81 configuration files, media files, or scripts (e.g. Python and Perl),
82 then it should inherit the <filename>allarch</filename> class.
83 </para>
84</section>
85
86<section id='ref-classes-archiver'>
87 <title><filename>archiver.bbclass</filename></title>
88
89 <para>
90 The <filename>archiver</filename> class supports releasing
91 source code and other materials with the binaries.
92 </para>
93
94 <para>
95 For more details on the source archiver, see the
96 "<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>"
97 section in the Yocto Project Development Manual.
98 You can also see the
99 <link linkend='var-ARCHIVER_MODE'><filename>ARCHIVER_MODE</filename></link>
100 variable for information about the variable flags (varflags)
101 that help control archive creation.
102 </para>
103</section>
104
105<section id='ref-classes-autotools'>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500106 <title><filename>autotools*.bbclass</filename></title>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500107
108 <para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500109 The <filename>autotools*</filename> classes support Autotooled
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500110 packages.
111 </para>
112
113 <para>
114 The <filename>autoconf</filename>, <filename>automake</filename>,
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500115 and <filename>libtool</filename> packages bring standardization.
116 This class defines a set of tasks (e.g.
117 <filename>configure</filename>, <filename>compile</filename> and
118 so forth) that
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500119 work for all Autotooled packages.
120 It should usually be enough to define a few standard variables
121 and then simply <filename>inherit autotools</filename>.
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500122 These classes can also work with software that emulates Autotools.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500123 For more information, see the
124 "<ulink url='&YOCTO_DOCS_DEV_URL;#new-recipe-autotooled-package'>Autotooled Package</ulink>"
125 section in the Yocto Project Development Manual.
126 </para>
127
128 <para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500129 By default, the <filename>autotools*</filename> classes
130 use out-of-tree builds (i.e.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500131 <filename>autotools.bbclass</filename>).
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500132 (<link linkend='var-B'><filename>B</filename></link> <filename>!=</filename>
133 <link linkend='var-S'><filename>S</filename></link>).
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500134 </para>
135
136 <para>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500137 If the software being built by a recipe does not support
138 using out-of-tree builds, you should have the recipe inherit the
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500139 <filename>autotools-brokensep</filename> class.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500140 The <filename>autotools-brokensep</filename> class behaves the same
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500141 as the <filename>autotools</filename> class but builds with
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500142 <link linkend='var-B'><filename>B</filename></link> ==
143 <link linkend='var-S'><filename>S</filename></link>.
144 This method is useful when out-of-tree build support is either not
145 present or is broken.
146 <note>
147 It is recommended that out-of-tree support be fixed and used
148 if at all possible.
149 </note>
150 </para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500151
152 <para>
153 It's useful to have some idea of how the tasks defined by
154 the <filename>autotools*</filename> classes work and what they do
155 behind the scenes.
156 <itemizedlist>
157 <listitem><para><link linkend='ref-tasks-configure'><filename>do_configure</filename></link> -
158 Regenerates the
159 configure script (using <filename>autoreconf</filename>) and
160 then launches it with a standard set of arguments used during
161 cross-compilation.
162 You can pass additional parameters to
163 <filename>configure</filename> through the
164 <filename><link linkend='var-EXTRA_OECONF'>EXTRA_OECONF</link></filename> variable.
165 </para></listitem>
166 <listitem><para><link linkend='ref-tasks-compile'><filename>do_compile</filename></link> -
167 Runs <filename>make</filename> with arguments that specify the
168 compiler and linker.
169 You can pass additional arguments through
170 the <filename><link linkend='var-EXTRA_OEMAKE'>EXTRA_OEMAKE</link></filename> variable.
171 </para></listitem>
172 <listitem><para><link linkend='ref-tasks-install'><filename>do_install</filename></link> -
173 Runs <filename>make install</filename> and passes in
174 <filename>${</filename><link linkend='var-D'><filename>D</filename></link><filename>}</filename>
175 as <filename>DESTDIR</filename>.
176 </para></listitem>
177 </itemizedlist>
178 </para>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500179</section>
180
181<section id='ref-classes-base'>
182 <title><filename>base.bbclass</filename></title>
183
184 <para>
185 The <filename>base</filename> class is special in that every
186 <filename>.bb</filename> file implicitly inherits the class.
187 This class contains definitions for standard basic
188 tasks such as fetching, unpacking, configuring (empty by default),
189 compiling (runs any <filename>Makefile</filename> present), installing
190 (empty by default) and packaging (empty by default).
191 These classes are often overridden or extended by other classes
192 such as the
193 <link linkend='ref-classes-autotools'><filename>autotools</filename></link>
194 class or the
195 <link linkend='ref-classes-package'><filename>package</filename></link>
196 class.
197 The class also contains some commonly used functions such as
198 <filename>oe_runmake</filename>.
199 </para>
200</section>
201
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500202<section id='ref-classes-bash-completion'>
203 <title><filename>bash-completion.bbclass</filename></title>
204
205 <para>
206 Sets up packaging and dependencies appropriate for recipes that
207 build software that includes bash-completion data.
208 </para>
209</section>
210
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500211<section id='ref-classes-bin-package'>
212 <title><filename>bin_package.bbclass</filename></title>
213
214 <para>
215 The <filename>bin_package</filename> class is a
216 helper class for recipes that extract the contents of a binary package
217 (e.g. an RPM) and install those contents rather than building the
218 binary from source.
219 The binary package is extracted and new packages in the configured
220 output package format are created.
221 Extraction and installation of proprietary binaries is a good example
222 use for this class.
223 <note>
224 For RPMs and other packages that do not contain a subdirectory,
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500225 you should specify an appropriate fetcher parameter to point to
226 the subdirectory.
227 For example, if BitBake is using the Git fetcher
228 (<filename>git://</filename>), the "subpath" parameter limits
229 the checkout to a specific subpath of the tree.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500230 Here is an example where <filename>${BP}</filename> is used so that
231 the files are extracted into the subdirectory expected by the
232 default value of
233 <link linkend='var-S'><filename>S</filename></link>:
234 <literallayout class='monospaced'>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500235 SRC_URI = "git://example.com/downloads/somepackage.rpm;subpath=${BP}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500236 </literallayout>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500237 See the
238 "<ulink url='&YOCTO_DOCS_BB_URL;#bb-fetchers'>Fetchers</ulink>"
239 section in the BitBake User Manual for more information on
240 supported BitBake Fetchers.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500241 </note>
242 </para>
243</section>
244
245<section id='ref-classes-binconfig'>
246 <title><filename>binconfig.bbclass</filename></title>
247
248 <para>
249 The <filename>binconfig</filename> class helps to correct paths in
250 shell scripts.
251 </para>
252
253 <para>
254 Before <filename>pkg-config</filename> had become widespread, libraries
255 shipped shell scripts to give information about the libraries and
256 include paths needed to build software (usually named
257 <filename>LIBNAME-config</filename>).
258 This class assists any recipe using such scripts.
259 </para>
260
261 <para>
262 During staging, the OpenEmbedded build system installs such scripts
263 into the <filename>sysroots/</filename> directory.
264 Inheriting this class results in all paths in these scripts being
265 changed to point into the <filename>sysroots/</filename> directory so
266 that all builds that use the script use the correct directories
267 for the cross compiling layout.
268 See the
269 <link linkend='var-BINCONFIG_GLOB'><filename>BINCONFIG_GLOB</filename></link>
270 variable for more information.
271 </para>
272</section>
273
274<section id='ref-classes-binconfig-disabled'>
275 <title><filename>binconfig-disabled.bbclass</filename></title>
276
277 <para>
278 An alternative version of the
279 <link linkend='ref-classes-binconfig'><filename>binconfig</filename></link>
280 class, which disables binary configuration scripts by making them
281 return an error in favor of using <filename>pkg-config</filename>
282 to query the information.
283 The scripts to be disabled should be specified using the
284 <link linkend='var-BINCONFIG'><filename>BINCONFIG</filename></link>
285 variable within the recipe inheriting the class.
286 </para>
287</section>
288
289<section id='ref-classes-blacklist'>
290 <title><filename>blacklist.bbclass</filename></title>
291
292 <para>
293 The <filename>blacklist</filename> class prevents
294 the OpenEmbedded build system from building specific recipes
295 (blacklists them).
296 To use this class, inherit the class globally and set
297 <link linkend='var-PNBLACKLIST'><filename>PNBLACKLIST</filename></link>
298 for each recipe you wish to blacklist.
299 Specify the <link linkend='var-PN'><filename>PN</filename></link>
300 value as a variable flag (varflag) and provide a reason, which is
301 reported, if the package is requested to be built as the value.
302 For example, if you want to blacklist a recipe called "exoticware",
303 you add the following to your <filename>local.conf</filename>
304 or distribution configuration:
305 <literallayout class='monospaced'>
306 INHERIT += "blacklist"
307 PNBLACKLIST[exoticware] = "Not supported by our organization."
308 </literallayout>
309 </para>
310</section>
311
312<section id='ref-classes-bluetooth'>
313 <title><filename>bluetooth.bbclass</filename></title>
314
315 <para>
316 The <filename>bluetooth</filename> class defines a variable that
317 expands to the recipe (package) providing core
318 bluetooth support on the platform.
319 </para>
320
321 <para>
322 For details on how the class works, see the
323 <filename>meta/classes/bluetooth.bbclass</filename> file in the Yocto
324 Project
325 <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
326 </para>
327</section>
328
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500329<section id='ref-classes-bugzilla'>
330 <title><filename>bugzilla.bbclass</filename></title>
331
332 <para>
333 The <filename>bugzilla</filename> class supports setting up an
334 instance of Bugzilla in which you can automatically files bug reports
335 in response to build failures.
336 For this class to work, you need to enable the XML-RPC interface in
337 the instance of Bugzilla.
338 </para>
339</section>
340
341<section id='ref-classes-buildhistory'>
342 <title><filename>buildhistory.bbclass</filename></title>
343
344 <para>
345 The <filename>buildhistory</filename> class records a
346 history of build output metadata, which can be used to detect possible
347 regressions as well as used for analysis of the build output.
348 For more information on using Build History, see the
349 "<link linkend='maintaining-build-output-quality'>Maintaining Build Output Quality</link>"
350 section.
351 </para>
352</section>
353
354<section id='ref-classes-buildstats'>
355 <title><filename>buildstats.bbclass</filename></title>
356
357 <para>
358 The <filename>buildstats</filename> class records
359 performance statistics about each task executed during the build
360 (e.g. elapsed time, CPU usage, and I/O usage).
361 </para>
362
363 <para>
364 When you use this class, the output goes into the
365 <link linkend='var-BUILDSTATS_BASE'><filename>BUILDSTATS_BASE</filename></link>
366 directory, which defaults to <filename>${TMPDIR}/buildstats/</filename>.
367 You can analyze the elapsed time using
368 <filename>scripts/pybootchartgui/pybootchartgui.py</filename>, which
369 produces a cascading chart of the entire build process and can be
370 useful for highlighting bottlenecks.
371 </para>
372
373 <para>
374 Collecting build statistics is enabled by default through the
375 <link linkend='var-USER_CLASSES'><filename>USER_CLASSES</filename></link>
376 variable from your <filename>local.conf</filename> file.
377 Consequently, you do not have to do anything to enable the class.
378 However, if you want to disable the class, simply remove "buildstats"
379 from the <filename>USER_CLASSES</filename> list.
380 </para>
381</section>
382
383<section id='ref-classes-buildstats-summary'>
384 <title><filename>buildstats-summary.bbclass</filename></title>
385
386 <para>
387 When inherited globally, prints statistics at the end of the build
388 on sstate re-use.
389 In order to function, this class requires the
390 <link linkend='ref-classes-buildstats'><filename>buildstats</filename></link>
391 class be enabled.
392 </para>
393</section>
394
395<section id='ref-classes-ccache'>
396 <title><filename>ccache.bbclass</filename></title>
397
398 <para>
399 The <filename>ccache</filename> class enables the
400 <ulink url='http://ccache.samba.org/'>C/C++ Compiler Cache</ulink>
401 for the build.
402 This class is used to give a minor performance boost during the build.
403 However, using the class can lead to unexpected side-effects.
404 Thus, it is recommended that you do not use this class.
405 See <ulink url='http://ccache.samba.org/'></ulink> for information on
406 the C/C++ Compiler Cache.
407 </para>
408</section>
409
410<section id='ref-classes-chrpath'>
411 <title><filename>chrpath.bbclass</filename></title>
412
413 <para>
414 The <filename>chrpath</filename> class
415 is a wrapper around the "chrpath" utility, which is used during the
416 build process for <filename>nativesdk</filename>,
417 <filename>cross</filename>, and
418 <filename>cross-canadian</filename> recipes to change
419 <filename>RPATH</filename> records within binaries in order to make
420 them relocatable.
421 </para>
422</section>
423
424<section id='ref-classes-clutter'>
425 <title><filename>clutter.bbclass</filename></title>
426
427 <para>
428 The <filename>clutter</filename> class consolidates the
429 major and minor version naming and other common items used by Clutter
430 and related recipes.
431 <note>
432 Unlike some other classes related to specific libraries, recipes
433 building other software that uses Clutter do not need to
434 inherit this class unless they use the same recipe versioning
435 scheme that the Clutter and related recipes do.
436 </note>
437 </para>
438</section>
439
440<section id='ref-classes-cmake'>
441 <title><filename>cmake.bbclass</filename></title>
442
443 <para>
444 The <filename>cmake</filename> class allows for
445 recipes that need to build software using the CMake build system.
446 You can use the
447 <link linkend='var-EXTRA_OECMAKE'><filename>EXTRA_OECMAKE</filename></link>
448 variable to specify additional configuration options to be passed on
449 the <filename>cmake</filename> command line.
450 </para>
451</section>
452
453<section id='ref-classes-cml1'>
454 <title><filename>cml1.bbclass</filename></title>
455
456 <para>
457 The <filename>cml1</filename> class provides basic support for the
458 Linux kernel style build configuration system.
459 </para>
460</section>
461
462<section id='ref-classes-compress_doc'>
463 <title><filename>compress_doc.bbclass</filename></title>
464
465 <para>
466 Enables compression for man pages and info pages.
467 This class is intended to be inherited globally.
468 The default compression mechanism is gz (gzip) but you can
469 select an alternative mechanism by setting the
470 <link linkend='var-DOC_COMPRESS'><filename>DOC_COMPRESS</filename></link>
471 variable.
472 </para>
473</section>
474
475<section id='ref-classes-copyleft_compliance'>
476 <title><filename>copyleft_compliance.bbclass</filename></title>
477
478 <para>
479 The <filename>copyleft_compliance</filename> class
480 preserves source code for the purposes of license compliance.
481 This class is an alternative to the <filename>archiver</filename>
482 class and is still used by some users even though it has been
483 deprecated in favor of the
484 <link linkend='ref-classes-archiver'><filename>archiver</filename></link>
485 class.
486 </para>
487</section>
488
489<section id='ref-classes-copyleft_filter'>
490 <title><filename>copyleft_filter.bbclass</filename></title>
491
492 <para>
493 A class used by the
494 <link linkend='ref-classes-archiver'><filename>archiver</filename></link>
495 and
496 <link linkend='ref-classes-copyleft_compliance'><filename>copyleft_compliance</filename></link>
497 classes for filtering licenses.
498 The <filename>copyleft_filter</filename> class is an internal class
499 and is not intended to be used directly.
500 </para>
501</section>
502
503<section id='ref-classes-core-image'>
504 <title><filename>core-image.bbclass</filename></title>
505
506 <para>
507 The <filename>core-image</filename> class
508 provides common definitions for the
509 <filename>core-image-*</filename> image recipes, such as support for
510 additional
511 <link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link>.
512 </para>
513</section>
514
515<section id='ref-classes-cpan'>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500516 <title><filename>cpan*.bbclass</filename></title>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500517
518 <para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500519 The <filename>cpan*</filename> classes support Perl modules.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500520 </para>
521
522 <para>
523 Recipes for Perl modules are simple.
524 These recipes usually only need to point to the source's archive and
525 then inherit the proper class file.
526 Building is split into two methods depending on which method the module
527 authors used.
528 <itemizedlist>
529 <listitem><para>Modules that use old
530 <filename>Makefile.PL</filename>-based build system require
531 <filename>cpan.bbclass</filename> in their recipes.
532 </para></listitem>
533 <listitem><para>Modules that use
534 <filename>Build.PL</filename>-based build system require
535 using <filename>cpan_build.bbclass</filename> in their recipes.
536 </para></listitem>
537 </itemizedlist>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500538 Both build methods inherit the <filename>cpan-base</filename> class
539 for basic Perl support.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500540 </para>
541</section>
542
543<section id='ref-classes-cross'>
544 <title><filename>cross.bbclass</filename></title>
545
546 <para>
547 The <filename>cross</filename> class provides support for the recipes
548 that build the cross-compilation tools.
549 </para>
550</section>
551
552<section id='ref-classes-cross-canadian'>
553 <title><filename>cross-canadian.bbclass</filename></title>
554
555 <para>
556 The <filename>cross-canadian</filename> class
557 provides support for the recipes that build the Canadian
558 Cross-compilation tools for SDKs.
559 See the
560 "<link linkend='cross-development-toolchain-generation'>Cross-Development Toolchain Generation</link>"
561 section for more discussion on these cross-compilation tools.
562 </para>
563</section>
564
565<section id='ref-classes-crosssdk'>
566 <title><filename>crosssdk.bbclass</filename></title>
567
568 <para>
569 The <filename>crosssdk</filename> class
570 provides support for the recipes that build the cross-compilation
571 tools used for building SDKs.
572 See the
573 "<link linkend='cross-development-toolchain-generation'>Cross-Development Toolchain Generation</link>"
574 section for more discussion on these cross-compilation tools.
575 </para>
576</section>
577
578<section id='ref-classes-debian'>
579 <title><filename>debian.bbclass</filename></title>
580
581 <para>
582 The <filename>debian</filename> class renames output packages so that
583 they follow the Debian naming policy (i.e. <filename>glibc</filename>
584 becomes <filename>libc6</filename> and <filename>glibc-devel</filename>
585 becomes <filename>libc6-dev</filename>.)
586 Renaming includes the library name and version as part of the package
587 name.
588 </para>
589
590 <para>
591 If a recipe creates packages for multiple libraries
592 (shared object files of <filename>.so</filename> type), use the
593 <link linkend='var-LEAD_SONAME'><filename>LEAD_SONAME</filename></link>
594 variable in the recipe to specify the library on which to apply the
595 naming scheme.
596 </para>
597</section>
598
599<section id='ref-classes-deploy'>
600 <title><filename>deploy.bbclass</filename></title>
601
602 <para>
603 The <filename>deploy</filename> class handles deploying files
604 to the
605 <link linkend='var-DEPLOY_DIR_IMAGE'><filename>DEPLOY_DIR_IMAGE</filename></link>
606 directory.
607 The main function of this class is to allow the deploy step to be
608 accelerated by shared state.
609 Recipes that inherit this class should define their own
610 <link linkend='ref-tasks-deploy'><filename>do_deploy</filename></link>
611 function to copy the files to be deployed to
612 <link linkend='var-DEPLOYDIR'><filename>DEPLOYDIR</filename></link>,
613 and use <filename>addtask</filename> to add the task at the appropriate
614 place, which is usually after
615 <link linkend='ref-tasks-compile'><filename>do_compile</filename></link>
616 or
617 <link linkend='ref-tasks-install'><filename>do_install</filename></link>.
618 The class then takes care of staging the files from
619 <filename>DEPLOYDIR</filename> to
620 <filename>DEPLOY_DIR_IMAGE</filename>.
621 </para>
622</section>
623
624<section id='ref-classes-devshell'>
625 <title><filename>devshell.bbclass</filename></title>
626
627 <para>
628 The <filename>devshell</filename> class adds the
629 <filename>do_devshell</filename> task.
630 Distribution policy dictates whether to include this class.
631 See the
632 "<ulink url='&YOCTO_DOCS_DEV_URL;#platdev-appdev-devshell'>Using a Development Shell</ulink>" section
633 in the Yocto Project Development Manual for more information about
634 using <filename>devshell</filename>.
635 </para>
636</section>
637
638<section id='ref-classes-distro_features_check'>
639 <title><filename>distro_features_check.bbclass</filename></title>
640
641 <para>
642 The <filename>distro_features_check</filename> class
643 allows individual recipes to check for required and conflicting
644 <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>.
645 </para>
646
647 <para>
648 This class provides support for the
649 <link linkend='var-REQUIRED_DISTRO_FEATURES'><filename>REQUIRED_DISTRO_FEATURES</filename></link>
650 and
651 <link linkend='var-CONFLICT_DISTRO_FEATURES'><filename>CONFLICT_DISTRO_FEATURES</filename></link>
652 variables.
653 If any conditions specified in the recipe using the above variables are
654 not met, the recipe will be skipped.
655 </para>
656</section>
657
658<section id='ref-classes-distrodata'>
659 <title><filename>distrodata.bbclass</filename></title>
660
661 <para>
662 The <filename>distrodata</filename> class
663 provides for automatic checking for upstream recipe updates.
664 The class creates a comma-separated value (CSV) spreadsheet that
665 contains information about the recipes.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500666 The information provides the
667 <link linkend='ref-tasks-distrodata'><filename>do_distrodata</filename></link>
668 and
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500669 <filename>do_distro_check</filename> tasks, which do upstream checking
670 and also verify if a package is used in multiple major distributions.
671 </para>
672
673 <para>
674 The class is not included by default.
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500675 To use it, you must set the
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500676 <link linkend='var-INHERIT'><filename>INHERIT</filename></link>
677 variable:
678 <literallayout class='monospaced'>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500679 INHERIT+= "distrodata"
680 </literallayout>
681 </para>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500682
683 <para>
684 The <filename>distrodata</filename> class also provides the
685 <link linkend='ref-tasks-checkpkg'><filename>do_checkpkg</filename></link>
686 task, which can be used against a simple recipe or against an
687 image to get all its recipe information.
688 </para>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500689</section>
690
691<section id='ref-classes-distutils'>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500692 <title><filename>distutils*.bbclass</filename></title>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500693
694 <para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500695 The <filename>distutils*</filename> classes support recipes for Python
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500696 version 2.x extensions, which are simple.
697 These recipes usually only need to point to the source's archive and
698 then inherit the proper class.
699 Building is split into two methods depending on which method the
700 module authors used.
701 <itemizedlist>
702 <listitem><para>Extensions that use an Autotools-based build system
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500703 require Autotools and the classes based on
704 <filename>distutils</filename> in their recipes.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500705 </para></listitem>
706 <listitem><para>Extensions that use build systems based on
707 <filename>distutils</filename> require
708 the <filename>distutils</filename> class in their recipes.
709 </para></listitem>
710 <listitem><para>Extensions that use build systems based on
711 <filename>setuptools</filename> require the
712 <link linkend='ref-classes-setuptools'><filename>setuptools</filename></link>
713 class in their recipes.
714 </para></listitem>
715 </itemizedlist>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500716 The <filename>distutils-common-base</filename> class is required by
717 some of the <filename>distutils*</filename> classes to provide common
718 Python2 support.
719 </para>
720
721 <para>
722 The <filename>distutils-tools</filename> class supports recipes for
723 additional "distutils" tools.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500724 </para>
725</section>
726
727<section id='ref-classes-distutils3'>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500728 <title><filename>distutils3*.bbclass</filename></title>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500729
730 <para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500731 The <filename>distutils3*</filename> classes support recipes for Python
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500732 version 3.x extensions, which are simple.
733 These recipes usually only need to point to the source's archive and
734 then inherit the proper class.
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500735 Building is split into three methods depending on which method the
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500736 module authors used.
737 <itemizedlist>
738 <listitem><para>Extensions that use an Autotools-based build system
739 require Autotools and
740 <filename>distutils</filename>-based classes in their recipes.
741 </para></listitem>
742 <listitem><para>Extensions that use
743 <filename>distutils</filename>-based build systems require
744 the <filename>distutils</filename> class in their recipes.
745 </para></listitem>
746 <listitem><para>Extensions that use build systems based on
747 <filename>setuptools3</filename> require the
748 <link linkend='ref-classes-setuptools'><filename>setuptools3</filename></link>
749 class in their recipes.
750 </para></listitem>
751 </itemizedlist>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500752 The <filename>distutils3*</filename> classes either inherit their
753 corresponding <filename>distutils*</filename> class or replicate them
754 using a Python3 version instead (e.g.
755 <filename>distutils3-base</filename> inherits
756 <filename>distutils-common-base</filename>, which is the same as
757 <filename>distutils-base</filename> but inherits
758 <filename>python3native</filename> instead of
759 <filename>pythonnative</filename>).
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500760 </para>
761</section>
762
763<section id='ref-classes-externalsrc'>
764 <title><filename>externalsrc.bbclass</filename></title>
765
766 <para>
767 The <filename>externalsrc</filename> class supports building software
768 from source code that is external to the OpenEmbedded build system.
769 Building software from an external source tree means that the build
770 system's normal fetch, unpack, and patch process is not used.
771 </para>
772
773 <para>
774 By default, the OpenEmbedded build system uses the
775 <link linkend='var-S'><filename>S</filename></link> and
776 <link linkend='var-B'><filename>B</filename></link> variables to
777 locate unpacked recipe source code and to build it, respectively.
778 When your recipe inherits the <filename>externalsrc</filename> class,
779 you use the
780 <link linkend='var-EXTERNALSRC'><filename>EXTERNALSRC</filename></link>
781 and
782 <link linkend='var-EXTERNALSRC_BUILD'><filename>EXTERNALSRC_BUILD</filename></link>
783 variables to ultimately define <filename>S</filename> and
784 <filename>B</filename>.
785 </para>
786
787 <para>
788 By default, this class expects the source code to support recipe builds
789 that use the <link linkend='var-B'><filename>B</filename></link>
790 variable to point to the directory in which the OpenEmbedded build
791 system places the generated objects built from the recipes.
792 By default, the <filename>B</filename> directory is set to the
793 following, which is separate from the source directory
794 (<filename>S</filename>):
795 <literallayout class='monospaced'>
796 ${WORKDIR}/${BPN}/{PV}/
797 </literallayout>
798 See these variables for more information:
799 <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>,
800 <link linkend='var-BPN'><filename>BPN</filename></link>, and
801 <link linkend='var-PV'><filename>PV</filename></link>,
802 </para>
803
804 <para>
805 For more information on the
806 <filename>externalsrc</filename> class, see the comments in
807 <filename>meta/classes/externalsrc.bbclass</filename> in the
808 <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
809 For information on how to use the <filename>externalsrc</filename>
810 class, see the
811 "<ulink url='&YOCTO_DOCS_DEV_URL;#building-software-from-an-external-source'>Building Software from an External Source</ulink>"
812 section in the Yocto Project Development Manual.
813 </para>
814</section>
815
816<section id='ref-classes-extrausers'>
817 <title><filename>extrausers.bbclass</filename></title>
818
819 <para>
820 The <filename>extrausers</filename> class allows
821 additional user and group configuration to be applied at the image
822 level.
823 Inheriting this class either globally or from an image recipe allows
824 additional user and group operations to be performed using the
825 <link linkend='var-EXTRA_USERS_PARAMS'><filename>EXTRA_USERS_PARAMS</filename></link>
826 variable.
827 <note>
828 The user and group operations added using the
829 <filename>extrausers</filename> class are not tied to a specific
830 recipe outside of the recipe for the image.
831 Thus, the operations can be performed across the image as a whole.
832 Use the
833 <link linkend='ref-classes-useradd'><filename>useradd</filename></link>
834 class to add user and group configuration to a specific recipe.
835 </note>
836 Here is an example that uses this class in an image recipe:
837 <literallayout class='monospaced'>
838 inherit extrausers
839 EXTRA_USERS_PARAMS = "\
840 useradd -p '' tester; \
841 groupadd developers; \
842 userdel nobody; \
843 groupdel -g video; \
844 groupmod -g 1020 developers; \
845 usermod -s /bin/sh tester; \
846 "
847 </literallayout>
848 Here is an example that adds two users named "tester-jim" and
849 "tester-sue" and assigns passwords:
850 <literallayout class='monospaced'>
851 inherit extrausers
852 EXTRA_USERS_PARAMS = "\
853 useradd -P tester01 tester-jim; \
854 useradd -P tester01 tester-sue; \
855 "
856 </literallayout>
857 Finally, here is an example that sets the root password to
858 "1876*18":
859 <literallayout class='monospaced'>
860 inherit extrausers
861 EXTRA_USERS_PARAMS = "\
862 usermod -P 1876*18 root; \
863 "
864 </literallayout>
865 </para>
866</section>
867
868<section id='ref-classes-fontcache'>
869 <title><filename>fontcache.bbclass</filename></title>
870
871 <para>
872 The <filename>fontcache</filename> class generates the
873 proper post-install and post-remove (postinst and postrm)
874 scriptlets for font packages.
875 These scriptlets call <filename>fc-cache</filename> (part of
876 <filename>Fontconfig</filename>) to add the fonts to the font
877 information cache.
878 Since the cache files are architecture-specific,
879 <filename>fc-cache</filename> runs using QEMU if the postinst
880 scriptlets need to be run on the build host during image creation.
881 </para>
882
883 <para>
884 If the fonts being installed are in packages other than the main
885 package, set
886 <link linkend='var-FONT_PACKAGES'><filename>FONT_PACKAGES</filename></link>
887 to specify the packages containing the fonts.
888 </para>
889</section>
890
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500891<section id='ref-classes-fs-uuid'>
892 <title><filename>fs-uuid.bbclass</filename></title>
893
894 <para>
895 The <filename>fs-uuid</filename> class extracts UUID from
896 <filename>${</filename><link linkend='var-ROOTFS'><filename>ROOTFS</filename></link><filename>}</filename>,
897 which must have been built by the time that this function gets called.
898 The <filename>fs-uuid</filename> class only works on
899 <filename>ext</filename> file systems and depends on
900 <filename>tune2fs</filename>.
901 </para>
902</section>
903
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500904<section id='ref-classes-gconf'>
905 <title><filename>gconf.bbclass</filename></title>
906
907 <para>
908 The <filename>gconf</filename> class provides common
909 functionality for recipes that need to install GConf schemas.
910 The schemas will be put into a separate package
911 (<filename>${</filename><link linkend='var-PN'><filename>PN</filename></link><filename>}-gconf</filename>)
912 that is created automatically when this class is inherited.
913 This package uses the appropriate post-install and post-remove
914 (postinst/postrm) scriptlets to register and unregister the schemas
915 in the target image.
916 </para>
917</section>
918
919<section id='ref-classes-gettext'>
920 <title><filename>gettext.bbclass</filename></title>
921
922 <para>
923 The <filename>gettext</filename> class provides support for
924 building software that uses the GNU <filename>gettext</filename>
925 internationalization and localization system.
926 All recipes building software that use
927 <filename>gettext</filename> should inherit this class.
928 </para>
929</section>
930
931<section id='ref-classes-gnome'>
932 <title><filename>gnome.bbclass</filename></title>
933
934 <para>
935 The <filename>gnome</filename> class supports recipes that
936 build software from the GNOME stack.
937 This class inherits the
938 <link linkend='ref-classes-gnomebase'><filename>gnomebase</filename></link>,
939 <link linkend='ref-classes-gtk-icon-cache'><filename>gtk-icon-cache</filename></link>,
940 <link linkend='ref-classes-gconf'><filename>gconf</filename></link> and
941 <link linkend='ref-classes-mime'><filename>mime</filename></link> classes.
942 The class also disables GObject introspection where applicable.
943 </para>
944</section>
945
946<section id='ref-classes-gnomebase'>
947 <title><filename>gnomebase.bbclass</filename></title>
948
949 <para>
950 The <filename>gnomebase</filename> class is the base
951 class for recipes that build software from the GNOME stack.
952 This class sets
953 <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link> to
954 download the source from the GNOME mirrors as well as extending
955 <link linkend='var-FILES'><filename>FILES</filename></link>
956 with the typical GNOME installation paths.
957 </para>
958</section>
959
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500960<section id='ref-classes-gobject-introspection'>
961 <title><filename>gobject-introspection.bbclass</filename></title>
962
963 <para>
964 Provides support for recipes building software that
965 supports GObject introspection.
966 This functionality is only enabled if the
967 "gobject-introspection-data" feature is in
968 <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>
969 as well as "qemu-usermode" being in
970 <link linkend='var-MACHINE_FEATURES'><filename>MACHINE_FEATURES</filename></link>.
971 <note>
972 This functionality is backfilled by default and,
973 if not applicable, should be disabled through
974 <link linkend='var-DISTRO_FEATURES_BACKFILL_CONSIDERED'><filename>DISTRO_FEATURES_BACKFILL_CONSIDERED</filename></link>
975 or
976 <link linkend='var-MACHINE_FEATURES_BACKFILL_CONSIDERED'><filename>MACHINE_FEATURES_BACKFILL_CONSIDERED</filename></link>,
977 respectively.
978 </note>
979 </para>
980</section>
981
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500982<section id='ref-classes-grub-efi'>
983 <title><filename>grub-efi.bbclass</filename></title>
984
985 <para>
986 The <filename>grub-efi</filename>
987 class provides <filename>grub-efi</filename>-specific functions for
988 building bootable images.
989 </para>
990
991 <para>
992 This class supports several variables:
993 <itemizedlist>
994 <listitem><para>
995 <link linkend='var-INITRD'><filename>INITRD</filename></link>:
996 Indicates list of filesystem images to concatenate and use
997 as an initial RAM disk (initrd) (optional).
998 </para></listitem>
999 <listitem><para>
1000 <link linkend='var-ROOTFS'><filename>ROOTFS</filename></link>:
1001 Indicates a filesystem image to include as the root filesystem
1002 (optional).</para></listitem>
1003 <listitem><para>
1004 <link linkend='var-GRUB_GFXSERIAL'><filename>GRUB_GFXSERIAL</filename></link>:
1005 Set this to "1" to have graphics and serial in the boot menu.
1006 </para></listitem>
1007 <listitem><para>
1008 <link linkend='var-LABELS'><filename>LABELS</filename></link>:
1009 A list of targets for the automatic configuration.
1010 </para></listitem>
1011 <listitem><para>
1012 <link linkend='var-APPEND'><filename>APPEND</filename></link>:
1013 An override list of append strings for each
1014 <filename>LABEL</filename>.
1015 </para></listitem>
1016 <listitem><para>
1017 <link linkend='var-GRUB_OPTS'><filename>GRUB_OPTS</filename></link>:
1018 Additional options to add to the configuration (optional).
1019 Options are delimited using semi-colon characters
1020 (<filename>;</filename>).</para></listitem>
1021 <listitem><para>
1022 <link linkend='var-GRUB_TIMEOUT'><filename>GRUB_TIMEOUT</filename></link>:
1023 Timeout before executing the default <filename>LABEL</filename>
1024 (optional).
1025 </para></listitem>
1026 </itemizedlist>
1027 </para>
1028</section>
1029
1030<section id='ref-classes-gsettings'>
1031 <title><filename>gsettings.bbclass</filename></title>
1032
1033 <para>
1034 The <filename>gsettings</filename> class
1035 provides common functionality for recipes that need to install
1036 GSettings (glib) schemas.
1037 The schemas are assumed to be part of the main package.
1038 Appropriate post-install and post-remove (postinst/postrm)
1039 scriptlets are added to register and unregister the schemas in the
1040 target image.
1041 </para>
1042</section>
1043
1044<section id='ref-classes-gtk-doc'>
1045 <title><filename>gtk-doc.bbclass</filename></title>
1046
1047 <para>
1048 The <filename>gtk-doc</filename> class
1049 is a helper class to pull in the appropriate
1050 <filename>gtk-doc</filename> dependencies and disable
1051 <filename>gtk-doc</filename>.
1052 </para>
1053</section>
1054
1055<section id='ref-classes-gtk-icon-cache'>
1056 <title><filename>gtk-icon-cache.bbclass</filename></title>
1057
1058 <para>
1059 The <filename>gtk-icon-cache</filename> class
1060 generates the proper post-install and post-remove (postinst/postrm)
1061 scriptlets for packages that use GTK+ and install icons.
1062 These scriptlets call <filename>gtk-update-icon-cache</filename> to add
1063 the fonts to GTK+'s icon cache.
1064 Since the cache files are architecture-specific,
1065 <filename>gtk-update-icon-cache</filename> is run using QEMU if the
1066 postinst scriptlets need to be run on the build host during image
1067 creation.
1068 </para>
1069</section>
1070
1071<section id='ref-classes-gtk-immodules-cache'>
1072 <title><filename>gtk-immodules-cache.bbclass</filename></title>
1073
1074 <para>
1075 The <filename>gtk-immodules-cache</filename> class
1076 generates the proper post-install and post-remove (postinst/postrm)
1077 scriptlets for packages that install GTK+ input method modules for
1078 virtual keyboards.
1079 These scriptlets call <filename>gtk-update-icon-cache</filename> to add
1080 the input method modules to the cache.
1081 Since the cache files are architecture-specific,
1082 <filename>gtk-update-icon-cache</filename> is run using QEMU if the
1083 postinst scriptlets need to be run on the build host during image
1084 creation.
1085 </para>
1086
1087 <para>
1088 If the input method modules being installed are in packages other than
1089 the main package, set
1090 <link linkend='var-GTKIMMODULES_PACKAGES'><filename>GTKIMMODULES_PACKAGES</filename></link>
1091 to specify the packages containing the modules.
1092 </para>
1093</section>
1094
1095<section id='ref-classes-gummiboot'>
1096 <title><filename>gummiboot.bbclass</filename></title>
1097
1098 <para>
1099 The <filename>gummiboot</filename> class provides functions specific
1100 to the gummiboot bootloader for building bootable images.
1101 This is an internal class and is not intended to be
1102 used directly.
1103 Set the
1104 <link linkend='var-EFI_PROVIDER'><filename>EFI_PROVIDER</filename></link>
1105 variable to "gummiboot" to use this class.
1106 </para>
1107
1108 <para>
1109 For information on more variables used and supported in this class,
1110 see the
1111 <link linkend='var-GUMMIBOOT_CFG'><filename>GUMMIBOOT_CFG</filename></link>,
1112 <link linkend='var-GUMMIBOOT_ENTRIES'><filename>GUMMIBOOT_ENTRIES</filename></link>,
1113 and
1114 <link linkend='var-GUMMIBOOT_TIMEOUT'><filename>GUMMIBOOT_TIMEOUT</filename></link>
1115 variables.
1116 </para>
1117
1118 <para>
1119 You can also see the
1120 <ulink url='http://freedesktop.org/wiki/Software/gummiboot/'>Gummiboot documentation</ulink>
1121 for more information.
1122 </para>
1123</section>
1124
1125<section id='ref-classes-gzipnative'>
1126 <title><filename>gzipnative.bbclass</filename></title>
1127
1128 <para>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001129 The <filename>gzipnative</filename> class enables the use of
1130 different native versions of <filename>gzip</filename>
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001131 and <filename>pigz</filename> rather than the versions of these tools
1132 from the build host.
1133 </para>
1134</section>
1135
1136<section id='ref-classes-icecc'>
1137 <title><filename>icecc.bbclass</filename></title>
1138
1139 <para>
1140 The <filename>icecc</filename> class supports
1141 <ulink url='https://github.com/icecc/icecream'>Icecream</ulink>, which
1142 facilitates taking compile jobs and distributing them among remote
1143 machines.
1144 </para>
1145
1146 <para>
1147 The class stages directories with symlinks from <filename>gcc</filename>
1148 and <filename>g++</filename> to <filename>icecc</filename>, for both
1149 native and cross compilers.
1150 Depending on each configure or compile, the OpenEmbedded build system
1151 adds the directories at the head of the <filename>PATH</filename> list
1152 and then sets the <filename>ICECC_CXX</filename> and
1153 <filename>ICEC_CC</filename> variables, which are the paths to the
1154 <filename>g++</filename> and <filename>gcc</filename> compilers,
1155 respectively.
1156 </para>
1157
1158 <para>
1159 For the cross compiler, the class creates a <filename>tar.gz</filename>
1160 file that contains the Yocto Project toolchain and sets
1161 <filename>ICECC_VERSION</filename>, which is the version of the
1162 cross-compiler used in the cross-development toolchain, accordingly.
1163 </para>
1164
1165 <para>
1166 The class handles all three different compile stages
1167 (i.e native ,cross-kernel and target) and creates the necessary
1168 environment <filename>tar.gz</filename> file to be used by the remote
1169 machines.
1170 The class also supports SDK generation.
1171 </para>
1172
1173 <para>
1174 If <link linkend='var-ICECC_PATH'><filename>ICECC_PATH</filename></link>
1175 is not set in your <filename>local.conf</filename> file, then the
1176 class tries to locate the <filename>icecc</filename> binary
1177 using <filename>which</filename>.
1178
1179 If
1180 <link linkend='var-ICECC_ENV_EXEC'><filename>ICECC_ENV_EXEC</filename></link>
1181 is set in your <filename>local.conf</filename> file, the variable should
1182 point to the <filename>icecc-create-env</filename> script
1183 provided by the user.
1184 If you do not point to a user-provided script, the build system
1185 uses the default script provided by the recipe
1186 <filename>icecc-create-env-native.bb</filename>.
1187 <note>
1188 This script is a modified version and not the one that comes with
1189 <filename>icecc</filename>.
1190 </note>
1191 </para>
1192
1193 <para>
1194 If you do not want the Icecream distributed compile support to apply
1195 to specific recipes or classes, you can effectively "blacklist" them
1196 by listing the recipes and classes using the
1197 <link linkend='var-ICECC_USER_PACKAGE_BL'><filename>ICECC_USER_PACKAGE_BL</filename></link>
1198 and
1199 <link linkend='var-ICECC_USER_CLASS_BL'><filename>ICECC_USER_CLASS_BL</filename></link>,
1200 variables, respectively, in your <filename>local.conf</filename> file.
1201 Doing so causes the OpenEmbedded build system to handle these
1202 compilations locally.
1203 </para>
1204
1205 <para>
1206 Additionally, you can list recipes using the
1207 <link linkend='var-ICECC_USER_PACKAGE_WL'><filename>ICECC_USER_PACKAGE_WL</filename></link>
1208 variable in your <filename>local.conf</filename> file to force
1209 <filename>icecc</filename> to be enabled for recipes using an empty
1210 <link linkend='var-PARALLEL_MAKE'><filename>PARALLEL_MAKE</filename></link>
1211 variable.
1212 </para>
1213
1214 <para>
1215 Inheriting the <filename>icecc</filename> class changes all sstate
1216 signatures.
1217 Consequently, if a development team has a dedicated build system
1218 that populates
1219 <link linkend='var-SSTATE_MIRRORS'><filename>STATE_MIRRORS</filename></link>
1220 and they want to reuse sstate from
1221 <filename>STATE_MIRRORS</filename>, then all developers and the
1222 build system need to either inherit the <filename>icecc</filename>
1223 class or nobody should.
1224 </para>
1225
1226 <para>
1227 At the distribution level, you can inherit the
1228 <filename>icecc</filename> class to be sure that all builders start
1229 with the same sstate signatures.
1230 After inheriting the class, you can then disable the feature by setting
1231 the
1232 <link linkend='var-ICECC_DISABLED'><filename>ICECC_DISABLED</filename></link>
1233 variable to "1" as follows:
1234 <literallayout class='monospaced'>
1235 INHERIT_DISTRO_append = " icecc"
1236 ICECC_DISABLED ??= "1"
1237 </literallayout>
1238 This practice makes sure everyone is using the same signatures but also
1239 requires individuals that do want to use Icecream to enable the feature
1240 individually as follows in your <filename>local.conf</filename> file:
1241 <literallayout class='monospaced'>
1242 ICECC_DISABLED = ""
1243 </literallayout>
1244 </para>
1245</section>
1246
1247<section id='ref-classes-image'>
1248 <title><filename>image.bbclass</filename></title>
1249
1250 <para>
1251 The <filename>image</filename> class helps support creating images
1252 in different formats.
1253 First, the root filesystem is created from packages using
1254 one of the <filename>rootfs*.bbclass</filename>
1255 files (depending on the package format used) and then one or more image
1256 files are created.
1257 <itemizedlist>
1258 <listitem><para>The
1259 <filename><link linkend='var-IMAGE_FSTYPES'>IMAGE_FSTYPES</link></filename>
1260 variable controls the types of images to generate.
1261 </para></listitem>
1262 <listitem><para>The
1263 <filename><link linkend='var-IMAGE_INSTALL'>IMAGE_INSTALL</link></filename>
1264 variable controls the list of packages to install into the
1265 image.</para></listitem>
1266 </itemizedlist>
1267 For information on customizing images, see the
1268 "<ulink url='&YOCTO_DOCS_DEV_URL;#usingpoky-extend-customimage'>Customizing Images</ulink>"
1269 section in the Yocto Project Development Manual.
1270 For information on how images are created, see the
1271 "<link linkend='images-dev-environment'>Images</link>" section elsewhere
1272 in this manual.
1273 </para>
1274</section>
1275
Patrick Williamsf1e5d692016-03-30 15:21:19 -05001276<section id='ref-classes-image-buildinfo'>
1277 <title><filename>image-buildinfo.bbclass</filename></title>
1278
1279 <para>
1280 The <filename>image-buildinfo</filename> class writes information
1281 to the target filesystem on <filename>/etc/build</filename>.
1282 </para>
1283</section>
1284
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001285<section id='ref-classes-image_types'>
1286 <title><filename>image_types.bbclass</filename></title>
1287
1288 <para>
1289 The <filename>image_types</filename> class defines all of
1290 the standard image output types that you can enable through the
1291 <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>
1292 variable.
1293 You can use this class as a reference on how to add support for custom
1294 image output types.
1295 </para>
1296
1297 <para>
1298 By default, this class is enabled through the
1299 <link linkend='var-IMAGE_CLASSES'><filename>IMAGE_CLASSES</filename></link>
1300 variable in
1301 <link linkend='ref-classes-image'><filename>image.bbclass</filename></link>.
1302 If you define your own image types using a custom BitBake class and
1303 then use <filename>IMAGE_CLASSES</filename> to enable it, the custom
1304 class must either inherit <filename>image_types</filename> or
1305 <filename>image_types</filename> must also appear in
1306 <filename>IMAGE_CLASSES</filename>.
1307 </para>
1308</section>
1309
1310<section id='ref-classes-image_types_uboot'>
1311 <title><filename>image_types_uboot.bbclass</filename></title>
1312
1313 <para>
1314 The <filename>image_types_uboot</filename> class
1315 defines additional image types specifically for the U-Boot bootloader.
1316 </para>
1317</section>
1318
1319<section id='ref-classes-image-live'>
1320 <title><filename>image-live.bbclass</filename></title>
1321
1322 <para>
1323 The <filename>image-live</filename> class supports building "live"
1324 images.
1325 </para>
1326
1327 <para>
1328 Normally, you do not use this class directly.
1329 Instead, you add "live" to
1330 <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>.
1331 For example, if you were building an ISO image, you would add "live"
1332 to <filename>IMAGE_FSTYPES</filename>, set the
1333 <link linkend='var-NOISO'><filename>NOISO</filename></link> variable to
1334 "0" and the build system would use the <filename>image-live</filename>
1335 class to build the ISO image.
1336 </para>
1337</section>
1338
1339<section id='ref-classes-image-mklibs'>
1340 <title><filename>image-mklibs.bbclass</filename></title>
1341
1342 <para>
1343 The <filename>image-mklibs</filename> class
1344 enables the use of the <filename>mklibs</filename> utility during the
1345 <link linkend='ref-tasks-rootfs'><filename>do_rootfs</filename></link>
1346 task, which optimizes the size of
1347 libraries contained in the image.
1348 </para>
1349
1350 <para>
1351 By default, the class is enabled in the
1352 <filename>local.conf.template</filename> using the
1353 <link linkend='var-USER_CLASSES'><filename>USER_CLASSES</filename></link>
1354 variable as follows:
1355 <literallayout class='monospaced'>
1356 USER_CLASSES ?= "buildstats image-mklibs image-prelink"
1357 </literallayout>
1358 </para>
1359</section>
1360
1361<section id='ref-classes-image-prelink'>
1362 <title><filename>image-prelink.bbclass</filename></title>
1363
1364 <para>
1365 The <filename>image-prelink</filename> class
1366 enables the use of the <filename>prelink</filename> utility during
1367 the
1368 <link linkend='ref-tasks-rootfs'><filename>do_rootfs</filename></link>
1369 task, which optimizes the dynamic
1370 linking of shared libraries to reduce executable startup time.
1371 </para>
1372
1373 <para>
1374 By default, the class is enabled in the
1375 <filename>local.conf.template</filename> using the
1376 <link linkend='var-USER_CLASSES'><filename>USER_CLASSES</filename></link>
1377 variable as follows:
1378 <literallayout class='monospaced'>
1379 USER_CLASSES ?= "buildstats image-mklibs image-prelink"
1380 </literallayout>
1381 </para>
1382</section>
1383
1384<section id='ref-classes-image-swab'>
1385 <title><filename>image-swab.bbclass</filename></title>
1386
1387 <para>
1388 The <filename>image-swab</filename> class enables the
1389 <ulink url='&YOCTO_HOME_URL;/tools-resources/projects/swabber'>Swabber</ulink>
1390 tool in order to detect and log accesses to the host system during
1391 the OpenEmbedded build process.
1392 <note>
1393 This class is currently unmaintained.
Patrick Williamsf1e5d692016-03-30 15:21:19 -05001394 The <filename>strace</filename> package needs to be installed
1395 in the build host as a dependency for this tool.
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001396 </note>
1397 </para>
1398</section>
1399
Patrick Williamsf1e5d692016-03-30 15:21:19 -05001400<section id='ref-classes-image-vm'>
1401 <title><filename>image-vm.bbclass</filename></title>
1402
1403 <para>
1404 The <filename>image-vm</filename> class supports building VM
1405 images.
1406 </para>
1407</section>
1408
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001409<section id='ref-classes-image-vmdk'>
1410 <title><filename>image-vmdk.bbclass</filename></title>
1411
1412 <para>
1413 The <filename>image-vmdk</filename> class supports building VMware
1414 VMDK images.
1415 Normally, you do not use this class directly.
1416 Instead, you add "vmdk" to
1417 <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>.
1418 </para>
1419</section>
1420
1421<section id='ref-classes-insane'>
1422 <title><filename>insane.bbclass</filename></title>
1423
1424 <para>
1425 The <filename>insane</filename> class adds a step to the package
1426 generation process so that output quality assurance checks are
1427 generated by the OpenEmbedded build system.
1428 A range of checks are performed that check the build's output
1429 for common problems that show up during runtime.
1430 Distribution policy usually dictates whether to include this class.
1431 </para>
1432
1433 <para>
1434 You can configure the sanity checks so that specific test failures
1435 either raise a warning or an error message.
1436 Typically, failures for new tests generate a warning.
1437 Subsequent failures for the same test would then generate an error
1438 message once the metadata is in a known and good condition.
1439 See the
1440 "<link linkend='ref-qa-checks'>QA Error and Warning Messages</link>"
1441 Chapter for a list of all the warning and error messages
1442 you might encounter using a default configuration.
1443 </para>
1444
1445 <para>
1446 Use the
1447 <link linkend='var-WARN_QA'><filename>WARN_QA</filename></link> and
1448 <link linkend='var-ERROR_QA'><filename>ERROR_QA</filename></link>
1449 variables to control the behavior of
1450 these checks at the global level (i.e. in your custom distro
1451 configuration).
1452 However, to skip one or more checks in recipes, you should use
1453 <link linkend='var-INSANE_SKIP'><filename>INSANE_SKIP</filename></link>.
1454 For example, to skip the check for symbolic link
1455 <filename>.so</filename> files in the main package of a recipe,
1456 add the following to the recipe.
1457 You need to realize that the package name override, in this example
1458 <filename>${PN}</filename>, must be used:
1459 <literallayout class='monospaced'>
1460 INSANE_SKIP_${PN} += "dev-so"
1461 </literallayout>
1462 Please keep in mind that the QA checks exist in order to detect real
1463 or potential problems in the packaged output.
1464 So exercise caution when disabling these checks.
1465 </para>
1466
1467 <para>
1468 The following list shows the tests you can list with the
1469 <filename>WARN_QA</filename> and <filename>ERROR_QA</filename>
1470 variables:
1471 <itemizedlist>
1472 <listitem><para><emphasis><filename>already-stripped:</filename></emphasis>
1473 Checks that produced binaries have not already been
1474 stripped prior to the build system extracting debug symbols.
1475 It is common for upstream software projects to default to
1476 stripping debug symbols for output binaries.
1477 In order for debugging to work on the target using
1478 <filename>-dbg</filename> packages, this stripping must be
1479 disabled.
1480 </para></listitem>
1481 <listitem><para><emphasis><filename>arch:</filename></emphasis>
1482 Checks the Executable and Linkable Format (ELF) type, bit size,
1483 and endianness of any binaries to ensure they match the target
1484 architecture.
1485 This test fails if any binaries do not match the type since
1486 there would be an incompatibility.
1487 The test could indicate that the
1488 wrong compiler or compiler options have been used.
1489 Sometimes software, like bootloaders, might need to bypass
1490 this check.
1491 </para></listitem>
1492 <listitem><para><emphasis><filename>buildpaths:</filename></emphasis>
1493 Checks for paths to locations on the build host inside the
1494 output files.
1495 Currently, this test triggers too many false positives and
1496 thus is not normally enabled.
1497 </para></listitem>
1498 <listitem><para><emphasis><filename>build-deps:</filename></emphasis>
1499 Determines if a build-time dependency that is specified through
1500 <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>,
1501 explicit
1502 <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>,
1503 or task-level dependencies exists to match any runtime
1504 dependency.
1505 This determination is particularly useful to discover where
1506 runtime dependencies are detected and added during packaging.
1507 If no explicit dependency has been specified within the
1508 metadata, at the packaging stage it is too late to ensure that
1509 the dependency is built, and thus you can end up with an
1510 error when the package is installed into the image during the
1511 <link linkend='ref-tasks-rootfs'><filename>do_rootfs</filename></link>
1512 task because the auto-detected dependency was not satisfied.
1513 An example of this would be where the
1514 <link linkend='ref-classes-update-rc.d'><filename>update-rc.d</filename></link>
1515 class automatically adds a dependency on the
1516 <filename>initscripts-functions</filename> package to packages
1517 that install an initscript that refers to
1518 <filename>/etc/init.d/functions</filename>.
1519 The recipe should really have an explicit
1520 <filename>RDEPENDS</filename> for the package in question on
1521 <filename>initscripts-functions</filename> so that the
1522 OpenEmbedded build system is able to ensure that the
1523 <filename>initscripts</filename> recipe is actually built and
1524 thus the <filename>initscripts-functions</filename> package is
1525 made available.
1526 </para></listitem>
1527 <listitem><para><emphasis><filename>compile-host-path:</filename></emphasis>
1528 Checks the
1529 <link linkend='ref-tasks-compile'><filename>do_compile</filename></link>
1530 log for indications
1531 that paths to locations on the build host were used.
1532 Using such paths might result in host contamination of the
1533 build output.
1534 </para></listitem>
1535 <listitem><para><emphasis><filename>debug-deps:</filename></emphasis>
1536 Checks that all packages except <filename>-dbg</filename>
1537 packages do not depend on <filename>-dbg</filename>
1538 packages, which would cause a packaging bug.
1539 </para></listitem>
1540 <listitem><para><emphasis><filename>debug-files:</filename></emphasis>
1541 Checks for <filename>.debug</filename> directories in anything but the
1542 <filename>-dbg</filename> package.
1543 The debug files should all be in the <filename>-dbg</filename> package.
1544 Thus, anything packaged elsewhere is incorrect packaging.</para></listitem>
1545 <listitem><para><emphasis><filename>dep-cmp:</filename></emphasis>
1546 Checks for invalid version comparison statements in runtime
1547 dependency relationships between packages (i.e. in
1548 <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>,
1549 <link linkend='var-RRECOMMENDS'><filename>RRECOMMENDS</filename></link>,
1550 <link linkend='var-RSUGGESTS'><filename>RSUGGESTS</filename></link>,
1551 <link linkend='var-RPROVIDES'><filename>RPROVIDES</filename></link>,
1552 <link linkend='var-RREPLACES'><filename>RREPLACES</filename></link>,
1553 and
1554 <link linkend='var-RCONFLICTS'><filename>RCONFLICTS</filename></link>
1555 variable values).
1556 Any invalid comparisons might trigger failures or undesirable
1557 behavior when passed to the package manager.
1558 </para></listitem>
1559 <listitem><para><emphasis><filename>desktop:</filename></emphasis>
1560 Runs the <filename>desktop-file-validate</filename> program
1561 against any <filename>.desktop</filename> files to validate
1562 their contents against the specification for
1563 <filename>.desktop</filename> files.</para></listitem>
1564 <listitem><para><emphasis><filename>dev-deps:</filename></emphasis>
1565 Checks that all packages except <filename>-dev</filename>
1566 or <filename>-staticdev</filename> packages do not depend on
1567 <filename>-dev</filename> packages, which would be a
1568 packaging bug.</para></listitem>
1569 <listitem><para><emphasis><filename>dev-so:</filename></emphasis>
1570 Checks that the <filename>.so</filename> symbolic links are in the
1571 <filename>-dev</filename> package and not in any of the other packages.
1572 In general, these symlinks are only useful for development purposes.
1573 Thus, the <filename>-dev</filename> package is the correct location for
1574 them.
1575 Some very rare cases do exist for dynamically loaded modules where
1576 these symlinks are needed instead in the main package.
1577 </para></listitem>
1578 <listitem><para><emphasis><filename>file-rdeps:</filename></emphasis>
1579 Checks that file-level dependencies identified by the
1580 OpenEmbedded build system at packaging time are satisfied.
1581 For example, a shell script might start with the line
1582 <filename>#!/bin/bash</filename>.
1583 This line would translate to a file dependency on
1584 <filename>/bin/bash</filename>.
1585 Of the three package managers that the OpenEmbedded build
1586 system supports, only RPM directly handles file-level
1587 dependencies, resolving them automatically to packages
1588 providing the files.
1589 However, the lack of that functionality in the other two
1590 package managers does not mean the dependencies do not still
1591 need resolving.
1592 This QA check attempts to ensure that explicitly declared
1593 <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>
1594 exist to handle any file-level dependency detected in
1595 packaged files.
1596 </para></listitem>
1597 <listitem><para><emphasis><filename>files-invalid:</filename></emphasis>
1598 Checks for
1599 <link linkend='var-FILES'><filename>FILES</filename></link>
1600 variable values that contain "//", which is invalid.
1601 </para></listitem>
1602 <listitem><para><emphasis><filename>incompatible-license:</filename></emphasis>
1603 Report when packages are excluded from being created due to
1604 being marked with a license that is in
1605 <link linkend='var-INCOMPATIBLE_LICENSE'><filename>INCOMPATIBLE_LICENSE</filename></link>.
1606 </para></listitem>
1607 <listitem><para><emphasis><filename>install-host-path:</filename></emphasis>
1608 Checks the
1609 <link linkend='ref-tasks-install'><filename>do_install</filename></link>
1610 log for indications
1611 that paths to locations on the build host were used.
1612 Using such paths might result in host contamination of the
1613 build output.
1614 </para></listitem>
1615 <listitem><para><emphasis><filename>installed-vs-shipped:</filename></emphasis>
1616 Reports when files have been installed within
1617 <filename>do_install</filename> but have not been included in
1618 any package by way of the
1619 <link linkend='var-FILES'><filename>FILES</filename></link>
1620 variable.
1621 Files that do not appear in any package cannot be present in
1622 an image later on in the build process.
1623 Ideally, all installed files should be packaged or not
1624 installed at all.
1625 These files can be deleted at the end of
1626 <filename>do_install</filename> if the files are not
1627 needed in any package.
1628 </para></listitem>
1629 <listitem><para><emphasis><filename>la:</filename></emphasis>
1630 Checks <filename>.la</filename> files for any <filename>TMPDIR</filename>
1631 paths.
1632 Any <filename>.la</filename> file containing these paths is incorrect since
1633 <filename>libtool</filename> adds the correct sysroot prefix when using the
1634 files automatically itself.</para></listitem>
1635 <listitem><para><emphasis><filename>ldflags:</filename></emphasis>
1636 Ensures that the binaries were linked with the
1637 <link linkend='var-LDFLAGS'><filename>LDFLAGS</filename></link>
1638 options provided by the build system.
1639 If this test fails, check that the <filename>LDFLAGS</filename> variable
1640 is being passed to the linker command.</para></listitem>
1641 <listitem><para><emphasis><filename>libdir:</filename></emphasis>
1642 Checks for libraries being installed into incorrect
1643 (possibly hardcoded) installation paths.
1644 For example, this test will catch recipes that install
1645 <filename>/lib/bar.so</filename> when
1646 <filename>${base_libdir}</filename> is "lib32".
1647 Another example is when recipes install
1648 <filename>/usr/lib64/foo.so</filename> when
1649 <filename>${libdir}</filename> is "/usr/lib".
1650 </para></listitem>
1651 <listitem><para><emphasis><filename>libexec:</filename></emphasis>
1652 Checks if a package contains files in
1653 <filename>/usr/libexec</filename>.
1654 This check is not performed if the
1655 <filename>libexecdir</filename> variable has been set
1656 explicitly to <filename>/usr/libexec</filename>.
1657 </para></listitem>
1658 <listitem><para><emphasis><filename>packages-list:</filename></emphasis>
1659 Checks for the same package being listed multiple times through
1660 the <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link>
1661 variable value.
1662 Installing the package in this manner can cause errors during
1663 packaging.
1664 </para></listitem>
1665 <listitem><para><emphasis><filename>perm-config:</filename></emphasis>
1666 Reports lines in <filename>fs-perms.txt</filename> that have
1667 an invalid format.
1668 </para></listitem>
1669 <listitem><para><emphasis><filename>perm-line:</filename></emphasis>
1670 Reports lines in <filename>fs-perms.txt</filename> that have
1671 an invalid format.
1672 </para></listitem>
1673 <listitem><para><emphasis><filename>perm-link:</filename></emphasis>
1674 Reports lines in <filename>fs-perms.txt</filename> that
1675 specify 'link' where the specified target already exists.
1676 </para></listitem>
1677 <listitem><para><emphasis><filename>perms:</filename></emphasis>
1678 Currently, this check is unused but reserved.
1679 </para></listitem>
1680 <listitem><para><emphasis><filename>pkgconfig:</filename></emphasis>
1681 Checks <filename>.pc</filename> files for any
1682 <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>/<link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>
1683 paths.
1684 Any <filename>.pc</filename> file containing these paths is incorrect
1685 since <filename>pkg-config</filename> itself adds the correct sysroot prefix
1686 when the files are accessed.</para></listitem>
1687 <listitem><para><emphasis><filename>pkgname:</filename></emphasis>
1688 Checks that all packages in
1689 <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link>
1690 have names that do not contain invalid characters (i.e.
1691 characters other than 0-9, a-z, ., +, and -).
1692 </para></listitem>
1693 <listitem><para><emphasis><filename>pkgv-undefined:</filename></emphasis>
1694 Checks to see if the <filename>PKGV</filename> variable
1695 is undefined during
1696 <link linkend='ref-tasks-package'><filename>do_package</filename></link>.
1697 </para></listitem>
1698 <listitem><para><emphasis><filename>pkgvarcheck:</filename></emphasis>
1699 Checks through the variables
1700 <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>,
1701 <link linkend='var-RRECOMMENDS'><filename>RRECOMMENDS</filename></link>,
1702 <link linkend='var-RSUGGESTS'><filename>RSUGGESTS</filename></link>,
1703 <link linkend='var-RCONFLICTS'><filename>RCONFLICTS</filename></link>,
1704 <link linkend='var-RPROVIDES'><filename>RPROVIDES</filename></link>,
1705 <link linkend='var-RREPLACES'><filename>RREPLACES</filename></link>,
1706 <link linkend='var-FILES'><filename>FILES</filename></link>,
1707 <link linkend='var-ALLOW_EMPTY'><filename>ALLOW_EMPTY</filename></link>,
1708 <filename>pkg_preinst</filename>,
1709 <filename>pkg_postinst</filename>,
1710 <filename>pkg_prerm</filename>
1711 and <filename>pkg_postrm</filename>, and reports if there are
1712 variable sets that are not package-specific.
1713 Using these variables without a package suffix is bad practice,
1714 and might unnecessarily complicate dependencies of other packages
1715 within the same recipe or have other unintended consequences.
1716 </para></listitem>
1717 <listitem><para><emphasis><filename>pn-overrides:</filename></emphasis>
1718 Checks that a recipe does not have a name
1719 (<link linkend='var-PN'><filename>PN</filename></link>) value
1720 that appears in
1721 <link linkend='var-OVERRIDES'><filename>OVERRIDES</filename></link>.
1722 If a recipe is named such that its <filename>PN</filename>
1723 value matches something already in
1724 <filename>OVERRIDES</filename> (e.g. <filename>PN</filename>
1725 happens to be the same as
1726 <link linkend='var-MACHINE'><filename>MACHINE</filename></link>
1727 or
1728 <link linkend='var-DISTRO'><filename>DISTRO</filename></link>),
1729 it can have unexpected consequences.
1730 For example, assignments such as
1731 <filename>FILES_${PN} = "xyz"</filename> effectively turn into
1732 <filename>FILES = "xyz"</filename>.
1733 </para></listitem>
1734 <listitem><para><emphasis><filename>rpaths:</filename></emphasis>
1735 Checks for rpaths in the binaries that contain build system paths such
1736 as <filename>TMPDIR</filename>.
1737 If this test fails, bad <filename>-rpath</filename> options are being
1738 passed to the linker commands and your binaries have potential security
1739 issues.</para></listitem>
1740 <listitem><para><emphasis><filename>split-strip:</filename></emphasis>
1741 Reports that splitting or stripping debug symbols from binaries
1742 has failed.
1743 </para></listitem>
1744 <listitem><para><emphasis><filename>staticdev:</filename></emphasis>
1745 Checks for static library files (<filename>*.a</filename>) in
1746 non-<filename>staticdev</filename> packages.
1747 </para></listitem>
1748 <listitem><para><emphasis><filename>symlink-to-sysroot:</filename></emphasis>
1749 Checks for symlinks in packages that point into
1750 <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>
1751 on the host.
1752 Such symlinks will work on the host, but are clearly invalid
1753 when running on the target.
1754 </para></listitem>
1755 <listitem><para><emphasis><filename>textrel:</filename></emphasis>
1756 Checks for ELF binaries that contain relocations in their
1757 <filename>.text</filename> sections, which can result in a
1758 performance impact at runtime.
1759 See the explanation for the
1760 <link linkend='qa-issue-textrel'><filename>ELF binary</filename></link>
1761 message for more information regarding runtime performance issues.
1762 </para></listitem>
1763 <listitem><para><emphasis><filename>unsafe-references-in-binaries:</filename></emphasis>
1764 Reports when a binary installed in
1765 <filename>${base_libdir}</filename>,
1766 <filename>${base_bindir}</filename>, or
1767 <filename>${base_sbindir}</filename>, depends on another
1768 binary installed under <filename>${exec_prefix}</filename>.
1769 This dependency is a concern if you want the system to remain
1770 basically operable if <filename>/usr</filename> is mounted
1771 separately and is not mounted.
1772 <note>
1773 Defaults for binaries installed in
1774 <filename>${base_libdir}</filename>,
1775 <filename>${base_bindir}</filename>, and
1776 <filename>${base_sbindir}</filename> are
1777 <filename>/lib</filename>, <filename>/bin</filename>, and
1778 <filename>/sbin</filename>, respectively.
1779 The default for a binary installed
1780 under <filename>${exec_prefix}</filename> is
1781 <filename>/usr</filename>.
1782 </note>
1783 </para></listitem>
1784 <listitem><para><emphasis><filename>unsafe-references-in-scripts:</filename></emphasis>
1785 Reports when a script file installed in
1786 <filename>${base_libdir}</filename>,
1787 <filename>${base_bindir}</filename>, or
1788 <filename>${base_sbindir}</filename>, depends on files
1789 installed under <filename>${exec_prefix}</filename>.
1790 This dependency is a concern if you want the system to remain
1791 basically operable if <filename>/usr</filename> is mounted
1792 separately and is not mounted.
1793 <note>
1794 Defaults for binaries installed in
1795 <filename>${base_libdir}</filename>,
1796 <filename>${base_bindir}</filename>, and
1797 <filename>${base_sbindir}</filename> are
1798 <filename>/lib</filename>, <filename>/bin</filename>, and
1799 <filename>/sbin</filename>, respectively.
1800 The default for a binary installed
1801 under <filename>${exec_prefix}</filename> is
1802 <filename>/usr</filename>.
1803 </note>
1804 </para></listitem>
1805 <listitem><para><emphasis><filename>useless-rpaths:</filename></emphasis>
1806 Checks for dynamic library load paths (rpaths) in the binaries that
1807 by default on a standard system are searched by the linker (e.g.
1808 <filename>/lib</filename> and <filename>/usr/lib</filename>).
1809 While these paths will not cause any breakage, they do waste space and
1810 are unnecessary.</para></listitem>
1811 <listitem><para><emphasis><filename>var-undefined:</filename></emphasis>
1812 Reports when variables fundamental to packaging (i.e.
1813 <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>,
1814 <link linkend='var-DEPLOY_DIR'><filename>DEPLOY_DIR</filename></link>,
1815 <link linkend='var-D'><filename>D</filename></link>,
1816 <link linkend='var-PN'><filename>PN</filename></link>, and
1817 <link linkend='var-PKGD'><filename>PKGD</filename></link>) are
1818 undefined during
1819 <link linkend='ref-tasks-package'><filename>do_package</filename></link>.
1820 </para></listitem>
1821 <listitem><para><emphasis><filename>version-going-backwards:</filename></emphasis>
1822 If Build History is enabled, reports when a package
1823 being written out has a lower version than the previously
1824 written package under the same name.
1825 If you are placing output packages into a feed and
1826 upgrading packages on a target system using that feed, the
1827 version of a package going backwards can result in the target
1828 system not correctly upgrading to the "new" version of the
1829 package.
1830 <note>
1831 If you are not using runtime package management on your
1832 target system, then you do not need to worry about
1833 this situation.
1834 </note>
1835 </para></listitem>
1836 <listitem><para><emphasis><filename>xorg-driver-abi:</filename></emphasis>
1837 Checks that all packages containing Xorg drivers have ABI
1838 dependencies.
1839 The <filename>xserver-xorg</filename> recipe provides driver
1840 ABI names.
1841 All drivers should depend on the ABI versions that they have
1842 been built against.
1843 Driver recipes that include
1844 <filename>xorg-driver-input.inc</filename>
1845 or <filename>xorg-driver-video.inc</filename> will
1846 automatically get these versions.
1847 Consequently, you should only need to explicitly add
1848 dependencies to binary driver recipes.
1849 </para></listitem>
1850 </itemizedlist>
1851 </para>
1852</section>
1853
1854<section id='ref-classes-insserv'>
1855 <title><filename>insserv.bbclass</filename></title>
1856
1857 <para>
1858 The <filename>insserv</filename> class
1859 uses the <filename>insserv</filename> utility to update the order of
1860 symbolic links in <filename>/etc/rc?.d/</filename> within an image
1861 based on dependencies specified by LSB headers in the
1862 <filename>init.d</filename> scripts themselves.
1863 </para>
1864</section>
1865
1866<section id='ref-classes-kernel'>
1867 <title><filename>kernel.bbclass</filename></title>
1868
1869 <para>
1870 The <filename>kernel</filename> class handles building Linux kernels.
1871 The class contains code to build all kernel trees.
1872 All needed headers are staged into the
1873 <filename><link linkend='var-STAGING_KERNEL_DIR'>STAGING_KERNEL_DIR</link></filename>
1874 directory to allow out-of-tree module builds using
1875 the
1876 <link linkend='ref-classes-module'><filename>module</filename></link>
1877 class.
1878 </para>
1879
1880 <para>
1881 This means that each built kernel module is packaged separately and inter-module
1882 dependencies are created by parsing the <filename>modinfo</filename> output.
1883 If all modules are required, then installing the <filename>kernel-modules</filename>
1884 package installs all packages with modules and various other kernel packages
1885 such as <filename>kernel-vmlinux</filename>.
1886 </para>
1887
1888 <para>
1889 Various other classes are used by the <filename>kernel</filename>
1890 and <filename>module</filename> classes internally including the
1891 <link linkend='ref-classes-kernel-arch'><filename>kernel-arch</filename></link>,
1892 <link linkend='ref-classes-module-base'><filename>module-base</filename></link>,
1893 and
1894 <link linkend='ref-classes-linux-kernel-base'><filename>linux-kernel-base</filename></link>
1895 classes.
1896 </para>
1897</section>
1898
1899<section id='ref-classes-kernel-arch'>
1900 <title><filename>kernel-arch.bbclass</filename></title>
1901
1902 <para>
1903 The <filename>kernel-arch</filename> class
1904 sets the <filename>ARCH</filename> environment variable for Linux
1905 kernel compilation (including modules).
1906 </para>
1907</section>
1908
Patrick Williamsf1e5d692016-03-30 15:21:19 -05001909<section id='ref-classes-kernel-fitimage'>
1910 <title><filename>kernel-fitimage.bbclass</filename></title>
1911
1912 <para>
1913 The <filename>kernel-fitimage</filename> class provides support to
1914 pack zImages.
1915 </para>
1916</section>
1917
1918<section id='ref-classes-kernel-grub'>
1919 <title><filename>kernel-grub.bbclass</filename></title>
1920
1921 <para>
1922 The <filename>kernel-grub</filename> class updates the boot area and
1923 the boot menu with the kernel as the priority boot mechanism while
1924 installing a RPM to update the kernel on a deployed target.
1925 </para>
1926</section>
1927
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001928<section id='ref-classes-kernel-module-split'>
1929 <title><filename>kernel-module-split.bbclass</filename></title>
1930
1931 <para>
1932 The <filename>kernel-module-split</filename> class
1933 provides common functionality for splitting Linux kernel modules into
1934 separate packages.
1935 </para>
1936</section>
1937
Patrick Williamsf1e5d692016-03-30 15:21:19 -05001938<section id='ref-classes-kernel-uboot'>
1939 <title><filename>kernel-uboot.bbclass</filename></title>
1940
1941 <para>
1942 The <filename>kernel-uboot</filename> class provides support for
1943 building from vmlinux-style kernel sources.
1944 </para>
1945</section>
1946
1947<section id='ref-classes-kernel-uimage'>
1948 <title><filename>kernel-uimage.bbclass</filename></title>
1949
1950 <para>
1951 The <filename>kernel-uimage</filename> class provides support to
1952 pack uImage.
1953 </para>
1954</section>
1955
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001956<section id='ref-classes-kernel-yocto'>
1957 <title><filename>kernel-yocto.bbclass</filename></title>
1958
1959 <para>
1960 The <filename>kernel-yocto</filename> class
1961 provides common functionality for building from linux-yocto style
1962 kernel source repositories.
1963 </para>
1964</section>
1965
Patrick Williamsf1e5d692016-03-30 15:21:19 -05001966<section id='ref-classes-kernelsrc'>
1967 <title><filename>kernelsrc.bbclass</filename></title>
1968
1969 <para>
1970 The <filename>kernelsrc</filename> class sets the Linux kernel
1971 source and version.
1972 </para>
1973</section>
1974
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001975<section id='ref-classes-lib_package'>
1976 <title><filename>lib_package.bbclass</filename></title>
1977
1978 <para>
1979 The <filename>lib_package</filename> class
1980 supports recipes that build libraries and produce executable
1981 binaries, where those binaries should not be installed by default
1982 along with the library.
1983 Instead, the binaries are added to a separate
1984 <filename>${</filename><link linkend='var-PN'><filename>PN</filename></link><filename>}-bin</filename>
1985 package to make their installation optional.
1986 </para>
1987</section>
1988
Patrick Williamsf1e5d692016-03-30 15:21:19 -05001989<section id='ref-classes-libc*'>
1990 <title><filename>libc*.bbclass</filename></title>
1991
1992 <para>
1993 The <filename>libc*</filename> classes support recipes that build
1994 packages with <filename>libc</filename>:
1995 <itemizedlist>
1996 <listitem><para>The <filename>libc-common</filename> class
1997 provides common support for building with
1998 <filename>libc</filename>.
1999 </para></listitem>
2000 <listitem><para>The <filename>libc-package</filename> class
2001 supports packaging up <filename>glibc</filename> and
2002 <filename>eglibc</filename>.
2003 </para></listitem>
2004 </itemizedlist>
2005 </para>
2006</section>
2007
Patrick Williamsc124f4f2015-09-15 14:41:29 -05002008<section id='ref-classes-license'>
2009 <title><filename>license.bbclass</filename></title>
2010
2011 <para>
2012 The <filename>license</filename> class provides license
2013 manifest creation and license exclusion.
2014 This class is enabled by default using the default value for the
2015 <link linkend='var-INHERIT_DISTRO'><filename>INHERIT_DISTRO</filename></link>
2016 variable.
2017 </para>
2018</section>
2019
2020<section id='ref-classes-linux-kernel-base'>
2021 <title><filename>linux-kernel-base.bbclass</filename></title>
2022
2023 <para>
2024 The <filename>linux-kernel-base</filename> class
2025 provides common functionality for recipes that build out of the Linux
2026 kernel source tree.
2027 These builds goes beyond the kernel itself.
2028 For example, the Perf recipe also inherits this class.
2029 </para>
2030</section>
2031
Patrick Williamsf1e5d692016-03-30 15:21:19 -05002032<section id='ref-classes-linuxloader'>
2033 <title><filename>linuxloader.bbclass</filename></title>
2034
2035 <para>
2036 Provides the function <filename>linuxloader()</filename>, which gives
2037 the value of the dynamic loader/linker provided on the platform.
2038 This value is used by a number of other classes.
2039 </para>
2040</section>
2041
Patrick Williamsc124f4f2015-09-15 14:41:29 -05002042<section id='ref-classes-logging'>
2043 <title><filename>logging.bbclass</filename></title>
2044
2045 <para>
2046 The <filename>logging</filename> class provides the standard
2047 shell functions used to log messages for various BitBake severity levels
2048 (i.e. <filename>bbplain</filename>, <filename>bbnote</filename>,
2049 <filename>bbwarn</filename>, <filename>bberror</filename>,
2050 <filename>bbfatal</filename>, and <filename>bbdebug</filename>).
2051 </para>
2052
2053 <para>
2054 This class is enabled by default since it is inherited by
2055 the <filename>base</filename> class.
2056 </para>
2057</section>
2058
2059<section id='ref-classes-meta'>
2060 <title><filename>meta.bbclass</filename></title>
2061
2062 <para>
2063 The <filename>meta</filename> class is inherited by recipes
2064 that do not build any output packages themselves, but act as a "meta"
2065 target for building other recipes.
2066 </para>
2067</section>
2068
2069<section id='ref-classes-metadata_scm'>
2070 <title><filename>metadata_scm.bbclass</filename></title>
2071
2072 <para>
2073 The <filename>metadata_scm</filename> class provides functionality for
2074 querying the branch and revision of a Source Code Manager (SCM)
2075 repository.
2076 </para>
2077
2078 <para>
2079 The <link linkend='ref-classes-base'><filename>base</filename></link>
2080 class uses this class to print the revisions of each layer before
2081 starting every build.
2082 The <filename>metadata_scm</filename> class is enabled by default
2083 because it is inherited by the <filename>base</filename> class.
2084 </para>
2085</section>
2086
Patrick Williamsf1e5d692016-03-30 15:21:19 -05002087<section id='ref-classes-migrate_localcount'>
2088 <title><filename>migrate_localcount.bbclass</filename></title>
2089
2090 <para>
2091 The <filename>migrate_localcount</filename> class verifies a recipe's
2092 localcount data and increments it appropriately.
2093 </para>
2094</section>
2095
Patrick Williamsc124f4f2015-09-15 14:41:29 -05002096<section id='ref-classes-mime'>
2097 <title><filename>mime.bbclass</filename></title>
2098
2099 <para>
2100 The <filename>mime</filename> class generates the proper
2101 post-install and post-remove (postinst/postrm) scriptlets for packages
2102 that install MIME type files.
2103 These scriptlets call <filename>update-mime-database</filename> to add
2104 the MIME types to the shared database.
2105 </para>
2106</section>
2107
2108<section id='ref-classes-mirrors'>
2109 <title><filename>mirrors.bbclass</filename></title>
2110
2111 <para>
2112 The <filename>mirrors</filename> class sets up some standard
2113 <link linkend='var-MIRRORS'><filename>MIRRORS</filename></link> entries
2114 for source code mirrors.
2115 These mirrors provide a fall-back path in case the upstream source
2116 specified in
2117 <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>
2118 within recipes is unavailable.
2119 </para>
2120
2121 <para>
2122 This class is enabled by default since it is inherited by the
2123 <link linkend='ref-classes-base'><filename>base</filename></link> class.
2124 </para>
2125</section>
2126
2127<section id='ref-classes-module'>
2128 <title><filename>module.bbclass</filename></title>
2129
2130 <para>
2131 The <filename>module</filename> class provides support for building
2132 out-of-tree Linux kernel modules.
2133 The class inherits the
2134 <link linkend='ref-classes-module-base'><filename>module-base</filename></link>
2135 and
2136 <link linkend='ref-classes-kernel-module-split'><filename>kernel-module-split</filename></link>
2137 classes, and implements the
2138 <link linkend='ref-tasks-compile'><filename>do_compile</filename></link>
2139 and
2140 <link linkend='ref-tasks-install'><filename>do_install</filename></link>
2141 tasks.
2142 The class provides everything needed to build and package a kernel
2143 module.
2144 </para>
2145
2146 <para>
2147 For general information on out-of-tree Linux kernel modules, see the
2148 "<ulink url='&YOCTO_DOCS_KERNEL_URL;#incorporating-out-of-tree-modules'>Incorporating Out-of-Tree Modules</ulink>"
2149 section in the Yocto Project Linux Kernel Development Manual.
2150 </para>
2151</section>
2152
2153<section id='ref-classes-module-base'>
2154 <title><filename>module-base.bbclass</filename></title>
2155
2156 <para>
2157 The <filename>module-base</filename> class provides the base
2158 functionality for building Linux kernel modules.
2159 Typically, a recipe that builds software that includes one or
2160 more kernel modules and has its own means of building
2161 the module inherits this class as opposed to inheriting the
2162 <link linkend='ref-classes-module'><filename>module</filename></link>
2163 class.
2164 </para>
2165</section>
2166
2167<section id='ref-classes-multilib*'>
2168 <title><filename>multilib*.bbclass</filename></title>
2169
2170 <para>
2171 The <filename>multilib*</filename> classes provide support
2172 for building libraries with different target optimizations or target
2173 architectures and installing them side-by-side in the same image.
2174 </para>
2175
2176 <para>
2177 For more information on using the Multilib feature, see the
2178 "<ulink url='&YOCTO_DOCS_DEV_URL;#combining-multiple-versions-library-files-into-one-image'>Combining Multiple Versions of Library Files into One Image</ulink>"
2179 section in the Yocto Project Development Manual.
2180 </para>
2181</section>
2182
2183<section id='ref-classes-native'>
2184 <title><filename>native.bbclass</filename></title>
2185
2186 <para>
2187 The <filename>native</filename> class provides common
2188 functionality for recipes that wish to build tools to run on the build
2189 host (i.e. tools that use the compiler or other tools from the
2190 build host).
2191 </para>
2192
2193 <para>
2194 You can create a recipe that builds tools that run natively on the
2195 host a couple different ways:
2196 <itemizedlist>
2197 <listitem><para>Create a <replaceable>myrecipe</replaceable><filename>-native.bb</filename>
2198 that inherits the <filename>native</filename> class.
2199 If you use this method, you must order the inherit statement
2200 in the recipe after all other inherit statements so that the
2201 <filename>native</filename> class is inherited last.
2202 </para></listitem>
2203 <listitem><para>Create or modify a target recipe that contains
2204 the following:
2205 <literallayout class='monospaced'>
2206 <link linkend='var-BBCLASSEXTEND'><filename>BBCLASSEXTEND</filename></link> = "native"
2207 </literallayout>
2208 Inside the recipe, use <filename>_class-native</filename> and
2209 <filename>_class-target</filename> overrides to specify any
2210 functionality specific to the respective native or target
2211 case.</para></listitem>
2212 </itemizedlist>
2213 </para>
2214
2215 <para>
2216 Although applied differently, the <filename>native</filename> class is
2217 used with both methods.
2218 The advantage of the second method is that you do not need to have two
2219 separate recipes (assuming you need both) for native and target.
2220 All common parts of the recipe are automatically shared.
2221 </para>
2222</section>
2223
2224<section id='ref-classes-nativesdk'>
2225 <title><filename>nativesdk.bbclass</filename></title>
2226
2227 <para>
2228 The <filename>nativesdk</filename> class provides common
2229 functionality for recipes that wish to build tools to run as part of
2230 an SDK (i.e. tools that run on
2231 <link linkend='var-SDKMACHINE'><filename>SDKMACHINE</filename></link>).
2232 </para>
2233
2234 <para>
2235 You can create a recipe that builds tools that run on the SDK machine
2236 a couple different ways:
2237 <itemizedlist>
2238 <listitem><para>Create a
2239 <filename>nativesdk-</filename><replaceable>myrecipe</replaceable><filename>.bb</filename>
2240 recipe that inherits the <filename>nativesdk</filename> class.
2241 If you use this method, you must order the inherit statement
2242 in the recipe after all other inherit statements so that the
2243 <filename>nativesdk</filename> class is inherited last.
2244 </para></listitem>
2245 <listitem><para>Create a <filename>nativesdk</filename> variant
2246 of any recipe by adding the following:
2247 <literallayout class='monospaced'>
2248 <link linkend='var-BBCLASSEXTEND'><filename>BBCLASSEXTEND</filename></link> = "nativesdk"
2249 </literallayout>
2250 Inside the recipe, use <filename>_class-nativesdk</filename> and
2251 <filename>_class-target</filename> overrides to specify any
2252 functionality specific to the respective SDK machine or target
2253 case.</para></listitem>
2254 </itemizedlist>
2255 </para>
2256
2257 <para>
2258 Although applied differently, the <filename>nativesdk</filename> class
2259 is used with both methods.
2260 The advantage of the second method is that you do not need to have two
2261 separate recipes (assuming you need both) for the SDK machine and the
2262 target.
2263 All common parts of the recipe are automatically shared.
2264 </para>
2265</section>
2266
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05002267<section id='ref-classes-nopackages'>
2268 <title><filename>nopackages.bbclass</filename></title>
2269
2270 <para>
2271 Disables packaging tasks for those recipes and classes where
2272 packaging is not needed.
2273 </para>
2274</section>
2275
2276<section id='ref-classes-npm'>
2277 <title><filename>npm.bbclass</filename></title>
2278
2279 <para>
2280 Provides support for building Node.js software fetched using the npm
2281 package manager.
2282 <note>
2283 Currently, recipes inheriting this class must use the
2284 <filename>npm://</filename> fetcher to have dependencies fetched
2285 and packaged automatically.
2286 </note>
2287 </para>
2288</section>
2289
Patrick Williamsc124f4f2015-09-15 14:41:29 -05002290<section id='ref-classes-oelint'>
2291 <title><filename>oelint.bbclass</filename></title>
2292
2293 <para>
2294 The <filename>oelint</filename> class is an
2295 obsolete lint checking tool that exists in
2296 <filename>meta/classes</filename> in the
2297 <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
2298 </para>
2299
2300 <para>
2301 A number of classes exist that could be generally useful in
2302 OE-Core but are never actually used within OE-Core itself.
2303 The <filename>oelint</filename> class is one such example.
2304 However, being aware of this class can reduce the proliferation of
2305 different versions of similar classes across multiple layers.
2306 </para>
2307</section>
2308
2309<section id='ref-classes-own-mirrors'>
2310 <title><filename>own-mirrors.bbclass</filename></title>
2311
2312 <para>
2313 The <filename>own-mirrors</filename> class makes it
2314 easier to set up your own
2315 <link linkend='var-PREMIRRORS'><filename>PREMIRRORS</filename></link>
2316 from which to first fetch source before attempting to fetch it from the
2317 upstream specified in
2318 <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>
2319 within each recipe.
2320 </para>
2321
2322 <para>
2323 To use this class, inherit it globally and specify
2324 <link linkend='var-SOURCE_MIRROR_URL'><filename>SOURCE_MIRROR_URL</filename></link>.
2325 Here is an example:
2326 <literallayout class='monospaced'>
2327 INHERIT += "own-mirrors"
2328 SOURCE_MIRROR_URL = "http://example.com/my-source-mirror"
2329 </literallayout>
2330 You can specify only a single URL in
2331 <filename>SOURCE_MIRROR_URL</filename>.
2332 </para>
2333</section>
2334
2335<section id='ref-classes-package'>
2336 <title><filename>package.bbclass</filename></title>
2337
2338 <para>
2339 The <filename>package</filename> class supports generating
2340 packages from a build's output.
2341 The core generic functionality is in
2342 <filename>package.bbclass</filename>.
2343 The code specific to particular package types resides in these
2344 package-specific classes:
2345 <link linkend='ref-classes-package_deb'><filename>package_deb</filename></link>,
2346 <link linkend='ref-classes-package_rpm'><filename>package_rpm</filename></link>,
2347 <link linkend='ref-classes-package_ipk'><filename>package_ipk</filename></link>,
2348 and
2349 <link linkend='ref-classes-package_tar'><filename>package_tar</filename></link>.
2350 <note><title>Warning</title>
2351 The <filename>package_tar</filename> class is broken and not
2352 supported.
2353 It is recommended that you do not use this class.
2354 </note>
2355 </para>
2356
2357 <para>
2358 You can control the list of resulting package formats by using the
2359 <filename><link linkend='var-PACKAGE_CLASSES'>PACKAGE_CLASSES</link></filename>
2360 variable defined in your <filename>conf/local.conf</filename>
2361 configuration file, which is located in the
2362 <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
2363 When defining the variable, you can specify one or more package types.
2364 Since images are generated from packages, a packaging class is
2365 needed to enable image generation.
2366 The first class listed in this variable is used for image generation.
2367 </para>
2368
2369 <para>
2370 If you take the optional step to set up a repository (package feed)
2371 on the development host that can be used by Smart, you can
2372 install packages from the feed while you are running the image
2373 on the target (i.e. runtime installation of packages).
2374 For more information, see the
2375 "<ulink url='&YOCTO_DOCS_DEV_URL;#using-runtime-package-management'>Using Runtime Package Management</ulink>"
2376 section in the Yocto Project Development Manual.
2377 </para>
2378
2379 <para>
2380 The package-specific class you choose can affect build-time performance
2381 and has space ramifications.
2382 In general, building a package with IPK takes about thirty percent less
2383 time as compared to using RPM to build the same or similar package.
2384 This comparison takes into account a complete build of the package with
2385 all dependencies previously built.
2386 The reason for this discrepancy is because the RPM package manager
2387 creates and processes more
2388 <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink> than the
2389 IPK package manager.
2390 Consequently, you might consider setting
2391 <filename>PACKAGE_CLASSES</filename> to "package_ipk" if you are
2392 building smaller systems.
2393 </para>
2394
2395 <para>
2396 Before making your package manager decision, however, you should
2397 consider some further things about using RPM:
2398 <itemizedlist>
2399 <listitem><para>
2400 RPM starts to provide more abilities than IPK due to
2401 the fact that it processes more Metadata.
2402 For example, this information includes individual file types,
2403 file checksum generation and evaluation on install, sparse file
2404 support, conflict detection and resolution for Multilib systems,
2405 ACID style upgrade, and repackaging abilities for rollbacks.
2406 </para></listitem>
2407 <listitem><para>
2408 For smaller systems, the extra space used for the Berkeley
2409 Database and the amount of metadata when using RPM can affect
2410 your ability to perform on-device upgrades.
2411 </para></listitem>
2412 </itemizedlist>
2413 </para>
2414
2415 <para>
2416 You can find additional information on the effects of the package
2417 class at these two Yocto Project mailing list links:
2418 <itemizedlist>
2419 <listitem><para><ulink url='&YOCTO_LISTS_URL;/pipermail/poky/2011-May/006362.html'>
2420 https://lists.yoctoproject.org/pipermail/poky/2011-May/006362.html</ulink></para></listitem>
2421 <listitem><para><ulink url='&YOCTO_LISTS_URL;/pipermail/poky/2011-May/006363.html'>
2422 https://lists.yoctoproject.org/pipermail/poky/2011-May/006363.html</ulink></para></listitem>
2423 </itemizedlist>
2424 </para>
2425</section>
2426
2427<section id='ref-classes-package_deb'>
2428 <title><filename>package_deb.bbclass</filename></title>
2429
2430 <para>
2431 The <filename>package_deb</filename> class
2432 provides support for creating packages that use the Debian
2433 (i.e. <filename>.deb</filename>) file format.
2434 The class ensures the packages are written out in a
2435 <filename>.deb</filename> file format to the
2436 <filename>${</filename><link linkend='var-DEPLOY_DIR_DEB'><filename>DEPLOY_DIR_DEB</filename></link><filename>}</filename>
2437 directory.
2438 </para>
2439
2440 <para>
2441 This class inherits the
2442 <link linkend='ref-classes-package'><filename>package</filename></link>
2443 class and is enabled through the
2444 <link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link>
2445 variable in the <filename>local.conf</filename> file.
2446 </para>
2447</section>
2448
2449<section id='ref-classes-package_ipk'>
2450 <title><filename>package_ipk.bbclass</filename></title>
2451
2452 <para>
2453 The <filename>package_ipk</filename> class
2454 provides support for creating packages that use the IPK
2455 (i.e. <filename>.ipk</filename>) file format.
2456 The class ensures the packages are written out in a
2457 <filename>.ipk</filename> file format to the
2458 <filename>${</filename><link linkend='var-DEPLOY_DIR_IPK'><filename>DEPLOY_DIR_IPK</filename></link><filename>}</filename>
2459 directory.
2460 </para>
2461
2462 <para>
2463 This class inherits the
2464 <link linkend='ref-classes-package'><filename>package</filename></link>
2465 class and is enabled through the
2466 <link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link>
2467 variable in the <filename>local.conf</filename> file.
2468 </para>
2469</section>
2470
2471<section id='ref-classes-package_rpm'>
2472 <title><filename>package_rpm.bbclass</filename></title>
2473
2474 <para>
2475 The <filename>package_rpm</filename> class
2476 provides support for creating packages that use the RPM
2477 (i.e. <filename>.rpm</filename>) file format.
2478 The class ensures the packages are written out in a
2479 <filename>.rpm</filename> file format to the
2480 <filename>${</filename><link linkend='var-DEPLOY_DIR_RPM'><filename>DEPLOY_DIR_RPM</filename></link><filename>}</filename>
2481 directory.
2482 </para>
2483
2484 <para>
2485 This class inherits the
2486 <link linkend='ref-classes-package'><filename>package</filename></link>
2487 class and is enabled through the
2488 <link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link>
2489 variable in the <filename>local.conf</filename> file.
2490 </para>
2491</section>
2492
2493<section id='ref-classes-package_tar'>
2494 <title><filename>package_tar.bbclass</filename></title>
2495
2496 <para>
2497 The <filename>package_tar</filename> class
2498 provides support for creating tarballs.
2499 The class ensures the packages are written out in a
2500 tarball format to the
2501 <filename>${</filename><link linkend='var-DEPLOY_DIR_TAR'><filename>DEPLOY_DIR_TAR</filename></link><filename>}</filename>
2502 directory.
2503 </para>
2504
2505 <para>
2506 This class inherits the
2507 <link linkend='ref-classes-package'><filename>package</filename></link>
2508 class and is enabled through the
2509 <link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link>
2510 variable in the <filename>local.conf</filename> file.
2511 <note>
2512 You cannot specify the <filename>package_tar</filename> class
2513 first using the <filename>PACKAGE_CLASSES</filename> variable.
2514 You must use <filename>.deb</filename>,
2515 <filename>.ipk</filename>, or <filename>.rpm</filename> file
2516 formats for your image or SDK.
2517 </note>
2518 </para>
2519</section>
2520
2521<section id='ref-classes-packagedata'>
2522 <title><filename>packagedata.bbclass</filename></title>
2523
2524 <para>
2525 The <filename>packagedata</filename> class provides
2526 common functionality for reading <filename>pkgdata</filename> files
2527 found in
2528 <link linkend='var-PKGDATA_DIR'><filename>PKGDATA_DIR</filename></link>.
2529 These files contain information about each output package produced by
2530 the OpenEmbedded build system.
2531 </para>
2532
2533 <para>
2534 This class is enabled by default because it is inherited by the
2535 <link linkend='ref-classes-package'><filename>package</filename></link>
2536 class.
2537 </para>
2538</section>
2539
2540<section id='ref-classes-packagegroup'>
2541 <title><filename>packagegroup.bbclass</filename></title>
2542
2543 <para>
2544 The <filename>packagegroup</filename> class sets default values
2545 appropriate for package group recipes (e.g.
2546 <filename><link linkend='var-PACKAGES'>PACKAGES</link></filename>,
2547 <filename><link linkend='var-PACKAGE_ARCH'>PACKAGE_ARCH</link></filename>,
2548 <filename><link linkend='var-ALLOW_EMPTY'>ALLOW_EMPTY</link></filename>,
2549 and so forth).
2550 It is highly recommended that all package group recipes inherit this class.
2551 </para>
2552
2553 <para>
2554 For information on how to use this class, see the
2555 "<ulink url='&YOCTO_DOCS_DEV_URL;#usingpoky-extend-customimage-customtasks'>Customizing Images Using Custom Package Groups</ulink>"
2556 section in the Yocto Project Development Manual.
2557 </para>
2558
2559 <para>
2560 Previously, this class was called the <filename>task</filename> class.
2561 </para>
2562</section>
2563
Patrick Williamsc124f4f2015-09-15 14:41:29 -05002564<section id='ref-classes-patch'>
2565 <title><filename>patch.bbclass</filename></title>
2566
2567 <para>
2568 The <filename>patch</filename> class provides all functionality for
2569 applying patches during the
2570 <link linkend='ref-tasks-patch'><filename>do_patch</filename></link>
2571 task.
2572 </para>
2573
2574 <para>
2575 This class is enabled by default because it is inherited by the
2576 <link linkend='ref-classes-base'><filename>base</filename></link>
2577 class.
2578 </para>
2579</section>
2580
2581<section id='ref-classes-perlnative'>
2582 <title><filename>perlnative.bbclass</filename></title>
2583
2584 <para>
2585 When inherited by a recipe, the <filename>perlnative</filename> class
2586 supports using the native version of Perl built by the build system
2587 rather than using the version provided by the build host.
2588 </para>
2589</section>
2590
2591<section id='ref-classes-pixbufcache'>
2592 <title><filename>pixbufcache.bbclass</filename></title>
2593
2594 <para>
2595 The <filename>pixbufcache</filename> class generates the proper
2596 post-install and post-remove (postinst/postrm) scriptlets for packages
2597 that install pixbuf loaders, which are used with
2598 <filename>gdk-pixbuf</filename>.
2599 These scriptlets call <filename>update_pixbuf_cache</filename>
2600 to add the pixbuf loaders to the cache.
2601 Since the cache files are architecture-specific,
2602 <filename>update_pixbuf_cache</filename> is run using QEMU if the
2603 postinst scriptlets need to be run on the build host during image
2604 creation.
2605 </para>
2606
2607 <para>
2608 If the pixbuf loaders being installed are in packages other
2609 than the recipe's main package, set
2610 <link linkend='var-PIXBUF_PACKAGES'><filename>PIXBUF_PACKAGES</filename></link>
2611 to specify the packages containing the loaders.
2612 </para>
2613</section>
2614
2615<section id='ref-classes-pkgconfig'>
2616 <title><filename>pkgconfig.bbclass</filename></title>
2617
2618 <para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -05002619 The <filename>pkgconfig</filename> class provides a standard way to get
2620 header and library information by using <filename>pkg-config</filename>.
Patrick Williamsc124f4f2015-09-15 14:41:29 -05002621 This class aims to smooth integration of
2622 <filename>pkg-config</filename> into libraries that use it.
2623 </para>
2624
2625 <para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -05002626 During staging, BitBake installs <filename>pkg-config</filename>
2627 data into the <filename>sysroots/</filename> directory.
2628 By making use of sysroot functionality within
2629 <filename>pkg-config</filename>, the <filename>pkgconfig</filename>
2630 class no longer has to manipulate the files.
Patrick Williamsc124f4f2015-09-15 14:41:29 -05002631 </para>
2632</section>
2633
2634<section id='ref-classes-populate-sdk'>
2635 <title><filename>populate_sdk.bbclass</filename></title>
2636
2637 <para>
2638 The <filename>populate_sdk</filename> class provides support for
2639 SDK-only recipes.
2640 For information on advantages gained when building a cross-development
2641 toolchain using the
2642 <link linkend='ref-tasks-populate_sdk'><filename>do_populate_sdk</filename></link>
2643 task, see the
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05002644 "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-building-an-sdk-installer'>Building an SDK Installer</ulink>"
2645 section in the Yocto Project Software Development Kit (SDK) Developer's Guide.
Patrick Williamsc124f4f2015-09-15 14:41:29 -05002646 </para>
2647</section>
2648
2649<section id='ref-classes-populate-sdk-*'>
2650 <title><filename>populate_sdk_*.bbclass</filename></title>
2651
2652 <para>
2653 The <filename>populate_sdk_*</filename> classes support SDK creation
2654 and consist of the following classes:
2655 <itemizedlist>
2656 <listitem><para><emphasis><filename>populate_sdk_base</filename>:</emphasis>
2657 The base class supporting SDK creation under all package
2658 managers (i.e. DEB, RPM, and opkg).</para></listitem>
2659 <listitem><para><emphasis><filename>populate_sdk_deb</filename>:</emphasis>
2660 Supports creation of the SDK given the Debian package manager.
2661 </para></listitem>
2662 <listitem><para><emphasis><filename>populate_sdk_rpm</filename>:</emphasis>
2663 Supports creation of the SDK given the RPM package manager.
2664 </para></listitem>
2665 <listitem><para><emphasis><filename>populate_sdk_ipk</filename>:</emphasis>
2666 Supports creation of the SDK given the opkg (IPK format)
2667 package manager.
2668 </para></listitem>
Patrick Williamsf1e5d692016-03-30 15:21:19 -05002669 <listitem><para><emphasis><filename>populate_sdk_ext</filename>:</emphasis>
2670 Supports extensible SDK creation under all package managers.
2671 </para></listitem>
Patrick Williamsc124f4f2015-09-15 14:41:29 -05002672 </itemizedlist>
2673 </para>
2674
2675 <para>
2676 The <filename>populate_sdk_base</filename> class inherits the
2677 appropriate <filename>populate_sdk_*</filename> (i.e.
2678 <filename>deb</filename>, <filename>rpm</filename>, and
2679 <filename>ipk</filename>) based on
2680 <link linkend='var-IMAGE_PKGTYPE'><filename>IMAGE_PKGTYPE</filename></link>.
2681 </para>
2682
2683 <para>
2684 The base class ensures all source and destination directories are
2685 established and then populates the SDK.
2686 After populating the SDK, the <filename>populate_sdk_base</filename>
2687 class constructs two sysroots:
2688 <filename>${</filename><link linkend='var-SDK_ARCH'><filename>SDK_ARCH</filename></link><filename>}-nativesdk</filename>,
2689 which contains the cross-compiler and associated tooling, and the
2690 target, which contains a target root filesystem that is configured for
2691 the SDK usage.
2692 These two images reside in
2693 <link linkend='var-SDK_OUTPUT'><filename>SDK_OUTPUT</filename></link>,
2694 which consists of the following:
2695 <literallayout class='monospaced'>
2696 ${SDK_OUTPUT}/${SDK_ARCH}<replaceable>-nativesdk-pkgs</replaceable>
2697 ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/<replaceable>target-pkgs</replaceable>
2698 </literallayout>
2699 </para>
2700
2701 <para>
2702 Finally, the base populate SDK class creates the toolchain
2703 environment setup script, the tarball of the SDK, and the installer.
2704 </para>
2705
2706 <para>
2707 The respective <filename>populate_sdk_deb</filename>,
2708 <filename>populate_sdk_rpm</filename>, and
2709 <filename>populate_sdk_ipk</filename> classes each support the
2710 specific type of SDK.
2711 These classes are inherited by and used with the
2712 <filename>populate_sdk_base</filename> class.
2713 </para>
2714
2715 <para>
2716 For more information on the cross-development toolchain
2717 generation, see the
2718 "<link linkend='cross-development-toolchain-generation'>Cross-Development Toolchain Generation</link>"
2719 section.
2720 For information on advantages gained when building a
2721 cross-development toolchain using the
2722 <link linkend='ref-tasks-populate_sdk'><filename>do_populate_sdk</filename></link>
2723 task, see the
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05002724 "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-building-an-sdk-installer'>Building an SDK Installer</ulink>"
2725 section in the Yocto Project Software Development Kit (SDK) Developer's
2726 Guide.
Patrick Williamsc124f4f2015-09-15 14:41:29 -05002727 </para>
2728</section>
2729
2730<section id='ref-classes-prexport'>
2731 <title><filename>prexport.bbclass</filename></title>
2732
2733 <para>
2734 The <filename>prexport</filename> class provides functionality for
2735 exporting
2736 <link linkend='var-PR'><filename>PR</filename></link> values.
2737 <note>
2738 This class is not intended to be used directly.
2739 Rather, it is enabled when using
2740 "<filename>bitbake-prserv-tool export</filename>".
2741 </note>
2742 </para>
2743</section>
2744
2745<section id='ref-classes-primport'>
2746 <title><filename>primport.bbclass</filename></title>
2747
2748 <para>
2749 The <filename>primport</filename> class provides functionality for
2750 importing
2751 <link linkend='var-PR'><filename>PR</filename></link> values.
2752 <note>
2753 This class is not intended to be used directly.
2754 Rather, it is enabled when using
2755 "<filename>bitbake-prserv-tool import</filename>".
2756 </note>
2757 </para>
2758</section>
2759
2760<section id='ref-classes-prserv'>
2761 <title><filename>prserv.bbclass</filename></title>
2762
2763 <para>
2764 The <filename>prserv</filename> class provides functionality for
2765 using a
2766 <ulink url='&YOCTO_DOCS_DEV_URL;#working-with-a-pr-service'>PR service</ulink>
2767 in order to automatically manage the incrementing of the
2768 <link linkend='var-PR'><filename>PR</filename></link> variable for
2769 each recipe.
2770 </para>
2771
2772 <para>
2773 This class is enabled by default because it is inherited by the
2774 <link linkend='ref-classes-package'><filename>package</filename></link>
2775 class.
2776 However, the OpenEmbedded build system will not enable the
2777 functionality of this class unless
2778 <link linkend='var-PRSERV_HOST'><filename>PRSERV_HOST</filename></link>
2779 has been set.
2780 </para>
2781</section>
2782
2783<section id='ref-classes-ptest'>
2784 <title><filename>ptest.bbclass</filename></title>
2785
2786 <para>
2787 The <filename>ptest</filename> class provides functionality for
2788 packaging and installing runtime tests for recipes that build software
2789 that provides these tests.
2790 </para>
2791
2792 <para>
2793 This class is intended to be inherited by individual recipes.
2794 However, the class' functionality is largely disabled unless "ptest"
2795 appears in
2796 <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>.
2797 See the
2798 "<ulink url='&YOCTO_DOCS_DEV_URL;#testing-packages-with-ptest'>Testing Packages With ptest</ulink>"
2799 section in the Yocto Project Development Manual for more information
2800 on ptest.
2801 </para>
2802</section>
2803
2804<section id='ref-classes-ptest-gnome'>
2805 <title><filename>ptest-gnome.bbclass</filename></title>
2806
2807 <para>
2808 Enables package tests (ptests) specifically for GNOME packages,
2809 which have tests intended to be executed with
2810 <filename>gnome-desktop-testing</filename>.
2811 </para>
2812
2813 <para>
2814 For information on setting up and running ptests, see the
2815 "<ulink url='&YOCTO_DOCS_DEV_URL;#testing-packages-with-ptest'>Testing Packages With ptest</ulink>"
2816 section in the Yocto Project Development Manual.
2817 </para>
2818</section>
2819
2820<section id='ref-classes-python-dir'>
2821 <title><filename>python-dir.bbclass</filename></title>
2822
2823 <para>
2824 The <filename>python-dir</filename> class provides the base version,
2825 location, and site package location for Python.
2826 </para>
2827</section>
2828
Patrick Williamsf1e5d692016-03-30 15:21:19 -05002829<section id='ref-classes-python3native'>
2830 <title><filename>python3native.bbclass</filename></title>
2831
2832 <para>
2833 The <filename>python3native</filename> class supports using the
2834 native version of Python 3 built by the build system rather than
2835 support of the version provided by the build host.
2836 </para>
2837</section>
2838
Patrick Williamsc124f4f2015-09-15 14:41:29 -05002839<section id='ref-classes-pythonnative'>
2840 <title><filename>pythonnative.bbclass</filename></title>
2841
2842 <para>
2843 When inherited by a recipe, the <filename>pythonnative</filename> class
2844 supports using the native version of Python built by the build system
2845 rather than using the version provided by the build host.
2846 </para>
2847</section>
2848
2849<section id='ref-classes-qemu'>
2850 <title><filename>qemu.bbclass</filename></title>
2851
2852 <para>
2853 The <filename>qemu</filename> class provides functionality for recipes
2854 that either need QEMU or test for the existence of QEMU.
2855 Typically, this class is used to run programs for a target system on
2856 the build host using QEMU's application emulation mode.
2857 </para>
2858</section>
2859
Patrick Williamsf1e5d692016-03-30 15:21:19 -05002860<section id='ref-classes-recipe_sanity'>
2861 <title><filename>recipe_sanity.bbclass</filename></title>
2862
2863 <para>
2864 The <filename>recipe_sanity</filename> class checks for the presence
2865 of any host system recipe prerequisites that might affect the
2866 build (e.g. variables that are set or software that is present).
2867 </para>
2868</section>
2869
Patrick Williamsc124f4f2015-09-15 14:41:29 -05002870<section id='ref-classes-relocatable'>
2871 <title><filename>relocatable.bbclass</filename></title>
2872
2873 <para>
2874 The <filename>relocatable</filename> class enables relocation of
2875 binaries when they are installed into the sysroot.
2876 </para>
2877
2878 <para>
2879 This class makes use of the
2880 <link linkend='ref-classes-chrpath'><filename>chrpath</filename></link>
2881 class and is used by both the
2882 <link linkend='ref-classes-cross'><filename>cross</filename></link>
2883 and
2884 <link linkend='ref-classes-native'><filename>native</filename></link>
2885 classes.
2886 </para>
2887</section>
2888
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05002889<section id='ref-classes-remove-libtool'>
2890 <title><filename>remove-libtool.bbclass</filename></title>
2891
2892 <para>
2893 The <filename>remove-libtool</filename> class adds a post function
2894 to the
2895 <link linkend='ref-tasks-install'><filename>do_install</filename></link>
2896 task to remove all <filename>.la</filename> files installed by
2897 <filename>libtool</filename>.
2898 Removing these files results in them being absent from both the
2899 sysroot and target packages.
2900 </para>
2901
2902 <para>
2903 If a recipe needs the <filename>.la</filename> files to be installed,
2904 then the recipe can override the removal by setting
2905 <filename>REMOVE_LIBTOOL_LA</filename> to "0" as follows:
2906 <literallayout class='monospaced'>
2907 REMOVE_LIBTOOL_LA = "0"
2908 </literallayout>
2909 <note>
2910 The <filename>remove-libtool</filename> class is not enabled by
2911 default.
2912 </note>
2913 </para>
2914</section>
2915
Patrick Williamsc124f4f2015-09-15 14:41:29 -05002916<section id='ref-classes-report-error'>
2917 <title><filename>report-error.bbclass</filename></title>
2918
2919 <para>
2920 The <filename>report-error</filename> class supports enabling the
2921 <ulink url='&YOCTO_DOCS_DEV_URL;#using-the-error-reporting-tool'>error reporting tool</ulink>,
2922 which allows you to submit build error information to a central
2923 database.
2924 </para>
2925
2926 <para>
2927 The class collects debug information for recipe, recipe version, task,
2928 machine, distro, build system, target system, host distro, branch,
2929 commit, and log.
2930 From the information, report files using a JSON format are created and
2931 stored in
2932 <filename>${</filename><link linkend='var-LOG_DIR'><filename>LOG_DIR</filename></link><filename>}/error-report</filename>.
2933 </para>
2934</section>
2935
2936<section id='ref-classes-rm-work'>
2937 <title><filename>rm_work.bbclass</filename></title>
2938
2939 <para>
2940 The <filename>rm_work</filename> class supports deletion of temporary
2941 workspace, which can ease your hard drive demands during builds.
2942 </para>
2943
2944 <para>
2945 The OpenEmbedded build system can use a substantial amount of disk
2946 space during the build process.
2947 A portion of this space is the work files under the
2948 <filename>${TMPDIR}/work</filename> directory for each recipe.
2949 Once the build system generates the packages for a recipe, the work
2950 files for that recipe are no longer needed.
2951 However, by default, the build system preserves these files
2952 for inspection and possible debugging purposes.
2953 If you would rather have these files deleted to save disk space
2954 as the build progresses, you can enable <filename>rm_work</filename>
2955 by adding the following to your <filename>local.conf</filename> file,
2956 which is found in the
2957 <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
2958 <literallayout class='monospaced'>
2959 INHERIT += "rm_work"
2960 </literallayout>
2961 If you are modifying and building source code out of the work directory
2962 for a recipe, enabling <filename>rm_work</filename> will potentially
2963 result in your changes to the source being lost.
2964 To exclude some recipes from having their work directories deleted by
2965 <filename>rm_work</filename>, you can add the names of the recipe or
2966 recipes you are working on to the <filename>RM_WORK_EXCLUDE</filename>
2967 variable, which can also be set in your <filename>local.conf</filename>
2968 file.
2969 Here is an example:
2970 <literallayout class='monospaced'>
2971 RM_WORK_EXCLUDE += "busybox glibc"
2972 </literallayout>
2973 </para>
2974</section>
2975
2976<section id='ref-classes-rootfs*'>
2977 <title><filename>rootfs*.bbclass</filename></title>
2978
2979 <para>
2980 The <filename>rootfs*</filename> classes support creating
2981 the root filesystem for an image and consist of the following classes:
2982 <itemizedlist>
2983 <listitem><para>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05002984 The <filename>rootfs-postcommands</filename> class, which
2985 defines filesystem post-processing functions for image recipes.
2986 </para></listitem>
2987 <listitem><para>
Patrick Williamsc124f4f2015-09-15 14:41:29 -05002988 The <filename>rootfs_deb</filename> class, which supports
2989 creation of root filesystems for images built using
2990 <filename>.deb</filename> packages.</para></listitem>
2991 <listitem><para>
2992 The <filename>rootfs_rpm</filename> class, which supports
2993 creation of root filesystems for images built using
2994 <filename>.rpm</filename> packages.</para></listitem>
2995 <listitem><para>
2996 The <filename>rootfs_ipk</filename> class, which supports
2997 creation of root filesystems for images built using
2998 <filename>.ipk</filename> packages.</para></listitem>
Patrick Williamsf1e5d692016-03-30 15:21:19 -05002999 <listitem><para>
3000 The <filename>rootfsdebugfiles</filename> class, which installs
3001 additional files found on the build host directly into the
3002 root filesystem.
3003 </para></listitem>
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003004 </itemizedlist>
3005 </para>
3006
3007 <para>
3008 The root filesystem is created from packages using one of the
3009 <filename>rootfs*.bbclass</filename> files as determined by the
3010 <link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link>
3011 variable.
3012 </para>
3013
3014 <para>
3015 For information on how root filesystem images are created, see the
3016 "<link linkend='image-generation-dev-environment'>Image Generation</link>"
3017 section.
3018 </para>
3019</section>
3020
3021<section id='ref-classes-sanity'>
3022 <title><filename>sanity.bbclass</filename></title>
3023
3024 <para>
3025 The <filename>sanity</filename> class checks to see if prerequisite
3026 software is present on the host system so that users can be notified
3027 of potential problems that might affect their build.
3028 The class also performs basic user configuration checks from
3029 the <filename>local.conf</filename> configuration file to
3030 prevent common mistakes that cause build failures.
3031 Distribution policy usually determines whether to include this class.
3032 </para>
3033</section>
3034
3035<section id='ref-classes-scons'>
3036 <title><filename>scons.bbclass</filename></title>
3037
3038 <para>
3039 The <filename>scons</filename> class supports recipes that need to
3040 build software that uses the SCons build system.
3041 You can use the
3042 <link linkend='var-EXTRA_OESCONS'><filename>EXTRA_OESCONS</filename></link>
3043 variable to specify additional configuration options you want to pass
3044 SCons command line.
3045 </para>
3046</section>
3047
3048<section id='ref-classes-sdl'>
3049 <title><filename>sdl.bbclass</filename></title>
3050
3051 <para>
3052 The <filename>sdl</filename> class supports recipes that need to build
3053 software that uses the Simple DirectMedia Layer (SDL) library.
3054 </para>
3055</section>
3056
3057<section id='ref-classes-setuptools'>
3058 <title><filename>setuptools.bbclass</filename></title>
3059
3060 <para>
3061 The <filename>setuptools</filename> class supports Python
3062 version 2.x extensions that use build systems based on
3063 <filename>setuptools</filename>.
3064 If your recipe uses these build systems, the recipe needs to
3065 inherit the <filename>setuptools</filename> class.
3066 </para>
3067</section>
3068
3069<section id='ref-classes-setuptools3'>
3070 <title><filename>setuptools3.bbclass</filename></title>
3071
3072 <para>
3073 The <filename>setuptools3</filename> class supports Python
3074 version 3.x extensions that use build systems based on
3075 <filename>setuptools3</filename>.
3076 If your recipe uses these build systems, the recipe needs to
3077 inherit the <filename>setuptools3</filename> class.
3078 </para>
3079</section>
3080
Patrick Williamsf1e5d692016-03-30 15:21:19 -05003081<section id='ref-classes-sign_rpm'>
3082 <title><filename>sign_rpm.bbclass</filename></title>
3083
3084 <para>
3085 The <filename>sign_rpm</filename> class supports generating signed
3086 RPM packages.
3087 </para>
3088</section>
3089
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003090<section id='ref-classes-sip'>
3091 <title><filename>sip.bbclass</filename></title>
3092
3093 <para>
3094 The <filename>sip</filename> class
3095 supports recipes that build or package SIP-based Python bindings.
3096 </para>
3097</section>
3098
3099<section id='ref-classes-siteconfig'>
3100 <title><filename>siteconfig.bbclass</filename></title>
3101
3102 <para>
3103 The <filename>siteconfig</filename> class
3104 provides functionality for handling site configuration.
3105 The class is used by the
3106 <link linkend='ref-classes-autotools'><filename>autotools</filename></link>
3107 class to accelerate the
3108 <link linkend='ref-tasks-configure'><filename>do_configure</filename></link>
3109 task.
3110 </para>
3111</section>
3112
3113<section id='ref-classes-siteinfo'>
3114 <title><filename>siteinfo.bbclass</filename></title>
3115
3116 <para>
3117 The <filename>siteinfo</filename> class provides information about
3118 the targets that might be needed by other classes or recipes.
3119 </para>
3120
3121 <para>
3122 As an example, consider Autotools, which can require tests that must
3123 execute on the target hardware.
3124 Since this is not possible in general when cross compiling, site
3125 information is used to provide cached test results so these tests can
3126 be skipped over but still make the correct values available.
3127 The
3128 <filename><link linkend='structure-meta-site'>meta/site directory</link></filename>
3129 contains test results sorted into different categories such as
3130 architecture, endianness, and the <filename>libc</filename> used.
3131 Site information provides a list of files containing data relevant to
3132 the current build in the
3133 <filename><link linkend='var-CONFIG_SITE'>CONFIG_SITE</link></filename> variable
3134 that Autotools automatically picks up.
3135 </para>
3136
3137 <para>
3138 The class also provides variables like
3139 <filename><link linkend='var-SITEINFO_ENDIANNESS'>SITEINFO_ENDIANNESS</link></filename>
3140 and <filename><link linkend='var-SITEINFO_BITS'>SITEINFO_BITS</link></filename>
3141 that can be used elsewhere in the metadata.
3142 </para>
3143
3144 <para>
3145 Because the
3146 <link linkend='ref-classes-base'><filename>base</filename></link> class
3147 includes the <filename>siteinfo</filename> class, it is always active.
3148 </para>
3149</section>
3150
3151<section id='ref-classes-spdx'>
3152 <title><filename>spdx.bbclass</filename></title>
3153
3154 <para>
3155 The <filename>spdx</filename> class integrates real-time license
3156 scanning, generation of SPDX standard output, and verification
3157 of license information during the build.
3158 <note>
3159 This class is currently at the prototype stage in the 1.6
3160 release.
3161 </note>
3162 </para>
3163</section>
3164
3165<section id='ref-classes-sstate'>
3166 <title><filename>sstate.bbclass</filename></title>
3167
3168 <para>
3169 The <filename>sstate</filename> class provides support for Shared
3170 State (sstate).
3171 By default, the class is enabled through the
3172 <link linkend='var-INHERIT_DISTRO'><filename>INHERIT_DISTRO</filename></link>
3173 variable's default value.
3174 </para>
3175
3176 <para>
3177 For more information on sstate, see the
3178 "<link linkend='shared-state-cache'>Shared State Cache</link>"
3179 section.
3180 </para>
3181</section>
3182
3183<section id='ref-classes-staging'>
3184 <title><filename>staging.bbclass</filename></title>
3185
3186 <para>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05003187 The <filename>staging</filename> class provides the
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003188 <link linkend='ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></link>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05003189 task, which stages files into the sysroot to make them available to
3190 other recipes at build time.
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003191 The class is enabled by default because it is inherited by the
3192 <link linkend='ref-classes-base'><filename>base</filename></link>
3193 class.
3194 </para>
3195</section>
3196
3197<section id='ref-classes-syslinux'>
3198 <title><filename>syslinux.bbclass</filename></title>
3199
3200 <para>
3201 The <filename>syslinux</filename> class provides syslinux-specific
3202 functions for building bootable images.
3203 </para>
3204
3205 <para>
3206 The class supports the following variables:
3207 <itemizedlist>
3208 <listitem><para><link linkend='var-INITRD'><filename>INITRD</filename></link>:
3209 Indicates list of filesystem images to concatenate and use as
3210 an initial RAM disk (initrd).
3211 This variable is optional.</para></listitem>
3212 <listitem><para><link linkend='var-ROOTFS'><filename>ROOTFS</filename></link>:
3213 Indicates a filesystem image to include as the root filesystem.
3214 This variable is optional.</para></listitem>
3215 <listitem><para><link linkend='var-AUTO_SYSLINUXMENU'><filename>AUTO_SYSLINUXMENU</filename></link>:
3216 Enables creating an automatic menu when set to "1".
3217 </para></listitem>
3218 <listitem><para><link linkend='var-LABELS'><filename>LABELS</filename></link>:
3219 Lists targets for automatic configuration.
3220 </para></listitem>
3221 <listitem><para><link linkend='var-APPEND'><filename>APPEND</filename></link>:
3222 Lists append string overrides for each label.
3223 </para></listitem>
3224 <listitem><para><link linkend='var-SYSLINUX_OPTS'><filename>SYSLINUX_OPTS</filename></link>:
3225 Lists additional options to add to the syslinux file.
3226 Semicolon characters separate multiple options.
3227 </para></listitem>
3228 <listitem><para><link linkend='var-SYSLINUX_SPLASH'><filename>SYSLINUX_SPLASH</filename></link>:
3229 Lists a background for the VGA boot menu when you are using the
3230 boot menu.</para></listitem>
3231 <listitem><para><link linkend='var-SYSLINUX_DEFAULT_CONSOLE'><filename>SYSLINUX_DEFAULT_CONSOLE</filename></link>:
3232 Set to "console=ttyX" to change kernel boot default console.
3233 </para></listitem>
3234 <listitem><para><link linkend='var-SYSLINUX_SERIAL'><filename>SYSLINUX_SERIAL</filename></link>:
3235 Sets an alternate serial port.
3236 Or, turns off serial when the variable is set with an
3237 empty string.</para></listitem>
3238 <listitem><para><link linkend='var-SYSLINUX_SERIAL_TTY'><filename>SYSLINUX_SERIAL_TTY</filename></link>:
3239 Sets an alternate "console=tty..." kernel boot argument.
3240 </para></listitem>
3241 </itemizedlist>
3242 </para>
3243</section>
3244
3245<section id='ref-classes-systemd'>
3246 <title><filename>systemd.bbclass</filename></title>
3247
3248 <para>
3249 The <filename>systemd</filename> class provides support for recipes
3250 that install systemd unit files.
3251 </para>
3252
3253 <para>
3254 The functionality for this class is disabled unless you have "systemd"
3255 in
3256 <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>.
3257 </para>
3258
3259 <para>
3260 Under this class, the recipe or Makefile (i.e. whatever the recipe is
3261 calling during the
3262 <link linkend='ref-tasks-install'><filename>do_install</filename></link>
3263 task) installs unit files into
3264 <filename>${</filename><link linkend='var-D'><filename>D</filename></link><filename>}${systemd_unitdir}/system</filename>.
3265 If the unit files being installed go into packages other than the
3266 main package, you need to set
3267 <link linkend='var-SYSTEMD_PACKAGES'><filename>SYSTEMD_PACKAGES</filename></link>
3268 in your recipe to identify the packages in which the files will be
3269 installed.
3270 </para>
3271
3272 <para>
3273 You should set
3274 <link linkend='var-SYSTEMD_SERVICE'><filename>SYSTEMD_SERVICE</filename></link>
3275 to the name of the service file.
3276 You should also use a package name override to indicate the package
3277 to which the value applies.
3278 If the value applies to the recipe's main package, use
3279 <filename>${</filename><link linkend='var-PN'><filename>PN</filename></link><filename>}</filename>.
3280 Here is an example from the connman recipe:
3281 <literallayout class='monospaced'>
3282 SYSTEMD_SERVICE_${PN} = "connman.service"
3283 </literallayout>
3284 Services are set up to start on boot automatically unless
3285 you have set
3286 <link linkend='var-SYSTEMD_AUTO_ENABLE'><filename>SYSTEMD_AUTO_ENABLE</filename></link>
3287 to "disable".
3288 </para>
3289
3290 <para>
3291 For more information on <filename>systemd</filename>, see the
3292 "<ulink url='&YOCTO_DOCS_DEV_URL;#selecting-an-initialization-manager'>Selecting an Initialization Manager</ulink>"
3293 section in the Yocto Project Development Manual.
3294 </para>
3295</section>
3296
3297<section id='ref-classes-terminal'>
3298 <title><filename>terminal.bbclass</filename></title>
3299
3300 <para>
3301 The <filename>terminal</filename> class provides support for starting
3302 a terminal session.
3303 The
3304 <link linkend='var-OE_TERMINAL'><filename>OE_TERMINAL</filename></link>
3305 variable controls which terminal emulator is used for the session.
3306 </para>
3307
3308 <para>
3309 Other classes use the <filename>terminal</filename> class anywhere a
3310 separate terminal session needs to be started.
3311 For example, the
3312 <link linkend='ref-classes-patch'><filename>patch</filename></link>
3313 class assuming
3314 <link linkend='var-PATCHRESOLVE'><filename>PATCHRESOLVE</filename></link>
3315 is set to "user", the
3316 <link linkend='ref-classes-cml1'><filename>cml1</filename></link>
3317 class, and the
3318 <link linkend='ref-classes-devshell'><filename>devshell</filename></link>
3319 class all use the <filename>terminal</filename> class.
3320 </para>
3321</section>
3322
Patrick Williamsf1e5d692016-03-30 15:21:19 -05003323<section id='ref-classes-testimage*'>
3324 <title><filename>testimage*.bbclass</filename></title>
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003325
3326 <para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -05003327 The <filename>testimage*</filename> classes support running
3328 automated tests against images using QEMU and on actual hardware.
3329 The classes handle loading the tests and starting the image.
3330 To use the classes, you need to perform steps to set up the
3331 environment.
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003332 </para>
3333
3334 <para>
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003335 The tests are commands that run on the target system over
3336 <filename>ssh</filename>.
Patrick Williamsf1e5d692016-03-30 15:21:19 -05003337 Each test is written in Python and makes use of the
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003338 <filename>unittest</filename> module.
3339 </para>
3340
3341 <para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -05003342 The <filename>testimage.bbclass</filename> runs tests on an image
3343 when called using the following:
3344 <literallayout class='monospaced'>
3345 $ bitbake -c testimage <replaceable>image</replaceable>
3346 </literallayout>
3347 The <filename>testimage-auto</filename> class runs tests on an image
3348 after the image is constructed (i.e.
3349 <link linkend='var-TEST_IMAGE'><filename>TEST_IMAGE</filename></link>
3350 must be set to "1").
3351 </para>
3352
3353 <para>
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003354 For information on how to enable, run, and create new tests, see the
3355 "<ulink url='&YOCTO_DOCS_DEV_URL;#performing-automated-runtime-testing'>Performing Automated Runtime Testing</ulink>"
Patrick Williamsf1e5d692016-03-30 15:21:19 -05003356 section in the Yocto Project Development Manual.
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003357 </para>
3358</section>
3359
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05003360<section id='ref-classes-testsdk'>
3361 <title><filename>testsdk.bbclass</filename></title>
3362
3363 <para>
3364 This class supports running automated tests against
3365 software development kits (SDKs).
3366 The <filename>testsdk</filename> class runs tests on an SDK when
3367 called using the following:
3368 <literallayout class='monospaced'>
3369 $ bitbake -c testsdk image
3370 </literallayout>
3371 </para>
3372</section>
3373
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003374<section id='ref-classes-texinfo'>
3375 <title><filename>texinfo.bbclass</filename></title>
3376
3377 <para>
3378 This class should be inherited by recipes whose upstream packages
3379 invoke the <filename>texinfo</filename> utilities at build-time.
3380 Native and cross recipes are made to use the dummy scripts provided
3381 by <filename>texinfo-dummy-native</filename>, for improved performance.
3382 Target architecture recipes use the genuine
3383 Texinfo utilities.
3384 By default, they use the Texinfo utilities on the host system.
3385 <note>
3386 If you want to use the Texinfo recipe shipped with the build
3387 system, you can remove "texinfo-native" from
3388 <link linkend='var-ASSUME_PROVIDED'><filename>ASSUME_PROVIDED</filename></link>
3389 and makeinfo from
3390 <link linkend='var-SANITY_REQUIRED_UTILITIES'><filename>SANITY_REQUIRED_UTILITIES</filename></link>.
3391 </note>
3392 </para>
3393</section>
3394
3395<section id='ref-classes-tinderclient'>
3396 <title><filename>tinderclient.bbclass</filename></title>
3397
3398 <para>
3399 The <filename>tinderclient</filename> class submits build results to
3400 an external Tinderbox instance.
3401 <note>
3402 This class is currently unmaintained.
3403 </note>
3404 </para>
3405</section>
3406
3407<section id='ref-classes-toaster'>
3408 <title><filename>toaster.bbclass</filename></title>
3409
3410 <para>
3411 The <filename>toaster</filename> class collects information about
3412 packages and images and sends them as events that the BitBake
3413 user interface can receive.
3414 The class is enabled when the Toaster user interface is running.
3415 </para>
3416
3417 <para>
3418 This class is not intended to be used directly.
3419 </para>
3420</section>
3421
3422<section id='ref-classes-toolchain-scripts'>
3423 <title><filename>toolchain-scripts.bbclass</filename></title>
3424
3425 <para>
3426 The <filename>toolchain-scripts</filename> class provides the scripts
3427 used for setting up the environment for installed SDKs.
3428 </para>
3429</section>
3430
3431<section id='ref-classes-typecheck'>
3432 <title><filename>typecheck.bbclass</filename></title>
3433
3434 <para>
3435 The <filename>typecheck</filename> class provides support for
3436 validating the values of variables set at the configuration level
3437 against their defined types.
3438 The OpenEmbedded build system allows you to define the type of a
3439 variable using the "type" varflag.
3440 Here is an example:
3441 <literallayout class='monospaced'>
3442 IMAGE_FEATURES[type] = "list"
3443 </literallayout>
3444 </para>
3445</section>
3446
3447<section id='ref-classes-uboot-config'>
3448 <title><filename>uboot-config.bbclass</filename></title>
3449
3450 <para>
3451 The <filename>uboot-config</filename> class provides support for
3452 U-Boot configuration for a machine.
3453 Specify the machine in your recipe as follows:
3454 <literallayout class='monospaced'>
3455 UBOOT_CONFIG ??= &lt;default&gt;
3456 UBOOT_CONFIG[foo] = "config,images"
3457 </literallayout>
3458 You can also specify the machine using this method:
3459 <literallayout class='monospaced'>
3460 UBOOT_MACHINE = "config"
3461 </literallayout>
3462 See the
3463 <link linkend='var-UBOOT_CONFIG'><filename>UBOOT_CONFIG</filename></link>
3464 and
3465 <link linkend='var-UBOOT_MACHINE'><filename>UBOOT_MACHINE</filename></link>
3466 variables for additional information.
3467 </para>
3468</section>
3469
3470<section id='ref-classes-uninative'>
3471 <title><filename>uninative.bbclass</filename></title>
3472
3473 <para>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05003474 Attempts to isolate the build system from the host
3475 distribution's C library in order to make re-use of native shared state
3476 artifacts across different host distributions practical.
3477 With this class enabled, a tarball containing a pre-built C library
3478 is downloaded at the start of the build.
3479 In the Poky reference distribution this is enabled by default
3480 through
3481 <filename>meta/conf/distro/include/yocto-uninative.inc</filename>.
3482 Other distributions that do not derive from poky can also
3483 "<filename>require conf/distro/include/yocto-uninative.inc</filename>"
3484 to use this.
3485 Alternatively if you prefer, you can build the uninative-tarball recipe
3486 yourself, publish the resulting tarball (e.g. via HTTP) and set
3487 <filename>UNINATIVE_URL</filename> and
3488 <filename>UNINATIVE_CHECKSUM</filename> appropriately.
3489 For an example, see the
3490 <filename>meta/conf/distro/include/yocto-uninative.inc</filename>.
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003491 </para>
3492</section>
3493
3494<section id='ref-classes-update-alternatives'>
3495 <title><filename>update-alternatives.bbclass</filename></title>
3496
3497 <para>
3498 The <filename>update-alternatives</filename> class helps the
3499 alternatives system when multiple sources provide the same command.
3500 This situation occurs when several programs that have the same or
3501 similar function are installed with the same name.
3502 For example, the <filename>ar</filename> command is available from the
3503 <filename>busybox</filename>, <filename>binutils</filename> and
3504 <filename>elfutils</filename> packages.
3505 The <filename>update-alternatives</filename> class handles
3506 renaming the binaries so that multiple packages can be installed
3507 without conflicts.
3508 The <filename>ar</filename> command still works regardless of which
3509 packages are installed or subsequently removed.
3510 The class renames the conflicting binary in each package and symlinks
3511 the highest priority binary during installation or removal of packages.
3512 </para>
3513
3514 <para>
3515 To use this class, you need to define a number of variables:
3516 <itemizedlist>
3517 <listitem><para><link linkend='var-ALTERNATIVE'><filename>ALTERNATIVE</filename></link>
3518 </para></listitem>
3519 <listitem><para><link linkend='var-ALTERNATIVE_LINK_NAME'><filename>ALTERNATIVE_LINK_NAME</filename></link>
3520 </para></listitem>
3521 <listitem><para><link linkend='var-ALTERNATIVE_TARGET'><filename>ALTERNATIVE_TARGET</filename></link>
3522 </para></listitem>
3523 <listitem><para><link linkend='var-ALTERNATIVE_PRIORITY'><filename>ALTERNATIVE_PRIORITY</filename></link>
3524 </para></listitem>
3525 </itemizedlist>
3526 These variables list alternative commands needed by a package,
3527 provide pathnames for links, default links for targets, and
3528 so forth.
3529 For details on how to use this class, see the comments in the
3530 <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/meta/classes/update-alternatives.bbclass'><filename>update-alternatives.bbclass</filename></ulink>.
3531 </para>
3532
3533 <note>
3534 You can use the <filename>update-alternatives</filename> command
3535 directly in your recipes.
3536 However, this class simplifies things in most cases.
3537 </note>
3538</section>
3539
3540<section id='ref-classes-update-rc.d'>
3541 <title><filename>update-rc.d.bbclass</filename></title>
3542
3543 <para>
3544 The <filename>update-rc.d</filename> class uses
3545 <filename>update-rc.d</filename> to safely install an
3546 initialization script on behalf of the package.
3547 The OpenEmbedded build system takes care of details such as making
3548 sure the script is stopped before a package is removed and started when
3549 the package is installed.
3550 </para>
3551
3552 <para>
3553 Three variables control this class:
3554 <filename><link linkend='var-INITSCRIPT_PACKAGES'>INITSCRIPT_PACKAGES</link></filename>,
3555 <filename><link linkend='var-INITSCRIPT_NAME'>INITSCRIPT_NAME</link></filename> and
3556 <filename><link linkend='var-INITSCRIPT_PARAMS'>INITSCRIPT_PARAMS</link></filename>.
3557 See the variable links for details.
3558 </para>
3559</section>
3560
3561<section id='ref-classes-useradd'>
Patrick Williamsf1e5d692016-03-30 15:21:19 -05003562 <title><filename>useradd*.bbclass</filename></title>
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003563
3564 <para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -05003565 The <filename>useradd*</filename> classes support the addition of users
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003566 or groups for usage by the package on the target.
3567 For example, if you have packages that contain system services that
Patrick Williamsf1e5d692016-03-30 15:21:19 -05003568 should be run under their own user or group, you can use these classes
3569 to enable creation of the user or group.
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003570 The <filename>meta-skeleton/recipes-skeleton/useradd/useradd-example.bb</filename>
3571 recipe in the <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
3572 provides a simple example that shows how to add three
3573 users and groups to two packages.
3574 See the <filename>useradd-example.bb</filename> recipe for more
Patrick Williamsf1e5d692016-03-30 15:21:19 -05003575 information on how to use these classes.
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003576 </para>
3577
3578 <para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -05003579 The <filename>useradd_base</filename> class provides basic
3580 functionality for user or groups settings.
3581 </para>
3582
3583 <para>
3584 The <filename>useradd*</filename> classes support the
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003585 <link linkend='var-USERADD_PACKAGES'><filename>USERADD_PACKAGES</filename></link>,
3586 <link linkend='var-USERADD_PARAM'><filename>USERADD_PARAM</filename></link>,
3587 <link linkend='var-GROUPADD_PARAM'><filename>GROUPADD_PARAM</filename></link>,
3588 and
3589 <link linkend='var-GROUPMEMS_PARAM'><filename>GROUPMEMS_PARAM</filename></link>
3590 variables.
3591 </para>
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003592
3593 <para>
3594 The <filename>useradd-staticids</filename> class supports the addition
3595 of users or groups that have static user identification
3596 (<filename>uid</filename>) and group identification
3597 (<filename>gid</filename>) values.
3598 </para>
3599
3600 <para>
3601 The default behavior of the OpenEmbedded build system for assigning
3602 <filename>uid</filename> and <filename>gid</filename> values when
3603 packages add users and groups during package install time is to
3604 add them dynamically.
3605 This works fine for programs that do not care what the values of the
3606 resulting users and groups become.
3607 In these cases, the order of the installation determines the final
3608 <filename>uid</filename> and <filename>gid</filename> values.
3609 However, if non-deterministic
3610 <filename>uid</filename> and <filename>gid</filename> values are a
3611 problem, you can override the default, dynamic application of these
3612 values by setting static values.
3613 When you set static values, the OpenEmbedded build system looks in
3614 <link linkend='var-BBPATH'><filename>BBPATH</filename></link> for
3615 <filename>files/passwd</filename> and <filename>files/group</filename>
3616 files for the values.
3617 </para>
3618
3619 <para>
3620 To use static <filename>uid</filename> and <filename>gid</filename>
3621 values, you need to set some variables.
3622 See the
3623 <link linkend='var-USERADDEXTENSION'><filename>USERADDEXTENSION</filename></link>,
3624 <link linkend='var-USERADD_UID_TABLES'><filename>USERADD_UID_TABLES</filename></link>,
3625 <link linkend='var-USERADD_GID_TABLES'><filename>USERADD_GID_TABLES</filename></link>,
3626 and
3627 <link linkend='var-USERADD_ERROR_DYNAMIC'><filename>USERADD_ERROR_DYNAMIC</filename></link>
3628 variables.
3629 You can also see the
3630 <link linkend='ref-classes-useradd'><filename>useradd</filename></link>
3631 class for additional information.
3632 </para>
3633
3634 <note><title>Notes</title>
Patrick Williamsf1e5d692016-03-30 15:21:19 -05003635 You do not use the <filename>useradd-staticids</filename>
3636 class directly.
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003637 You either enable or disable the class by setting the
3638 <filename>USERADDEXTENSION</filename> variable.
3639 If you enable or disable the class in a configured system,
3640 <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>
3641 might contain incorrect <filename>uid</filename> and
3642 <filename>gid</filename> values.
3643 Deleting the <filename>TMPDIR</filename> directory
3644 will correct this condition.
3645 </note>
3646</section>
3647
3648<section id='ref-classes-utility-tasks'>
3649 <title><filename>utility-tasks.bbclass</filename></title>
3650
3651 <para>
3652 The <filename>utility-tasks</filename> class provides support for
3653 various "utility" type tasks that are applicable to all recipes,
3654 such as
3655 <link linkend='ref-tasks-clean'><filename>do_clean</filename></link> and
3656 <link linkend='ref-tasks-listtasks'><filename>do_listtasks</filename></link>.
3657 </para>
3658
3659 <para>
3660 This class is enabled by default because it is inherited by
3661 the
3662 <link linkend='ref-classes-base'><filename>base</filename></link>
3663 class.
3664 </para>
3665</section>
3666
3667<section id='ref-classes-utils'>
3668 <title><filename>utils.bbclass</filename></title>
3669
3670 <para>
3671 The <filename>utils</filename> class provides some useful Python
3672 functions that are typically used in inline Python expressions
3673 (e.g. <filename>${@...}</filename>).
3674 One example use is for <filename>bb.utils.contains()</filename>.
3675 </para>
3676
3677 <para>
3678 This class is enabled by default because it is inherited by the
3679 <link linkend='ref-classes-base'><filename>base</filename></link>
3680 class.
3681 </para>
3682</section>
3683
3684<section id='ref-classes-vala'>
3685 <title><filename>vala.bbclass</filename></title>
3686
3687 <para>
3688 The <filename>vala</filename> class supports recipes that need to
3689 build software written using the Vala programming language.
3690 </para>
3691</section>
3692
3693<section id='ref-classes-waf'>
3694 <title><filename>waf.bbclass</filename></title>
3695
3696 <para>
3697 The <filename>waf</filename> class supports recipes that need to build
3698 software that uses the Waf build system.
3699 You can use the
3700 <link linkend='var-EXTRA_OECONF'><filename>EXTRA_OECONF</filename></link>
3701 variable to specify additional configuration options to be passed on
3702 the Waf command line.
3703 </para>
3704</section>
3705
3706<!-- Undocumented classes are:
3707 image-empty.bbclass (possibly being dropped)
3708 migrate_localcount.bbclass (still need a description)
3709-->
3710
3711
3712</chapter>
3713<!--
3714vim: expandtab tw=80 ts=4
3715-->