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