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