blob: 09878c480f6c5ea7b4fce1abbf607e86b1004be6 [file] [log] [blame]
Andrew Geisslerf0343792020-11-18 10:42:21 -06001.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002
3*******
4Classes
5*******
6
7Class files are used to abstract common functionality and share it
8amongst multiple recipe (``.bb``) files. To use a class file, you simply
9make sure the recipe inherits the class. In most cases, when a recipe
10inherits a class it is enough to enable its features. There are cases,
11however, where in the recipe you might need to set variables or override
12some default behavior.
13
14Any :term:`Metadata` usually found in a recipe can also be
15placed in a class file. Class files are identified by the extension
16``.bbclass`` and are usually placed in a ``classes/`` directory beneath
17the ``meta*/`` directory found in the :term:`Source Directory`.
18Class files can also be pointed to by
19:term:`BUILDDIR` (e.g. ``build/``) in the same way as
20``.conf`` files in the ``conf`` directory. Class files are searched for
21in :term:`BBPATH` using the same method by which ``.conf``
22files are searched.
23
24This chapter discusses only the most useful and important classes. Other
25classes do exist within the ``meta/classes`` directory in the Source
26Directory. You can reference the ``.bbclass`` files directly for more
27information.
28
29.. _ref-classes-allarch:
30
31``allarch.bbclass``
32===================
33
34The ``allarch`` class is inherited by recipes that do not produce
35architecture-specific output. The class disables functionality that is
36normally needed for recipes that produce executable binaries (such as
37building the cross-compiler and a C library as pre-requisites, and
38splitting out of debug symbols during packaging).
39
40.. note::
41
42 Unlike some distro recipes (e.g. Debian), OpenEmbedded recipes that
43 produce packages that depend on tunings through use of the
44 :term:`RDEPENDS` and
45 :term:`TUNE_PKGARCH` variables, should never be
46 configured for all architectures using ``allarch``. This is the case
47 even if the recipes do not produce architecture-specific output.
48
49 Configuring such recipes for all architectures causes the
Andrew Geissler4c19ea12020-10-27 13:52:24 -050050 ``do_package_write_*`` tasks to
Andrew Geisslerc9f78652020-09-18 14:11:35 -050051 have different signatures for the machines with different tunings.
52 Additionally, unnecessary rebuilds occur every time an image for a
Andrew Geissler09036742021-06-25 14:25:14 -050053 different :term:`MACHINE` is built even when the recipe never changes.
Andrew Geisslerc9f78652020-09-18 14:11:35 -050054
55By default, all recipes inherit the :ref:`base <ref-classes-base>` and
56:ref:`package <ref-classes-package>` classes, which enable
57functionality needed for recipes that produce executable output. If your
58recipe, for example, only produces packages that contain configuration
59files, media files, or scripts (e.g. Python and Perl), then it should
60inherit the ``allarch`` class.
61
62.. _ref-classes-archiver:
63
64``archiver.bbclass``
65====================
66
67The ``archiver`` class supports releasing source code and other
68materials with the binaries.
69
70For more details on the source archiver, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -060071":ref:`dev-manual/common-tasks:maintaining open source license compliance during your product's lifecycle`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -050072section in the Yocto Project Development Tasks Manual. You can also see
73the :term:`ARCHIVER_MODE` variable for information
74about the variable flags (varflags) that help control archive creation.
75
76.. _ref-classes-autotools:
77
78``autotools*.bbclass``
79======================
80
81The ``autotools*`` classes support Autotooled packages.
82
83The ``autoconf``, ``automake``, and ``libtool`` packages bring
84standardization. This class defines a set of tasks (e.g. ``configure``,
85``compile`` and so forth) that work for all Autotooled packages. It
86should usually be enough to define a few standard variables and then
87simply ``inherit autotools``. These classes can also work with software
88that emulates Autotools. For more information, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -060089":ref:`dev-manual/common-tasks:autotooled package`" section
Andrew Geisslerc9f78652020-09-18 14:11:35 -050090in the Yocto Project Development Tasks Manual.
91
92By default, the ``autotools*`` classes use out-of-tree builds (i.e.
93``autotools.bbclass`` building with ``B != S``).
94
95If the software being built by a recipe does not support using
96out-of-tree builds, you should have the recipe inherit the
97``autotools-brokensep`` class. The ``autotools-brokensep`` class behaves
98the same as the ``autotools`` class but builds with :term:`B`
99== :term:`S`. This method is useful when out-of-tree build
100support is either not present or is broken.
101
102.. note::
103
104 It is recommended that out-of-tree support be fixed and used if at
105 all possible.
106
107It's useful to have some idea of how the tasks defined by the
108``autotools*`` classes work and what they do behind the scenes.
109
110- :ref:`ref-tasks-configure` - Regenerates the
111 configure script (using ``autoreconf``) and then launches it with a
112 standard set of arguments used during cross-compilation. You can pass
Andrew Geissler09036742021-06-25 14:25:14 -0500113 additional parameters to ``configure`` through the :term:`EXTRA_OECONF`
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500114 or :term:`PACKAGECONFIG_CONFARGS`
115 variables.
116
117- :ref:`ref-tasks-compile` - Runs ``make`` with
118 arguments that specify the compiler and linker. You can pass
119 additional arguments through the ``EXTRA_OEMAKE`` variable.
120
121- :ref:`ref-tasks-install` - Runs ``make install`` and
122 passes in ``${``\ :term:`D`\ ``}`` as ``DESTDIR``.
123
124.. _ref-classes-base:
125
126``base.bbclass``
127================
128
129The ``base`` class is special in that every ``.bb`` file implicitly
130inherits the class. This class contains definitions for standard basic
131tasks such as fetching, unpacking, configuring (empty by default),
132compiling (runs any ``Makefile`` present), installing (empty by default)
133and packaging (empty by default). These classes are often overridden or
134extended by other classes such as the
135:ref:`autotools <ref-classes-autotools>` class or the
136:ref:`package <ref-classes-package>` class.
137
138The class also contains some commonly used functions such as
139``oe_runmake``, which runs ``make`` with the arguments specified in
140:term:`EXTRA_OEMAKE` variable as well as the
141arguments passed directly to ``oe_runmake``.
142
143.. _ref-classes-bash-completion:
144
145``bash-completion.bbclass``
146===========================
147
148Sets up packaging and dependencies appropriate for recipes that build
149software that includes bash-completion data.
150
151.. _ref-classes-bin-package:
152
153``bin_package.bbclass``
154=======================
155
156The ``bin_package`` class is a helper class for recipes that extract the
157contents of a binary package (e.g. an RPM) and install those contents
158rather than building the binary from source. The binary package is
159extracted and new packages in the configured output package format are
160created. Extraction and installation of proprietary binaries is a good
161example use for this class.
162
163.. note::
164
165 For RPMs and other packages that do not contain a subdirectory, you
166 should specify an appropriate fetcher parameter to point to the
Andrew Geissler4c19ea12020-10-27 13:52:24 -0500167 subdirectory. For example, if BitBake is using the Git fetcher (``git://``),
168 the "subpath" parameter limits the checkout to a specific subpath
169 of the tree. Here is an example where ``${BP}`` is used so that the files
170 are extracted into the subdirectory expected by the default value of
Andrew Geissler09036742021-06-25 14:25:14 -0500171 :term:`S`::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500172
173 SRC_URI = "git://example.com/downloads/somepackage.rpm;subpath=${BP}"
174
175
Andrew Geissler4c19ea12020-10-27 13:52:24 -0500176 See the ":ref:`bitbake-user-manual/bitbake-user-manual-fetching:fetchers`" section in the BitBake User Manual for
177 more information on supported BitBake Fetchers.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500178
179.. _ref-classes-binconfig:
180
181``binconfig.bbclass``
182=====================
183
184The ``binconfig`` class helps to correct paths in shell scripts.
185
186Before ``pkg-config`` had become widespread, libraries shipped shell
187scripts to give information about the libraries and include paths needed
188to build software (usually named ``LIBNAME-config``). This class assists
189any recipe using such scripts.
190
191During staging, the OpenEmbedded build system installs such scripts into
192the ``sysroots/`` directory. Inheriting this class results in all paths
193in these scripts being changed to point into the ``sysroots/`` directory
194so that all builds that use the script use the correct directories for
195the cross compiling layout. See the
196:term:`BINCONFIG_GLOB` variable for more
197information.
198
199.. _ref-classes-binconfig-disabled:
200
201``binconfig-disabled.bbclass``
202==============================
203
204An alternative version of the :ref:`binconfig <ref-classes-binconfig>`
205class, which disables binary configuration scripts by making them return
206an error in favor of using ``pkg-config`` to query the information. The
207scripts to be disabled should be specified using the
208:term:`BINCONFIG` variable within the recipe inheriting
209the class.
210
211.. _ref-classes-blacklist:
212
213``blacklist.bbclass``
214=====================
215
216The ``blacklist`` class prevents the OpenEmbedded build system from
217building specific recipes (blacklists them). To use this class, inherit
218the class globally and set :term:`PNBLACKLIST` for
219each recipe you wish to blacklist. Specify the :term:`PN`
220value as a variable flag (varflag) and provide a reason, which is
221reported, if the package is requested to be built as the value. For
222example, if you want to blacklist a recipe called "exoticware", you add
Andrew Geisslerc926e172021-05-07 16:11:35 -0500223the following to your ``local.conf`` or distribution configuration::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500224
225 INHERIT += "blacklist"
226 PNBLACKLIST[exoticware] = "Not supported by our organization."
227
228.. _ref-classes-buildhistory:
229
230``buildhistory.bbclass``
231========================
232
233The ``buildhistory`` class records a history of build output metadata,
234which can be used to detect possible regressions as well as used for
235analysis of the build output. For more information on using Build
236History, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600237":ref:`dev-manual/common-tasks:maintaining build output quality`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500238section in the Yocto Project Development Tasks Manual.
239
240.. _ref-classes-buildstats:
241
242``buildstats.bbclass``
243======================
244
245The ``buildstats`` class records performance statistics about each task
246executed during the build (e.g. elapsed time, CPU usage, and I/O usage).
247
248When you use this class, the output goes into the
249:term:`BUILDSTATS_BASE` directory, which defaults
250to ``${TMPDIR}/buildstats/``. You can analyze the elapsed time using
251``scripts/pybootchartgui/pybootchartgui.py``, which produces a cascading
252chart of the entire build process and can be useful for highlighting
253bottlenecks.
254
255Collecting build statistics is enabled by default through the
256:term:`USER_CLASSES` variable from your
257``local.conf`` file. Consequently, you do not have to do anything to
258enable the class. However, if you want to disable the class, simply
Andrew Geissler09036742021-06-25 14:25:14 -0500259remove "buildstats" from the :term:`USER_CLASSES` list.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500260
261.. _ref-classes-buildstats-summary:
262
263``buildstats-summary.bbclass``
264==============================
265
266When inherited globally, prints statistics at the end of the build on
267sstate re-use. In order to function, this class requires the
268:ref:`buildstats <ref-classes-buildstats>` class be enabled.
269
270.. _ref-classes-ccache:
271
272``ccache.bbclass``
273==================
274
275The ``ccache`` class enables the C/C++ Compiler Cache for the build.
276This class is used to give a minor performance boost during the build.
277However, using the class can lead to unexpected side-effects. Thus, it
278is recommended that you do not use this class. See
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600279https://ccache.samba.org/ for information on the C/C++ Compiler
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500280Cache.
281
282.. _ref-classes-chrpath:
283
284``chrpath.bbclass``
285===================
286
287The ``chrpath`` class is a wrapper around the "chrpath" utility, which
288is used during the build process for ``nativesdk``, ``cross``, and
289``cross-canadian`` recipes to change ``RPATH`` records within binaries
290in order to make them relocatable.
291
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500292.. _ref-classes-cmake:
293
294``cmake.bbclass``
295=================
296
297The ``cmake`` class allows for recipes that need to build software using
298the `CMake <https://cmake.org/overview/>`__ build system. You can use
299the :term:`EXTRA_OECMAKE` variable to specify
300additional configuration options to be passed using the ``cmake``
301command line.
302
303On the occasion that you would be installing custom CMake toolchain
304files supplied by the application being built, you should install them
305to the preferred CMake Module directory: ``${D}${datadir}/cmake/``
306Modules during
307:ref:`ref-tasks-install`.
308
309.. _ref-classes-cml1:
310
311``cml1.bbclass``
312================
313
314The ``cml1`` class provides basic support for the Linux kernel style
315build configuration system.
316
317.. _ref-classes-compress_doc:
318
319``compress_doc.bbclass``
320========================
321
322Enables compression for man pages and info pages. This class is intended
323to be inherited globally. The default compression mechanism is gz (gzip)
324but you can select an alternative mechanism by setting the
325:term:`DOC_COMPRESS` variable.
326
327.. _ref-classes-copyleft_compliance:
328
329``copyleft_compliance.bbclass``
330===============================
331
332The ``copyleft_compliance`` class preserves source code for the purposes
333of license compliance. This class is an alternative to the ``archiver``
334class and is still used by some users even though it has been deprecated
335in favor of the :ref:`archiver <ref-classes-archiver>` class.
336
337.. _ref-classes-copyleft_filter:
338
339``copyleft_filter.bbclass``
340===========================
341
342A class used by the :ref:`archiver <ref-classes-archiver>` and
343:ref:`copyleft_compliance <ref-classes-copyleft_compliance>` classes
344for filtering licenses. The ``copyleft_filter`` class is an internal
345class and is not intended to be used directly.
346
347.. _ref-classes-core-image:
348
349``core-image.bbclass``
350======================
351
352The ``core-image`` class provides common definitions for the
353``core-image-*`` image recipes, such as support for additional
354:term:`IMAGE_FEATURES`.
355
356.. _ref-classes-cpan:
357
358``cpan*.bbclass``
359=================
360
361The ``cpan*`` classes support Perl modules.
362
363Recipes for Perl modules are simple. These recipes usually only need to
364point to the source's archive and then inherit the proper class file.
365Building is split into two methods depending on which method the module
366authors used.
367
368- Modules that use old ``Makefile.PL``-based build system require
369 ``cpan.bbclass`` in their recipes.
370
371- Modules that use ``Build.PL``-based build system require using
372 ``cpan_build.bbclass`` in their recipes.
373
374Both build methods inherit the ``cpan-base`` class for basic Perl
375support.
376
377.. _ref-classes-cross:
378
379``cross.bbclass``
380=================
381
382The ``cross`` class provides support for the recipes that build the
383cross-compilation tools.
384
385.. _ref-classes-cross-canadian:
386
387``cross-canadian.bbclass``
388==========================
389
390The ``cross-canadian`` class provides support for the recipes that build
391the Canadian Cross-compilation tools for SDKs. See the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600392":ref:`overview-manual/concepts:cross-development toolchain generation`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500393section in the Yocto Project Overview and Concepts Manual for more
394discussion on these cross-compilation tools.
395
396.. _ref-classes-crosssdk:
397
398``crosssdk.bbclass``
399====================
400
401The ``crosssdk`` class provides support for the recipes that build the
402cross-compilation tools used for building SDKs. See the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600403":ref:`overview-manual/concepts:cross-development toolchain generation`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500404section in the Yocto Project Overview and Concepts Manual for more
405discussion on these cross-compilation tools.
406
407.. _ref-classes-debian:
408
409``debian.bbclass``
410==================
411
412The ``debian`` class renames output packages so that they follow the
413Debian naming policy (i.e. ``glibc`` becomes ``libc6`` and
414``glibc-devel`` becomes ``libc6-dev``.) Renaming includes the library
415name and version as part of the package name.
416
417If a recipe creates packages for multiple libraries (shared object files
418of ``.so`` type), use the :term:`LEAD_SONAME`
419variable in the recipe to specify the library on which to apply the
420naming scheme.
421
422.. _ref-classes-deploy:
423
424``deploy.bbclass``
425==================
426
427The ``deploy`` class handles deploying files to the
428:term:`DEPLOY_DIR_IMAGE` directory. The main
429function of this class is to allow the deploy step to be accelerated by
430shared state. Recipes that inherit this class should define their own
431:ref:`ref-tasks-deploy` function to copy the files to be
432deployed to :term:`DEPLOYDIR`, and use ``addtask`` to
433add the task at the appropriate place, which is usually after
434:ref:`ref-tasks-compile` or
435:ref:`ref-tasks-install`. The class then takes care of
Andrew Geissler09036742021-06-25 14:25:14 -0500436staging the files from :term:`DEPLOYDIR` to :term:`DEPLOY_DIR_IMAGE`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500437
438.. _ref-classes-devshell:
439
440``devshell.bbclass``
441====================
442
443The ``devshell`` class adds the ``do_devshell`` task. Distribution
Andrew Geissler09209ee2020-12-13 08:44:15 -0600444policy dictates whether to include this class. See the ":ref:`dev-manual/common-tasks:using a development shell`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500445section in the Yocto Project Development Tasks Manual for more
446information about using ``devshell``.
447
448.. _ref-classes-devupstream:
449
450``devupstream.bbclass``
451=======================
452
453The ``devupstream`` class uses
454:term:`BBCLASSEXTEND` to add a variant of the
455recipe that fetches from an alternative URI (e.g. Git) instead of a
Andrew Geisslerc926e172021-05-07 16:11:35 -0500456tarball. Following is an example::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500457
458 BBCLASSEXTEND = "devupstream:target"
459 SRC_URI_class-devupstream = "git://git.example.com/example"
460 SRCREV_class-devupstream = "abcd1234"
461
462Adding the above statements to your recipe creates a variant that has
463:term:`DEFAULT_PREFERENCE` set to "-1".
464Consequently, you need to select the variant of the recipe to use it.
465Any development-specific adjustments can be done by using the
Andrew Geisslerc926e172021-05-07 16:11:35 -0500466``class-devupstream`` override. Here is an example::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500467
468 DEPENDS_append_class-devupstream = " gperf-native"
469 do_configure_prepend_class-devupstream() {
470 touch ${S}/README
471 }
472
473The class
474currently only supports creating a development variant of the target
475recipe, not ``native`` or ``nativesdk`` variants.
476
Andrew Geissler09036742021-06-25 14:25:14 -0500477The :term:`BBCLASSEXTEND` syntax (i.e. ``devupstream:target``) provides
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500478support for ``native`` and ``nativesdk`` variants. Consequently, this
479functionality can be added in a future release.
480
481Support for other version control systems such as Subversion is limited
482due to BitBake's automatic fetch dependencies (e.g.
483``subversion-native``).
484
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500485.. _ref-classes-distutils3:
486
487``distutils3*.bbclass``
488=======================
489
490The ``distutils3*`` classes support recipes for Python version 3.x
491extensions, which are simple. These recipes usually only need to point
492to the source's archive and then inherit the proper class. Building is
493split into three methods depending on which method the module authors
494used.
495
496- Extensions that use an Autotools-based build system require Autotools
497 and ``distutils``-based classes in their recipes.
498
499- Extensions that use ``distutils``-based build systems require the
500 ``distutils`` class in their recipes.
501
502- Extensions that use build systems based on ``setuptools3`` require
Andrew Geissler3b8a17c2021-04-15 15:55:55 -0500503 the :ref:`setuptools3 <ref-classes-setuptools3>` class in their
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500504 recipes.
505
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500506.. _ref-classes-externalsrc:
507
508``externalsrc.bbclass``
509=======================
510
511The ``externalsrc`` class supports building software from source code
512that is external to the OpenEmbedded build system. Building software
513from an external source tree means that the build system's normal fetch,
514unpack, and patch process is not used.
515
516By default, the OpenEmbedded build system uses the :term:`S`
517and :term:`B` variables to locate unpacked recipe source code
518and to build it, respectively. When your recipe inherits the
519``externalsrc`` class, you use the
520:term:`EXTERNALSRC` and
521:term:`EXTERNALSRC_BUILD` variables to
Andrew Geissler09036742021-06-25 14:25:14 -0500522ultimately define :term:`S` and :term:`B`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500523
524By default, this class expects the source code to support recipe builds
525that use the :term:`B` variable to point to the directory in
526which the OpenEmbedded build system places the generated objects built
Andrew Geissler09036742021-06-25 14:25:14 -0500527from the recipes. By default, the :term:`B` directory is set to the
528following, which is separate from the source directory (:term:`S`)::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500529
530 ${WORKDIR}/${BPN}/{PV}/
531
532See these variables for more information:
533:term:`WORKDIR`, :term:`BPN`, and
534:term:`PV`,
535
536For more information on the ``externalsrc`` class, see the comments in
537``meta/classes/externalsrc.bbclass`` in the :term:`Source Directory`.
538For information on how to use the
539``externalsrc`` class, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600540":ref:`dev-manual/common-tasks:building software from an external source`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500541section in the Yocto Project Development Tasks Manual.
542
543.. _ref-classes-extrausers:
544
545``extrausers.bbclass``
546======================
547
548The ``extrausers`` class allows additional user and group configuration
549to be applied at the image level. Inheriting this class either globally
550or from an image recipe allows additional user and group operations to
551be performed using the
552:term:`EXTRA_USERS_PARAMS` variable.
553
554.. note::
555
556 The user and group operations added using the
557 extrausers
558 class are not tied to a specific recipe outside of the recipe for the
559 image. Thus, the operations can be performed across the image as a
560 whole. Use the
561 useradd
562 class to add user and group configuration to a specific recipe.
563
Andrew Geisslerc926e172021-05-07 16:11:35 -0500564Here is an example that uses this class in an image recipe::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500565
566 inherit extrausers
567 EXTRA_USERS_PARAMS = "\
568 useradd -p '' tester; \
569 groupadd developers; \
570 userdel nobody; \
571 groupdel -g video; \
572 groupmod -g 1020 developers; \
573 usermod -s /bin/sh tester; \
574 "
575
576Here is an example that adds two users named "tester-jim" and "tester-sue" and assigns
Andrew Geisslerc926e172021-05-07 16:11:35 -0500577passwords::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500578
579 inherit extrausers
580 EXTRA_USERS_PARAMS = "\
581 useradd -P tester01 tester-jim; \
582 useradd -P tester01 tester-sue; \
583 "
584
Andrew Geisslerc926e172021-05-07 16:11:35 -0500585Finally, here is an example that sets the root password to "1876*18"::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500586
587 inherit extrausers
588 EXTRA_USERS_PARAMS = "\
589 usermod -P 1876*18 root; \
590 "
591
Andrew Geissler6ce62a22020-11-30 19:58:47 -0600592.. _ref-classes-features_check:
593
594``features_check.bbclass``
595=================================
596
597The ``features_check`` class allows individual recipes to check
598for required and conflicting
599:term:`DISTRO_FEATURES`, :term:`MACHINE_FEATURES` or :term:`COMBINED_FEATURES`.
600
601This class provides support for the following variables:
602
603- :term:`REQUIRED_DISTRO_FEATURES`
604- :term:`CONFLICT_DISTRO_FEATURES`
605- :term:`ANY_OF_DISTRO_FEATURES`
606- ``REQUIRED_MACHINE_FEATURES``
607- ``CONFLICT_MACHINE_FEATURES``
608- ``ANY_OF_MACHINE_FEATURES``
609- ``REQUIRED_COMBINED_FEATURES``
610- ``CONFLICT_COMBINED_FEATURES``
611- ``ANY_OF_COMBINED_FEATURES``
612
613If any conditions specified in the recipe using the above
614variables are not met, the recipe will be skipped, and if the
615build system attempts to build the recipe then an error will be
616triggered.
617
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500618.. _ref-classes-fontcache:
619
620``fontcache.bbclass``
621=====================
622
623The ``fontcache`` class generates the proper post-install and
624post-remove (postinst and postrm) scriptlets for font packages. These
625scriptlets call ``fc-cache`` (part of ``Fontconfig``) to add the fonts
626to the font information cache. Since the cache files are
627architecture-specific, ``fc-cache`` runs using QEMU if the postinst
628scriptlets need to be run on the build host during image creation.
629
630If the fonts being installed are in packages other than the main
631package, set :term:`FONT_PACKAGES` to specify the
632packages containing the fonts.
633
634.. _ref-classes-fs-uuid:
635
636``fs-uuid.bbclass``
637===================
638
639The ``fs-uuid`` class extracts UUID from
640``${``\ :term:`ROOTFS`\ ``}``, which must have been built
641by the time that this function gets called. The ``fs-uuid`` class only
642works on ``ext`` file systems and depends on ``tune2fs``.
643
644.. _ref-classes-gconf:
645
646``gconf.bbclass``
647=================
648
649The ``gconf`` class provides common functionality for recipes that need
650to install GConf schemas. The schemas will be put into a separate
651package (``${``\ :term:`PN`\ ``}-gconf``) that is created
652automatically when this class is inherited. This package uses the
653appropriate post-install and post-remove (postinst/postrm) scriptlets to
654register and unregister the schemas in the target image.
655
656.. _ref-classes-gettext:
657
658``gettext.bbclass``
659===================
660
661The ``gettext`` class provides support for building software that uses
662the GNU ``gettext`` internationalization and localization system. All
663recipes building software that use ``gettext`` should inherit this
664class.
665
666.. _ref-classes-gnomebase:
667
668``gnomebase.bbclass``
669=====================
670
671The ``gnomebase`` class is the base class for recipes that build
672software from the GNOME stack. This class sets
673:term:`SRC_URI` to download the source from the GNOME
674mirrors as well as extending :term:`FILES` with the typical
675GNOME installation paths.
676
677.. _ref-classes-gobject-introspection:
678
679``gobject-introspection.bbclass``
680=================================
681
682Provides support for recipes building software that supports GObject
683introspection. This functionality is only enabled if the
684"gobject-introspection-data" feature is in
685:term:`DISTRO_FEATURES` as well as
686"qemu-usermode" being in
687:term:`MACHINE_FEATURES`.
688
689.. note::
690
691 This functionality is backfilled by default and, if not applicable,
Andrew Geissler09036742021-06-25 14:25:14 -0500692 should be disabled through :term:`DISTRO_FEATURES_BACKFILL_CONSIDERED` or
693 :term:`MACHINE_FEATURES_BACKFILL_CONSIDERED`, respectively.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500694
695.. _ref-classes-grub-efi:
696
697``grub-efi.bbclass``
698====================
699
700The ``grub-efi`` class provides ``grub-efi``-specific functions for
701building bootable images.
702
703This class supports several variables:
704
705- :term:`INITRD`: Indicates list of filesystem images to
706 concatenate and use as an initial RAM disk (initrd) (optional).
707
708- :term:`ROOTFS`: Indicates a filesystem image to include
709 as the root filesystem (optional).
710
711- :term:`GRUB_GFXSERIAL`: Set this to "1" to have
712 graphics and serial in the boot menu.
713
714- :term:`LABELS`: A list of targets for the automatic
715 configuration.
716
717- :term:`APPEND`: An override list of append strings for
718 each ``LABEL``.
719
720- :term:`GRUB_OPTS`: Additional options to add to the
721 configuration (optional). Options are delimited using semi-colon
722 characters (``;``).
723
724- :term:`GRUB_TIMEOUT`: Timeout before executing
725 the default ``LABEL`` (optional).
726
727.. _ref-classes-gsettings:
728
729``gsettings.bbclass``
730=====================
731
732The ``gsettings`` class provides common functionality for recipes that
733need to install GSettings (glib) schemas. The schemas are assumed to be
734part of the main package. Appropriate post-install and post-remove
735(postinst/postrm) scriptlets are added to register and unregister the
736schemas in the target image.
737
738.. _ref-classes-gtk-doc:
739
740``gtk-doc.bbclass``
741===================
742
743The ``gtk-doc`` class is a helper class to pull in the appropriate
744``gtk-doc`` dependencies and disable ``gtk-doc``.
745
746.. _ref-classes-gtk-icon-cache:
747
748``gtk-icon-cache.bbclass``
749==========================
750
751The ``gtk-icon-cache`` class generates the proper post-install and
752post-remove (postinst/postrm) scriptlets for packages that use GTK+ and
753install icons. These scriptlets call ``gtk-update-icon-cache`` to add
754the fonts to GTK+'s icon cache. Since the cache files are
755architecture-specific, ``gtk-update-icon-cache`` is run using QEMU if
756the postinst scriptlets need to be run on the build host during image
757creation.
758
759.. _ref-classes-gtk-immodules-cache:
760
761``gtk-immodules-cache.bbclass``
762===============================
763
764The ``gtk-immodules-cache`` class generates the proper post-install and
765post-remove (postinst/postrm) scriptlets for packages that install GTK+
766input method modules for virtual keyboards. These scriptlets call
767``gtk-update-icon-cache`` to add the input method modules to the cache.
768Since the cache files are architecture-specific,
769``gtk-update-icon-cache`` is run using QEMU if the postinst scriptlets
770need to be run on the build host during image creation.
771
772If the input method modules being installed are in packages other than
773the main package, set
774:term:`GTKIMMODULES_PACKAGES` to specify
775the packages containing the modules.
776
777.. _ref-classes-gzipnative:
778
779``gzipnative.bbclass``
780======================
781
782The ``gzipnative`` class enables the use of different native versions of
783``gzip`` and ``pigz`` rather than the versions of these tools from the
784build host.
785
786.. _ref-classes-icecc:
787
788``icecc.bbclass``
789=================
790
791The ``icecc`` class supports
792`Icecream <https://github.com/icecc/icecream>`__, which facilitates
793taking compile jobs and distributing them among remote machines.
794
795The class stages directories with symlinks from ``gcc`` and ``g++`` to
796``icecc``, for both native and cross compilers. Depending on each
797configure or compile, the OpenEmbedded build system adds the directories
798at the head of the ``PATH`` list and then sets the ``ICECC_CXX`` and
799``ICEC_CC`` variables, which are the paths to the ``g++`` and ``gcc``
800compilers, respectively.
801
802For the cross compiler, the class creates a ``tar.gz`` file that
803contains the Yocto Project toolchain and sets ``ICECC_VERSION``, which
804is the version of the cross-compiler used in the cross-development
805toolchain, accordingly.
806
807The class handles all three different compile stages (i.e native
808,cross-kernel and target) and creates the necessary environment
809``tar.gz`` file to be used by the remote machines. The class also
810supports SDK generation.
811
812If :term:`ICECC_PATH` is not set in your
813``local.conf`` file, then the class tries to locate the ``icecc`` binary
814using ``which``. If :term:`ICECC_ENV_EXEC` is set
815in your ``local.conf`` file, the variable should point to the
816``icecc-create-env`` script provided by the user. If you do not point to
817a user-provided script, the build system uses the default script
818provided by the recipe ``icecc-create-env-native.bb``.
819
820.. note::
821
822 This script is a modified version and not the one that comes with
823 icecc.
824
825If you do not want the Icecream distributed compile support to apply to
826specific recipes or classes, you can effectively "blacklist" them by
827listing the recipes and classes using the
828:term:`ICECC_USER_PACKAGE_BL` and
829:term:`ICECC_USER_CLASS_BL`, variables,
830respectively, in your ``local.conf`` file. Doing so causes the
831OpenEmbedded build system to handle these compilations locally.
832
833Additionally, you can list recipes using the
834:term:`ICECC_USER_PACKAGE_WL` variable in
835your ``local.conf`` file to force ``icecc`` to be enabled for recipes
836using an empty :term:`PARALLEL_MAKE` variable.
837
838Inheriting the ``icecc`` class changes all sstate signatures.
839Consequently, if a development team has a dedicated build system that
840populates :term:`SSTATE_MIRRORS` and they want to
Andrew Geissler09036742021-06-25 14:25:14 -0500841reuse sstate from :term:`SSTATE_MIRRORS`, then all developers and the build
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500842system need to either inherit the ``icecc`` class or nobody should.
843
844At the distribution level, you can inherit the ``icecc`` class to be
845sure that all builders start with the same sstate signatures. After
846inheriting the class, you can then disable the feature by setting the
Andrew Geisslerc926e172021-05-07 16:11:35 -0500847:term:`ICECC_DISABLED` variable to "1" as follows::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500848
849 INHERIT_DISTRO_append = " icecc"
850 ICECC_DISABLED ??= "1"
851
852This practice
853makes sure everyone is using the same signatures but also requires
854individuals that do want to use Icecream to enable the feature
Andrew Geisslerc926e172021-05-07 16:11:35 -0500855individually as follows in your ``local.conf`` file::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500856
857 ICECC_DISABLED = ""
858
859.. _ref-classes-image:
860
861``image.bbclass``
862=================
863
864The ``image`` class helps support creating images in different formats.
865First, the root filesystem is created from packages using one of the
866``rootfs*.bbclass`` files (depending on the package format used) and
867then one or more image files are created.
868
Andrew Geissler09036742021-06-25 14:25:14 -0500869- The :term:`IMAGE_FSTYPES` variable controls the types of images to
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500870 generate.
871
Andrew Geissler09036742021-06-25 14:25:14 -0500872- The :term:`IMAGE_INSTALL` variable controls the list of packages to
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500873 install into the image.
874
875For information on customizing images, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600876":ref:`dev-manual/common-tasks:customizing images`" section
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500877in the Yocto Project Development Tasks Manual. For information on how
878images are created, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600879":ref:`overview-manual/concepts:images`" section in the
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600880Yocto Project Overview and Concepts Manual.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500881
882.. _ref-classes-image-buildinfo:
883
884``image-buildinfo.bbclass``
885===========================
886
887The ``image-buildinfo`` class writes information to the target
888filesystem on ``/etc/build``.
889
890.. _ref-classes-image_types:
891
892``image_types.bbclass``
893=======================
894
895The ``image_types`` class defines all of the standard image output types
896that you can enable through the
897:term:`IMAGE_FSTYPES` variable. You can use this
898class as a reference on how to add support for custom image output
899types.
900
901By default, the :ref:`image <ref-classes-image>` class automatically
902enables the ``image_types`` class. The ``image`` class uses the
Andrew Geisslerc926e172021-05-07 16:11:35 -0500903``IMGCLASSES`` variable as follows::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500904
905 IMGCLASSES = "rootfs_${IMAGE_PKGTYPE} image_types ${IMAGE_CLASSES}"
906 IMGCLASSES += "${@['populate_sdk_base', 'populate_sdk_ext']['linux' in d.getVar("SDK_OS")]}"
907 IMGCLASSES += "${@bb.utils.contains_any('IMAGE_FSTYPES', 'live iso hddimg', 'image-live', '', d)}"
908 IMGCLASSES += "${@bb.utils.contains('IMAGE_FSTYPES', 'container', 'image-container', '', d)}"
909 IMGCLASSES += "image_types_wic"
910 IMGCLASSES += "rootfs-postcommands"
911 IMGCLASSES += "image-postinst-intercepts"
912 inherit ${IMGCLASSES}
913
914The ``image_types`` class also handles conversion and compression of images.
915
916.. note::
917
918 To build a VMware VMDK image, you need to add "wic.vmdk" to
Andrew Geissler09036742021-06-25 14:25:14 -0500919 :term:`IMAGE_FSTYPES`. This would also be similar for Virtual Box Virtual Disk
Andrew Geissler4c19ea12020-10-27 13:52:24 -0500920 Image ("vdi") and QEMU Copy On Write Version 2 ("qcow2") images.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500921
922.. _ref-classes-image-live:
923
924``image-live.bbclass``
925======================
926
927This class controls building "live" (i.e. HDDIMG and ISO) images. Live
928images contain syslinux for legacy booting, as well as the bootloader
929specified by :term:`EFI_PROVIDER` if
930:term:`MACHINE_FEATURES` contains "efi".
931
932Normally, you do not use this class directly. Instead, you add "live" to
933:term:`IMAGE_FSTYPES`.
934
935.. _ref-classes-image-mklibs:
936
937``image-mklibs.bbclass``
938========================
939
940The ``image-mklibs`` class enables the use of the ``mklibs`` utility
941during the :ref:`ref-tasks-rootfs` task, which optimizes
942the size of libraries contained in the image.
943
944By default, the class is enabled in the ``local.conf.template`` using
Andrew Geisslerc926e172021-05-07 16:11:35 -0500945the :term:`USER_CLASSES` variable as follows::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500946
947 USER_CLASSES ?= "buildstats image-mklibs image-prelink"
948
949.. _ref-classes-image-prelink:
950
951``image-prelink.bbclass``
952=========================
953
954The ``image-prelink`` class enables the use of the ``prelink`` utility
955during the :ref:`ref-tasks-rootfs` task, which optimizes
956the dynamic linking of shared libraries to reduce executable startup
957time.
958
959By default, the class is enabled in the ``local.conf.template`` using
Andrew Geisslerc926e172021-05-07 16:11:35 -0500960the :term:`USER_CLASSES` variable as follows::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500961
962 USER_CLASSES ?= "buildstats image-mklibs image-prelink"
963
964.. _ref-classes-insane:
965
966``insane.bbclass``
967==================
968
969The ``insane`` class adds a step to the package generation process so
970that output quality assurance checks are generated by the OpenEmbedded
971build system. A range of checks are performed that check the build's
972output for common problems that show up during runtime. Distribution
973policy usually dictates whether to include this class.
974
975You can configure the sanity checks so that specific test failures
976either raise a warning or an error message. Typically, failures for new
977tests generate a warning. Subsequent failures for the same test would
978then generate an error message once the metadata is in a known and good
Andrew Geissler09209ee2020-12-13 08:44:15 -0600979condition. See the ":doc:`/ref-manual/qa-checks`" Chapter for a list of all the warning
Andrew Geissler4c19ea12020-10-27 13:52:24 -0500980and error messages you might encounter using a default configuration.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500981
982Use the :term:`WARN_QA` and
983:term:`ERROR_QA` variables to control the behavior of
984these checks at the global level (i.e. in your custom distro
985configuration). However, to skip one or more checks in recipes, you
986should use :term:`INSANE_SKIP`. For example, to skip
987the check for symbolic link ``.so`` files in the main package of a
988recipe, add the following to the recipe. You need to realize that the
Andrew Geisslerc926e172021-05-07 16:11:35 -0500989package name override, in this example ``${PN}``, must be used::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500990
991 INSANE_SKIP_${PN} += "dev-so"
992
993Please keep in mind that the QA checks
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700994are meant to detect real or potential problems in the packaged
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500995output. So exercise caution when disabling these checks.
996
Andrew Geissler09036742021-06-25 14:25:14 -0500997Here are the tests you can list with the :term:`WARN_QA` and
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500998``ERROR_QA`` variables:
999
1000- ``already-stripped:`` Checks that produced binaries have not
1001 already been stripped prior to the build system extracting debug
1002 symbols. It is common for upstream software projects to default to
1003 stripping debug symbols for output binaries. In order for debugging
1004 to work on the target using ``-dbg`` packages, this stripping must be
1005 disabled.
1006
1007- ``arch:`` Checks the Executable and Linkable Format (ELF) type, bit
1008 size, and endianness of any binaries to ensure they match the target
1009 architecture. This test fails if any binaries do not match the type
1010 since there would be an incompatibility. The test could indicate that
1011 the wrong compiler or compiler options have been used. Sometimes
1012 software, like bootloaders, might need to bypass this check.
1013
1014- ``buildpaths:`` Checks for paths to locations on the build host
1015 inside the output files. Currently, this test triggers too many false
1016 positives and thus is not normally enabled.
1017
1018- ``build-deps:`` Determines if a build-time dependency that is
1019 specified through :term:`DEPENDS`, explicit
1020 :term:`RDEPENDS`, or task-level dependencies exists
1021 to match any runtime dependency. This determination is particularly
1022 useful to discover where runtime dependencies are detected and added
1023 during packaging. If no explicit dependency has been specified within
1024 the metadata, at the packaging stage it is too late to ensure that
1025 the dependency is built, and thus you can end up with an error when
1026 the package is installed into the image during the
1027 :ref:`ref-tasks-rootfs` task because the auto-detected
1028 dependency was not satisfied. An example of this would be where the
1029 :ref:`update-rc.d <ref-classes-update-rc.d>` class automatically
1030 adds a dependency on the ``initscripts-functions`` package to
1031 packages that install an initscript that refers to
1032 ``/etc/init.d/functions``. The recipe should really have an explicit
1033 ``RDEPENDS`` for the package in question on ``initscripts-functions``
1034 so that the OpenEmbedded build system is able to ensure that the
1035 ``initscripts`` recipe is actually built and thus the
1036 ``initscripts-functions`` package is made available.
1037
1038- ``compile-host-path:`` Checks the
1039 :ref:`ref-tasks-compile` log for indications that
1040 paths to locations on the build host were used. Using such paths
1041 might result in host contamination of the build output.
1042
1043- ``debug-deps:`` Checks that all packages except ``-dbg`` packages
1044 do not depend on ``-dbg`` packages, which would cause a packaging
1045 bug.
1046
1047- ``debug-files:`` Checks for ``.debug`` directories in anything but
1048 the ``-dbg`` package. The debug files should all be in the ``-dbg``
1049 package. Thus, anything packaged elsewhere is incorrect packaging.
1050
1051- ``dep-cmp:`` Checks for invalid version comparison statements in
1052 runtime dependency relationships between packages (i.e. in
1053 :term:`RDEPENDS`,
1054 :term:`RRECOMMENDS`,
1055 :term:`RSUGGESTS`,
1056 :term:`RPROVIDES`,
1057 :term:`RREPLACES`, and
1058 :term:`RCONFLICTS` variable values). Any invalid
1059 comparisons might trigger failures or undesirable behavior when
1060 passed to the package manager.
1061
1062- ``desktop:`` Runs the ``desktop-file-validate`` program against any
1063 ``.desktop`` files to validate their contents against the
1064 specification for ``.desktop`` files.
1065
1066- ``dev-deps:`` Checks that all packages except ``-dev`` or
1067 ``-staticdev`` packages do not depend on ``-dev`` packages, which
1068 would be a packaging bug.
1069
1070- ``dev-so:`` Checks that the ``.so`` symbolic links are in the
1071 ``-dev`` package and not in any of the other packages. In general,
1072 these symlinks are only useful for development purposes. Thus, the
William A. Kennington IIIac69b482021-06-02 12:28:27 -07001073 ``-dev`` package is the correct location for them. In very rare
1074 cases, such as dynamically loaded modules, these symlinks
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001075 are needed instead in the main package.
1076
1077- ``file-rdeps:`` Checks that file-level dependencies identified by
1078 the OpenEmbedded build system at packaging time are satisfied. For
1079 example, a shell script might start with the line ``#!/bin/bash``.
1080 This line would translate to a file dependency on ``/bin/bash``. Of
1081 the three package managers that the OpenEmbedded build system
1082 supports, only RPM directly handles file-level dependencies,
1083 resolving them automatically to packages providing the files.
1084 However, the lack of that functionality in the other two package
1085 managers does not mean the dependencies do not still need resolving.
1086 This QA check attempts to ensure that explicitly declared
1087 :term:`RDEPENDS` exist to handle any file-level
1088 dependency detected in packaged files.
1089
1090- ``files-invalid:`` Checks for :term:`FILES` variable
1091 values that contain "//", which is invalid.
1092
1093- ``host-user-contaminated:`` Checks that no package produced by the
1094 recipe contains any files outside of ``/home`` with a user or group
1095 ID that matches the user running BitBake. A match usually indicates
1096 that the files are being installed with an incorrect UID/GID, since
1097 target IDs are independent from host IDs. For additional information,
1098 see the section describing the
1099 :ref:`ref-tasks-install` task.
1100
1101- ``incompatible-license:`` Report when packages are excluded from
1102 being created due to being marked with a license that is in
1103 :term:`INCOMPATIBLE_LICENSE`.
1104
1105- ``install-host-path:`` Checks the
1106 :ref:`ref-tasks-install` log for indications that
1107 paths to locations on the build host were used. Using such paths
1108 might result in host contamination of the build output.
1109
1110- ``installed-vs-shipped:`` Reports when files have been installed
1111 within ``do_install`` but have not been included in any package by
1112 way of the :term:`FILES` variable. Files that do not
1113 appear in any package cannot be present in an image later on in the
1114 build process. Ideally, all installed files should be packaged or not
1115 installed at all. These files can be deleted at the end of
1116 ``do_install`` if the files are not needed in any package.
1117
1118- ``invalid-chars:`` Checks that the recipe metadata variables
1119 :term:`DESCRIPTION`,
1120 :term:`SUMMARY`, :term:`LICENSE`, and
1121 :term:`SECTION` do not contain non-UTF-8 characters.
1122 Some package managers do not support such characters.
1123
1124- ``invalid-packageconfig:`` Checks that no undefined features are
1125 being added to :term:`PACKAGECONFIG`. For
Andrew Geisslerc926e172021-05-07 16:11:35 -05001126 example, any name "foo" for which the following form does not exist::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001127
1128 PACKAGECONFIG[foo] = "..."
1129
Andrew Geissler09036742021-06-25 14:25:14 -05001130- ``la:`` Checks ``.la`` files for any :term:`TMPDIR` paths. Any ``.la``
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001131 file containing these paths is incorrect since ``libtool`` adds the
1132 correct sysroot prefix when using the files automatically itself.
1133
1134- ``ldflags:`` Ensures that the binaries were linked with the
1135 :term:`LDFLAGS` options provided by the build system.
Andrew Geissler09036742021-06-25 14:25:14 -05001136 If this test fails, check that the :term:`LDFLAGS` variable is being
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001137 passed to the linker command.
1138
1139- ``libdir:`` Checks for libraries being installed into incorrect
1140 (possibly hardcoded) installation paths. For example, this test will
1141 catch recipes that install ``/lib/bar.so`` when ``${base_libdir}`` is
1142 "lib32". Another example is when recipes install
1143 ``/usr/lib64/foo.so`` when ``${libdir}`` is "/usr/lib".
1144
1145- ``libexec:`` Checks if a package contains files in
1146 ``/usr/libexec``. This check is not performed if the ``libexecdir``
1147 variable has been set explicitly to ``/usr/libexec``.
1148
1149- ``packages-list:`` Checks for the same package being listed
1150 multiple times through the :term:`PACKAGES` variable
1151 value. Installing the package in this manner can cause errors during
1152 packaging.
1153
1154- ``perm-config:`` Reports lines in ``fs-perms.txt`` that have an
1155 invalid format.
1156
1157- ``perm-line:`` Reports lines in ``fs-perms.txt`` that have an
1158 invalid format.
1159
1160- ``perm-link:`` Reports lines in ``fs-perms.txt`` that specify
1161 'link' where the specified target already exists.
1162
1163- ``perms:`` Currently, this check is unused but reserved.
1164
1165- ``pkgconfig:`` Checks ``.pc`` files for any
1166 :term:`TMPDIR`/:term:`WORKDIR` paths.
1167 Any ``.pc`` file containing these paths is incorrect since
1168 ``pkg-config`` itself adds the correct sysroot prefix when the files
1169 are accessed.
1170
1171- ``pkgname:`` Checks that all packages in
1172 :term:`PACKAGES` have names that do not contain
1173 invalid characters (i.e. characters other than 0-9, a-z, ., +, and
1174 -).
1175
Andrew Geissler09036742021-06-25 14:25:14 -05001176- ``pkgv-undefined:`` Checks to see if the :term:`PKGV` variable is
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001177 undefined during :ref:`ref-tasks-package`.
1178
1179- ``pkgvarcheck:`` Checks through the variables
1180 :term:`RDEPENDS`,
1181 :term:`RRECOMMENDS`,
1182 :term:`RSUGGESTS`,
1183 :term:`RCONFLICTS`,
1184 :term:`RPROVIDES`,
1185 :term:`RREPLACES`, :term:`FILES`,
1186 :term:`ALLOW_EMPTY`, ``pkg_preinst``,
1187 ``pkg_postinst``, ``pkg_prerm`` and ``pkg_postrm``, and reports if
1188 there are variable sets that are not package-specific. Using these
1189 variables without a package suffix is bad practice, and might
1190 unnecessarily complicate dependencies of other packages within the
1191 same recipe or have other unintended consequences.
1192
1193- ``pn-overrides:`` Checks that a recipe does not have a name
1194 (:term:`PN`) value that appears in
1195 :term:`OVERRIDES`. If a recipe is named such that
Andrew Geissler09036742021-06-25 14:25:14 -05001196 its :term:`PN` value matches something already in :term:`OVERRIDES` (e.g.
1197 :term:`PN` happens to be the same as :term:`MACHINE` or
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001198 :term:`DISTRO`), it can have unexpected consequences.
1199 For example, assignments such as ``FILES_${PN} = "xyz"`` effectively
1200 turn into ``FILES = "xyz"``.
1201
1202- ``rpaths:`` Checks for rpaths in the binaries that contain build
1203 system paths such as ``TMPDIR``. If this test fails, bad ``-rpath``
1204 options are being passed to the linker commands and your binaries
1205 have potential security issues.
1206
1207- ``split-strip:`` Reports that splitting or stripping debug symbols
1208 from binaries has failed.
1209
1210- ``staticdev:`` Checks for static library files (``*.a``) in
1211 non-``staticdev`` packages.
1212
1213- ``symlink-to-sysroot:`` Checks for symlinks in packages that point
1214 into :term:`TMPDIR` on the host. Such symlinks will
1215 work on the host, but are clearly invalid when running on the target.
1216
1217- ``textrel:`` Checks for ELF binaries that contain relocations in
1218 their ``.text`` sections, which can result in a performance impact at
Andrew Geissler4c19ea12020-10-27 13:52:24 -05001219 runtime. See the explanation for the ``ELF binary`` message in
Andrew Geissler09209ee2020-12-13 08:44:15 -06001220 ":doc:`/ref-manual/qa-checks`" for more information regarding runtime performance
Andrew Geissler4c19ea12020-10-27 13:52:24 -05001221 issues.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001222
1223- ``unlisted-pkg-lics:`` Checks that all declared licenses applying
1224 for a package are also declared on the recipe level (i.e. any license
1225 in ``LICENSE_*`` should appear in :term:`LICENSE`).
1226
1227- ``useless-rpaths:`` Checks for dynamic library load paths (rpaths)
1228 in the binaries that by default on a standard system are searched by
1229 the linker (e.g. ``/lib`` and ``/usr/lib``). While these paths will
1230 not cause any breakage, they do waste space and are unnecessary.
1231
1232- ``var-undefined:`` Reports when variables fundamental to packaging
1233 (i.e. :term:`WORKDIR`,
1234 :term:`DEPLOY_DIR`, :term:`D`,
1235 :term:`PN`, and :term:`PKGD`) are undefined
1236 during :ref:`ref-tasks-package`.
1237
1238- ``version-going-backwards:`` If Build History is enabled, reports
1239 when a package being written out has a lower version than the
1240 previously written package under the same name. If you are placing
1241 output packages into a feed and upgrading packages on a target system
1242 using that feed, the version of a package going backwards can result
1243 in the target system not correctly upgrading to the "new" version of
1244 the package.
1245
1246 .. note::
1247
William A. Kennington IIIac69b482021-06-02 12:28:27 -07001248 This is only relevant when you are using runtime package management
1249 on your target system.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001250
1251- ``xorg-driver-abi:`` Checks that all packages containing Xorg
1252 drivers have ABI dependencies. The ``xserver-xorg`` recipe provides
1253 driver ABI names. All drivers should depend on the ABI versions that
1254 they have been built against. Driver recipes that include
1255 ``xorg-driver-input.inc`` or ``xorg-driver-video.inc`` will
1256 automatically get these versions. Consequently, you should only need
1257 to explicitly add dependencies to binary driver recipes.
1258
1259.. _ref-classes-insserv:
1260
1261``insserv.bbclass``
1262===================
1263
1264The ``insserv`` class uses the ``insserv`` utility to update the order
1265of symbolic links in ``/etc/rc?.d/`` within an image based on
1266dependencies specified by LSB headers in the ``init.d`` scripts
1267themselves.
1268
1269.. _ref-classes-kernel:
1270
1271``kernel.bbclass``
1272==================
1273
1274The ``kernel`` class handles building Linux kernels. The class contains
1275code to build all kernel trees. All needed headers are staged into the
1276``STAGING_KERNEL_DIR`` directory to allow out-of-tree module builds
1277using the :ref:`module <ref-classes-module>` class.
1278
1279This means that each built kernel module is packaged separately and
1280inter-module dependencies are created by parsing the ``modinfo`` output.
1281If all modules are required, then installing the ``kernel-modules``
1282package installs all packages with modules and various other kernel
1283packages such as ``kernel-vmlinux``.
1284
1285The ``kernel`` class contains logic that allows you to embed an initial
1286RAM filesystem (initramfs) image when you build the kernel image. For
1287information on how to build an initramfs, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -06001288":ref:`dev-manual/common-tasks:building an initial ram filesystem (initramfs) image`" section in
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001289the Yocto Project Development Tasks Manual.
1290
1291Various other classes are used by the ``kernel`` and ``module`` classes
1292internally including the :ref:`kernel-arch <ref-classes-kernel-arch>`,
1293:ref:`module-base <ref-classes-module-base>`, and
1294:ref:`linux-kernel-base <ref-classes-linux-kernel-base>` classes.
1295
1296.. _ref-classes-kernel-arch:
1297
1298``kernel-arch.bbclass``
1299=======================
1300
1301The ``kernel-arch`` class sets the ``ARCH`` environment variable for
1302Linux kernel compilation (including modules).
1303
1304.. _ref-classes-kernel-devicetree:
1305
1306``kernel-devicetree.bbclass``
1307=============================
1308
1309The ``kernel-devicetree`` class, which is inherited by the
1310:ref:`kernel <ref-classes-kernel>` class, supports device tree
1311generation.
1312
1313.. _ref-classes-kernel-fitimage:
1314
1315``kernel-fitimage.bbclass``
1316===========================
1317
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001318The ``kernel-fitimage`` class provides support to pack a kernel image,
1319device trees, a U-boot script, a Initramfs bundle and a RAM disk
1320into a single FIT image. In theory, a FIT image can support any number
1321of kernels, U-boot scripts, Initramfs bundles, RAM disks and device-trees.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001322However, ``kernel-fitimage`` currently only supports
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001323limited usescases: just one kernel image, an optional U-boot script,
1324an optional Initramfs bundle, an optional RAM disk, and any number of
1325device tree.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001326
1327To create a FIT image, it is required that :term:`KERNEL_CLASSES`
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001328is set to include "kernel-fitimage" and :term:`KERNEL_IMAGETYPE`
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001329is set to "fitImage".
1330
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001331The options for the device tree compiler passed to ``mkimage -D``
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001332when creating the FIT image are specified using the
1333:term:`UBOOT_MKIMAGE_DTCOPTS` variable.
1334
1335Only a single kernel can be added to the FIT image created by
1336``kernel-fitimage`` and the kernel image in FIT is mandatory. The
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001337address where the kernel image is to be loaded by U-Boot is
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001338specified by :term:`UBOOT_LOADADDRESS` and the entrypoint by
1339:term:`UBOOT_ENTRYPOINT`.
1340
1341Multiple device trees can be added to the FIT image created by
1342``kernel-fitimage`` and the device tree is optional.
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001343The address where the device tree is to be loaded by U-Boot is
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001344specified by :term:`UBOOT_DTBO_LOADADDRESS` for device tree overlays
Andrew Geissler4c19ea12020-10-27 13:52:24 -05001345and by :term:`UBOOT_DTB_LOADADDRESS` for device tree binaries.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001346
1347Only a single RAM disk can be added to the FIT image created by
1348``kernel-fitimage`` and the RAM disk in FIT is optional.
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001349The address where the RAM disk image is to be loaded by U-Boot
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001350is specified by :term:`UBOOT_RD_LOADADDRESS` and the entrypoint by
1351:term:`UBOOT_RD_ENTRYPOINT`. The ramdisk is added to FIT image when
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001352:term:`INITRAMFS_IMAGE` is specified and that :term:`INITRAMFS_IMAGE_BUNDLE`
1353is set to 0.
1354
1355Only a single Initramfs bundle can be added to the FIT image created by
1356``kernel-fitimage`` and the Initramfs bundle in FIT is optional.
1357In case of Initramfs, the kernel is configured to be bundled with the rootfs
1358in the same binary (example: zImage-initramfs-:term:`MACHINE`.bin).
1359When the kernel is copied to RAM and executed, it unpacks the Initramfs rootfs.
1360The Initramfs bundle can be enabled when :term:`INITRAMFS_IMAGE`
1361is specified and that :term:`INITRAMFS_IMAGE_BUNDLE` is set to 1.
1362The address where the Initramfs bundle is to be loaded by U-boot is specified
1363by :term:`UBOOT_LOADADDRESS` and the entrypoint by :term:`UBOOT_ENTRYPOINT`.
1364
1365Only a single U-boot boot script can be added to the FIT image created by
1366``kernel-fitimage`` and the boot script is optional.
1367The boot script is specified in the ITS file as a text file containing
1368U-boot commands. When using a boot script the user should configure the
1369U-boot ``do_install`` task to copy the script to sysroot.
Andrew Geissler3b8a17c2021-04-15 15:55:55 -05001370So the script can be included in the FIT image by the ``kernel-fitimage``
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001371class. At run-time, U-boot CONFIG_BOOTCOMMAND define can be configured to
1372load the boot script from the FIT image and executes it.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001373
1374The FIT image generated by ``kernel-fitimage`` class is signed when the
1375variables :term:`UBOOT_SIGN_ENABLE`, :term:`UBOOT_MKIMAGE_DTCOPTS`,
1376:term:`UBOOT_SIGN_KEYDIR` and :term:`UBOOT_SIGN_KEYNAME` are set
1377appropriately. The default values used for :term:`FIT_HASH_ALG` and
1378:term:`FIT_SIGN_ALG` in ``kernel-fitimage`` are "sha256" and
Andrew Geisslerc3d88e42020-10-02 09:45:00 -05001379"rsa2048" respectively. The keys for signing fitImage can be generated using
1380the ``kernel-fitimage`` class when both :term:`FIT_GENERATE_KEYS` and
1381:term:`UBOOT_SIGN_ENABLE` are set to "1".
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001382
1383
1384.. _ref-classes-kernel-grub:
1385
1386``kernel-grub.bbclass``
1387=======================
1388
1389The ``kernel-grub`` class updates the boot area and the boot menu with
1390the kernel as the priority boot mechanism while installing a RPM to
1391update the kernel on a deployed target.
1392
1393.. _ref-classes-kernel-module-split:
1394
1395``kernel-module-split.bbclass``
1396===============================
1397
1398The ``kernel-module-split`` class provides common functionality for
1399splitting Linux kernel modules into separate packages.
1400
1401.. _ref-classes-kernel-uboot:
1402
1403``kernel-uboot.bbclass``
1404========================
1405
1406The ``kernel-uboot`` class provides support for building from
1407vmlinux-style kernel sources.
1408
1409.. _ref-classes-kernel-uimage:
1410
1411``kernel-uimage.bbclass``
1412=========================
1413
1414The ``kernel-uimage`` class provides support to pack uImage.
1415
1416.. _ref-classes-kernel-yocto:
1417
1418``kernel-yocto.bbclass``
1419========================
1420
1421The ``kernel-yocto`` class provides common functionality for building
1422from linux-yocto style kernel source repositories.
1423
1424.. _ref-classes-kernelsrc:
1425
1426``kernelsrc.bbclass``
1427=====================
1428
1429The ``kernelsrc`` class sets the Linux kernel source and version.
1430
1431.. _ref-classes-lib_package:
1432
1433``lib_package.bbclass``
1434=======================
1435
1436The ``lib_package`` class supports recipes that build libraries and
1437produce executable binaries, where those binaries should not be
1438installed by default along with the library. Instead, the binaries are
1439added to a separate ``${``\ :term:`PN`\ ``}-bin`` package to
1440make their installation optional.
1441
1442.. _ref-classes-libc*:
1443
1444``libc*.bbclass``
1445=================
1446
1447The ``libc*`` classes support recipes that build packages with ``libc``:
1448
1449- The ``libc-common`` class provides common support for building with
1450 ``libc``.
1451
1452- The ``libc-package`` class supports packaging up ``glibc`` and
1453 ``eglibc``.
1454
1455.. _ref-classes-license:
1456
1457``license.bbclass``
1458===================
1459
1460The ``license`` class provides license manifest creation and license
1461exclusion. This class is enabled by default using the default value for
1462the :term:`INHERIT_DISTRO` variable.
1463
1464.. _ref-classes-linux-kernel-base:
1465
1466``linux-kernel-base.bbclass``
1467=============================
1468
1469The ``linux-kernel-base`` class provides common functionality for
1470recipes that build out of the Linux kernel source tree. These builds
1471goes beyond the kernel itself. For example, the Perf recipe also
1472inherits this class.
1473
1474.. _ref-classes-linuxloader:
1475
1476``linuxloader.bbclass``
1477=======================
1478
1479Provides the function ``linuxloader()``, which gives the value of the
1480dynamic loader/linker provided on the platform. This value is used by a
1481number of other classes.
1482
1483.. _ref-classes-logging:
1484
1485``logging.bbclass``
1486===================
1487
1488The ``logging`` class provides the standard shell functions used to log
1489messages for various BitBake severity levels (i.e. ``bbplain``,
1490``bbnote``, ``bbwarn``, ``bberror``, ``bbfatal``, and ``bbdebug``).
1491
1492This class is enabled by default since it is inherited by the ``base``
1493class.
1494
1495.. _ref-classes-meta:
1496
1497``meta.bbclass``
1498================
1499
1500The ``meta`` class is inherited by recipes that do not build any output
1501packages themselves, but act as a "meta" target for building other
1502recipes.
1503
1504.. _ref-classes-metadata_scm:
1505
1506``metadata_scm.bbclass``
1507========================
1508
1509The ``metadata_scm`` class provides functionality for querying the
1510branch and revision of a Source Code Manager (SCM) repository.
1511
1512The :ref:`base <ref-classes-base>` class uses this class to print the
1513revisions of each layer before starting every build. The
1514``metadata_scm`` class is enabled by default because it is inherited by
1515the ``base`` class.
1516
1517.. _ref-classes-migrate_localcount:
1518
1519``migrate_localcount.bbclass``
1520==============================
1521
1522The ``migrate_localcount`` class verifies a recipe's localcount data and
1523increments it appropriately.
1524
1525.. _ref-classes-mime:
1526
1527``mime.bbclass``
1528================
1529
1530The ``mime`` class generates the proper post-install and post-remove
1531(postinst/postrm) scriptlets for packages that install MIME type files.
1532These scriptlets call ``update-mime-database`` to add the MIME types to
1533the shared database.
1534
1535.. _ref-classes-mirrors:
1536
1537``mirrors.bbclass``
1538===================
1539
1540The ``mirrors`` class sets up some standard
1541:term:`MIRRORS` entries for source code mirrors. These
1542mirrors provide a fall-back path in case the upstream source specified
1543in :term:`SRC_URI` within recipes is unavailable.
1544
1545This class is enabled by default since it is inherited by the
1546:ref:`base <ref-classes-base>` class.
1547
1548.. _ref-classes-module:
1549
1550``module.bbclass``
1551==================
1552
1553The ``module`` class provides support for building out-of-tree Linux
1554kernel modules. The class inherits the
1555:ref:`module-base <ref-classes-module-base>` and
1556:ref:`kernel-module-split <ref-classes-kernel-module-split>` classes,
1557and implements the :ref:`ref-tasks-compile` and
1558:ref:`ref-tasks-install` tasks. The class provides
1559everything needed to build and package a kernel module.
1560
1561For general information on out-of-tree Linux kernel modules, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -06001562":ref:`kernel-dev/common:incorporating out-of-tree modules`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001563section in the Yocto Project Linux Kernel Development Manual.
1564
1565.. _ref-classes-module-base:
1566
1567``module-base.bbclass``
1568=======================
1569
1570The ``module-base`` class provides the base functionality for building
1571Linux kernel modules. Typically, a recipe that builds software that
1572includes one or more kernel modules and has its own means of building
1573the module inherits this class as opposed to inheriting the
1574:ref:`module <ref-classes-module>` class.
1575
1576.. _ref-classes-multilib*:
1577
1578``multilib*.bbclass``
1579=====================
1580
1581The ``multilib*`` classes provide support for building libraries with
1582different target optimizations or target architectures and installing
1583them side-by-side in the same image.
1584
1585For more information on using the Multilib feature, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -06001586":ref:`dev-manual/common-tasks:combining multiple versions of library files into one image`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001587section in the Yocto Project Development Tasks Manual.
1588
1589.. _ref-classes-native:
1590
1591``native.bbclass``
1592==================
1593
1594The ``native`` class provides common functionality for recipes that
Andrew Geissler4c19ea12020-10-27 13:52:24 -05001595build tools to run on the :term:`Build Host` (i.e. tools that use the compiler
1596or other tools from the build host).
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001597
1598You can create a recipe that builds tools that run natively on the host
1599a couple different ways:
1600
1601- Create a myrecipe\ ``-native.bb`` recipe that inherits the ``native``
1602 class. If you use this method, you must order the inherit statement
1603 in the recipe after all other inherit statements so that the
1604 ``native`` class is inherited last.
1605
1606 .. note::
1607
1608 When creating a recipe this way, the recipe name must follow this
Andrew Geisslerc926e172021-05-07 16:11:35 -05001609 naming convention::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001610
1611 myrecipe-native.bb
1612
1613
1614 Not using this naming convention can lead to subtle problems
1615 caused by existing code that depends on that naming convention.
1616
Andrew Geisslerc926e172021-05-07 16:11:35 -05001617- Create or modify a target recipe that contains the following::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001618
1619 BBCLASSEXTEND = "native"
1620
1621 Inside the
1622 recipe, use ``_class-native`` and ``_class-target`` overrides to
1623 specify any functionality specific to the respective native or target
1624 case.
1625
1626Although applied differently, the ``native`` class is used with both
1627methods. The advantage of the second method is that you do not need to
1628have two separate recipes (assuming you need both) for native and
1629target. All common parts of the recipe are automatically shared.
1630
1631.. _ref-classes-nativesdk:
1632
1633``nativesdk.bbclass``
1634=====================
1635
1636The ``nativesdk`` class provides common functionality for recipes that
1637wish to build tools to run as part of an SDK (i.e. tools that run on
1638:term:`SDKMACHINE`).
1639
1640You can create a recipe that builds tools that run on the SDK machine a
1641couple different ways:
1642
1643- Create a ``nativesdk-``\ myrecipe\ ``.bb`` recipe that inherits the
1644 ``nativesdk`` class. If you use this method, you must order the
1645 inherit statement in the recipe after all other inherit statements so
1646 that the ``nativesdk`` class is inherited last.
1647
Andrew Geisslerc926e172021-05-07 16:11:35 -05001648- Create a ``nativesdk`` variant of any recipe by adding the following::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001649
1650 BBCLASSEXTEND = "nativesdk"
1651
1652 Inside the
1653 recipe, use ``_class-nativesdk`` and ``_class-target`` overrides to
1654 specify any functionality specific to the respective SDK machine or
1655 target case.
1656
1657.. note::
1658
Andrew Geisslerc926e172021-05-07 16:11:35 -05001659 When creating a recipe, you must follow this naming convention::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001660
1661 nativesdk-myrecipe.bb
1662
1663
William A. Kennington IIIac69b482021-06-02 12:28:27 -07001664 Not doing so can lead to subtle problems because there is code that
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001665 depends on the naming convention.
1666
1667Although applied differently, the ``nativesdk`` class is used with both
1668methods. The advantage of the second method is that you do not need to
1669have two separate recipes (assuming you need both) for the SDK machine
1670and the target. All common parts of the recipe are automatically shared.
1671
1672.. _ref-classes-nopackages:
1673
1674``nopackages.bbclass``
1675======================
1676
1677Disables packaging tasks for those recipes and classes where packaging
1678is not needed.
1679
1680.. _ref-classes-npm:
1681
1682``npm.bbclass``
1683===============
1684
1685Provides support for building Node.js software fetched using the `node
1686package manager (NPM) <https://en.wikipedia.org/wiki/Npm_(software)>`__.
1687
1688.. note::
1689
Andrew Geissler4c19ea12020-10-27 13:52:24 -05001690 Currently, recipes inheriting this class must use the ``npm://``
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001691 fetcher to have dependencies fetched and packaged automatically.
1692
1693For information on how to create NPM packages, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -06001694":ref:`dev-manual/common-tasks:creating node package manager (npm) packages`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001695section in the Yocto Project Development Tasks Manual.
1696
1697.. _ref-classes-oelint:
1698
1699``oelint.bbclass``
1700==================
1701
William A. Kennington IIIac69b482021-06-02 12:28:27 -07001702The ``oelint`` class is an obsolete lint checking tool available in
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001703``meta/classes`` in the :term:`Source Directory`.
1704
William A. Kennington IIIac69b482021-06-02 12:28:27 -07001705There are some classes that could be generally useful in OE-Core but
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001706are never actually used within OE-Core itself. The ``oelint`` class is
1707one such example. However, being aware of this class can reduce the
1708proliferation of different versions of similar classes across multiple
1709layers.
1710
1711.. _ref-classes-own-mirrors:
1712
1713``own-mirrors.bbclass``
1714=======================
1715
1716The ``own-mirrors`` class makes it easier to set up your own
1717:term:`PREMIRRORS` from which to first fetch source
1718before attempting to fetch it from the upstream specified in
1719:term:`SRC_URI` within each recipe.
1720
1721To use this class, inherit it globally and specify
Andrew Geisslerc926e172021-05-07 16:11:35 -05001722:term:`SOURCE_MIRROR_URL`. Here is an example::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001723
1724 INHERIT += "own-mirrors"
1725 SOURCE_MIRROR_URL = "http://example.com/my-source-mirror"
1726
1727You can specify only a single URL
Andrew Geissler09036742021-06-25 14:25:14 -05001728in :term:`SOURCE_MIRROR_URL`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001729
1730.. _ref-classes-package:
1731
1732``package.bbclass``
1733===================
1734
1735The ``package`` class supports generating packages from a build's
1736output. The core generic functionality is in ``package.bbclass``. The
1737code specific to particular package types resides in these
1738package-specific classes:
1739:ref:`package_deb <ref-classes-package_deb>`,
1740:ref:`package_rpm <ref-classes-package_rpm>`,
1741:ref:`package_ipk <ref-classes-package_ipk>`, and
1742:ref:`package_tar <ref-classes-package_tar>`.
1743
1744.. note::
1745
1746 The
1747 package_tar
1748 class is broken and not supported. It is recommended that you do not
1749 use this class.
1750
1751You can control the list of resulting package formats by using the
Andrew Geissler09036742021-06-25 14:25:14 -05001752:term:`PACKAGE_CLASSES` variable defined in your ``conf/local.conf``
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001753configuration file, which is located in the :term:`Build Directory`.
1754When defining the variable, you can
1755specify one or more package types. Since images are generated from
1756packages, a packaging class is needed to enable image generation. The
1757first class listed in this variable is used for image generation.
1758
1759If you take the optional step to set up a repository (package feed) on
1760the development host that can be used by DNF, you can install packages
1761from the feed while you are running the image on the target (i.e.
1762runtime installation of packages). For more information, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -06001763":ref:`dev-manual/common-tasks:using runtime package management`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001764section in the Yocto Project Development Tasks Manual.
1765
1766The package-specific class you choose can affect build-time performance
1767and has space ramifications. In general, building a package with IPK
1768takes about thirty percent less time as compared to using RPM to build
1769the same or similar package. This comparison takes into account a
1770complete build of the package with all dependencies previously built.
1771The reason for this discrepancy is because the RPM package manager
1772creates and processes more :term:`Metadata` than the IPK package
Andrew Geissler09036742021-06-25 14:25:14 -05001773manager. Consequently, you might consider setting :term:`PACKAGE_CLASSES` to
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001774"package_ipk" if you are building smaller systems.
1775
1776Before making your package manager decision, however, you should
1777consider some further things about using RPM:
1778
1779- RPM starts to provide more abilities than IPK due to the fact that it
1780 processes more Metadata. For example, this information includes
1781 individual file types, file checksum generation and evaluation on
1782 install, sparse file support, conflict detection and resolution for
1783 Multilib systems, ACID style upgrade, and repackaging abilities for
1784 rollbacks.
1785
1786- For smaller systems, the extra space used for the Berkeley Database
1787 and the amount of metadata when using RPM can affect your ability to
1788 perform on-device upgrades.
1789
1790You can find additional information on the effects of the package class
1791at these two Yocto Project mailing list links:
1792
Andrew Geissler4c19ea12020-10-27 13:52:24 -05001793- :yocto_lists:`/pipermail/poky/2011-May/006362.html`
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001794
Andrew Geissler4c19ea12020-10-27 13:52:24 -05001795- :yocto_lists:`/pipermail/poky/2011-May/006363.html`
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001796
1797.. _ref-classes-package_deb:
1798
1799``package_deb.bbclass``
1800=======================
1801
1802The ``package_deb`` class provides support for creating packages that
1803use the Debian (i.e. ``.deb``) file format. The class ensures the
1804packages are written out in a ``.deb`` file format to the
1805``${``\ :term:`DEPLOY_DIR_DEB`\ ``}`` directory.
1806
1807This class inherits the :ref:`package <ref-classes-package>` class and
1808is enabled through the :term:`PACKAGE_CLASSES`
1809variable in the ``local.conf`` file.
1810
1811.. _ref-classes-package_ipk:
1812
1813``package_ipk.bbclass``
1814=======================
1815
1816The ``package_ipk`` class provides support for creating packages that
1817use the IPK (i.e. ``.ipk``) file format. The class ensures the packages
1818are written out in a ``.ipk`` file format to the
1819``${``\ :term:`DEPLOY_DIR_IPK`\ ``}`` directory.
1820
1821This class inherits the :ref:`package <ref-classes-package>` class and
1822is enabled through the :term:`PACKAGE_CLASSES`
1823variable in the ``local.conf`` file.
1824
1825.. _ref-classes-package_rpm:
1826
1827``package_rpm.bbclass``
1828=======================
1829
1830The ``package_rpm`` class provides support for creating packages that
1831use the RPM (i.e. ``.rpm``) file format. The class ensures the packages
1832are written out in a ``.rpm`` file format to the
1833``${``\ :term:`DEPLOY_DIR_RPM`\ ``}`` directory.
1834
1835This class inherits the :ref:`package <ref-classes-package>` class and
1836is enabled through the :term:`PACKAGE_CLASSES`
1837variable in the ``local.conf`` file.
1838
1839.. _ref-classes-package_tar:
1840
1841``package_tar.bbclass``
1842=======================
1843
1844The ``package_tar`` class provides support for creating tarballs. The
1845class ensures the packages are written out in a tarball format to the
1846``${``\ :term:`DEPLOY_DIR_TAR`\ ``}`` directory.
1847
1848This class inherits the :ref:`package <ref-classes-package>` class and
1849is enabled through the :term:`PACKAGE_CLASSES`
1850variable in the ``local.conf`` file.
1851
1852.. note::
1853
Andrew Geissler4c19ea12020-10-27 13:52:24 -05001854 You cannot specify the ``package_tar`` class first using the
Andrew Geissler09036742021-06-25 14:25:14 -05001855 :term:`PACKAGE_CLASSES` variable. You must use ``.deb``, ``.ipk``, or ``.rpm``
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001856 file formats for your image or SDK.
1857
1858.. _ref-classes-packagedata:
1859
1860``packagedata.bbclass``
1861=======================
1862
1863The ``packagedata`` class provides common functionality for reading
1864``pkgdata`` files found in :term:`PKGDATA_DIR`. These
1865files contain information about each output package produced by the
1866OpenEmbedded build system.
1867
1868This class is enabled by default because it is inherited by the
1869:ref:`package <ref-classes-package>` class.
1870
1871.. _ref-classes-packagegroup:
1872
1873``packagegroup.bbclass``
1874========================
1875
1876The ``packagegroup`` class sets default values appropriate for package
Andrew Geissler09036742021-06-25 14:25:14 -05001877group recipes (e.g. :term:`PACKAGES`, :term:`PACKAGE_ARCH`, :term:`ALLOW_EMPTY`, and
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001878so forth). It is highly recommended that all package group recipes
1879inherit this class.
1880
1881For information on how to use this class, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -06001882":ref:`dev-manual/common-tasks:customizing images using custom package groups`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001883section in the Yocto Project Development Tasks Manual.
1884
1885Previously, this class was called the ``task`` class.
1886
1887.. _ref-classes-patch:
1888
1889``patch.bbclass``
1890=================
1891
1892The ``patch`` class provides all functionality for applying patches
1893during the :ref:`ref-tasks-patch` task.
1894
1895This class is enabled by default because it is inherited by the
1896:ref:`base <ref-classes-base>` class.
1897
1898.. _ref-classes-perlnative:
1899
1900``perlnative.bbclass``
1901======================
1902
1903When inherited by a recipe, the ``perlnative`` class supports using the
1904native version of Perl built by the build system rather than using the
1905version provided by the build host.
1906
1907.. _ref-classes-pixbufcache:
1908
1909``pixbufcache.bbclass``
1910=======================
1911
1912The ``pixbufcache`` class generates the proper post-install and
1913post-remove (postinst/postrm) scriptlets for packages that install
1914pixbuf loaders, which are used with ``gdk-pixbuf``. These scriptlets
1915call ``update_pixbuf_cache`` to add the pixbuf loaders to the cache.
1916Since the cache files are architecture-specific, ``update_pixbuf_cache``
1917is run using QEMU if the postinst scriptlets need to be run on the build
1918host during image creation.
1919
1920If the pixbuf loaders being installed are in packages other than the
1921recipe's main package, set
1922:term:`PIXBUF_PACKAGES` to specify the packages
1923containing the loaders.
1924
1925.. _ref-classes-pkgconfig:
1926
1927``pkgconfig.bbclass``
1928=====================
1929
1930The ``pkgconfig`` class provides a standard way to get header and
1931library information by using ``pkg-config``. This class aims to smooth
1932integration of ``pkg-config`` into libraries that use it.
1933
1934During staging, BitBake installs ``pkg-config`` data into the
1935``sysroots/`` directory. By making use of sysroot functionality within
1936``pkg-config``, the ``pkgconfig`` class no longer has to manipulate the
1937files.
1938
1939.. _ref-classes-populate-sdk:
1940
1941``populate_sdk.bbclass``
1942========================
1943
1944The ``populate_sdk`` class provides support for SDK-only recipes. For
1945information on advantages gained when building a cross-development
1946toolchain using the :ref:`ref-tasks-populate_sdk`
Andrew Geissler09209ee2020-12-13 08:44:15 -06001947task, see the ":ref:`sdk-manual/appendix-obtain:building an sdk installer`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001948section in the Yocto Project Application Development and the Extensible
1949Software Development Kit (eSDK) manual.
1950
1951.. _ref-classes-populate-sdk-*:
1952
1953``populate_sdk_*.bbclass``
1954==========================
1955
1956The ``populate_sdk_*`` classes support SDK creation and consist of the
1957following classes:
1958
1959- ``populate_sdk_base``: The base class supporting SDK creation under
1960 all package managers (i.e. DEB, RPM, and opkg).
1961
1962- ``populate_sdk_deb``: Supports creation of the SDK given the Debian
1963 package manager.
1964
1965- ``populate_sdk_rpm``: Supports creation of the SDK given the RPM
1966 package manager.
1967
1968- ``populate_sdk_ipk``: Supports creation of the SDK given the opkg
1969 (IPK format) package manager.
1970
1971- ``populate_sdk_ext``: Supports extensible SDK creation under all
1972 package managers.
1973
1974The ``populate_sdk_base`` class inherits the appropriate
1975``populate_sdk_*`` (i.e. ``deb``, ``rpm``, and ``ipk``) based on
1976:term:`IMAGE_PKGTYPE`.
1977
1978The base class ensures all source and destination directories are
1979established and then populates the SDK. After populating the SDK, the
1980``populate_sdk_base`` class constructs two sysroots:
1981``${``\ :term:`SDK_ARCH`\ ``}-nativesdk``, which
1982contains the cross-compiler and associated tooling, and the target,
1983which contains a target root filesystem that is configured for the SDK
1984usage. These two images reside in :term:`SDK_OUTPUT`,
Andrew Geisslerc926e172021-05-07 16:11:35 -05001985which consists of the following::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001986
1987 ${SDK_OUTPUT}/${SDK_ARCH}-nativesdk-pkgs
1988 ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/target-pkgs
1989
1990Finally, the base populate SDK class creates the toolchain environment
1991setup script, the tarball of the SDK, and the installer.
1992
1993The respective ``populate_sdk_deb``, ``populate_sdk_rpm``, and
1994``populate_sdk_ipk`` classes each support the specific type of SDK.
1995These classes are inherited by and used with the ``populate_sdk_base``
1996class.
1997
1998For more information on the cross-development toolchain generation, see
Andrew Geissler09209ee2020-12-13 08:44:15 -06001999the ":ref:`overview-manual/concepts:cross-development toolchain generation`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002000section in the Yocto Project Overview and Concepts Manual. For
2001information on advantages gained when building a cross-development
2002toolchain using the :ref:`ref-tasks-populate_sdk`
2003task, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -06002004":ref:`sdk-manual/appendix-obtain:building an sdk installer`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002005section in the Yocto Project Application Development and the Extensible
2006Software Development Kit (eSDK) manual.
2007
2008.. _ref-classes-prexport:
2009
2010``prexport.bbclass``
2011====================
2012
2013The ``prexport`` class provides functionality for exporting
2014:term:`PR` values.
2015
2016.. note::
2017
2018 This class is not intended to be used directly. Rather, it is enabled
Andrew Geissler4c19ea12020-10-27 13:52:24 -05002019 when using "``bitbake-prserv-tool export``".
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002020
2021.. _ref-classes-primport:
2022
2023``primport.bbclass``
2024====================
2025
2026The ``primport`` class provides functionality for importing
2027:term:`PR` values.
2028
2029.. note::
2030
2031 This class is not intended to be used directly. Rather, it is enabled
Andrew Geissler4c19ea12020-10-27 13:52:24 -05002032 when using "``bitbake-prserv-tool import``".
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002033
2034.. _ref-classes-prserv:
2035
2036``prserv.bbclass``
2037==================
2038
2039The ``prserv`` class provides functionality for using a :ref:`PR
Andrew Geissler09209ee2020-12-13 08:44:15 -06002040service <dev-manual/common-tasks:working with a pr service>` in order to
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002041automatically manage the incrementing of the :term:`PR`
2042variable for each recipe.
2043
2044This class is enabled by default because it is inherited by the
2045:ref:`package <ref-classes-package>` class. However, the OpenEmbedded
2046build system will not enable the functionality of this class unless
2047:term:`PRSERV_HOST` has been set.
2048
2049.. _ref-classes-ptest:
2050
2051``ptest.bbclass``
2052=================
2053
2054The ``ptest`` class provides functionality for packaging and installing
2055runtime tests for recipes that build software that provides these tests.
2056
2057This class is intended to be inherited by individual recipes. However,
2058the class' functionality is largely disabled unless "ptest" appears in
2059:term:`DISTRO_FEATURES`. See the
Andrew Geissler09209ee2020-12-13 08:44:15 -06002060":ref:`dev-manual/common-tasks:testing packages with ptest`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002061section in the Yocto Project Development Tasks Manual for more information
2062on ptest.
2063
2064.. _ref-classes-ptest-gnome:
2065
2066``ptest-gnome.bbclass``
2067=======================
2068
2069Enables package tests (ptests) specifically for GNOME packages, which
2070have tests intended to be executed with ``gnome-desktop-testing``.
2071
2072For information on setting up and running ptests, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -06002073":ref:`dev-manual/common-tasks:testing packages with ptest`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002074section in the Yocto Project Development Tasks Manual.
2075
Andrew Geissler3b8a17c2021-04-15 15:55:55 -05002076.. _ref-classes-python3-dir:
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002077
Andrew Geissler3b8a17c2021-04-15 15:55:55 -05002078``python3-dir.bbclass``
2079=======================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002080
Andrew Geissler3b8a17c2021-04-15 15:55:55 -05002081The ``python3-dir`` class provides the base version, location, and site
2082package location for Python 3.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002083
2084.. _ref-classes-python3native:
2085
2086``python3native.bbclass``
2087=========================
2088
2089The ``python3native`` class supports using the native version of Python
20903 built by the build system rather than support of the version provided
2091by the build host.
2092
Andrew Geissler3b8a17c2021-04-15 15:55:55 -05002093.. _ref-classes-python3targetconfig:
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002094
Andrew Geissler3b8a17c2021-04-15 15:55:55 -05002095``python3targetconfig.bbclass``
2096===============================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002097
Andrew Geissler3b8a17c2021-04-15 15:55:55 -05002098The ``python3targetconfig`` class supports using the native version of Python
20993 built by the build system rather than support of the version provided
2100by the build host, except that the configuration for the target machine
2101is accessible (such as correct installation directories). This also adds a
2102dependency on target ``python3``, so should only be used where appropriate
2103in order to avoid unnecessarily lengthening builds.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002104
2105.. _ref-classes-qemu:
2106
2107``qemu.bbclass``
2108================
2109
2110The ``qemu`` class provides functionality for recipes that either need
2111QEMU or test for the existence of QEMU. Typically, this class is used to
2112run programs for a target system on the build host using QEMU's
2113application emulation mode.
2114
2115.. _ref-classes-recipe_sanity:
2116
2117``recipe_sanity.bbclass``
2118=========================
2119
2120The ``recipe_sanity`` class checks for the presence of any host system
2121recipe prerequisites that might affect the build (e.g. variables that
2122are set or software that is present).
2123
2124.. _ref-classes-relocatable:
2125
2126``relocatable.bbclass``
2127=======================
2128
2129The ``relocatable`` class enables relocation of binaries when they are
2130installed into the sysroot.
2131
2132This class makes use of the :ref:`chrpath <ref-classes-chrpath>` class
2133and is used by both the :ref:`cross <ref-classes-cross>` and
2134:ref:`native <ref-classes-native>` classes.
2135
2136.. _ref-classes-remove-libtool:
2137
2138``remove-libtool.bbclass``
2139==========================
2140
2141The ``remove-libtool`` class adds a post function to the
2142:ref:`ref-tasks-install` task to remove all ``.la`` files
2143installed by ``libtool``. Removing these files results in them being
2144absent from both the sysroot and target packages.
2145
2146If a recipe needs the ``.la`` files to be installed, then the recipe can
Andrew Geisslerc926e172021-05-07 16:11:35 -05002147override the removal by setting ``REMOVE_LIBTOOL_LA`` to "0" as follows::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002148
2149 REMOVE_LIBTOOL_LA = "0"
2150
2151.. note::
2152
Andrew Geissler4c19ea12020-10-27 13:52:24 -05002153 The ``remove-libtool`` class is not enabled by default.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002154
2155.. _ref-classes-report-error:
2156
2157``report-error.bbclass``
2158========================
2159
2160The ``report-error`` class supports enabling the :ref:`error reporting
Andrew Geissler09209ee2020-12-13 08:44:15 -06002161tool <dev-manual/common-tasks:using the error reporting tool>`",
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002162which allows you to submit build error information to a central database.
2163
2164The class collects debug information for recipe, recipe version, task,
2165machine, distro, build system, target system, host distro, branch,
2166commit, and log. From the information, report files using a JSON format
2167are created and stored in
2168``${``\ :term:`LOG_DIR`\ ``}/error-report``.
2169
2170.. _ref-classes-rm-work:
2171
2172``rm_work.bbclass``
2173===================
2174
2175The ``rm_work`` class supports deletion of temporary workspace, which
2176can ease your hard drive demands during builds.
2177
2178The OpenEmbedded build system can use a substantial amount of disk space
2179during the build process. A portion of this space is the work files
2180under the ``${TMPDIR}/work`` directory for each recipe. Once the build
2181system generates the packages for a recipe, the work files for that
2182recipe are no longer needed. However, by default, the build system
2183preserves these files for inspection and possible debugging purposes. If
2184you would rather have these files deleted to save disk space as the
2185build progresses, you can enable ``rm_work`` by adding the following to
2186your ``local.conf`` file, which is found in the :term:`Build Directory`.
2187::
2188
2189 INHERIT += "rm_work"
2190
2191If you are
2192modifying and building source code out of the work directory for a
2193recipe, enabling ``rm_work`` will potentially result in your changes to
2194the source being lost. To exclude some recipes from having their work
2195directories deleted by ``rm_work``, you can add the names of the recipe
Andrew Geissler09036742021-06-25 14:25:14 -05002196or recipes you are working on to the :term:`RM_WORK_EXCLUDE` variable, which
Andrew Geisslerc926e172021-05-07 16:11:35 -05002197can also be set in your ``local.conf`` file. Here is an example::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002198
2199 RM_WORK_EXCLUDE += "busybox glibc"
2200
2201.. _ref-classes-rootfs*:
2202
2203``rootfs*.bbclass``
2204===================
2205
2206The ``rootfs*`` classes support creating the root filesystem for an
2207image and consist of the following classes:
2208
2209- The ``rootfs-postcommands`` class, which defines filesystem
2210 post-processing functions for image recipes.
2211
2212- The ``rootfs_deb`` class, which supports creation of root filesystems
2213 for images built using ``.deb`` packages.
2214
2215- The ``rootfs_rpm`` class, which supports creation of root filesystems
2216 for images built using ``.rpm`` packages.
2217
2218- The ``rootfs_ipk`` class, which supports creation of root filesystems
2219 for images built using ``.ipk`` packages.
2220
2221- The ``rootfsdebugfiles`` class, which installs additional files found
2222 on the build host directly into the root filesystem.
2223
2224The root filesystem is created from packages using one of the
2225``rootfs*.bbclass`` files as determined by the
2226:term:`PACKAGE_CLASSES` variable.
2227
2228For information on how root filesystem images are created, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -06002229":ref:`overview-manual/concepts:image generation`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002230section in the Yocto Project Overview and Concepts Manual.
2231
2232.. _ref-classes-sanity:
2233
2234``sanity.bbclass``
2235==================
2236
2237The ``sanity`` class checks to see if prerequisite software is present
2238on the host system so that users can be notified of potential problems
2239that might affect their build. The class also performs basic user
2240configuration checks from the ``local.conf`` configuration file to
2241prevent common mistakes that cause build failures. Distribution policy
2242usually determines whether to include this class.
2243
2244.. _ref-classes-scons:
2245
2246``scons.bbclass``
2247=================
2248
2249The ``scons`` class supports recipes that need to build software that
2250uses the SCons build system. You can use the
2251:term:`EXTRA_OESCONS` variable to specify
2252additional configuration options you want to pass SCons command line.
2253
2254.. _ref-classes-sdl:
2255
2256``sdl.bbclass``
2257===============
2258
2259The ``sdl`` class supports recipes that need to build software that uses
2260the Simple DirectMedia Layer (SDL) library.
2261
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002262.. _ref-classes-setuptools3:
2263
2264``setuptools3.bbclass``
2265=======================
2266
2267The ``setuptools3`` class supports Python version 3.x extensions that
Andrew Geissler3b8a17c2021-04-15 15:55:55 -05002268use build systems based on ``setuptools``. If your recipe uses these
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002269build systems, the recipe needs to inherit the ``setuptools3`` class.
2270
2271.. _ref-classes-sign_rpm:
2272
2273``sign_rpm.bbclass``
2274====================
2275
2276The ``sign_rpm`` class supports generating signed RPM packages.
2277
2278.. _ref-classes-sip:
2279
2280``sip.bbclass``
2281===============
2282
2283The ``sip`` class supports recipes that build or package SIP-based
2284Python bindings.
2285
2286.. _ref-classes-siteconfig:
2287
2288``siteconfig.bbclass``
2289======================
2290
2291The ``siteconfig`` class provides functionality for handling site
2292configuration. The class is used by the
2293:ref:`autotools <ref-classes-autotools>` class to accelerate the
2294:ref:`ref-tasks-configure` task.
2295
2296.. _ref-classes-siteinfo:
2297
2298``siteinfo.bbclass``
2299====================
2300
2301The ``siteinfo`` class provides information about the targets that might
2302be needed by other classes or recipes.
2303
2304As an example, consider Autotools, which can require tests that must
2305execute on the target hardware. Since this is not possible in general
2306when cross compiling, site information is used to provide cached test
2307results so these tests can be skipped over but still make the correct
2308values available. The ``meta/site directory`` contains test results
2309sorted into different categories such as architecture, endianness, and
2310the ``libc`` used. Site information provides a list of files containing
Andrew Geissler09036742021-06-25 14:25:14 -05002311data relevant to the current build in the :term:`CONFIG_SITE` variable that
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002312Autotools automatically picks up.
2313
Andrew Geissler09036742021-06-25 14:25:14 -05002314The class also provides variables like :term:`SITEINFO_ENDIANNESS` and
2315:term:`SITEINFO_BITS` that can be used elsewhere in the metadata.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002316
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002317.. _ref-classes-sstate:
2318
2319``sstate.bbclass``
2320==================
2321
2322The ``sstate`` class provides support for Shared State (sstate). By
2323default, the class is enabled through the
2324:term:`INHERIT_DISTRO` variable's default value.
2325
2326For more information on sstate, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -06002327":ref:`overview-manual/concepts:shared state cache`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002328section in the Yocto Project Overview and Concepts Manual.
2329
2330.. _ref-classes-staging:
2331
2332``staging.bbclass``
2333===================
2334
2335The ``staging`` class installs files into individual recipe work
2336directories for sysroots. The class contains the following key tasks:
2337
2338- The :ref:`ref-tasks-populate_sysroot` task,
2339 which is responsible for handing the files that end up in the recipe
2340 sysroots.
2341
2342- The
2343 :ref:`ref-tasks-prepare_recipe_sysroot`
2344 task (a "partner" task to the ``populate_sysroot`` task), which
2345 installs the files into the individual recipe work directories (i.e.
2346 :term:`WORKDIR`).
2347
2348The code in the ``staging`` class is complex and basically works in two
2349stages:
2350
2351- *Stage One:* The first stage addresses recipes that have files they
2352 want to share with other recipes that have dependencies on the
2353 originating recipe. Normally these dependencies are installed through
2354 the :ref:`ref-tasks-install` task into
2355 ``${``\ :term:`D`\ ``}``. The ``do_populate_sysroot`` task
2356 copies a subset of these files into ``${SYSROOT_DESTDIR}``. This
2357 subset of files is controlled by the
2358 :term:`SYSROOT_DIRS`,
2359 :term:`SYSROOT_DIRS_NATIVE`, and
2360 :term:`SYSROOT_DIRS_BLACKLIST`
2361 variables.
2362
2363 .. note::
2364
2365 Additionally, a recipe can customize the files further by
Andrew Geissler09036742021-06-25 14:25:14 -05002366 declaring a processing function in the :term:`SYSROOT_PREPROCESS_FUNCS`
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002367 variable.
2368
2369 A shared state (sstate) object is built from these files and the
2370 files are placed into a subdirectory of
Andrew Geissler4c19ea12020-10-27 13:52:24 -05002371 :ref:`structure-build-tmp-sysroots-components`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002372 The files are scanned for hardcoded paths to the original
2373 installation location. If the location is found in text files, the
2374 hardcoded locations are replaced by tokens and a list of the files
2375 needing such replacements is created. These adjustments are referred
2376 to as "FIXMEs". The list of files that are scanned for paths is
2377 controlled by the :term:`SSTATE_SCAN_FILES`
2378 variable.
2379
2380- *Stage Two:* The second stage addresses recipes that want to use
2381 something from another recipe and declare a dependency on that recipe
2382 through the :term:`DEPENDS` variable. The recipe will
2383 have a
2384 :ref:`ref-tasks-prepare_recipe_sysroot`
2385 task and when this task executes, it creates the ``recipe-sysroot``
2386 and ``recipe-sysroot-native`` in the recipe work directory (i.e.
2387 :term:`WORKDIR`). The OpenEmbedded build system
2388 creates hard links to copies of the relevant files from
2389 ``sysroots-components`` into the recipe work directory.
2390
2391 .. note::
2392
2393 If hard links are not possible, the build system uses actual
2394 copies.
2395
2396 The build system then addresses any "FIXMEs" to paths as defined from
2397 the list created in the first stage.
2398
2399 Finally, any files in ``${bindir}`` within the sysroot that have the
2400 prefix "``postinst-``" are executed.
2401
2402 .. note::
2403
2404 Although such sysroot post installation scripts are not
2405 recommended for general use, the files do allow some issues such
2406 as user creation and module indexes to be addressed.
2407
Andrew Geissler09036742021-06-25 14:25:14 -05002408 Because recipes can have other dependencies outside of :term:`DEPENDS`
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002409 (e.g. ``do_unpack[depends] += "tar-native:do_populate_sysroot"``),
2410 the sysroot creation function ``extend_recipe_sysroot`` is also added
2411 as a pre-function for those tasks whose dependencies are not through
Andrew Geissler09036742021-06-25 14:25:14 -05002412 :term:`DEPENDS` but operate similarly.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002413
2414 When installing dependencies into the sysroot, the code traverses the
2415 dependency graph and processes dependencies in exactly the same way
2416 as the dependencies would or would not be when installed from sstate.
2417 This processing means, for example, a native tool would have its
2418 native dependencies added but a target library would not have its
2419 dependencies traversed or installed. The same sstate dependency code
2420 is used so that builds should be identical regardless of whether
2421 sstate was used or not. For a closer look, see the
2422 ``setscene_depvalid()`` function in the
2423 :ref:`sstate <ref-classes-sstate>` class.
2424
2425 The build system is careful to maintain manifests of the files it
2426 installs so that any given dependency can be installed as needed. The
2427 sstate hash of the installed item is also stored so that if it
2428 changes, the build system can reinstall it.
2429
2430.. _ref-classes-syslinux:
2431
2432``syslinux.bbclass``
2433====================
2434
2435The ``syslinux`` class provides syslinux-specific functions for building
2436bootable images.
2437
2438The class supports the following variables:
2439
2440- :term:`INITRD`: Indicates list of filesystem images to
2441 concatenate and use as an initial RAM disk (initrd). This variable is
2442 optional.
2443
2444- :term:`ROOTFS`: Indicates a filesystem image to include
2445 as the root filesystem. This variable is optional.
2446
2447- :term:`AUTO_SYSLINUXMENU`: Enables creating
2448 an automatic menu when set to "1".
2449
2450- :term:`LABELS`: Lists targets for automatic
2451 configuration.
2452
2453- :term:`APPEND`: Lists append string overrides for each
2454 label.
2455
2456- :term:`SYSLINUX_OPTS`: Lists additional options
2457 to add to the syslinux file. Semicolon characters separate multiple
2458 options.
2459
2460- :term:`SYSLINUX_SPLASH`: Lists a background
2461 for the VGA boot menu when you are using the boot menu.
2462
2463- :term:`SYSLINUX_DEFAULT_CONSOLE`: Set
2464 to "console=ttyX" to change kernel boot default console.
2465
2466- :term:`SYSLINUX_SERIAL`: Sets an alternate
2467 serial port. Or, turns off serial when the variable is set with an
2468 empty string.
2469
2470- :term:`SYSLINUX_SERIAL_TTY`: Sets an
2471 alternate "console=tty..." kernel boot argument.
2472
2473.. _ref-classes-systemd:
2474
2475``systemd.bbclass``
2476===================
2477
2478The ``systemd`` class provides support for recipes that install systemd
2479unit files.
2480
2481The functionality for this class is disabled unless you have "systemd"
2482in :term:`DISTRO_FEATURES`.
2483
2484Under this class, the recipe or Makefile (i.e. whatever the recipe is
2485calling during the :ref:`ref-tasks-install` task)
2486installs unit files into
2487``${``\ :term:`D`\ ``}${systemd_unitdir}/system``. If the unit
2488files being installed go into packages other than the main package, you
2489need to set :term:`SYSTEMD_PACKAGES` in your
2490recipe to identify the packages in which the files will be installed.
2491
2492You should set :term:`SYSTEMD_SERVICE` to the
2493name of the service file. You should also use a package name override to
2494indicate the package to which the value applies. If the value applies to
2495the recipe's main package, use ``${``\ :term:`PN`\ ``}``. Here
Andrew Geisslerc926e172021-05-07 16:11:35 -05002496is an example from the connman recipe::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002497
2498 SYSTEMD_SERVICE_${PN} = "connman.service"
2499
2500Services are set up to start on boot automatically
2501unless you have set
2502:term:`SYSTEMD_AUTO_ENABLE` to "disable".
2503
2504For more information on ``systemd``, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -06002505":ref:`dev-manual/common-tasks:selecting an initialization manager`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002506section in the Yocto Project Development Tasks Manual.
2507
2508.. _ref-classes-systemd-boot:
2509
2510``systemd-boot.bbclass``
2511========================
2512
2513The ``systemd-boot`` class provides functions specific to the
2514systemd-boot bootloader for building bootable images. This is an
2515internal class and is not intended to be used directly.
2516
2517.. note::
2518
Andrew Geissler4c19ea12020-10-27 13:52:24 -05002519 The ``systemd-boot`` class is a result from merging the ``gummiboot`` class
2520 used in previous Yocto Project releases with the ``systemd`` project.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002521
2522Set the :term:`EFI_PROVIDER` variable to
2523"systemd-boot" to use this class. Doing so creates a standalone EFI
2524bootloader that is not dependent on systemd.
2525
2526For information on more variables used and supported in this class, see
2527the :term:`SYSTEMD_BOOT_CFG`,
2528:term:`SYSTEMD_BOOT_ENTRIES`, and
2529:term:`SYSTEMD_BOOT_TIMEOUT` variables.
2530
2531You can also see the `Systemd-boot
Andrew Geisslerd1e89492021-02-12 15:35:20 -06002532documentation <https://www.freedesktop.org/wiki/Software/systemd/systemd-boot/>`__
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002533for more information.
2534
2535.. _ref-classes-terminal:
2536
2537``terminal.bbclass``
2538====================
2539
2540The ``terminal`` class provides support for starting a terminal session.
2541The :term:`OE_TERMINAL` variable controls which
2542terminal emulator is used for the session.
2543
2544Other classes use the ``terminal`` class anywhere a separate terminal
2545session needs to be started. For example, the
2546:ref:`patch <ref-classes-patch>` class assuming
2547:term:`PATCHRESOLVE` is set to "user", the
2548:ref:`cml1 <ref-classes-cml1>` class, and the
2549:ref:`devshell <ref-classes-devshell>` class all use the ``terminal``
2550class.
2551
2552.. _ref-classes-testimage*:
2553
2554``testimage*.bbclass``
2555======================
2556
2557The ``testimage*`` classes support running automated tests against
2558images using QEMU and on actual hardware. The classes handle loading the
2559tests and starting the image. To use the classes, you need to perform
2560steps to set up the environment.
2561
2562.. note::
2563
Andrew Geissler4c19ea12020-10-27 13:52:24 -05002564 Best practices include using :term:`IMAGE_CLASSES` rather than
2565 :term:`INHERIT` to inherit the ``testimage`` class for automated image
2566 testing.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002567
2568The tests are commands that run on the target system over ``ssh``. Each
2569test is written in Python and makes use of the ``unittest`` module.
2570
2571The ``testimage.bbclass`` runs tests on an image when called using the
Andrew Geisslerc926e172021-05-07 16:11:35 -05002572following::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002573
2574 $ bitbake -c testimage image
2575
2576The ``testimage-auto`` class
2577runs tests on an image after the image is constructed (i.e.
2578:term:`TESTIMAGE_AUTO` must be set to "1").
2579
2580For information on how to enable, run, and create new tests, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -06002581":ref:`dev-manual/common-tasks:performing automated runtime testing`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002582section in the Yocto Project Development Tasks Manual.
2583
2584.. _ref-classes-testsdk:
2585
2586``testsdk.bbclass``
2587===================
2588
2589This class supports running automated tests against software development
2590kits (SDKs). The ``testsdk`` class runs tests on an SDK when called
Andrew Geisslerc926e172021-05-07 16:11:35 -05002591using the following::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002592
2593 $ bitbake -c testsdk image
2594
2595.. note::
2596
Andrew Geissler4c19ea12020-10-27 13:52:24 -05002597 Best practices include using :term:`IMAGE_CLASSES` rather than
2598 :term:`INHERIT` to inherit the ``testsdk`` class for automated SDK
2599 testing.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002600
2601.. _ref-classes-texinfo:
2602
2603``texinfo.bbclass``
2604===================
2605
2606This class should be inherited by recipes whose upstream packages invoke
2607the ``texinfo`` utilities at build-time. Native and cross recipes are
2608made to use the dummy scripts provided by ``texinfo-dummy-native``, for
2609improved performance. Target architecture recipes use the genuine
2610Texinfo utilities. By default, they use the Texinfo utilities on the
2611host system.
2612
2613.. note::
2614
2615 If you want to use the Texinfo recipe shipped with the build system,
Andrew Geissler4c19ea12020-10-27 13:52:24 -05002616 you can remove "texinfo-native" from :term:`ASSUME_PROVIDED` and makeinfo
2617 from :term:`SANITY_REQUIRED_UTILITIES`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002618
2619.. _ref-classes-toaster:
2620
2621``toaster.bbclass``
2622===================
2623
2624The ``toaster`` class collects information about packages and images and
2625sends them as events that the BitBake user interface can receive. The
2626class is enabled when the Toaster user interface is running.
2627
2628This class is not intended to be used directly.
2629
2630.. _ref-classes-toolchain-scripts:
2631
2632``toolchain-scripts.bbclass``
2633=============================
2634
2635The ``toolchain-scripts`` class provides the scripts used for setting up
2636the environment for installed SDKs.
2637
2638.. _ref-classes-typecheck:
2639
2640``typecheck.bbclass``
2641=====================
2642
2643The ``typecheck`` class provides support for validating the values of
2644variables set at the configuration level against their defined types.
2645The OpenEmbedded build system allows you to define the type of a
Andrew Geisslerc926e172021-05-07 16:11:35 -05002646variable using the "type" varflag. Here is an example::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002647
2648 IMAGE_FEATURES[type] = "list"
2649
2650.. _ref-classes-uboot-config:
2651
2652``uboot-config.bbclass``
2653========================
2654
2655The ``uboot-config`` class provides support for U-Boot configuration for
Andrew Geisslerc926e172021-05-07 16:11:35 -05002656a machine. Specify the machine in your recipe as follows::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002657
2658 UBOOT_CONFIG ??= <default>
2659 UBOOT_CONFIG[foo] = "config,images"
2660
Andrew Geisslerc926e172021-05-07 16:11:35 -05002661You can also specify the machine using this method::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002662
2663 UBOOT_MACHINE = "config"
2664
2665See the :term:`UBOOT_CONFIG` and :term:`UBOOT_MACHINE` variables for additional
2666information.
2667
2668.. _ref-classes-uninative:
2669
2670``uninative.bbclass``
2671=====================
2672
2673Attempts to isolate the build system from the host distribution's C
2674library in order to make re-use of native shared state artifacts across
2675different host distributions practical. With this class enabled, a
2676tarball containing a pre-built C library is downloaded at the start of
2677the build. In the Poky reference distribution this is enabled by default
2678through ``meta/conf/distro/include/yocto-uninative.inc``. Other
2679distributions that do not derive from poky can also
2680"``require conf/distro/include/yocto-uninative.inc``" to use this.
2681Alternatively if you prefer, you can build the uninative-tarball recipe
2682yourself, publish the resulting tarball (e.g. via HTTP) and set
2683``UNINATIVE_URL`` and ``UNINATIVE_CHECKSUM`` appropriately. For an
2684example, see the ``meta/conf/distro/include/yocto-uninative.inc``.
2685
2686The ``uninative`` class is also used unconditionally by the extensible
2687SDK. When building the extensible SDK, ``uninative-tarball`` is built
2688and the resulting tarball is included within the SDK.
2689
2690.. _ref-classes-update-alternatives:
2691
2692``update-alternatives.bbclass``
2693===============================
2694
2695The ``update-alternatives`` class helps the alternatives system when
2696multiple sources provide the same command. This situation occurs when
2697several programs that have the same or similar function are installed
2698with the same name. For example, the ``ar`` command is available from
2699the ``busybox``, ``binutils`` and ``elfutils`` packages. The
2700``update-alternatives`` class handles renaming the binaries so that
2701multiple packages can be installed without conflicts. The ``ar`` command
2702still works regardless of which packages are installed or subsequently
2703removed. The class renames the conflicting binary in each package and
2704symlinks the highest priority binary during installation or removal of
2705packages.
2706
2707To use this class, you need to define a number of variables:
2708
2709- :term:`ALTERNATIVE`
2710
2711- :term:`ALTERNATIVE_LINK_NAME`
2712
2713- :term:`ALTERNATIVE_TARGET`
2714
2715- :term:`ALTERNATIVE_PRIORITY`
2716
2717These variables list alternative commands needed by a package, provide
2718pathnames for links, default links for targets, and so forth. For
2719details on how to use this class, see the comments in the
Andrew Geissler09209ee2020-12-13 08:44:15 -06002720:yocto_git:`update-alternatives.bbclass </poky/tree/meta/classes/update-alternatives.bbclass>`
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002721file.
2722
2723.. note::
2724
Andrew Geissler4c19ea12020-10-27 13:52:24 -05002725 You can use the ``update-alternatives`` command directly in your recipes.
2726 However, this class simplifies things in most cases.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002727
2728.. _ref-classes-update-rc.d:
2729
2730``update-rc.d.bbclass``
2731=======================
2732
2733The ``update-rc.d`` class uses ``update-rc.d`` to safely install an
2734initialization script on behalf of the package. The OpenEmbedded build
2735system takes care of details such as making sure the script is stopped
2736before a package is removed and started when the package is installed.
2737
Andrew Geissler09036742021-06-25 14:25:14 -05002738Three variables control this class: :term:`INITSCRIPT_PACKAGES`,
2739:term:`INITSCRIPT_NAME` and :term:`INITSCRIPT_PARAMS`. See the variable links
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002740for details.
2741
2742.. _ref-classes-useradd:
2743
2744``useradd*.bbclass``
2745====================
2746
2747The ``useradd*`` classes support the addition of users or groups for
2748usage by the package on the target. For example, if you have packages
2749that contain system services that should be run under their own user or
2750group, you can use these classes to enable creation of the user or
2751group. The ``meta-skeleton/recipes-skeleton/useradd/useradd-example.bb``
2752recipe in the :term:`Source Directory` provides a simple
2753example that shows how to add three users and groups to two packages.
2754See the ``useradd-example.bb`` recipe for more information on how to use
2755these classes.
2756
2757The ``useradd_base`` class provides basic functionality for user or
2758groups settings.
2759
2760The ``useradd*`` classes support the
2761:term:`USERADD_PACKAGES`,
2762:term:`USERADD_PARAM`,
2763:term:`GROUPADD_PARAM`, and
2764:term:`GROUPMEMS_PARAM` variables.
2765
2766The ``useradd-staticids`` class supports the addition of users or groups
2767that have static user identification (``uid``) and group identification
2768(``gid``) values.
2769
2770The default behavior of the OpenEmbedded build system for assigning
2771``uid`` and ``gid`` values when packages add users and groups during
2772package install time is to add them dynamically. This works fine for
2773programs that do not care what the values of the resulting users and
2774groups become. In these cases, the order of the installation determines
2775the final ``uid`` and ``gid`` values. However, if non-deterministic
2776``uid`` and ``gid`` values are a problem, you can override the default,
2777dynamic application of these values by setting static values. When you
2778set static values, the OpenEmbedded build system looks in
2779:term:`BBPATH` for ``files/passwd`` and ``files/group``
2780files for the values.
2781
2782To use static ``uid`` and ``gid`` values, you need to set some
2783variables. See the :term:`USERADDEXTENSION`,
2784:term:`USERADD_UID_TABLES`,
2785:term:`USERADD_GID_TABLES`, and
2786:term:`USERADD_ERROR_DYNAMIC` variables.
2787You can also see the :ref:`useradd <ref-classes-useradd>` class for
2788additional information.
2789
2790.. note::
2791
Andrew Geissler4c19ea12020-10-27 13:52:24 -05002792 You do not use the ``useradd-staticids`` class directly. You either enable
Andrew Geissler09036742021-06-25 14:25:14 -05002793 or disable the class by setting the :term:`USERADDEXTENSION` variable. If you
Andrew Geissler4c19ea12020-10-27 13:52:24 -05002794 enable or disable the class in a configured system, :term:`TMPDIR` might
Andrew Geissler09036742021-06-25 14:25:14 -05002795 contain incorrect ``uid`` and ``gid`` values. Deleting the :term:`TMPDIR`
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002796 directory will correct this condition.
2797
2798.. _ref-classes-utility-tasks:
2799
2800``utility-tasks.bbclass``
2801=========================
2802
2803The ``utility-tasks`` class provides support for various "utility" type
2804tasks that are applicable to all recipes, such as
2805:ref:`ref-tasks-clean` and
2806:ref:`ref-tasks-listtasks`.
2807
2808This class is enabled by default because it is inherited by the
2809:ref:`base <ref-classes-base>` class.
2810
2811.. _ref-classes-utils:
2812
2813``utils.bbclass``
2814=================
2815
2816The ``utils`` class provides some useful Python functions that are
2817typically used in inline Python expressions (e.g. ``${@...}``). One
2818example use is for ``bb.utils.contains()``.
2819
2820This class is enabled by default because it is inherited by the
2821:ref:`base <ref-classes-base>` class.
2822
2823.. _ref-classes-vala:
2824
2825``vala.bbclass``
2826================
2827
2828The ``vala`` class supports recipes that need to build software written
2829using the Vala programming language.
2830
2831.. _ref-classes-waf:
2832
2833``waf.bbclass``
2834===============
2835
2836The ``waf`` class supports recipes that need to build software that uses
2837the Waf build system. You can use the
2838:term:`EXTRA_OECONF` or
2839:term:`PACKAGECONFIG_CONFARGS` variables
2840to specify additional configuration options to be passed on the Waf
2841command line.