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