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