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