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