blob: 7dba617db5f4a062cb3894a47da21d3035018ee2 [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
Patrick Williams975a06f2022-10-21 14:42:47 -050016``.bbclass`` and are usually placed in one of a set of subdirectories
17beneath the ``meta*/`` directory found in the :term:`Source Directory`:
18
19 - ``classes-recipe/`` - classes intended to be inherited by recipes
20 individually
21 - ``classes-global/`` - classes intended to be inherited globally
22 - ``classes/`` - classes whose usage context is not clearly defined
23
Andrew Geisslerc9f78652020-09-18 14:11:35 -050024Class files can also be pointed to by
25:term:`BUILDDIR` (e.g. ``build/``) in the same way as
26``.conf`` files in the ``conf`` directory. Class files are searched for
27in :term:`BBPATH` using the same method by which ``.conf``
28files are searched.
29
30This chapter discusses only the most useful and important classes. Other
Patrick Williams975a06f2022-10-21 14:42:47 -050031classes do exist within the ``meta/classes*`` directories in the Source
Andrew Geisslerc9f78652020-09-18 14:11:35 -050032Directory. You can reference the ``.bbclass`` files directly for more
33information.
34
35.. _ref-classes-allarch:
36
Andrew Geissler517393d2023-01-13 08:55:19 -060037``allarch``
38===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -050039
Andrew Geissler517393d2023-01-13 08:55:19 -060040The :ref:`ref-classes-allarch` class is inherited by recipes that do not produce
Andrew Geisslerc9f78652020-09-18 14:11:35 -050041architecture-specific output. The class disables functionality that is
42normally needed for recipes that produce executable binaries (such as
43building the cross-compiler and a C library as pre-requisites, and
44splitting out of debug symbols during packaging).
45
46.. note::
47
48 Unlike some distro recipes (e.g. Debian), OpenEmbedded recipes that
49 produce packages that depend on tunings through use of the
50 :term:`RDEPENDS` and
51 :term:`TUNE_PKGARCH` variables, should never be
Andrew Geissler517393d2023-01-13 08:55:19 -060052 configured for all architectures using :ref:`ref-classes-allarch`. This is the case
Andrew Geisslerc9f78652020-09-18 14:11:35 -050053 even if the recipes do not produce architecture-specific output.
54
55 Configuring such recipes for all architectures causes the
Patrick Williams2194f502022-10-16 14:26:09 -050056 :ref:`do_package_write_* <ref-tasks-package_write_deb>` tasks to
Andrew Geisslerc9f78652020-09-18 14:11:35 -050057 have different signatures for the machines with different tunings.
58 Additionally, unnecessary rebuilds occur every time an image for a
Andrew Geissler09036742021-06-25 14:25:14 -050059 different :term:`MACHINE` is built even when the recipe never changes.
Andrew Geisslerc9f78652020-09-18 14:11:35 -050060
Andrew Geissler517393d2023-01-13 08:55:19 -060061By default, all recipes inherit the :ref:`ref-classes-base` and
62:ref:`ref-classes-package` classes, which enable
Andrew Geisslerc9f78652020-09-18 14:11:35 -050063functionality needed for recipes that produce executable output. If your
64recipe, for example, only produces packages that contain configuration
65files, media files, or scripts (e.g. Python and Perl), then it should
Andrew Geissler517393d2023-01-13 08:55:19 -060066inherit the :ref:`ref-classes-allarch` class.
Andrew Geisslerc9f78652020-09-18 14:11:35 -050067
68.. _ref-classes-archiver:
69
Andrew Geissler517393d2023-01-13 08:55:19 -060070``archiver``
71============
Andrew Geisslerc9f78652020-09-18 14:11:35 -050072
Andrew Geissler517393d2023-01-13 08:55:19 -060073The :ref:`ref-classes-archiver` class supports releasing source code and other
Andrew Geisslerc9f78652020-09-18 14:11:35 -050074materials with the binaries.
75
Andrew Geissler517393d2023-01-13 08:55:19 -060076For more details on the source :ref:`ref-classes-archiver`, see the
77":ref:`dev-manual/licenses:maintaining open source license compliance during your product's lifecycle`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -050078section in the Yocto Project Development Tasks Manual. You can also see
79the :term:`ARCHIVER_MODE` variable for information
80about the variable flags (varflags) that help control archive creation.
81
82.. _ref-classes-autotools:
83
Andrew Geissler517393d2023-01-13 08:55:19 -060084``autotools*``
85==============
Andrew Geisslerc9f78652020-09-18 14:11:35 -050086
Patrick Williams2390b1b2022-11-03 13:47:49 -050087The :ref:`autotools* <ref-classes-autotools>` classes support packages built with the
Patrick Williams7784c422022-11-17 07:29:11 -060088:wikipedia:`GNU Autotools <GNU_Autotools>`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -050089
90The ``autoconf``, ``automake``, and ``libtool`` packages bring
91standardization. This class defines a set of tasks (e.g. ``configure``,
92``compile`` and so forth) that work for all Autotooled packages. It
93should usually be enough to define a few standard variables and then
94simply ``inherit autotools``. These classes can also work with software
95that emulates Autotools. For more information, see the
Andrew Geissler517393d2023-01-13 08:55:19 -060096":ref:`dev-manual/new-recipe:autotooled package`" section
Andrew Geisslerc9f78652020-09-18 14:11:35 -050097in the Yocto Project Development Tasks Manual.
98
Patrick Williams2390b1b2022-11-03 13:47:49 -050099By default, the :ref:`autotools* <ref-classes-autotools>` classes use out-of-tree builds (i.e.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500100``autotools.bbclass`` building with ``B != S``).
101
102If the software being built by a recipe does not support using
103out-of-tree builds, you should have the recipe inherit the
Patrick Williams2390b1b2022-11-03 13:47:49 -0500104:ref:`autotools-brokensep <ref-classes-autotools>` class. The :ref:`autotools-brokensep <ref-classes-autotools>` class behaves
Andrew Geissler517393d2023-01-13 08:55:19 -0600105the same as the :ref:`ref-classes-autotools` class but builds with :term:`B`
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500106== :term:`S`. This method is useful when out-of-tree build
107support is either not present or is broken.
108
109.. note::
110
111 It is recommended that out-of-tree support be fixed and used if at
112 all possible.
113
114It's useful to have some idea of how the tasks defined by the
Patrick Williams2390b1b2022-11-03 13:47:49 -0500115:ref:`autotools* <ref-classes-autotools>` classes work and what they do behind the scenes.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500116
Andrew Geissler615f2f12022-07-15 14:00:58 -0500117- :ref:`ref-tasks-configure` --- regenerates the
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500118 configure script (using ``autoreconf``) and then launches it with a
119 standard set of arguments used during cross-compilation. You can pass
Andrew Geissler09036742021-06-25 14:25:14 -0500120 additional parameters to ``configure`` through the :term:`EXTRA_OECONF`
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500121 or :term:`PACKAGECONFIG_CONFARGS`
122 variables.
123
Andrew Geissler615f2f12022-07-15 14:00:58 -0500124- :ref:`ref-tasks-compile` --- runs ``make`` with
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500125 arguments that specify the compiler and linker. You can pass
Andrew Geissler5f350902021-07-23 13:09:54 -0400126 additional arguments through the :term:`EXTRA_OEMAKE` variable.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500127
Andrew Geissler615f2f12022-07-15 14:00:58 -0500128- :ref:`ref-tasks-install` --- runs ``make install`` and
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500129 passes in ``${``\ :term:`D`\ ``}`` as ``DESTDIR``.
130
131.. _ref-classes-base:
132
Andrew Geissler517393d2023-01-13 08:55:19 -0600133``base``
134========
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500135
Andrew Geissler517393d2023-01-13 08:55:19 -0600136The :ref:`ref-classes-base` class is special in that every ``.bb`` file implicitly
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500137inherits the class. This class contains definitions for standard basic
138tasks such as fetching, unpacking, configuring (empty by default),
139compiling (runs any ``Makefile`` present), installing (empty by default)
140and packaging (empty by default). These classes are often overridden or
Andrew Geissler517393d2023-01-13 08:55:19 -0600141extended by other classes such as the :ref:`ref-classes-autotools` class or the
142:ref:`ref-classes-package` class.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500143
144The class also contains some commonly used functions such as
145``oe_runmake``, which runs ``make`` with the arguments specified in
146:term:`EXTRA_OEMAKE` variable as well as the
147arguments passed directly to ``oe_runmake``.
148
149.. _ref-classes-bash-completion:
150
Andrew Geissler517393d2023-01-13 08:55:19 -0600151``bash-completion``
152===================
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500153
154Sets up packaging and dependencies appropriate for recipes that build
155software that includes bash-completion data.
156
157.. _ref-classes-bin-package:
158
Andrew Geissler517393d2023-01-13 08:55:19 -0600159``bin_package``
160===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500161
Andrew Geissler517393d2023-01-13 08:55:19 -0600162The :ref:`ref-classes-bin-package` class is a helper class for recipes that extract the
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500163contents of a binary package (e.g. an RPM) and install those contents
164rather than building the binary from source. The binary package is
165extracted and new packages in the configured output package format are
166created. Extraction and installation of proprietary binaries is a good
167example use for this class.
168
169.. note::
170
171 For RPMs and other packages that do not contain a subdirectory, you
172 should specify an appropriate fetcher parameter to point to the
Andrew Geissler4c19ea12020-10-27 13:52:24 -0500173 subdirectory. For example, if BitBake is using the Git fetcher (``git://``),
174 the "subpath" parameter limits the checkout to a specific subpath
175 of the tree. Here is an example where ``${BP}`` is used so that the files
176 are extracted into the subdirectory expected by the default value of
Andrew Geissler09036742021-06-25 14:25:14 -0500177 :term:`S`::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500178
Andrew Geissler9aee5002022-03-30 16:27:02 +0000179 SRC_URI = "git://example.com/downloads/somepackage.rpm;branch=main;subpath=${BP}"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500180
Andrew Geissler4c19ea12020-10-27 13:52:24 -0500181 See the ":ref:`bitbake-user-manual/bitbake-user-manual-fetching:fetchers`" section in the BitBake User Manual for
182 more information on supported BitBake Fetchers.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500183
184.. _ref-classes-binconfig:
185
Andrew Geissler517393d2023-01-13 08:55:19 -0600186``binconfig``
187=============
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500188
Andrew Geissler517393d2023-01-13 08:55:19 -0600189The :ref:`ref-classes-binconfig` class helps to correct paths in shell scripts.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500190
191Before ``pkg-config`` had become widespread, libraries shipped shell
192scripts to give information about the libraries and include paths needed
193to build software (usually named ``LIBNAME-config``). This class assists
194any recipe using such scripts.
195
196During staging, the OpenEmbedded build system installs such scripts into
197the ``sysroots/`` directory. Inheriting this class results in all paths
198in these scripts being changed to point into the ``sysroots/`` directory
199so that all builds that use the script use the correct directories for
200the cross compiling layout. See the
201:term:`BINCONFIG_GLOB` variable for more
202information.
203
204.. _ref-classes-binconfig-disabled:
205
Andrew Geissler517393d2023-01-13 08:55:19 -0600206``binconfig-disabled``
207======================
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500208
Andrew Geissler517393d2023-01-13 08:55:19 -0600209An alternative version of the :ref:`ref-classes-binconfig`
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500210class, which disables binary configuration scripts by making them return
211an error in favor of using ``pkg-config`` to query the information. The
Andrew Geissler517393d2023-01-13 08:55:19 -0600212scripts to be disabled should be specified using the :term:`BINCONFIG`
213variable within the recipe inheriting the class.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500214
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500215.. _ref-classes-buildhistory:
216
Andrew Geissler517393d2023-01-13 08:55:19 -0600217``buildhistory``
218================
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500219
Andrew Geissler517393d2023-01-13 08:55:19 -0600220The :ref:`ref-classes-buildhistory` class records a history of build output metadata,
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500221which can be used to detect possible regressions as well as used for
222analysis of the build output. For more information on using Build
223History, see the
Andrew Geissler517393d2023-01-13 08:55:19 -0600224":ref:`dev-manual/build-quality:maintaining build output quality`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500225section in the Yocto Project Development Tasks Manual.
226
227.. _ref-classes-buildstats:
228
Andrew Geissler517393d2023-01-13 08:55:19 -0600229``buildstats``
230==============
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500231
Andrew Geissler517393d2023-01-13 08:55:19 -0600232The :ref:`ref-classes-buildstats` class records performance statistics about each task
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500233executed during the build (e.g. elapsed time, CPU usage, and I/O usage).
234
235When you use this class, the output goes into the
236:term:`BUILDSTATS_BASE` directory, which defaults
237to ``${TMPDIR}/buildstats/``. You can analyze the elapsed time using
238``scripts/pybootchartgui/pybootchartgui.py``, which produces a cascading
239chart of the entire build process and can be useful for highlighting
240bottlenecks.
241
242Collecting build statistics is enabled by default through the
243:term:`USER_CLASSES` variable from your
244``local.conf`` file. Consequently, you do not have to do anything to
245enable the class. However, if you want to disable the class, simply
Andrew Geissler517393d2023-01-13 08:55:19 -0600246remove ":ref:`ref-classes-buildstats`" from the :term:`USER_CLASSES` list.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500247
248.. _ref-classes-buildstats-summary:
249
Andrew Geissler517393d2023-01-13 08:55:19 -0600250``buildstats-summary``
251======================
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500252
253When inherited globally, prints statistics at the end of the build on
254sstate re-use. In order to function, this class requires the
Andrew Geissler517393d2023-01-13 08:55:19 -0600255:ref:`ref-classes-buildstats` class be enabled.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500256
257.. _ref-classes-ccache:
258
Andrew Geissler517393d2023-01-13 08:55:19 -0600259``ccache``
260==========
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500261
Andrew Geissler517393d2023-01-13 08:55:19 -0600262The :ref:`ref-classes-ccache` class enables the C/C++ Compiler Cache for the build.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500263This class is used to give a minor performance boost during the build.
Andrew Geissler7e0e3c02022-02-25 20:34:39 +0000264
265See https://ccache.samba.org/ for information on the C/C++ Compiler
266Cache, and the :oe_git:`ccache.bbclass </openembedded-core/tree/meta/classes/ccache.bbclass>`
267file for details about how to enable this mechanism in your configuration
268file, how to disable it for specific recipes, and how to share ``ccache``
269files between builds.
270
271However, using the class can lead to unexpected side-effects. Thus, using
272this class is not recommended.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500273
274.. _ref-classes-chrpath:
275
Andrew Geissler517393d2023-01-13 08:55:19 -0600276``chrpath``
277===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500278
Andrew Geissler517393d2023-01-13 08:55:19 -0600279The :ref:`ref-classes-chrpath` class is a wrapper around the "chrpath" utility, which
280is used during the build process for :ref:`ref-classes-nativesdk`, :ref:`ref-classes-cross`, and
281:ref:`ref-classes-cross-canadian` recipes to change ``RPATH`` records within binaries
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500282in order to make them relocatable.
283
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500284.. _ref-classes-cmake:
285
Andrew Geissler517393d2023-01-13 08:55:19 -0600286``cmake``
287=========
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500288
Andrew Geissler517393d2023-01-13 08:55:19 -0600289The ref:`ref-classes-cmake` class allows for recipes that need to build software using
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500290the `CMake <https://cmake.org/overview/>`__ build system. You can use
291the :term:`EXTRA_OECMAKE` variable to specify
292additional configuration options to be passed using the ``cmake``
293command line.
294
295On the occasion that you would be installing custom CMake toolchain
296files supplied by the application being built, you should install them
297to the preferred CMake Module directory: ``${D}${datadir}/cmake/``
298Modules during
299:ref:`ref-tasks-install`.
300
301.. _ref-classes-cml1:
302
Andrew Geissler517393d2023-01-13 08:55:19 -0600303``cml1``
304========
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500305
Andrew Geissler517393d2023-01-13 08:55:19 -0600306The :ref:`ref-classes-cml1` class provides basic support for the Linux kernel style
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500307build configuration system.
308
309.. _ref-classes-compress_doc:
310
Andrew Geissler517393d2023-01-13 08:55:19 -0600311``compress_doc``
312================
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500313
314Enables compression for man pages and info pages. This class is intended
315to be inherited globally. The default compression mechanism is gz (gzip)
316but you can select an alternative mechanism by setting the
317:term:`DOC_COMPRESS` variable.
318
319.. _ref-classes-copyleft_compliance:
320
Andrew Geissler517393d2023-01-13 08:55:19 -0600321``copyleft_compliance``
322=======================
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500323
Andrew Geissler517393d2023-01-13 08:55:19 -0600324The :ref:`ref-classes-copyleft_compliance` class preserves source code for the purposes
325of license compliance. This class is an alternative to the :ref:`ref-classes-archiver`
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500326class and is still used by some users even though it has been deprecated
Andrew Geissler517393d2023-01-13 08:55:19 -0600327in favor of the :ref:`ref-classes-archiver` class.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500328
329.. _ref-classes-copyleft_filter:
330
Andrew Geissler517393d2023-01-13 08:55:19 -0600331``copyleft_filter``
332===================
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500333
Andrew Geissler517393d2023-01-13 08:55:19 -0600334A class used by the :ref:`ref-classes-archiver` and
335:ref:`ref-classes-copyleft_compliance` classes
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500336for filtering licenses. The ``copyleft_filter`` class is an internal
337class and is not intended to be used directly.
338
339.. _ref-classes-core-image:
340
Andrew Geissler517393d2023-01-13 08:55:19 -0600341``core-image``
342==============
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500343
Andrew Geissler517393d2023-01-13 08:55:19 -0600344The :ref:`ref-classes-core-image` class provides common definitions for the
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500345``core-image-*`` image recipes, such as support for additional
346:term:`IMAGE_FEATURES`.
347
348.. _ref-classes-cpan:
349
Andrew Geissler517393d2023-01-13 08:55:19 -0600350``cpan*``
351=========
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500352
Patrick Williams2390b1b2022-11-03 13:47:49 -0500353The :ref:`cpan* <ref-classes-cpan>` classes support Perl modules.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500354
355Recipes for Perl modules are simple. These recipes usually only need to
356point to the source's archive and then inherit the proper class file.
357Building is split into two methods depending on which method the module
358authors used.
359
360- Modules that use old ``Makefile.PL``-based build system require
361 ``cpan.bbclass`` in their recipes.
362
363- Modules that use ``Build.PL``-based build system require using
364 ``cpan_build.bbclass`` in their recipes.
365
Patrick Williams2390b1b2022-11-03 13:47:49 -0500366Both build methods inherit the :ref:`cpan-base <ref-classes-cpan>` class for basic Perl
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500367support.
368
Patrick Williams975a06f2022-10-21 14:42:47 -0500369.. _ref-classes-create-spdx:
370
Andrew Geissler517393d2023-01-13 08:55:19 -0600371``create-spdx``
372===============
Patrick Williams975a06f2022-10-21 14:42:47 -0500373
Andrew Geissler517393d2023-01-13 08:55:19 -0600374The :ref:`ref-classes-create-spdx` class provides support for
Patrick Williams7784c422022-11-17 07:29:11 -0600375automatically creating :term:`SPDX` :term:`SBOM` documents based upon image
376and SDK contents.
377
378This class is meant to be inherited globally from a configuration file::
379
380 INHERIT += "create-spdx"
381
382The toplevel :term:`SPDX` output file is generated in JSON format as a
383``IMAGE-MACHINE.spdx.json`` file in ``tmp/deploy/images/MACHINE/`` inside the
384:term:`Build Directory`. There are other related files in the same directory,
385as well as in ``tmp/deploy/spdx``.
386
387The exact behaviour of this class, and the amount of output can be controlled
388by the :term:`SPDX_PRETTY`, :term:`SPDX_ARCHIVE_PACKAGED`,
389:term:`SPDX_ARCHIVE_SOURCES` and :term:`SPDX_INCLUDE_SOURCES` variables.
390
391See the description of these variables and the
Andrew Geissler517393d2023-01-13 08:55:19 -0600392":ref:`dev-manual/sbom:creating a software bill of materials`"
Patrick Williams7784c422022-11-17 07:29:11 -0600393section in the Yocto Project Development Manual for more details.
Patrick Williams975a06f2022-10-21 14:42:47 -0500394
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500395.. _ref-classes-cross:
396
Andrew Geissler517393d2023-01-13 08:55:19 -0600397``cross``
398=========
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500399
Andrew Geissler517393d2023-01-13 08:55:19 -0600400The :ref:`ref-classes-cross` class provides support for the recipes that build the
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500401cross-compilation tools.
402
403.. _ref-classes-cross-canadian:
404
Andrew Geissler517393d2023-01-13 08:55:19 -0600405``cross-canadian``
406==================
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500407
Andrew Geissler517393d2023-01-13 08:55:19 -0600408The :ref:`ref-classes-cross-canadian` class provides support for the recipes that build
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500409the Canadian Cross-compilation tools for SDKs. See the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600410":ref:`overview-manual/concepts:cross-development toolchain generation`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500411section in the Yocto Project Overview and Concepts Manual for more
412discussion on these cross-compilation tools.
413
414.. _ref-classes-crosssdk:
415
Andrew Geissler517393d2023-01-13 08:55:19 -0600416``crosssdk``
417============
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500418
Andrew Geissler517393d2023-01-13 08:55:19 -0600419The :ref:`ref-classes-crosssdk` class provides support for the recipes that build the
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500420cross-compilation tools used for building SDKs. See the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600421":ref:`overview-manual/concepts:cross-development toolchain generation`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500422section in the Yocto Project Overview and Concepts Manual for more
423discussion on these cross-compilation tools.
424
Patrick Williams0ca19cc2021-08-16 14:03:13 -0500425.. _ref-classes-cve-check:
426
Andrew Geissler517393d2023-01-13 08:55:19 -0600427``cve-check``
428=============
Patrick Williams0ca19cc2021-08-16 14:03:13 -0500429
Andrew Geissler517393d2023-01-13 08:55:19 -0600430The :ref:`ref-classes-cve-check` class looks for known CVEs (Common Vulnerabilities
Patrick Williams2390b1b2022-11-03 13:47:49 -0500431and Exposures) while building with BitBake. This class is meant to be
Patrick Williams0ca19cc2021-08-16 14:03:13 -0500432inherited globally from a configuration file::
433
434 INHERIT += "cve-check"
435
Patrick Williams2390b1b2022-11-03 13:47:49 -0500436To filter out obsolete CVE database entries which are known not to impact software from Poky and OE-Core,
437add following line to the build configuration file::
438
439 include cve-extra-exclusions.inc
440
Patrick Williams0ca19cc2021-08-16 14:03:13 -0500441You can also look for vulnerabilities in specific packages by passing
Patrick Williams2390b1b2022-11-03 13:47:49 -0500442``-c cve_check`` to BitBake.
443
444After building the software with Bitbake, CVE check output reports are available in ``tmp/deploy/cve``
445and image specific summaries in ``tmp/deploy/images/*.cve`` or ``tmp/deploy/images/*.json`` files.
446
447When building, the CVE checker will emit build time warnings for any detected
448issues which are in the state ``Unpatched``, meaning that CVE issue seems to affect the software component
449and version being compiled and no patches to address the issue are applied. Other states
450for detected CVE issues are: ``Patched`` meaning that a patch to address the issue is already
451applied, and ``Ignored`` meaning that the issue can be ignored.
452
453The ``Patched`` state of a CVE issue is detected from patch files with the format
454``CVE-ID.patch``, e.g. ``CVE-2019-20633.patch``, in the :term:`SRC_URI` and using
455CVE metadata of format ``CVE: CVE-ID`` in the commit message of the patch file.
456
457If the recipe lists the ``CVE-ID`` in :term:`CVE_CHECK_IGNORE` variable, then the CVE state is reported
458as ``Ignored``. Multiple CVEs can be listed separated by spaces. Example::
459
460 CVE_CHECK_IGNORE += "CVE-2020-29509 CVE-2020-29511"
461
462If CVE check reports that a recipe contains false positives or false negatives, these may be
463fixed in recipes by adjusting the CVE product name using :term:`CVE_PRODUCT` and :term:`CVE_VERSION` variables.
464:term:`CVE_PRODUCT` defaults to the plain recipe name :term:`BPN` which can be adjusted to one or more CVE
465database vendor and product pairs using the syntax::
466
467 CVE_PRODUCT = "flex_project:flex"
468
469where ``flex_project`` is the CVE database vendor name and ``flex`` is the product name. Similarly
470if the default recipe version :term:`PV` does not match the version numbers of the software component
471in upstream releases or the CVE database, then the :term:`CVE_VERSION` variable can be used to set the
472CVE database compatible version number, for example::
473
474 CVE_VERSION = "2.39"
475
476Any bugs or missing or incomplete information in the CVE database entries should be fixed in the CVE database
477via the `NVD feedback form <https://nvd.nist.gov/info/contact-form>`__.
478
479Users should note that security is a process, not a product, and thus also CVE checking, analyzing results,
480patching and updating the software should be done as a regular process. The data and assumptions
481required for CVE checker to reliably detect issues are frequently broken in various ways.
482These can only be detected by reviewing the details of the issues and iterating over the generated reports,
483and following what happens in other Linux distributions and in the greater open source community.
484
485You will find some more details in the
Andrew Geissler517393d2023-01-13 08:55:19 -0600486":ref:`dev-manual/vulnerabilities:checking for vulnerabilities`"
Patrick Williams0ca19cc2021-08-16 14:03:13 -0500487section in the Development Tasks Manual.
488
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500489.. _ref-classes-debian:
490
Andrew Geissler517393d2023-01-13 08:55:19 -0600491``debian``
492==========
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500493
Andrew Geissler517393d2023-01-13 08:55:19 -0600494The :ref:`ref-classes-debian` class renames output packages so that they follow the
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500495Debian naming policy (i.e. ``glibc`` becomes ``libc6`` and
496``glibc-devel`` becomes ``libc6-dev``.) Renaming includes the library
497name and version as part of the package name.
498
499If a recipe creates packages for multiple libraries (shared object files
500of ``.so`` type), use the :term:`LEAD_SONAME`
501variable in the recipe to specify the library on which to apply the
502naming scheme.
503
504.. _ref-classes-deploy:
505
Andrew Geissler517393d2023-01-13 08:55:19 -0600506``deploy``
507==========
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500508
Andrew Geissler517393d2023-01-13 08:55:19 -0600509The :ref:`ref-classes-deploy` class handles deploying files to the
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500510:term:`DEPLOY_DIR_IMAGE` directory. The main
511function of this class is to allow the deploy step to be accelerated by
512shared state. Recipes that inherit this class should define their own
513:ref:`ref-tasks-deploy` function to copy the files to be
514deployed to :term:`DEPLOYDIR`, and use ``addtask`` to
515add the task at the appropriate place, which is usually after
516:ref:`ref-tasks-compile` or
517:ref:`ref-tasks-install`. The class then takes care of
Andrew Geissler09036742021-06-25 14:25:14 -0500518staging the files from :term:`DEPLOYDIR` to :term:`DEPLOY_DIR_IMAGE`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500519
520.. _ref-classes-devshell:
521
Andrew Geissler517393d2023-01-13 08:55:19 -0600522``devshell``
523============
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500524
Andrew Geissler517393d2023-01-13 08:55:19 -0600525The :ref:`ref-classes-devshell` class adds the :ref:`ref-tasks-devshell` task. Distribution
526policy dictates whether to include this class. See the ":ref:`dev-manual/development-shell:using a development shell`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500527section in the Yocto Project Development Tasks Manual for more
Andrew Geissler517393d2023-01-13 08:55:19 -0600528information about using :ref:`ref-classes-devshell`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500529
530.. _ref-classes-devupstream:
531
Andrew Geissler517393d2023-01-13 08:55:19 -0600532``devupstream``
533===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500534
Andrew Geissler517393d2023-01-13 08:55:19 -0600535The :ref:`ref-classes-devupstream` class uses
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500536:term:`BBCLASSEXTEND` to add a variant of the
537recipe that fetches from an alternative URI (e.g. Git) instead of a
Andrew Geisslerc926e172021-05-07 16:11:35 -0500538tarball. Following is an example::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500539
540 BBCLASSEXTEND = "devupstream:target"
Andrew Geissler9aee5002022-03-30 16:27:02 +0000541 SRC_URI:class-devupstream = "git://git.example.com/example;branch=main"
Patrick Williams0ca19cc2021-08-16 14:03:13 -0500542 SRCREV:class-devupstream = "abcd1234"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500543
544Adding the above statements to your recipe creates a variant that has
545:term:`DEFAULT_PREFERENCE` set to "-1".
546Consequently, you need to select the variant of the recipe to use it.
547Any development-specific adjustments can be done by using the
Andrew Geisslerc926e172021-05-07 16:11:35 -0500548``class-devupstream`` override. Here is an example::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500549
Patrick Williams0ca19cc2021-08-16 14:03:13 -0500550 DEPENDS:append:class-devupstream = " gperf-native"
551 do_configure:prepend:class-devupstream() {
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500552 touch ${S}/README
553 }
554
555The class
556currently only supports creating a development variant of the target
Andrew Geissler517393d2023-01-13 08:55:19 -0600557recipe, not :ref:`ref-classes-native` or :ref:`ref-classes-nativesdk` variants.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500558
Andrew Geissler09036742021-06-25 14:25:14 -0500559The :term:`BBCLASSEXTEND` syntax (i.e. ``devupstream:target``) provides
Andrew Geissler517393d2023-01-13 08:55:19 -0600560support for :ref:`ref-classes-native` and :ref:`ref-classes-nativesdk` variants. Consequently, this
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500561functionality can be added in a future release.
562
563Support for other version control systems such as Subversion is limited
564due to BitBake's automatic fetch dependencies (e.g.
565``subversion-native``).
566
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500567.. _ref-classes-externalsrc:
568
Andrew Geissler517393d2023-01-13 08:55:19 -0600569``externalsrc``
570===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500571
Andrew Geissler517393d2023-01-13 08:55:19 -0600572The :ref:`ref-classes-externalsrc` class supports building software from source code
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500573that is external to the OpenEmbedded build system. Building software
574from an external source tree means that the build system's normal fetch,
575unpack, and patch process is not used.
576
577By default, the OpenEmbedded build system uses the :term:`S`
578and :term:`B` variables to locate unpacked recipe source code
579and to build it, respectively. When your recipe inherits the
Andrew Geissler517393d2023-01-13 08:55:19 -0600580:ref:`ref-classes-externalsrc` class, you use the
581:term:`EXTERNALSRC` and :term:`EXTERNALSRC_BUILD` variables to
Andrew Geissler09036742021-06-25 14:25:14 -0500582ultimately define :term:`S` and :term:`B`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500583
584By default, this class expects the source code to support recipe builds
585that use the :term:`B` variable to point to the directory in
586which the OpenEmbedded build system places the generated objects built
Andrew Geissler09036742021-06-25 14:25:14 -0500587from the recipes. By default, the :term:`B` directory is set to the
588following, which is separate from the source directory (:term:`S`)::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500589
Andrew Geissler5199d832021-09-24 16:47:35 -0500590 ${WORKDIR}/${BPN}-{PV}/
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500591
592See these variables for more information:
593:term:`WORKDIR`, :term:`BPN`, and
594:term:`PV`,
595
Andrew Geissler517393d2023-01-13 08:55:19 -0600596For more information on the :ref:`ref-classes-externalsrc` class, see the comments in
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500597``meta/classes/externalsrc.bbclass`` in the :term:`Source Directory`.
Andrew Geissler517393d2023-01-13 08:55:19 -0600598For information on how to use the :ref:`ref-classes-externalsrc` class, see the
599":ref:`dev-manual/building:building software from an external source`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500600section in the Yocto Project Development Tasks Manual.
601
602.. _ref-classes-extrausers:
603
Andrew Geissler517393d2023-01-13 08:55:19 -0600604``extrausers``
605==============
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500606
Andrew Geissler517393d2023-01-13 08:55:19 -0600607The :ref:`ref-classes-extrausers` class allows additional user and group configuration
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500608to be applied at the image level. Inheriting this class either globally
609or from an image recipe allows additional user and group operations to
610be performed using the
611:term:`EXTRA_USERS_PARAMS` variable.
612
613.. note::
614
Andrew Geissler517393d2023-01-13 08:55:19 -0600615 The user and group operations added using the :ref:`ref-classes-extrausers`
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500616 class are not tied to a specific recipe outside of the recipe for the
617 image. Thus, the operations can be performed across the image as a
Andrew Geissler517393d2023-01-13 08:55:19 -0600618 whole. Use the :ref:`ref-classes-useradd` class to add user and group
619 configuration to a specific recipe.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500620
Andrew Geisslerc926e172021-05-07 16:11:35 -0500621Here is an example that uses this class in an image recipe::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500622
623 inherit extrausers
624 EXTRA_USERS_PARAMS = "\
625 useradd -p '' tester; \
626 groupadd developers; \
627 userdel nobody; \
628 groupdel -g video; \
629 groupmod -g 1020 developers; \
630 usermod -s /bin/sh tester; \
631 "
632
633Here is an example that adds two users named "tester-jim" and "tester-sue" and assigns
Andrew Geissler9aee5002022-03-30 16:27:02 +0000634passwords. First on host, create the (escaped) password hash::
Andrew Geisslereff27472021-10-29 15:35:00 -0500635
Andrew Geissler9aee5002022-03-30 16:27:02 +0000636 printf "%q" $(mkpasswd -m sha256crypt tester01)
Andrew Geisslereff27472021-10-29 15:35:00 -0500637
Andrew Geissler9aee5002022-03-30 16:27:02 +0000638The resulting hash is set to a variable and used in ``useradd`` command parameters::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500639
640 inherit extrausers
Andrew Geisslereff27472021-10-29 15:35:00 -0500641 PASSWD = "\$X\$ABC123\$A-Long-Hash"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500642 EXTRA_USERS_PARAMS = "\
Andrew Geisslereff27472021-10-29 15:35:00 -0500643 useradd -p '${PASSWD}' tester-jim; \
644 useradd -p '${PASSWD}' tester-sue; \
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500645 "
646
Andrew Geisslereff27472021-10-29 15:35:00 -0500647Finally, here is an example that sets the root password::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500648
649 inherit extrausers
650 EXTRA_USERS_PARAMS = "\
Andrew Geisslereff27472021-10-29 15:35:00 -0500651 usermod -p '${PASSWD}' root; \
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500652 "
653
Patrick Williams03907ee2022-05-01 06:28:52 -0500654.. note::
655
656 From a security perspective, hardcoding a default password is not
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500657 generally a good idea or even legal in some jurisdictions. It is
658 recommended that you do not do this if you are building a production
Patrick Williams03907ee2022-05-01 06:28:52 -0500659 image.
660
661
Andrew Geissler6ce62a22020-11-30 19:58:47 -0600662.. _ref-classes-features_check:
663
Andrew Geissler517393d2023-01-13 08:55:19 -0600664``features_check``
665==================
Andrew Geissler6ce62a22020-11-30 19:58:47 -0600666
Andrew Geissler517393d2023-01-13 08:55:19 -0600667The :ref:`ref-classes-features_check` class allows individual recipes to check
668for required and conflicting :term:`DISTRO_FEATURES`, :term:`MACHINE_FEATURES`
669or :term:`COMBINED_FEATURES`.
Andrew Geissler6ce62a22020-11-30 19:58:47 -0600670
671This class provides support for the following variables:
672
673- :term:`REQUIRED_DISTRO_FEATURES`
674- :term:`CONFLICT_DISTRO_FEATURES`
675- :term:`ANY_OF_DISTRO_FEATURES`
676- ``REQUIRED_MACHINE_FEATURES``
677- ``CONFLICT_MACHINE_FEATURES``
678- ``ANY_OF_MACHINE_FEATURES``
679- ``REQUIRED_COMBINED_FEATURES``
680- ``CONFLICT_COMBINED_FEATURES``
681- ``ANY_OF_COMBINED_FEATURES``
682
683If any conditions specified in the recipe using the above
684variables are not met, the recipe will be skipped, and if the
685build system attempts to build the recipe then an error will be
686triggered.
687
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500688.. _ref-classes-fontcache:
689
Andrew Geissler517393d2023-01-13 08:55:19 -0600690``fontcache``
691=============
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500692
Andrew Geissler517393d2023-01-13 08:55:19 -0600693The :ref:`ref-classes-fontcache` class generates the proper post-install and
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500694post-remove (postinst and postrm) scriptlets for font packages. These
695scriptlets call ``fc-cache`` (part of ``Fontconfig``) to add the fonts
696to the font information cache. Since the cache files are
697architecture-specific, ``fc-cache`` runs using QEMU if the postinst
698scriptlets need to be run on the build host during image creation.
699
700If the fonts being installed are in packages other than the main
701package, set :term:`FONT_PACKAGES` to specify the
702packages containing the fonts.
703
704.. _ref-classes-fs-uuid:
705
Andrew Geissler517393d2023-01-13 08:55:19 -0600706``fs-uuid``
707===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500708
Andrew Geissler517393d2023-01-13 08:55:19 -0600709The :ref:`ref-classes-fs-uuid` class extracts UUID from
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500710``${``\ :term:`ROOTFS`\ ``}``, which must have been built
Andrew Geissler517393d2023-01-13 08:55:19 -0600711by the time that this function gets called. The :ref:`ref-classes-fs-uuid` class only
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500712works on ``ext`` file systems and depends on ``tune2fs``.
713
714.. _ref-classes-gconf:
715
Andrew Geissler517393d2023-01-13 08:55:19 -0600716``gconf``
717=========
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500718
Andrew Geissler517393d2023-01-13 08:55:19 -0600719The :ref:`ref-classes-gconf` class provides common functionality for recipes that need
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500720to install GConf schemas. The schemas will be put into a separate
721package (``${``\ :term:`PN`\ ``}-gconf``) that is created
722automatically when this class is inherited. This package uses the
723appropriate post-install and post-remove (postinst/postrm) scriptlets to
724register and unregister the schemas in the target image.
725
726.. _ref-classes-gettext:
727
Andrew Geissler517393d2023-01-13 08:55:19 -0600728``gettext``
729===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500730
Andrew Geissler517393d2023-01-13 08:55:19 -0600731The :ref:`ref-classes-gettext` class provides support for building
732software that uses the GNU ``gettext`` internationalization and localization
733system. All recipes building software that use ``gettext`` should inherit this
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500734class.
735
Patrick Williams975a06f2022-10-21 14:42:47 -0500736.. _ref-classes-github-releases:
737
Andrew Geissler517393d2023-01-13 08:55:19 -0600738``github-releases``
739===================
Patrick Williams975a06f2022-10-21 14:42:47 -0500740
Andrew Geissler517393d2023-01-13 08:55:19 -0600741For recipes that fetch release tarballs from github, the :ref:`ref-classes-github-releases`
Patrick Williams975a06f2022-10-21 14:42:47 -0500742class sets up a standard way for checking available upstream versions
743(to support ``devtool upgrade`` and the Automated Upgrade Helper (AUH)).
744
Andrew Geissler517393d2023-01-13 08:55:19 -0600745To use it, add ":ref:`ref-classes-github-releases`" to the inherit line in the recipe,
Patrick Williams975a06f2022-10-21 14:42:47 -0500746and if the default value of :term:`GITHUB_BASE_URI` is not suitable,
747then set your own value in the recipe. You should then use ``${GITHUB_BASE_URI}``
748in the value you set for :term:`SRC_URI` within the recipe.
749
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500750.. _ref-classes-gnomebase:
751
Andrew Geissler517393d2023-01-13 08:55:19 -0600752``gnomebase``
753=============
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500754
Andrew Geissler517393d2023-01-13 08:55:19 -0600755The :ref:`ref-classes-gnomebase` class is the base class for recipes that build
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500756software from the GNOME stack. This class sets
757:term:`SRC_URI` to download the source from the GNOME
758mirrors as well as extending :term:`FILES` with the typical
759GNOME installation paths.
760
761.. _ref-classes-gobject-introspection:
762
Andrew Geissler517393d2023-01-13 08:55:19 -0600763``gobject-introspection``
764=========================
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500765
766Provides support for recipes building software that supports GObject
767introspection. This functionality is only enabled if the
768"gobject-introspection-data" feature is in
769:term:`DISTRO_FEATURES` as well as
770"qemu-usermode" being in
771:term:`MACHINE_FEATURES`.
772
773.. note::
774
775 This functionality is backfilled by default and, if not applicable,
Andrew Geissler09036742021-06-25 14:25:14 -0500776 should be disabled through :term:`DISTRO_FEATURES_BACKFILL_CONSIDERED` or
777 :term:`MACHINE_FEATURES_BACKFILL_CONSIDERED`, respectively.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500778
779.. _ref-classes-grub-efi:
780
Andrew Geissler517393d2023-01-13 08:55:19 -0600781``grub-efi``
782============
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500783
Andrew Geissler517393d2023-01-13 08:55:19 -0600784The :ref:`ref-classes-grub-efi` class provides ``grub-efi``-specific functions for
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500785building bootable images.
786
787This class supports several variables:
788
789- :term:`INITRD`: Indicates list of filesystem images to
790 concatenate and use as an initial RAM disk (initrd) (optional).
791
792- :term:`ROOTFS`: Indicates a filesystem image to include
793 as the root filesystem (optional).
794
795- :term:`GRUB_GFXSERIAL`: Set this to "1" to have
796 graphics and serial in the boot menu.
797
798- :term:`LABELS`: A list of targets for the automatic
799 configuration.
800
801- :term:`APPEND`: An override list of append strings for
802 each ``LABEL``.
803
804- :term:`GRUB_OPTS`: Additional options to add to the
805 configuration (optional). Options are delimited using semi-colon
806 characters (``;``).
807
808- :term:`GRUB_TIMEOUT`: Timeout before executing
809 the default ``LABEL`` (optional).
810
811.. _ref-classes-gsettings:
812
Andrew Geissler517393d2023-01-13 08:55:19 -0600813``gsettings``
814=============
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500815
Andrew Geissler517393d2023-01-13 08:55:19 -0600816The :ref:`ref-classes-gsettings` class provides common functionality for recipes that
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500817need to install GSettings (glib) schemas. The schemas are assumed to be
818part of the main package. Appropriate post-install and post-remove
819(postinst/postrm) scriptlets are added to register and unregister the
820schemas in the target image.
821
822.. _ref-classes-gtk-doc:
823
Andrew Geissler517393d2023-01-13 08:55:19 -0600824``gtk-doc``
825===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500826
Andrew Geissler517393d2023-01-13 08:55:19 -0600827The :ref:`ref-classes-gtk-doc` class is a helper class to pull in the appropriate
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500828``gtk-doc`` dependencies and disable ``gtk-doc``.
829
830.. _ref-classes-gtk-icon-cache:
831
Andrew Geissler517393d2023-01-13 08:55:19 -0600832``gtk-icon-cache``
833==================
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500834
Andrew Geissler517393d2023-01-13 08:55:19 -0600835The :ref:`ref-classes-gtk-icon-cache` class generates the proper post-install and
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500836post-remove (postinst/postrm) scriptlets for packages that use GTK+ and
837install icons. These scriptlets call ``gtk-update-icon-cache`` to add
838the fonts to GTK+'s icon cache. Since the cache files are
839architecture-specific, ``gtk-update-icon-cache`` is run using QEMU if
840the postinst scriptlets need to be run on the build host during image
841creation.
842
843.. _ref-classes-gtk-immodules-cache:
844
Andrew Geissler517393d2023-01-13 08:55:19 -0600845``gtk-immodules-cache``
846=======================
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500847
Andrew Geissler517393d2023-01-13 08:55:19 -0600848The :ref:`ref-classes-gtk-immodules-cache` class generates the proper post-install and
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500849post-remove (postinst/postrm) scriptlets for packages that install GTK+
850input method modules for virtual keyboards. These scriptlets call
851``gtk-update-icon-cache`` to add the input method modules to the cache.
852Since the cache files are architecture-specific,
853``gtk-update-icon-cache`` is run using QEMU if the postinst scriptlets
854need to be run on the build host during image creation.
855
856If the input method modules being installed are in packages other than
857the main package, set
858:term:`GTKIMMODULES_PACKAGES` to specify
859the packages containing the modules.
860
861.. _ref-classes-gzipnative:
862
Andrew Geissler517393d2023-01-13 08:55:19 -0600863``gzipnative``
864==============
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500865
Andrew Geissler517393d2023-01-13 08:55:19 -0600866The :ref:`ref-classes-gzipnative` class enables the use of different native versions of
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500867``gzip`` and ``pigz`` rather than the versions of these tools from the
868build host.
869
870.. _ref-classes-icecc:
871
Andrew Geissler517393d2023-01-13 08:55:19 -0600872``icecc``
873=========
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500874
Andrew Geissler517393d2023-01-13 08:55:19 -0600875The :ref:`ref-classes-icecc` class supports
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500876`Icecream <https://github.com/icecc/icecream>`__, which facilitates
877taking compile jobs and distributing them among remote machines.
878
879The class stages directories with symlinks from ``gcc`` and ``g++`` to
880``icecc``, for both native and cross compilers. Depending on each
881configure or compile, the OpenEmbedded build system adds the directories
882at the head of the ``PATH`` list and then sets the ``ICECC_CXX`` and
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500883``ICECC_CC`` variables, which are the paths to the ``g++`` and ``gcc``
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500884compilers, respectively.
885
886For the cross compiler, the class creates a ``tar.gz`` file that
887contains the Yocto Project toolchain and sets ``ICECC_VERSION``, which
888is the version of the cross-compiler used in the cross-development
889toolchain, accordingly.
890
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500891The class handles all three different compile stages (i.e native,
892cross-kernel and target) and creates the necessary environment
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500893``tar.gz`` file to be used by the remote machines. The class also
894supports SDK generation.
895
896If :term:`ICECC_PATH` is not set in your
897``local.conf`` file, then the class tries to locate the ``icecc`` binary
898using ``which``. If :term:`ICECC_ENV_EXEC` is set
899in your ``local.conf`` file, the variable should point to the
900``icecc-create-env`` script provided by the user. If you do not point to
901a user-provided script, the build system uses the default script
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500902provided by the recipe :oe_git:`icecc-create-env_0.1.bb
903</openembedded-core/tree/meta/recipes-devtools/icecc-create-env/icecc-create-env_0.1.bb>`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500904
905.. note::
906
907 This script is a modified version and not the one that comes with
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500908 ``icecream``.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500909
910If you do not want the Icecream distributed compile support to apply to
Andrew Geissler595f6302022-01-24 19:11:47 +0000911specific recipes or classes, you can ask them to be ignored by Icecream
912by listing the recipes and classes using the
Andrew Geissler9aee5002022-03-30 16:27:02 +0000913:term:`ICECC_RECIPE_DISABLE` and
914:term:`ICECC_CLASS_DISABLE` variables,
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500915respectively, in your ``local.conf`` file. Doing so causes the
916OpenEmbedded build system to handle these compilations locally.
917
918Additionally, you can list recipes using the
Andrew Geissler9aee5002022-03-30 16:27:02 +0000919:term:`ICECC_RECIPE_ENABLE` variable in
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500920your ``local.conf`` file to force ``icecc`` to be enabled for recipes
921using an empty :term:`PARALLEL_MAKE` variable.
922
Andrew Geissler517393d2023-01-13 08:55:19 -0600923Inheriting the :ref:`ref-classes-icecc` class changes all sstate signatures.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500924Consequently, if a development team has a dedicated build system that
925populates :term:`SSTATE_MIRRORS` and they want to
Andrew Geissler09036742021-06-25 14:25:14 -0500926reuse sstate from :term:`SSTATE_MIRRORS`, then all developers and the build
Andrew Geissler517393d2023-01-13 08:55:19 -0600927system need to either inherit the :ref:`ref-classes-icecc` class or nobody should.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500928
Andrew Geissler517393d2023-01-13 08:55:19 -0600929At the distribution level, you can inherit the :ref:`ref-classes-icecc` class to be
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500930sure that all builders start with the same sstate signatures. After
931inheriting the class, you can then disable the feature by setting the
Andrew Geisslerc926e172021-05-07 16:11:35 -0500932:term:`ICECC_DISABLED` variable to "1" as follows::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500933
Patrick Williams0ca19cc2021-08-16 14:03:13 -0500934 INHERIT_DISTRO:append = " icecc"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500935 ICECC_DISABLED ??= "1"
936
937This practice
938makes sure everyone is using the same signatures but also requires
939individuals that do want to use Icecream to enable the feature
Andrew Geisslerc926e172021-05-07 16:11:35 -0500940individually as follows in your ``local.conf`` file::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500941
942 ICECC_DISABLED = ""
943
944.. _ref-classes-image:
945
Andrew Geissler517393d2023-01-13 08:55:19 -0600946``image``
947=========
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500948
Andrew Geissler517393d2023-01-13 08:55:19 -0600949The :ref:`ref-classes-image` class helps support creating images in different formats.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500950First, the root filesystem is created from packages using one of the
951``rootfs*.bbclass`` files (depending on the package format used) and
952then one or more image files are created.
953
Andrew Geissler09036742021-06-25 14:25:14 -0500954- The :term:`IMAGE_FSTYPES` variable controls the types of images to
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500955 generate.
956
Andrew Geissler09036742021-06-25 14:25:14 -0500957- The :term:`IMAGE_INSTALL` variable controls the list of packages to
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500958 install into the image.
959
960For information on customizing images, see the
Andrew Geissler517393d2023-01-13 08:55:19 -0600961":ref:`dev-manual/customizing-images:customizing images`" section
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500962in the Yocto Project Development Tasks Manual. For information on how
963images are created, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600964":ref:`overview-manual/concepts:images`" section in the
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600965Yocto Project Overview and Concepts Manual.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500966
967.. _ref-classes-image-buildinfo:
968
Andrew Geissler517393d2023-01-13 08:55:19 -0600969``image-buildinfo``
970===================
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500971
Andrew Geissler517393d2023-01-13 08:55:19 -0600972The :ref:`ref-classes-image-buildinfo` class writes a plain text file containing
Patrick Williams975a06f2022-10-21 14:42:47 -0500973build information to the target filesystem at ``${sysconfdir}/buildinfo``
Patrick Williams7784c422022-11-17 07:29:11 -0600974by default (as specified by :term:`IMAGE_BUILDINFO_FILE`).
Patrick Williams975a06f2022-10-21 14:42:47 -0500975This can be useful for manually determining the origin of any given
976image. It writes out two sections:
977
Andrew Geissler517393d2023-01-13 08:55:19 -0600978#. `Build Configuration`: a list of variables and their values (specified
Patrick Williams975a06f2022-10-21 14:42:47 -0500979 by :term:`IMAGE_BUILDINFO_VARS`, which defaults to :term:`DISTRO` and
980 :term:`DISTRO_VERSION`)
981
Andrew Geissler517393d2023-01-13 08:55:19 -0600982#. `Layer Revisions`: the revisions of all of the layers used in the
Patrick Williams975a06f2022-10-21 14:42:47 -0500983 build.
984
985Additionally, when building an SDK it will write the same contents
986to ``/buildinfo`` by default (as specified by
987:term:`SDK_BUILDINFO_FILE`).
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500988
989.. _ref-classes-image_types:
990
Andrew Geissler517393d2023-01-13 08:55:19 -0600991``image_types``
992===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500993
Andrew Geissler517393d2023-01-13 08:55:19 -0600994The :ref:`ref-classes-image_types` class defines all of the standard image output types
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500995that you can enable through the
996:term:`IMAGE_FSTYPES` variable. You can use this
997class as a reference on how to add support for custom image output
998types.
999
Andrew Geissler517393d2023-01-13 08:55:19 -06001000By default, the :ref:`ref-classes-image` class automatically
1001enables the :ref:`ref-classes-image_types` class. The :ref:`ref-classes-image` class uses the
Andrew Geisslerc926e172021-05-07 16:11:35 -05001002``IMGCLASSES`` variable as follows::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001003
1004 IMGCLASSES = "rootfs_${IMAGE_PKGTYPE} image_types ${IMAGE_CLASSES}"
1005 IMGCLASSES += "${@['populate_sdk_base', 'populate_sdk_ext']['linux' in d.getVar("SDK_OS")]}"
1006 IMGCLASSES += "${@bb.utils.contains_any('IMAGE_FSTYPES', 'live iso hddimg', 'image-live', '', d)}"
1007 IMGCLASSES += "${@bb.utils.contains('IMAGE_FSTYPES', 'container', 'image-container', '', d)}"
1008 IMGCLASSES += "image_types_wic"
1009 IMGCLASSES += "rootfs-postcommands"
1010 IMGCLASSES += "image-postinst-intercepts"
1011 inherit ${IMGCLASSES}
1012
Andrew Geissler517393d2023-01-13 08:55:19 -06001013The :ref:`ref-classes-image_types` class also handles conversion and compression of images.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001014
1015.. note::
1016
1017 To build a VMware VMDK image, you need to add "wic.vmdk" to
Andrew Geissler09036742021-06-25 14:25:14 -05001018 :term:`IMAGE_FSTYPES`. This would also be similar for Virtual Box Virtual Disk
Andrew Geissler4c19ea12020-10-27 13:52:24 -05001019 Image ("vdi") and QEMU Copy On Write Version 2 ("qcow2") images.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001020
1021.. _ref-classes-image-live:
1022
Andrew Geissler517393d2023-01-13 08:55:19 -06001023``image-live``
1024==============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001025
1026This class controls building "live" (i.e. HDDIMG and ISO) images. Live
1027images contain syslinux for legacy booting, as well as the bootloader
1028specified by :term:`EFI_PROVIDER` if
1029:term:`MACHINE_FEATURES` contains "efi".
1030
1031Normally, you do not use this class directly. Instead, you add "live" to
1032:term:`IMAGE_FSTYPES`.
1033
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001034.. _ref-classes-insane:
1035
Andrew Geissler517393d2023-01-13 08:55:19 -06001036``insane``
1037==========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001038
Andrew Geissler517393d2023-01-13 08:55:19 -06001039The :ref:`ref-classes-insane` class adds a step to the package generation process so
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001040that output quality assurance checks are generated by the OpenEmbedded
1041build system. A range of checks are performed that check the build's
1042output for common problems that show up during runtime. Distribution
1043policy usually dictates whether to include this class.
1044
1045You can configure the sanity checks so that specific test failures
1046either raise a warning or an error message. Typically, failures for new
1047tests generate a warning. Subsequent failures for the same test would
1048then generate an error message once the metadata is in a known and good
Andrew Geissler09209ee2020-12-13 08:44:15 -06001049condition. See the ":doc:`/ref-manual/qa-checks`" Chapter for a list of all the warning
Andrew Geissler4c19ea12020-10-27 13:52:24 -05001050and error messages you might encounter using a default configuration.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001051
1052Use the :term:`WARN_QA` and
1053:term:`ERROR_QA` variables to control the behavior of
1054these checks at the global level (i.e. in your custom distro
1055configuration). However, to skip one or more checks in recipes, you
1056should use :term:`INSANE_SKIP`. For example, to skip
1057the check for symbolic link ``.so`` files in the main package of a
1058recipe, add the following to the recipe. You need to realize that the
Andrew Geisslerc926e172021-05-07 16:11:35 -05001059package name override, in this example ``${PN}``, must be used::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001060
Patrick Williams0ca19cc2021-08-16 14:03:13 -05001061 INSANE_SKIP:${PN} += "dev-so"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001062
1063Please keep in mind that the QA checks
William A. Kennington IIIac69b482021-06-02 12:28:27 -07001064are meant to detect real or potential problems in the packaged
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001065output. So exercise caution when disabling these checks.
1066
Andrew Geissler09036742021-06-25 14:25:14 -05001067Here are the tests you can list with the :term:`WARN_QA` and
Andrew Geissler5f350902021-07-23 13:09:54 -04001068:term:`ERROR_QA` variables:
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001069
1070- ``already-stripped:`` Checks that produced binaries have not
1071 already been stripped prior to the build system extracting debug
1072 symbols. It is common for upstream software projects to default to
1073 stripping debug symbols for output binaries. In order for debugging
1074 to work on the target using ``-dbg`` packages, this stripping must be
1075 disabled.
1076
1077- ``arch:`` Checks the Executable and Linkable Format (ELF) type, bit
1078 size, and endianness of any binaries to ensure they match the target
1079 architecture. This test fails if any binaries do not match the type
1080 since there would be an incompatibility. The test could indicate that
1081 the wrong compiler or compiler options have been used. Sometimes
1082 software, like bootloaders, might need to bypass this check.
1083
1084- ``buildpaths:`` Checks for paths to locations on the build host
Patrick Williams975a06f2022-10-21 14:42:47 -05001085 inside the output files. Not only can these leak information about
1086 the build environment, they also hinder binary reproducibility.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001087
1088- ``build-deps:`` Determines if a build-time dependency that is
1089 specified through :term:`DEPENDS`, explicit
1090 :term:`RDEPENDS`, or task-level dependencies exists
1091 to match any runtime dependency. This determination is particularly
1092 useful to discover where runtime dependencies are detected and added
1093 during packaging. If no explicit dependency has been specified within
1094 the metadata, at the packaging stage it is too late to ensure that
1095 the dependency is built, and thus you can end up with an error when
1096 the package is installed into the image during the
1097 :ref:`ref-tasks-rootfs` task because the auto-detected
1098 dependency was not satisfied. An example of this would be where the
Andrew Geissler517393d2023-01-13 08:55:19 -06001099 :ref:`ref-classes-update-rc.d` class automatically
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001100 adds a dependency on the ``initscripts-functions`` package to
1101 packages that install an initscript that refers to
1102 ``/etc/init.d/functions``. The recipe should really have an explicit
Andrew Geissler5f350902021-07-23 13:09:54 -04001103 :term:`RDEPENDS` for the package in question on ``initscripts-functions``
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001104 so that the OpenEmbedded build system is able to ensure that the
1105 ``initscripts`` recipe is actually built and thus the
1106 ``initscripts-functions`` package is made available.
1107
1108- ``compile-host-path:`` Checks the
1109 :ref:`ref-tasks-compile` log for indications that
1110 paths to locations on the build host were used. Using such paths
1111 might result in host contamination of the build output.
1112
1113- ``debug-deps:`` Checks that all packages except ``-dbg`` packages
1114 do not depend on ``-dbg`` packages, which would cause a packaging
1115 bug.
1116
1117- ``debug-files:`` Checks for ``.debug`` directories in anything but
1118 the ``-dbg`` package. The debug files should all be in the ``-dbg``
1119 package. Thus, anything packaged elsewhere is incorrect packaging.
1120
1121- ``dep-cmp:`` Checks for invalid version comparison statements in
1122 runtime dependency relationships between packages (i.e. in
1123 :term:`RDEPENDS`,
1124 :term:`RRECOMMENDS`,
1125 :term:`RSUGGESTS`,
1126 :term:`RPROVIDES`,
1127 :term:`RREPLACES`, and
1128 :term:`RCONFLICTS` variable values). Any invalid
1129 comparisons might trigger failures or undesirable behavior when
1130 passed to the package manager.
1131
1132- ``desktop:`` Runs the ``desktop-file-validate`` program against any
1133 ``.desktop`` files to validate their contents against the
1134 specification for ``.desktop`` files.
1135
1136- ``dev-deps:`` Checks that all packages except ``-dev`` or
1137 ``-staticdev`` packages do not depend on ``-dev`` packages, which
1138 would be a packaging bug.
1139
1140- ``dev-so:`` Checks that the ``.so`` symbolic links are in the
1141 ``-dev`` package and not in any of the other packages. In general,
1142 these symlinks are only useful for development purposes. Thus, the
William A. Kennington IIIac69b482021-06-02 12:28:27 -07001143 ``-dev`` package is the correct location for them. In very rare
1144 cases, such as dynamically loaded modules, these symlinks
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001145 are needed instead in the main package.
1146
Patrick Williams03907ee2022-05-01 06:28:52 -05001147- ``empty-dirs:`` Checks that packages are not installing files to
1148 directories that are normally expected to be empty (such as ``/tmp``)
1149 The list of directories that are checked is specified by the
1150 :term:`QA_EMPTY_DIRS` variable.
1151
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001152- ``file-rdeps:`` Checks that file-level dependencies identified by
1153 the OpenEmbedded build system at packaging time are satisfied. For
1154 example, a shell script might start with the line ``#!/bin/bash``.
1155 This line would translate to a file dependency on ``/bin/bash``. Of
1156 the three package managers that the OpenEmbedded build system
1157 supports, only RPM directly handles file-level dependencies,
1158 resolving them automatically to packages providing the files.
1159 However, the lack of that functionality in the other two package
1160 managers does not mean the dependencies do not still need resolving.
1161 This QA check attempts to ensure that explicitly declared
1162 :term:`RDEPENDS` exist to handle any file-level
1163 dependency detected in packaged files.
1164
1165- ``files-invalid:`` Checks for :term:`FILES` variable
1166 values that contain "//", which is invalid.
1167
1168- ``host-user-contaminated:`` Checks that no package produced by the
1169 recipe contains any files outside of ``/home`` with a user or group
1170 ID that matches the user running BitBake. A match usually indicates
1171 that the files are being installed with an incorrect UID/GID, since
1172 target IDs are independent from host IDs. For additional information,
1173 see the section describing the
1174 :ref:`ref-tasks-install` task.
1175
1176- ``incompatible-license:`` Report when packages are excluded from
1177 being created due to being marked with a license that is in
1178 :term:`INCOMPATIBLE_LICENSE`.
1179
1180- ``install-host-path:`` Checks the
1181 :ref:`ref-tasks-install` log for indications that
1182 paths to locations on the build host were used. Using such paths
1183 might result in host contamination of the build output.
1184
1185- ``installed-vs-shipped:`` Reports when files have been installed
Patrick Williams2194f502022-10-16 14:26:09 -05001186 within :ref:`ref-tasks-install` but have not been included in any package by
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001187 way of the :term:`FILES` variable. Files that do not
1188 appear in any package cannot be present in an image later on in the
1189 build process. Ideally, all installed files should be packaged or not
1190 installed at all. These files can be deleted at the end of
Patrick Williams2194f502022-10-16 14:26:09 -05001191 :ref:`ref-tasks-install` if the files are not needed in any package.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001192
1193- ``invalid-chars:`` Checks that the recipe metadata variables
1194 :term:`DESCRIPTION`,
1195 :term:`SUMMARY`, :term:`LICENSE`, and
1196 :term:`SECTION` do not contain non-UTF-8 characters.
1197 Some package managers do not support such characters.
1198
1199- ``invalid-packageconfig:`` Checks that no undefined features are
1200 being added to :term:`PACKAGECONFIG`. For
Andrew Geisslerc926e172021-05-07 16:11:35 -05001201 example, any name "foo" for which the following form does not exist::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001202
1203 PACKAGECONFIG[foo] = "..."
1204
Andrew Geissler09036742021-06-25 14:25:14 -05001205- ``la:`` Checks ``.la`` files for any :term:`TMPDIR` paths. Any ``.la``
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001206 file containing these paths is incorrect since ``libtool`` adds the
1207 correct sysroot prefix when using the files automatically itself.
1208
1209- ``ldflags:`` Ensures that the binaries were linked with the
1210 :term:`LDFLAGS` options provided by the build system.
Andrew Geissler09036742021-06-25 14:25:14 -05001211 If this test fails, check that the :term:`LDFLAGS` variable is being
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001212 passed to the linker command.
1213
1214- ``libdir:`` Checks for libraries being installed into incorrect
1215 (possibly hardcoded) installation paths. For example, this test will
1216 catch recipes that install ``/lib/bar.so`` when ``${base_libdir}`` is
1217 "lib32". Another example is when recipes install
1218 ``/usr/lib64/foo.so`` when ``${libdir}`` is "/usr/lib".
1219
1220- ``libexec:`` Checks if a package contains files in
1221 ``/usr/libexec``. This check is not performed if the ``libexecdir``
1222 variable has been set explicitly to ``/usr/libexec``.
1223
1224- ``packages-list:`` Checks for the same package being listed
1225 multiple times through the :term:`PACKAGES` variable
1226 value. Installing the package in this manner can cause errors during
1227 packaging.
1228
1229- ``perm-config:`` Reports lines in ``fs-perms.txt`` that have an
1230 invalid format.
1231
1232- ``perm-line:`` Reports lines in ``fs-perms.txt`` that have an
1233 invalid format.
1234
1235- ``perm-link:`` Reports lines in ``fs-perms.txt`` that specify
1236 'link' where the specified target already exists.
1237
1238- ``perms:`` Currently, this check is unused but reserved.
1239
1240- ``pkgconfig:`` Checks ``.pc`` files for any
1241 :term:`TMPDIR`/:term:`WORKDIR` paths.
1242 Any ``.pc`` file containing these paths is incorrect since
1243 ``pkg-config`` itself adds the correct sysroot prefix when the files
1244 are accessed.
1245
1246- ``pkgname:`` Checks that all packages in
1247 :term:`PACKAGES` have names that do not contain
1248 invalid characters (i.e. characters other than 0-9, a-z, ., +, and
1249 -).
1250
Andrew Geissler09036742021-06-25 14:25:14 -05001251- ``pkgv-undefined:`` Checks to see if the :term:`PKGV` variable is
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001252 undefined during :ref:`ref-tasks-package`.
1253
1254- ``pkgvarcheck:`` Checks through the variables
1255 :term:`RDEPENDS`,
1256 :term:`RRECOMMENDS`,
1257 :term:`RSUGGESTS`,
1258 :term:`RCONFLICTS`,
1259 :term:`RPROVIDES`,
1260 :term:`RREPLACES`, :term:`FILES`,
1261 :term:`ALLOW_EMPTY`, ``pkg_preinst``,
1262 ``pkg_postinst``, ``pkg_prerm`` and ``pkg_postrm``, and reports if
1263 there are variable sets that are not package-specific. Using these
1264 variables without a package suffix is bad practice, and might
1265 unnecessarily complicate dependencies of other packages within the
1266 same recipe or have other unintended consequences.
1267
1268- ``pn-overrides:`` Checks that a recipe does not have a name
1269 (:term:`PN`) value that appears in
1270 :term:`OVERRIDES`. If a recipe is named such that
Andrew Geissler09036742021-06-25 14:25:14 -05001271 its :term:`PN` value matches something already in :term:`OVERRIDES` (e.g.
1272 :term:`PN` happens to be the same as :term:`MACHINE` or
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001273 :term:`DISTRO`), it can have unexpected consequences.
Patrick Williams0ca19cc2021-08-16 14:03:13 -05001274 For example, assignments such as ``FILES:${PN} = "xyz"`` effectively
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001275 turn into ``FILES = "xyz"``.
1276
1277- ``rpaths:`` Checks for rpaths in the binaries that contain build
Andrew Geissler5f350902021-07-23 13:09:54 -04001278 system paths such as :term:`TMPDIR`. If this test fails, bad ``-rpath``
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001279 options are being passed to the linker commands and your binaries
1280 have potential security issues.
1281
1282- ``split-strip:`` Reports that splitting or stripping debug symbols
1283 from binaries has failed.
1284
1285- ``staticdev:`` Checks for static library files (``*.a``) in
1286 non-``staticdev`` packages.
1287
1288- ``symlink-to-sysroot:`` Checks for symlinks in packages that point
1289 into :term:`TMPDIR` on the host. Such symlinks will
1290 work on the host, but are clearly invalid when running on the target.
1291
1292- ``textrel:`` Checks for ELF binaries that contain relocations in
1293 their ``.text`` sections, which can result in a performance impact at
Andrew Geissler4c19ea12020-10-27 13:52:24 -05001294 runtime. See the explanation for the ``ELF binary`` message in
Andrew Geissler09209ee2020-12-13 08:44:15 -06001295 ":doc:`/ref-manual/qa-checks`" for more information regarding runtime performance
Andrew Geissler4c19ea12020-10-27 13:52:24 -05001296 issues.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001297
1298- ``unlisted-pkg-lics:`` Checks that all declared licenses applying
1299 for a package are also declared on the recipe level (i.e. any license
Patrick Williams0ca19cc2021-08-16 14:03:13 -05001300 in ``LICENSE:*`` should appear in :term:`LICENSE`).
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001301
1302- ``useless-rpaths:`` Checks for dynamic library load paths (rpaths)
1303 in the binaries that by default on a standard system are searched by
1304 the linker (e.g. ``/lib`` and ``/usr/lib``). While these paths will
1305 not cause any breakage, they do waste space and are unnecessary.
1306
1307- ``var-undefined:`` Reports when variables fundamental to packaging
1308 (i.e. :term:`WORKDIR`,
1309 :term:`DEPLOY_DIR`, :term:`D`,
1310 :term:`PN`, and :term:`PKGD`) are undefined
1311 during :ref:`ref-tasks-package`.
1312
1313- ``version-going-backwards:`` If Build History is enabled, reports
1314 when a package being written out has a lower version than the
1315 previously written package under the same name. If you are placing
1316 output packages into a feed and upgrading packages on a target system
1317 using that feed, the version of a package going backwards can result
1318 in the target system not correctly upgrading to the "new" version of
1319 the package.
1320
1321 .. note::
1322
William A. Kennington IIIac69b482021-06-02 12:28:27 -07001323 This is only relevant when you are using runtime package management
1324 on your target system.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001325
1326- ``xorg-driver-abi:`` Checks that all packages containing Xorg
1327 drivers have ABI dependencies. The ``xserver-xorg`` recipe provides
1328 driver ABI names. All drivers should depend on the ABI versions that
1329 they have been built against. Driver recipes that include
1330 ``xorg-driver-input.inc`` or ``xorg-driver-video.inc`` will
1331 automatically get these versions. Consequently, you should only need
1332 to explicitly add dependencies to binary driver recipes.
1333
1334.. _ref-classes-insserv:
1335
Andrew Geissler517393d2023-01-13 08:55:19 -06001336``insserv``
1337===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001338
Andrew Geissler517393d2023-01-13 08:55:19 -06001339The :ref:`ref-classes-insserv` class uses the ``insserv`` utility to update the order
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001340of symbolic links in ``/etc/rc?.d/`` within an image based on
1341dependencies specified by LSB headers in the ``init.d`` scripts
1342themselves.
1343
1344.. _ref-classes-kernel:
1345
Andrew Geissler517393d2023-01-13 08:55:19 -06001346``kernel``
1347==========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001348
Andrew Geissler517393d2023-01-13 08:55:19 -06001349The :ref:`ref-classes-kernel` class handles building Linux kernels. The class contains
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001350code to build all kernel trees. All needed headers are staged into the
Andrew Geissler5f350902021-07-23 13:09:54 -04001351:term:`STAGING_KERNEL_DIR` directory to allow out-of-tree module builds
Andrew Geissler517393d2023-01-13 08:55:19 -06001352using the :ref:`ref-classes-module` class.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001353
1354This means that each built kernel module is packaged separately and
1355inter-module dependencies are created by parsing the ``modinfo`` output.
1356If all modules are required, then installing the ``kernel-modules``
1357package installs all packages with modules and various other kernel
1358packages such as ``kernel-vmlinux``.
1359
Andrew Geissler517393d2023-01-13 08:55:19 -06001360The :ref:`ref-classes-kernel` class contains logic that allows you to embed an initial
Patrick Williams2194f502022-10-16 14:26:09 -05001361RAM filesystem (:term:`Initramfs`) image when you build the kernel image. For
1362information on how to build an :term:`Initramfs`, see the
Andrew Geissler517393d2023-01-13 08:55:19 -06001363":ref:`dev-manual/building:building an initial ram filesystem (Initramfs) image`" section in
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001364the Yocto Project Development Tasks Manual.
1365
Andrew Geissler517393d2023-01-13 08:55:19 -06001366Various other classes are used by the :ref:`ref-classes-kernel` and :ref:`ref-classes-module` classes
1367internally including the :ref:`ref-classes-kernel-arch`, :ref:`ref-classes-module-base`, and
1368:ref:`ref-classes-linux-kernel-base` classes.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001369
1370.. _ref-classes-kernel-arch:
1371
Andrew Geissler517393d2023-01-13 08:55:19 -06001372``kernel-arch``
1373===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001374
Andrew Geissler517393d2023-01-13 08:55:19 -06001375The :ref:`ref-classes-kernel-arch` class sets the ``ARCH`` environment variable for
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001376Linux kernel compilation (including modules).
1377
1378.. _ref-classes-kernel-devicetree:
1379
Andrew Geissler517393d2023-01-13 08:55:19 -06001380``kernel-devicetree``
1381=====================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001382
Andrew Geissler517393d2023-01-13 08:55:19 -06001383The :ref:`ref-classes-kernel-devicetree` class, which is inherited by the
1384:ref:`ref-classes-kernel` class, supports device tree generation.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001385
1386.. _ref-classes-kernel-fitimage:
1387
Andrew Geissler517393d2023-01-13 08:55:19 -06001388``kernel-fitimage``
1389===================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001390
Andrew Geissler517393d2023-01-13 08:55:19 -06001391The :ref:`ref-classes-kernel-fitimage` class provides support to pack a kernel image,
1392device trees, a U-boot script, a :term:`Initramfs` bundle and a RAM disk
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001393into a single FIT image. In theory, a FIT image can support any number
Andrew Geissler517393d2023-01-13 08:55:19 -06001394of kernels, U-boot scripts, :term:`Initramfs` bundles, RAM disks and device-trees.
1395However, :ref:`ref-classes-kernel-fitimage` currently only supports
Patrick Williams975a06f2022-10-21 14:42:47 -05001396limited usecases: just one kernel image, an optional U-boot script,
Andrew Geissler517393d2023-01-13 08:55:19 -06001397an optional :term:`Initramfs` bundle, an optional RAM disk, and any number of
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001398device tree.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001399
1400To create a FIT image, it is required that :term:`KERNEL_CLASSES`
Andrew Geissler517393d2023-01-13 08:55:19 -06001401is set to include ":ref:`ref-classes-kernel-fitimage`" and :term:`KERNEL_IMAGETYPE`
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001402is set to "fitImage".
1403
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001404The options for the device tree compiler passed to ``mkimage -D``
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001405when creating the FIT image are specified using the
1406:term:`UBOOT_MKIMAGE_DTCOPTS` variable.
1407
1408Only a single kernel can be added to the FIT image created by
Andrew Geissler517393d2023-01-13 08:55:19 -06001409:ref:`ref-classes-kernel-fitimage` and the kernel image in FIT is mandatory. The
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001410address where the kernel image is to be loaded by U-Boot is
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001411specified by :term:`UBOOT_LOADADDRESS` and the entrypoint by
1412:term:`UBOOT_ENTRYPOINT`.
1413
1414Multiple device trees can be added to the FIT image created by
Andrew Geissler517393d2023-01-13 08:55:19 -06001415:ref:`ref-classes-kernel-fitimage` and the device tree is optional.
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001416The address where the device tree is to be loaded by U-Boot is
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001417specified by :term:`UBOOT_DTBO_LOADADDRESS` for device tree overlays
Andrew Geissler4c19ea12020-10-27 13:52:24 -05001418and by :term:`UBOOT_DTB_LOADADDRESS` for device tree binaries.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001419
1420Only a single RAM disk can be added to the FIT image created by
Andrew Geissler517393d2023-01-13 08:55:19 -06001421:ref:`ref-classes-kernel-fitimage` and the RAM disk in FIT is optional.
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001422The address where the RAM disk image is to be loaded by U-Boot
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001423is specified by :term:`UBOOT_RD_LOADADDRESS` and the entrypoint by
1424:term:`UBOOT_RD_ENTRYPOINT`. The ramdisk is added to FIT image when
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001425:term:`INITRAMFS_IMAGE` is specified and that :term:`INITRAMFS_IMAGE_BUNDLE`
1426is set to 0.
1427
Andrew Geissler517393d2023-01-13 08:55:19 -06001428Only a single :term:`Initramfs` bundle can be added to the FIT image created by
1429:ref:`ref-classes-kernel-fitimage` and the :term:`Initramfs` bundle in FIT is optional.
1430In case of :term:`Initramfs`, the kernel is configured to be bundled with the root filesystem
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001431in the same binary (example: zImage-initramfs-:term:`MACHINE`.bin).
Andrew Geissler517393d2023-01-13 08:55:19 -06001432When the kernel is copied to RAM and executed, it unpacks the :term:`Initramfs` root filesystem.
1433The :term:`Initramfs` bundle can be enabled when :term:`INITRAMFS_IMAGE`
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001434is specified and that :term:`INITRAMFS_IMAGE_BUNDLE` is set to 1.
Andrew Geissler517393d2023-01-13 08:55:19 -06001435The address where the :term:`Initramfs` bundle is to be loaded by U-boot is specified
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001436by :term:`UBOOT_LOADADDRESS` and the entrypoint by :term:`UBOOT_ENTRYPOINT`.
1437
1438Only a single U-boot boot script can be added to the FIT image created by
Andrew Geissler517393d2023-01-13 08:55:19 -06001439:ref:`ref-classes-kernel-fitimage` and the boot script is optional.
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001440The boot script is specified in the ITS file as a text file containing
1441U-boot commands. When using a boot script the user should configure the
Patrick Williams2194f502022-10-16 14:26:09 -05001442U-boot :ref:`ref-tasks-install` task to copy the script to sysroot.
Andrew Geissler517393d2023-01-13 08:55:19 -06001443So the script can be included in the FIT image by the :ref:`ref-classes-kernel-fitimage`
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001444class. At run-time, U-boot CONFIG_BOOTCOMMAND define can be configured to
1445load the boot script from the FIT image and executes it.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001446
Andrew Geissler517393d2023-01-13 08:55:19 -06001447The FIT image generated by :ref:`ref-classes-kernel-fitimage` class is signed when the
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001448variables :term:`UBOOT_SIGN_ENABLE`, :term:`UBOOT_MKIMAGE_DTCOPTS`,
1449:term:`UBOOT_SIGN_KEYDIR` and :term:`UBOOT_SIGN_KEYNAME` are set
1450appropriately. The default values used for :term:`FIT_HASH_ALG` and
Andrew Geissler517393d2023-01-13 08:55:19 -06001451:term:`FIT_SIGN_ALG` in :ref:`ref-classes-kernel-fitimage` are "sha256" and
Andrew Geisslerc3d88e42020-10-02 09:45:00 -05001452"rsa2048" respectively. The keys for signing fitImage can be generated using
Andrew Geissler517393d2023-01-13 08:55:19 -06001453the :ref:`ref-classes-kernel-fitimage` class when both :term:`FIT_GENERATE_KEYS` and
Andrew Geisslerc3d88e42020-10-02 09:45:00 -05001454:term:`UBOOT_SIGN_ENABLE` are set to "1".
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001455
1456
1457.. _ref-classes-kernel-grub:
1458
Andrew Geissler517393d2023-01-13 08:55:19 -06001459``kernel-grub``
1460===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001461
Andrew Geissler517393d2023-01-13 08:55:19 -06001462The :ref:`ref-classes-kernel-grub` class updates the boot area and the boot menu with
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001463the kernel as the priority boot mechanism while installing a RPM to
1464update the kernel on a deployed target.
1465
1466.. _ref-classes-kernel-module-split:
1467
Andrew Geissler517393d2023-01-13 08:55:19 -06001468``kernel-module-split``
1469=======================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001470
Andrew Geissler517393d2023-01-13 08:55:19 -06001471The :ref:`ref-classes-kernel-module-split` class provides common functionality for
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001472splitting Linux kernel modules into separate packages.
1473
1474.. _ref-classes-kernel-uboot:
1475
Andrew Geissler517393d2023-01-13 08:55:19 -06001476``kernel-uboot``
1477================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001478
Andrew Geissler517393d2023-01-13 08:55:19 -06001479The :ref:`ref-classes-kernel-uboot` class provides support for building from
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001480vmlinux-style kernel sources.
1481
1482.. _ref-classes-kernel-uimage:
1483
Andrew Geissler517393d2023-01-13 08:55:19 -06001484``kernel-uimage``
1485=================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001486
Andrew Geissler517393d2023-01-13 08:55:19 -06001487The :ref:`ref-classes-kernel-uimage` class provides support to pack uImage.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001488
1489.. _ref-classes-kernel-yocto:
1490
Andrew Geissler517393d2023-01-13 08:55:19 -06001491``kernel-yocto``
1492================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001493
Andrew Geissler517393d2023-01-13 08:55:19 -06001494The :ref:`ref-classes-kernel-yocto` class provides common functionality for building
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001495from linux-yocto style kernel source repositories.
1496
1497.. _ref-classes-kernelsrc:
1498
Andrew Geissler517393d2023-01-13 08:55:19 -06001499``kernelsrc``
1500=============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001501
Andrew Geissler517393d2023-01-13 08:55:19 -06001502The :ref:`ref-classes-kernelsrc` class sets the Linux kernel source and version.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001503
1504.. _ref-classes-lib_package:
1505
Andrew Geissler517393d2023-01-13 08:55:19 -06001506``lib_package``
1507===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001508
Andrew Geissler517393d2023-01-13 08:55:19 -06001509The :ref:`ref-classes-lib_package` class supports recipes that build libraries and
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001510produce executable binaries, where those binaries should not be
1511installed by default along with the library. Instead, the binaries are
1512added to a separate ``${``\ :term:`PN`\ ``}-bin`` package to
1513make their installation optional.
1514
1515.. _ref-classes-libc*:
1516
Andrew Geissler517393d2023-01-13 08:55:19 -06001517``libc*``
1518=========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001519
Andrew Geissler517393d2023-01-13 08:55:19 -06001520The :ref:`ref-classes-libc*` classes support recipes that build packages with ``libc``:
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001521
Patrick Williams2390b1b2022-11-03 13:47:49 -05001522- The :ref:`libc-common <ref-classes-libc*>` class provides common support for building with
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001523 ``libc``.
1524
Patrick Williams2390b1b2022-11-03 13:47:49 -05001525- The :ref:`libc-package <ref-classes-libc*>` class supports packaging up ``glibc`` and
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001526 ``eglibc``.
1527
1528.. _ref-classes-license:
1529
Andrew Geissler517393d2023-01-13 08:55:19 -06001530``license``
1531===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001532
Andrew Geissler517393d2023-01-13 08:55:19 -06001533The :ref:`ref-classes-license` class provides license manifest creation and license
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001534exclusion. This class is enabled by default using the default value for
1535the :term:`INHERIT_DISTRO` variable.
1536
1537.. _ref-classes-linux-kernel-base:
1538
Andrew Geissler517393d2023-01-13 08:55:19 -06001539``linux-kernel-base``
1540=====================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001541
Andrew Geissler517393d2023-01-13 08:55:19 -06001542The :ref:`ref-classes-linux-kernel-base` class provides common functionality for
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001543recipes that build out of the Linux kernel source tree. These builds
1544goes beyond the kernel itself. For example, the Perf recipe also
1545inherits this class.
1546
1547.. _ref-classes-linuxloader:
1548
Andrew Geissler517393d2023-01-13 08:55:19 -06001549``linuxloader``
1550===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001551
1552Provides the function ``linuxloader()``, which gives the value of the
1553dynamic loader/linker provided on the platform. This value is used by a
1554number of other classes.
1555
1556.. _ref-classes-logging:
1557
Andrew Geissler517393d2023-01-13 08:55:19 -06001558``logging``
1559===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001560
Andrew Geissler517393d2023-01-13 08:55:19 -06001561The :ref:`ref-classes-logging` class provides the standard shell functions used to log
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001562messages for various BitBake severity levels (i.e. ``bbplain``,
1563``bbnote``, ``bbwarn``, ``bberror``, ``bbfatal``, and ``bbdebug``).
1564
Andrew Geissler517393d2023-01-13 08:55:19 -06001565This class is enabled by default since it is inherited by the :ref:`ref-classes-base`
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001566class.
1567
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001568.. _ref-classes-metadata_scm:
1569
Andrew Geissler517393d2023-01-13 08:55:19 -06001570``metadata_scm``
1571================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001572
Andrew Geissler517393d2023-01-13 08:55:19 -06001573The :ref:`ref-classes-metadata_scm` class provides functionality for querying the
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001574branch and revision of a Source Code Manager (SCM) repository.
1575
Andrew Geissler517393d2023-01-13 08:55:19 -06001576The :ref:`ref-classes-base` class uses this class to print the revisions of
1577each layer before starting every build. The :ref:`ref-classes-metadata_scm`
1578class is enabled by default because it is inherited by the
1579:ref:`ref-classes-base` class.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001580
1581.. _ref-classes-migrate_localcount:
1582
Andrew Geissler517393d2023-01-13 08:55:19 -06001583``migrate_localcount``
1584======================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001585
Andrew Geissler517393d2023-01-13 08:55:19 -06001586The :ref:`ref-classes-migrate_localcount` class verifies a recipe's localcount data and
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001587increments it appropriately.
1588
1589.. _ref-classes-mime:
1590
Andrew Geissler517393d2023-01-13 08:55:19 -06001591``mime``
1592========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001593
Andrew Geissler517393d2023-01-13 08:55:19 -06001594The :ref:`ref-classes-mime` class generates the proper post-install and post-remove
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001595(postinst/postrm) scriptlets for packages that install MIME type files.
1596These scriptlets call ``update-mime-database`` to add the MIME types to
1597the shared database.
1598
Patrick Williams7784c422022-11-17 07:29:11 -06001599.. _ref-classes-mime-xdg:
1600
Andrew Geissler517393d2023-01-13 08:55:19 -06001601``mime-xdg``
1602============
Patrick Williams7784c422022-11-17 07:29:11 -06001603
Andrew Geissler517393d2023-01-13 08:55:19 -06001604The :ref:`ref-classes-mime-xdg` class generates the proper
Patrick Williams7784c422022-11-17 07:29:11 -06001605post-install and post-remove (postinst/postrm) scriptlets for packages
1606that install ``.desktop`` files containing ``MimeType`` entries.
1607These scriptlets call ``update-desktop-database`` to add the MIME types
1608to the database of MIME types handled by desktop files.
1609
1610Thanks to this class, when users open a file through a file browser
1611on recently created images, they don't have to choose the application
1612to open the file from the pool of all known applications, even the ones
1613that cannot open the selected file.
1614
1615If you have recipes installing their ``.desktop`` files as absolute
1616symbolic links, the detection of such files cannot be done by the current
1617implementation of this class. In this case, you have to add the corresponding
1618package names to the :term:`MIME_XDG_PACKAGES` variable.
1619
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001620.. _ref-classes-mirrors:
1621
Andrew Geissler517393d2023-01-13 08:55:19 -06001622``mirrors``
1623===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001624
Andrew Geissler517393d2023-01-13 08:55:19 -06001625The :ref:`ref-classes-mirrors` class sets up some standard
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001626:term:`MIRRORS` entries for source code mirrors. These
1627mirrors provide a fall-back path in case the upstream source specified
1628in :term:`SRC_URI` within recipes is unavailable.
1629
1630This class is enabled by default since it is inherited by the
Andrew Geissler517393d2023-01-13 08:55:19 -06001631:ref:`ref-classes-base` class.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001632
1633.. _ref-classes-module:
1634
Andrew Geissler517393d2023-01-13 08:55:19 -06001635``module``
1636==========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001637
Andrew Geissler517393d2023-01-13 08:55:19 -06001638The :ref:`ref-classes-module` class provides support for building out-of-tree Linux
1639kernel modules. The class inherits the :ref:`ref-classes-module-base` and
1640:ref:`ref-classes-kernel-module-split` classes, and implements the
1641:ref:`ref-tasks-compile` and :ref:`ref-tasks-install` tasks. The class provides
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001642everything needed to build and package a kernel module.
1643
1644For general information on out-of-tree Linux kernel modules, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -06001645":ref:`kernel-dev/common:incorporating out-of-tree modules`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001646section in the Yocto Project Linux Kernel Development Manual.
1647
1648.. _ref-classes-module-base:
1649
Andrew Geissler517393d2023-01-13 08:55:19 -06001650``module-base``
1651===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001652
Andrew Geissler517393d2023-01-13 08:55:19 -06001653The :ref:`ref-classes-module-base` class provides the base functionality for
1654building Linux kernel modules. Typically, a recipe that builds software that
1655includes one or more kernel modules and has its own means of building the module
1656inherits this class as opposed to inheriting the :ref:`ref-classes-module`
1657class.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001658
1659.. _ref-classes-multilib*:
1660
Andrew Geissler517393d2023-01-13 08:55:19 -06001661``multilib*``
1662=============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001663
Andrew Geissler517393d2023-01-13 08:55:19 -06001664The :ref:`ref-classes-multilib*` classes provide support for building libraries with
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001665different target optimizations or target architectures and installing
1666them side-by-side in the same image.
1667
1668For more information on using the Multilib feature, see the
Andrew Geissler517393d2023-01-13 08:55:19 -06001669":ref:`dev-manual/libraries:combining multiple versions of library files into one image`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001670section in the Yocto Project Development Tasks Manual.
1671
1672.. _ref-classes-native:
1673
Andrew Geissler517393d2023-01-13 08:55:19 -06001674``native``
1675==========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001676
Andrew Geissler517393d2023-01-13 08:55:19 -06001677The :ref:`ref-classes-native` class provides common functionality for recipes that
Andrew Geissler4c19ea12020-10-27 13:52:24 -05001678build tools to run on the :term:`Build Host` (i.e. tools that use the compiler
1679or other tools from the build host).
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001680
1681You can create a recipe that builds tools that run natively on the host
1682a couple different ways:
1683
Andrew Geissler517393d2023-01-13 08:55:19 -06001684- Create a ``myrecipe-native.bb`` recipe that inherits the :ref:`ref-classes-native`
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001685 class. If you use this method, you must order the inherit statement
1686 in the recipe after all other inherit statements so that the
Andrew Geissler517393d2023-01-13 08:55:19 -06001687 :ref:`ref-classes-native` class is inherited last.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001688
1689 .. note::
1690
1691 When creating a recipe this way, the recipe name must follow this
Andrew Geisslerc926e172021-05-07 16:11:35 -05001692 naming convention::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001693
1694 myrecipe-native.bb
1695
1696
1697 Not using this naming convention can lead to subtle problems
1698 caused by existing code that depends on that naming convention.
1699
Andrew Geisslerc926e172021-05-07 16:11:35 -05001700- Create or modify a target recipe that contains the following::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001701
1702 BBCLASSEXTEND = "native"
1703
1704 Inside the
Patrick Williams0ca19cc2021-08-16 14:03:13 -05001705 recipe, use ``:class-native`` and ``:class-target`` overrides to
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001706 specify any functionality specific to the respective native or target
1707 case.
1708
Andrew Geissler517393d2023-01-13 08:55:19 -06001709Although applied differently, the :ref:`ref-classes-native` class is used with both
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001710methods. The advantage of the second method is that you do not need to
1711have two separate recipes (assuming you need both) for native and
1712target. All common parts of the recipe are automatically shared.
1713
1714.. _ref-classes-nativesdk:
1715
Andrew Geissler517393d2023-01-13 08:55:19 -06001716``nativesdk``
1717=============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001718
Andrew Geissler517393d2023-01-13 08:55:19 -06001719The :ref:`ref-classes-nativesdk` class provides common functionality for recipes that
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001720wish to build tools to run as part of an SDK (i.e. tools that run on
1721:term:`SDKMACHINE`).
1722
1723You can create a recipe that builds tools that run on the SDK machine a
1724couple different ways:
1725
Andrew Geisslereff27472021-10-29 15:35:00 -05001726- Create a ``nativesdk-myrecipe.bb`` recipe that inherits the
Andrew Geissler517393d2023-01-13 08:55:19 -06001727 :ref:`ref-classes-nativesdk` class. If you use this method, you must order the
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001728 inherit statement in the recipe after all other inherit statements so
Andrew Geissler517393d2023-01-13 08:55:19 -06001729 that the :ref:`ref-classes-nativesdk` class is inherited last.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001730
Andrew Geissler517393d2023-01-13 08:55:19 -06001731- Create a :ref:`ref-classes-nativesdk` variant of any recipe by adding the following::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001732
1733 BBCLASSEXTEND = "nativesdk"
1734
1735 Inside the
Patrick Williams0ca19cc2021-08-16 14:03:13 -05001736 recipe, use ``:class-nativesdk`` and ``:class-target`` overrides to
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001737 specify any functionality specific to the respective SDK machine or
1738 target case.
1739
1740.. note::
1741
Andrew Geisslerc926e172021-05-07 16:11:35 -05001742 When creating a recipe, you must follow this naming convention::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001743
1744 nativesdk-myrecipe.bb
1745
1746
William A. Kennington IIIac69b482021-06-02 12:28:27 -07001747 Not doing so can lead to subtle problems because there is code that
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001748 depends on the naming convention.
1749
Andrew Geissler517393d2023-01-13 08:55:19 -06001750Although applied differently, the :ref:`ref-classes-nativesdk` class is used with both
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001751methods. The advantage of the second method is that you do not need to
1752have two separate recipes (assuming you need both) for the SDK machine
1753and the target. All common parts of the recipe are automatically shared.
1754
1755.. _ref-classes-nopackages:
1756
Andrew Geissler517393d2023-01-13 08:55:19 -06001757``nopackages``
1758==============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001759
1760Disables packaging tasks for those recipes and classes where packaging
1761is not needed.
1762
1763.. _ref-classes-npm:
1764
Andrew Geissler517393d2023-01-13 08:55:19 -06001765``npm``
1766=======
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001767
Patrick Williams7784c422022-11-17 07:29:11 -06001768Provides support for building Node.js software fetched using the
1769:wikipedia:`node package manager (NPM) <Npm_(software)>`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001770
1771.. note::
1772
Andrew Geissler4c19ea12020-10-27 13:52:24 -05001773 Currently, recipes inheriting this class must use the ``npm://``
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001774 fetcher to have dependencies fetched and packaged automatically.
1775
1776For information on how to create NPM packages, see the
Andrew Geissler517393d2023-01-13 08:55:19 -06001777":ref:`dev-manual/packages:creating node package manager (npm) packages`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001778section in the Yocto Project Development Tasks Manual.
1779
1780.. _ref-classes-oelint:
1781
Andrew Geissler517393d2023-01-13 08:55:19 -06001782``oelint``
1783==========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001784
Andrew Geissler517393d2023-01-13 08:55:19 -06001785The :ref:`ref-classes-oelint` class is an obsolete lint checking tool available in
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001786``meta/classes`` in the :term:`Source Directory`.
1787
William A. Kennington IIIac69b482021-06-02 12:28:27 -07001788There are some classes that could be generally useful in OE-Core but
Andrew Geissler517393d2023-01-13 08:55:19 -06001789are never actually used within OE-Core itself. The :ref:`ref-classes-oelint` class is
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001790one such example. However, being aware of this class can reduce the
1791proliferation of different versions of similar classes across multiple
1792layers.
1793
Andrew Geissler5199d832021-09-24 16:47:35 -05001794.. _ref-classes-overlayfs:
1795
Andrew Geissler517393d2023-01-13 08:55:19 -06001796``overlayfs``
1797=============
Andrew Geissler5199d832021-09-24 16:47:35 -05001798
Andrew Geissler595f6302022-01-24 19:11:47 +00001799It's often desired in Embedded System design to have a read-only root filesystem.
Andrew Geissler5199d832021-09-24 16:47:35 -05001800But a lot of different applications might want to have read-write access to
1801some parts of a filesystem. It can be especially useful when your update mechanism
Andrew Geissler595f6302022-01-24 19:11:47 +00001802overwrites the whole root filesystem, but you may want your application data to be preserved
Andrew Geissler517393d2023-01-13 08:55:19 -06001803between updates. The :ref:`ref-classes-overlayfs` class provides a way
Andrew Geissler5199d832021-09-24 16:47:35 -05001804to achieve that by means of ``overlayfs`` and at the same time keeping the base
Andrew Geissler595f6302022-01-24 19:11:47 +00001805root filesystem read-only.
Andrew Geissler5199d832021-09-24 16:47:35 -05001806
1807To use this class, set a mount point for a partition ``overlayfs`` is going to use as upper
1808layer in your machine configuration. The underlying file system can be anything that
1809is supported by ``overlayfs``. This has to be done in your machine configuration::
1810
1811 OVERLAYFS_MOUNT_POINT[data] = "/data"
1812
1813.. note::
1814
1815 * QA checks fail to catch file existence if you redefine this variable in your recipe!
1816 * Only the existence of the systemd mount unit file is checked, not its contents.
1817 * To get more details on ``overlayfs``, its internals and supported operations, please refer
Patrick Williams2390b1b2022-11-03 13:47:49 -05001818 to the official documentation of the `Linux kernel <https://www.kernel.org/doc/html/latest/filesystems/overlayfs.html>`__.
Andrew Geissler5199d832021-09-24 16:47:35 -05001819
1820The class assumes you have a ``data.mount`` systemd unit defined elsewhere in your BSP
1821(e.g. in ``systemd-machine-units`` recipe) and it's installed into the image.
1822
1823Then you can specify writable directories on a recipe basis (e.g. in my-application.bb)::
1824
1825 OVERLAYFS_WRITABLE_PATHS[data] = "/usr/share/my-custom-application"
1826
1827To support several mount points you can use a different variable flag. Assuming we
1828want to have a writable location on the file system, but do not need that the data
Andrew Geissler595f6302022-01-24 19:11:47 +00001829survives a reboot, then we could have a ``mnt-overlay.mount`` unit for a ``tmpfs``
1830file system.
Andrew Geissler5199d832021-09-24 16:47:35 -05001831
1832In your machine configuration::
1833
1834 OVERLAYFS_MOUNT_POINT[mnt-overlay] = "/mnt/overlay"
1835
1836and then in your recipe::
1837
1838 OVERLAYFS_WRITABLE_PATHS[mnt-overlay] = "/usr/share/another-application"
1839
Andrew Geissler595f6302022-01-24 19:11:47 +00001840On a practical note, your application recipe might require multiple
1841overlays to be mounted before running to avoid writing to the underlying
1842file system (which can be forbidden in case of read-only file system)
Andrew Geissler517393d2023-01-13 08:55:19 -06001843To achieve that :ref:`ref-classes-overlayfs` provides a ``systemd``
Andrew Geissler595f6302022-01-24 19:11:47 +00001844helper service for mounting overlays. This helper service is named
1845``${PN}-overlays.service`` and can be depended on in your application recipe
1846(named ``application`` in the following example) ``systemd`` unit by adding
1847to the unit the following::
1848
1849 [Unit]
1850 After=application-overlays.service
1851 Requires=application-overlays.service
1852
Andrew Geissler5199d832021-09-24 16:47:35 -05001853.. note::
1854
1855 The class does not support the ``/etc`` directory itself, because ``systemd`` depends on it.
Andrew Geissler517393d2023-01-13 08:55:19 -06001856 In order to get ``/etc`` in overlayfs, see :ref:`ref-classes-overlayfs-etc`.
Andrew Geissler595f6302022-01-24 19:11:47 +00001857
1858.. _ref-classes-overlayfs-etc:
1859
Andrew Geissler517393d2023-01-13 08:55:19 -06001860``overlayfs-etc``
1861=================
Andrew Geissler595f6302022-01-24 19:11:47 +00001862
1863In order to have the ``/etc`` directory in overlayfs a special handling at early
1864boot stage is required. The idea is to supply a custom init script that mounts
1865``/etc`` before launching the actual init program, because the latter already
1866requires ``/etc`` to be mounted.
1867
1868Example usage in image recipe::
1869
1870 IMAGE_FEATURES += "overlayfs-etc"
1871
1872.. note::
1873
1874 This class must not be inherited directly. Use :term:`IMAGE_FEATURES` or :term:`EXTRA_IMAGE_FEATURES`
1875
1876Your machine configuration should define at least the device, mount point, and file system type
1877you are going to use for ``overlayfs``::
1878
1879 OVERLAYFS_ETC_MOUNT_POINT = "/data"
1880 OVERLAYFS_ETC_DEVICE = "/dev/mmcblk0p2"
1881 OVERLAYFS_ETC_FSTYPE ?= "ext4"
1882
1883To control more mount options you should consider setting mount options
1884(``defaults`` is used by default)::
1885
1886 OVERLAYFS_ETC_MOUNT_OPTIONS = "wsync"
1887
1888The class provides two options for ``/sbin/init`` generation:
1889
1890- The default option is to rename the original ``/sbin/init`` to ``/sbin/init.orig``
1891 and place the generated init under original name, i.e. ``/sbin/init``. It has an advantage
1892 that you won't need to change any kernel parameters in order to make it work,
1893 but it poses a restriction that package-management can't be used, because updating
1894 the init manager would remove the generated script.
1895
1896- If you wish to keep original init as is, you can set::
1897
1898 OVERLAYFS_ETC_USE_ORIG_INIT_NAME = "0"
1899
1900 Then the generated init will be named ``/sbin/preinit`` and you would need to extend your
1901 kernel parameters manually in your bootloader configuration.
Andrew Geissler5199d832021-09-24 16:47:35 -05001902
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001903.. _ref-classes-own-mirrors:
1904
Andrew Geissler517393d2023-01-13 08:55:19 -06001905``own-mirrors``
1906===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001907
Andrew Geissler517393d2023-01-13 08:55:19 -06001908The :ref:`ref-classes-own-mirrors` class makes it easier to set up your own
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001909:term:`PREMIRRORS` from which to first fetch source
1910before attempting to fetch it from the upstream specified in
1911:term:`SRC_URI` within each recipe.
1912
1913To use this class, inherit it globally and specify
Andrew Geisslerc926e172021-05-07 16:11:35 -05001914:term:`SOURCE_MIRROR_URL`. Here is an example::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001915
1916 INHERIT += "own-mirrors"
1917 SOURCE_MIRROR_URL = "http://example.com/my-source-mirror"
1918
1919You can specify only a single URL
Andrew Geissler09036742021-06-25 14:25:14 -05001920in :term:`SOURCE_MIRROR_URL`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001921
1922.. _ref-classes-package:
1923
Andrew Geissler517393d2023-01-13 08:55:19 -06001924``package``
1925===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001926
Andrew Geissler517393d2023-01-13 08:55:19 -06001927The :ref:`ref-classes-package` class supports generating packages from a build's
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001928output. The core generic functionality is in ``package.bbclass``. The
1929code specific to particular package types resides in these
Andrew Geissler517393d2023-01-13 08:55:19 -06001930package-specific classes: :ref:`ref-classes-package_deb`,
1931:ref:`ref-classes-package_rpm`, :ref:`ref-classes-package_ipk`, and
1932:ref:`ref-classes-package_tar`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001933
1934.. note::
1935
Andrew Geissler517393d2023-01-13 08:55:19 -06001936 The :ref:`ref-classes-package_tar` class is broken and
Patrick Williams2390b1b2022-11-03 13:47:49 -05001937 not supported. It is recommended that you do not use this class.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001938
1939You can control the list of resulting package formats by using the
Andrew Geissler09036742021-06-25 14:25:14 -05001940:term:`PACKAGE_CLASSES` variable defined in your ``conf/local.conf``
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001941configuration file, which is located in the :term:`Build Directory`.
Patrick Williams2390b1b2022-11-03 13:47:49 -05001942When defining the variable, you can specify one or more package types.
1943Since images are generated from packages, a packaging class is needed
1944to enable image generation. The first class listed in this variable is
1945used for image generation.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001946
1947If you take the optional step to set up a repository (package feed) on
1948the development host that can be used by DNF, you can install packages
1949from the feed while you are running the image on the target (i.e.
1950runtime installation of packages). For more information, see the
Andrew Geissler517393d2023-01-13 08:55:19 -06001951":ref:`dev-manual/packages:using runtime package management`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001952section in the Yocto Project Development Tasks Manual.
1953
1954The package-specific class you choose can affect build-time performance
1955and has space ramifications. In general, building a package with IPK
1956takes about thirty percent less time as compared to using RPM to build
1957the same or similar package. This comparison takes into account a
1958complete build of the package with all dependencies previously built.
1959The reason for this discrepancy is because the RPM package manager
1960creates and processes more :term:`Metadata` than the IPK package
Andrew Geissler09036742021-06-25 14:25:14 -05001961manager. Consequently, you might consider setting :term:`PACKAGE_CLASSES` to
Andrew Geissler517393d2023-01-13 08:55:19 -06001962":ref:`ref-classes-package_ipk`" if you are building smaller systems.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001963
1964Before making your package manager decision, however, you should
1965consider some further things about using RPM:
1966
1967- RPM starts to provide more abilities than IPK due to the fact that it
1968 processes more Metadata. For example, this information includes
1969 individual file types, file checksum generation and evaluation on
1970 install, sparse file support, conflict detection and resolution for
1971 Multilib systems, ACID style upgrade, and repackaging abilities for
1972 rollbacks.
1973
1974- For smaller systems, the extra space used for the Berkeley Database
1975 and the amount of metadata when using RPM can affect your ability to
1976 perform on-device upgrades.
1977
1978You can find additional information on the effects of the package class
1979at these two Yocto Project mailing list links:
1980
Andrew Geissler4c19ea12020-10-27 13:52:24 -05001981- :yocto_lists:`/pipermail/poky/2011-May/006362.html`
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001982
Andrew Geissler4c19ea12020-10-27 13:52:24 -05001983- :yocto_lists:`/pipermail/poky/2011-May/006363.html`
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001984
1985.. _ref-classes-package_deb:
1986
Andrew Geissler517393d2023-01-13 08:55:19 -06001987``package_deb``
1988===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001989
Andrew Geissler517393d2023-01-13 08:55:19 -06001990The :ref:`ref-classes-package_deb` class provides support for creating packages that
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001991use the Debian (i.e. ``.deb``) file format. The class ensures the
1992packages are written out in a ``.deb`` file format to the
1993``${``\ :term:`DEPLOY_DIR_DEB`\ ``}`` directory.
1994
Andrew Geissler517393d2023-01-13 08:55:19 -06001995This class inherits the :ref:`ref-classes-package` class and
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001996is enabled through the :term:`PACKAGE_CLASSES`
1997variable in the ``local.conf`` file.
1998
1999.. _ref-classes-package_ipk:
2000
Andrew Geissler517393d2023-01-13 08:55:19 -06002001``package_ipk``
2002===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002003
Andrew Geissler517393d2023-01-13 08:55:19 -06002004The :ref:`ref-classes-package_ipk` class provides support for creating packages that
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002005use the IPK (i.e. ``.ipk``) file format. The class ensures the packages
2006are written out in a ``.ipk`` file format to the
2007``${``\ :term:`DEPLOY_DIR_IPK`\ ``}`` directory.
2008
Andrew Geissler517393d2023-01-13 08:55:19 -06002009This class inherits the :ref:`ref-classes-package` class and
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002010is enabled through the :term:`PACKAGE_CLASSES`
2011variable in the ``local.conf`` file.
2012
2013.. _ref-classes-package_rpm:
2014
Andrew Geissler517393d2023-01-13 08:55:19 -06002015``package_rpm``
2016===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002017
Andrew Geissler517393d2023-01-13 08:55:19 -06002018The :ref:`ref-classes-package_rpm` class provides support for creating packages that
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002019use the RPM (i.e. ``.rpm``) file format. The class ensures the packages
2020are written out in a ``.rpm`` file format to the
2021``${``\ :term:`DEPLOY_DIR_RPM`\ ``}`` directory.
2022
Andrew Geissler517393d2023-01-13 08:55:19 -06002023This class inherits the :ref:`ref-classes-package` class and
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002024is enabled through the :term:`PACKAGE_CLASSES`
2025variable in the ``local.conf`` file.
2026
2027.. _ref-classes-package_tar:
2028
Andrew Geissler517393d2023-01-13 08:55:19 -06002029``package_tar``
2030===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002031
Andrew Geissler517393d2023-01-13 08:55:19 -06002032The :ref:`ref-classes-package_tar` class provides support for creating tarballs. The
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002033class ensures the packages are written out in a tarball format to the
2034``${``\ :term:`DEPLOY_DIR_TAR`\ ``}`` directory.
2035
Andrew Geissler517393d2023-01-13 08:55:19 -06002036This class inherits the :ref:`ref-classes-package` class and
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002037is enabled through the :term:`PACKAGE_CLASSES`
2038variable in the ``local.conf`` file.
2039
2040.. note::
2041
Andrew Geissler517393d2023-01-13 08:55:19 -06002042 You cannot specify the :ref:`ref-classes-package_tar` class first using the
Andrew Geissler09036742021-06-25 14:25:14 -05002043 :term:`PACKAGE_CLASSES` variable. You must use ``.deb``, ``.ipk``, or ``.rpm``
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002044 file formats for your image or SDK.
2045
2046.. _ref-classes-packagedata:
2047
Andrew Geissler517393d2023-01-13 08:55:19 -06002048``packagedata``
2049===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002050
Andrew Geissler517393d2023-01-13 08:55:19 -06002051The :ref:`ref-classes-packagedata` class provides common functionality for reading
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002052``pkgdata`` files found in :term:`PKGDATA_DIR`. These
2053files contain information about each output package produced by the
2054OpenEmbedded build system.
2055
2056This class is enabled by default because it is inherited by the
Andrew Geissler517393d2023-01-13 08:55:19 -06002057:ref:`ref-classes-package` class.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002058
2059.. _ref-classes-packagegroup:
2060
Andrew Geissler517393d2023-01-13 08:55:19 -06002061``packagegroup``
2062================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002063
Andrew Geissler517393d2023-01-13 08:55:19 -06002064The :ref:`ref-classes-packagegroup` class sets default values appropriate for package
Andrew Geissler09036742021-06-25 14:25:14 -05002065group recipes (e.g. :term:`PACKAGES`, :term:`PACKAGE_ARCH`, :term:`ALLOW_EMPTY`, and
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002066so forth). It is highly recommended that all package group recipes
2067inherit this class.
2068
2069For information on how to use this class, see the
Andrew Geissler517393d2023-01-13 08:55:19 -06002070":ref:`dev-manual/customizing-images:customizing images using custom package groups`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002071section in the Yocto Project Development Tasks Manual.
2072
2073Previously, this class was called the ``task`` class.
2074
2075.. _ref-classes-patch:
2076
Andrew Geissler517393d2023-01-13 08:55:19 -06002077``patch``
2078=========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002079
Andrew Geissler517393d2023-01-13 08:55:19 -06002080The :ref:`ref-classes-patch` class provides all functionality for applying patches
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002081during the :ref:`ref-tasks-patch` task.
2082
2083This class is enabled by default because it is inherited by the
Andrew Geissler517393d2023-01-13 08:55:19 -06002084:ref:`ref-classes-base` class.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002085
2086.. _ref-classes-perlnative:
2087
Andrew Geissler517393d2023-01-13 08:55:19 -06002088``perlnative``
2089==============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002090
Andrew Geissler517393d2023-01-13 08:55:19 -06002091When inherited by a recipe, the :ref:`ref-classes-perlnative` class supports using the
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002092native version of Perl built by the build system rather than using the
2093version provided by the build host.
2094
Patrick Williams975a06f2022-10-21 14:42:47 -05002095.. _ref-classes-pypi:
2096
Andrew Geissler517393d2023-01-13 08:55:19 -06002097``pypi``
2098========
Patrick Williams975a06f2022-10-21 14:42:47 -05002099
Andrew Geissler517393d2023-01-13 08:55:19 -06002100The :ref:`ref-classes-pypi` class sets variables appropriately for recipes that build
Patrick Williams975a06f2022-10-21 14:42:47 -05002101Python modules from `PyPI <https://pypi.org/>`__, the Python Package Index.
2102By default it determines the PyPI package name based upon :term:`BPN`
2103(stripping the "python-" or "python3-" prefix off if present), however in
2104some cases you may need to set it manually in the recipe by setting
2105:term:`PYPI_PACKAGE`.
2106
Andrew Geissler517393d2023-01-13 08:55:19 -06002107Variables set by the :ref:`ref-classes-pypi` class include :term:`SRC_URI`, :term:`SECTION`,
Patrick Williams975a06f2022-10-21 14:42:47 -05002108:term:`HOMEPAGE`, :term:`UPSTREAM_CHECK_URI`, :term:`UPSTREAM_CHECK_REGEX`
2109and :term:`CVE_PRODUCT`.
2110
Patrick Williams45852732022-04-02 08:58:32 -05002111.. _ref-classes-python_flit_core:
2112
Andrew Geissler517393d2023-01-13 08:55:19 -06002113``python_flit_core``
2114====================
Patrick Williams45852732022-04-02 08:58:32 -05002115
Andrew Geissler517393d2023-01-13 08:55:19 -06002116The :ref:`ref-classes-python_flit_core` class enables building Python modules which declare
Patrick Williams45852732022-04-02 08:58:32 -05002117the `PEP-517 <https://www.python.org/dev/peps/pep-0517/>`__ compliant
2118``flit_core.buildapi`` ``build-backend`` in the ``[build-system]``
2119section of ``pyproject.toml`` (See `PEP-518 <https://www.python.org/dev/peps/pep-0518/>`__).
2120
2121Python modules built with ``flit_core.buildapi`` are pure Python (no
2122``C`` or ``Rust`` extensions).
2123
Andrew Geissler517393d2023-01-13 08:55:19 -06002124Internally this uses the :ref:`ref-classes-python_pep517` class.
Patrick Williams45852732022-04-02 08:58:32 -05002125
Andrew Geissler9aee5002022-03-30 16:27:02 +00002126.. _ref-classes-python_pep517:
2127
Andrew Geissler517393d2023-01-13 08:55:19 -06002128``python_pep517``
2129=================
Andrew Geissler9aee5002022-03-30 16:27:02 +00002130
Andrew Geissler517393d2023-01-13 08:55:19 -06002131The :ref:`ref-classes-python_pep517` class builds and installs a Python ``wheel`` binary
Patrick Williams45852732022-04-02 08:58:32 -05002132archive (see `PEP-517 <https://peps.python.org/pep-0517/>`__).
Andrew Geissler9aee5002022-03-30 16:27:02 +00002133
Patrick Williams45852732022-04-02 08:58:32 -05002134Recipes wouldn't inherit this directly, instead typically another class will
Andrew Geissler615f2f12022-07-15 14:00:58 -05002135inherit this and add the relevant native dependencies.
Andrew Geissler9aee5002022-03-30 16:27:02 +00002136
Andrew Geissler517393d2023-01-13 08:55:19 -06002137Examples of classes which do this are :ref:`ref-classes-python_flit_core`,
2138:ref:`ref-classes-python_setuptools_build_meta`, and
2139:ref:`ref-classes-python_poetry_core`.
Patrick Williams45852732022-04-02 08:58:32 -05002140
2141.. _ref-classes-python_poetry_core:
2142
Andrew Geissler517393d2023-01-13 08:55:19 -06002143``python_poetry_core``
2144======================
Patrick Williams45852732022-04-02 08:58:32 -05002145
Andrew Geissler517393d2023-01-13 08:55:19 -06002146The :ref:`ref-classes-python_poetry_core` class enables building Python modules which use the
Patrick Williams45852732022-04-02 08:58:32 -05002147`Poetry Core <https://python-poetry.org>`__ build system.
2148
Andrew Geissler517393d2023-01-13 08:55:19 -06002149Internally this uses the :ref:`ref-classes-python_pep517` class.
Andrew Geissler9aee5002022-03-30 16:27:02 +00002150
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002151.. _ref-classes-pixbufcache:
2152
Andrew Geissler517393d2023-01-13 08:55:19 -06002153``pixbufcache``
2154===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002155
Andrew Geissler517393d2023-01-13 08:55:19 -06002156The :ref:`ref-classes-pixbufcache` class generates the proper post-install and
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002157post-remove (postinst/postrm) scriptlets for packages that install
2158pixbuf loaders, which are used with ``gdk-pixbuf``. These scriptlets
2159call ``update_pixbuf_cache`` to add the pixbuf loaders to the cache.
2160Since the cache files are architecture-specific, ``update_pixbuf_cache``
2161is run using QEMU if the postinst scriptlets need to be run on the build
2162host during image creation.
2163
2164If the pixbuf loaders being installed are in packages other than the
2165recipe's main package, set
2166:term:`PIXBUF_PACKAGES` to specify the packages
2167containing the loaders.
2168
2169.. _ref-classes-pkgconfig:
2170
Andrew Geissler517393d2023-01-13 08:55:19 -06002171``pkgconfig``
2172=============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002173
Andrew Geissler517393d2023-01-13 08:55:19 -06002174The :ref:`ref-classes-pkgconfig` class provides a standard way to get header and
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002175library information by using ``pkg-config``. This class aims to smooth
2176integration of ``pkg-config`` into libraries that use it.
2177
2178During staging, BitBake installs ``pkg-config`` data into the
2179``sysroots/`` directory. By making use of sysroot functionality within
Andrew Geissler517393d2023-01-13 08:55:19 -06002180``pkg-config``, the :ref:`ref-classes-pkgconfig` class no longer has to manipulate the
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002181files.
2182
2183.. _ref-classes-populate-sdk:
2184
Andrew Geissler517393d2023-01-13 08:55:19 -06002185``populate_sdk``
2186================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002187
Andrew Geissler517393d2023-01-13 08:55:19 -06002188The :ref:`ref-classes-populate-sdk` class provides support for SDK-only recipes. For
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002189information on advantages gained when building a cross-development
2190toolchain using the :ref:`ref-tasks-populate_sdk`
Andrew Geissler09209ee2020-12-13 08:44:15 -06002191task, see the ":ref:`sdk-manual/appendix-obtain:building an sdk installer`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002192section in the Yocto Project Application Development and the Extensible
2193Software Development Kit (eSDK) manual.
2194
2195.. _ref-classes-populate-sdk-*:
2196
Andrew Geissler517393d2023-01-13 08:55:19 -06002197``populate_sdk_*``
2198==================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002199
Andrew Geissler517393d2023-01-13 08:55:19 -06002200The :ref:`ref-classes-populate-sdk-*` classes support SDK creation and consist of the
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002201following classes:
2202
Patrick Williams2390b1b2022-11-03 13:47:49 -05002203- :ref:`populate_sdk_base <ref-classes-populate-sdk-*>`: The base class supporting SDK creation under
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002204 all package managers (i.e. DEB, RPM, and opkg).
2205
Patrick Williams2390b1b2022-11-03 13:47:49 -05002206- :ref:`populate_sdk_deb <ref-classes-populate-sdk-*>`: Supports creation of the SDK given the Debian
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002207 package manager.
2208
Patrick Williams2390b1b2022-11-03 13:47:49 -05002209- :ref:`populate_sdk_rpm <ref-classes-populate-sdk-*>`: Supports creation of the SDK given the RPM
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002210 package manager.
2211
Patrick Williams2390b1b2022-11-03 13:47:49 -05002212- :ref:`populate_sdk_ipk <ref-classes-populate-sdk-*>`: Supports creation of the SDK given the opkg
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002213 (IPK format) package manager.
2214
Patrick Williams2390b1b2022-11-03 13:47:49 -05002215- :ref:`populate_sdk_ext <ref-classes-populate-sdk-*>`: Supports extensible SDK creation under all
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002216 package managers.
2217
Patrick Williams2390b1b2022-11-03 13:47:49 -05002218The :ref:`populate_sdk_base <ref-classes-populate-sdk-*>` class inherits the appropriate
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002219``populate_sdk_*`` (i.e. ``deb``, ``rpm``, and ``ipk``) based on
2220:term:`IMAGE_PKGTYPE`.
2221
2222The base class ensures all source and destination directories are
2223established and then populates the SDK. After populating the SDK, the
Patrick Williams2390b1b2022-11-03 13:47:49 -05002224:ref:`populate_sdk_base <ref-classes-populate-sdk-*>` class constructs two sysroots:
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002225``${``\ :term:`SDK_ARCH`\ ``}-nativesdk``, which
2226contains the cross-compiler and associated tooling, and the target,
2227which contains a target root filesystem that is configured for the SDK
2228usage. These two images reside in :term:`SDK_OUTPUT`,
Andrew Geisslerc926e172021-05-07 16:11:35 -05002229which consists of the following::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002230
2231 ${SDK_OUTPUT}/${SDK_ARCH}-nativesdk-pkgs
2232 ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/target-pkgs
2233
2234Finally, the base populate SDK class creates the toolchain environment
2235setup script, the tarball of the SDK, and the installer.
2236
Patrick Williams2390b1b2022-11-03 13:47:49 -05002237The respective :ref:`populate_sdk_deb <ref-classes-populate-sdk-*>`, :ref:`populate_sdk_rpm <ref-classes-populate-sdk-*>`, and
2238:ref:`populate_sdk_ipk <ref-classes-populate-sdk-*>` classes each support the specific type of SDK.
2239These classes are inherited by and used with the :ref:`populate_sdk_base <ref-classes-populate-sdk-*>`
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002240class.
2241
2242For more information on the cross-development toolchain generation, see
Andrew Geissler09209ee2020-12-13 08:44:15 -06002243the ":ref:`overview-manual/concepts:cross-development toolchain generation`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002244section in the Yocto Project Overview and Concepts Manual. For
2245information on advantages gained when building a cross-development
2246toolchain using the :ref:`ref-tasks-populate_sdk`
2247task, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -06002248":ref:`sdk-manual/appendix-obtain:building an sdk installer`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002249section in the Yocto Project Application Development and the Extensible
2250Software Development Kit (eSDK) manual.
2251
2252.. _ref-classes-prexport:
2253
Andrew Geissler517393d2023-01-13 08:55:19 -06002254``prexport``
2255============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002256
Andrew Geissler517393d2023-01-13 08:55:19 -06002257The :ref:`ref-classes-prexport` class provides functionality for exporting
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002258:term:`PR` values.
2259
2260.. note::
2261
2262 This class is not intended to be used directly. Rather, it is enabled
Andrew Geissler4c19ea12020-10-27 13:52:24 -05002263 when using "``bitbake-prserv-tool export``".
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002264
2265.. _ref-classes-primport:
2266
Andrew Geissler517393d2023-01-13 08:55:19 -06002267``primport``
2268============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002269
Andrew Geissler517393d2023-01-13 08:55:19 -06002270The :ref:`ref-classes-primport` class provides functionality for importing
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002271:term:`PR` values.
2272
2273.. note::
2274
2275 This class is not intended to be used directly. Rather, it is enabled
Andrew Geissler4c19ea12020-10-27 13:52:24 -05002276 when using "``bitbake-prserv-tool import``".
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002277
2278.. _ref-classes-prserv:
2279
Andrew Geissler517393d2023-01-13 08:55:19 -06002280``prserv``
2281==========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002282
Andrew Geissler517393d2023-01-13 08:55:19 -06002283The :ref:`ref-classes-prserv` class provides functionality for using a :ref:`PR
2284service <dev-manual/packages:working with a pr service>` in order to
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002285automatically manage the incrementing of the :term:`PR`
2286variable for each recipe.
2287
2288This class is enabled by default because it is inherited by the
Andrew Geissler517393d2023-01-13 08:55:19 -06002289:ref:`ref-classes-package` class. However, the OpenEmbedded
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002290build system will not enable the functionality of this class unless
2291:term:`PRSERV_HOST` has been set.
2292
2293.. _ref-classes-ptest:
2294
Andrew Geissler517393d2023-01-13 08:55:19 -06002295``ptest``
2296=========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002297
Andrew Geissler517393d2023-01-13 08:55:19 -06002298The :ref:`ref-classes-ptest` class provides functionality for packaging and installing
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002299runtime tests for recipes that build software that provides these tests.
2300
2301This class is intended to be inherited by individual recipes. However,
2302the class' functionality is largely disabled unless "ptest" appears in
2303:term:`DISTRO_FEATURES`. See the
Andrew Geissler517393d2023-01-13 08:55:19 -06002304":ref:`dev-manual/packages:testing packages with ptest`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002305section in the Yocto Project Development Tasks Manual for more information
2306on ptest.
2307
2308.. _ref-classes-ptest-gnome:
2309
Andrew Geissler517393d2023-01-13 08:55:19 -06002310``ptest-gnome``
2311===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002312
2313Enables package tests (ptests) specifically for GNOME packages, which
2314have tests intended to be executed with ``gnome-desktop-testing``.
2315
2316For information on setting up and running ptests, see the
Andrew Geissler517393d2023-01-13 08:55:19 -06002317":ref:`dev-manual/packages:testing packages with ptest`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002318section in the Yocto Project Development Tasks Manual.
2319
Andrew Geissler3b8a17c2021-04-15 15:55:55 -05002320.. _ref-classes-python3-dir:
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002321
Andrew Geissler517393d2023-01-13 08:55:19 -06002322``python3-dir``
2323===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002324
Andrew Geissler517393d2023-01-13 08:55:19 -06002325The :ref:`ref-classes-python3-dir` class provides the base version, location, and site
Andrew Geissler3b8a17c2021-04-15 15:55:55 -05002326package location for Python 3.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002327
2328.. _ref-classes-python3native:
2329
Andrew Geissler517393d2023-01-13 08:55:19 -06002330``python3native``
2331=================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002332
Andrew Geissler517393d2023-01-13 08:55:19 -06002333The :ref:`ref-classes-python3native` class supports using the native version of Python
Andrew Geisslerc9f78652020-09-18 14:11:35 -050023343 built by the build system rather than support of the version provided
2335by the build host.
2336
Andrew Geissler3b8a17c2021-04-15 15:55:55 -05002337.. _ref-classes-python3targetconfig:
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002338
Andrew Geissler517393d2023-01-13 08:55:19 -06002339``python3targetconfig``
2340=======================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002341
Andrew Geissler517393d2023-01-13 08:55:19 -06002342The :ref:`ref-classes-python3targetconfig` class supports using the native version of Python
Andrew Geissler3b8a17c2021-04-15 15:55:55 -050023433 built by the build system rather than support of the version provided
2344by the build host, except that the configuration for the target machine
2345is accessible (such as correct installation directories). This also adds a
2346dependency on target ``python3``, so should only be used where appropriate
2347in order to avoid unnecessarily lengthening builds.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002348
2349.. _ref-classes-qemu:
2350
Andrew Geissler517393d2023-01-13 08:55:19 -06002351``qemu``
2352========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002353
Andrew Geissler517393d2023-01-13 08:55:19 -06002354The :ref:`ref-classes-qemu` class provides functionality for recipes that either need
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002355QEMU or test for the existence of QEMU. Typically, this class is used to
2356run programs for a target system on the build host using QEMU's
2357application emulation mode.
2358
2359.. _ref-classes-recipe_sanity:
2360
Andrew Geissler517393d2023-01-13 08:55:19 -06002361``recipe_sanity``
2362=================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002363
Andrew Geissler517393d2023-01-13 08:55:19 -06002364The :ref:`ref-classes-recipe_sanity` class checks for the presence of any host system
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002365recipe prerequisites that might affect the build (e.g. variables that
2366are set or software that is present).
2367
2368.. _ref-classes-relocatable:
2369
Andrew Geissler517393d2023-01-13 08:55:19 -06002370``relocatable``
2371===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002372
Andrew Geissler517393d2023-01-13 08:55:19 -06002373The :ref:`ref-classes-relocatable` class enables relocation of binaries when they are
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002374installed into the sysroot.
2375
Andrew Geissler517393d2023-01-13 08:55:19 -06002376This class makes use of the :ref:`ref-classes-chrpath` class and is used by
2377both the :ref:`ref-classes-cross` and :ref:`ref-classes-native` classes.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002378
2379.. _ref-classes-remove-libtool:
2380
Andrew Geissler517393d2023-01-13 08:55:19 -06002381``remove-libtool``
2382==================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002383
Andrew Geissler517393d2023-01-13 08:55:19 -06002384The :ref:`ref-classes-remove-libtool` class adds a post function to the
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002385:ref:`ref-tasks-install` task to remove all ``.la`` files
2386installed by ``libtool``. Removing these files results in them being
2387absent from both the sysroot and target packages.
2388
2389If a recipe needs the ``.la`` files to be installed, then the recipe can
Andrew Geisslerc926e172021-05-07 16:11:35 -05002390override the removal by setting ``REMOVE_LIBTOOL_LA`` to "0" as follows::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002391
2392 REMOVE_LIBTOOL_LA = "0"
2393
2394.. note::
2395
Andrew Geissler517393d2023-01-13 08:55:19 -06002396 The :ref:`ref-classes-remove-libtool` class is not enabled by default.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002397
2398.. _ref-classes-report-error:
2399
Andrew Geissler517393d2023-01-13 08:55:19 -06002400``report-error``
2401================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002402
Andrew Geissler517393d2023-01-13 08:55:19 -06002403The :ref:`ref-classes-report-error` class supports enabling the :ref:`error reporting
2404tool <dev-manual/error-reporting-tool:using the error reporting tool>`",
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002405which allows you to submit build error information to a central database.
2406
2407The class collects debug information for recipe, recipe version, task,
2408machine, distro, build system, target system, host distro, branch,
2409commit, and log. From the information, report files using a JSON format
2410are created and stored in
2411``${``\ :term:`LOG_DIR`\ ``}/error-report``.
2412
2413.. _ref-classes-rm-work:
2414
Andrew Geissler517393d2023-01-13 08:55:19 -06002415``rm_work``
2416===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002417
Andrew Geissler517393d2023-01-13 08:55:19 -06002418The :ref:`ref-classes-rm-work` class supports deletion of temporary workspace, which
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002419can ease your hard drive demands during builds.
2420
2421The OpenEmbedded build system can use a substantial amount of disk space
2422during the build process. A portion of this space is the work files
2423under the ``${TMPDIR}/work`` directory for each recipe. Once the build
2424system generates the packages for a recipe, the work files for that
2425recipe are no longer needed. However, by default, the build system
2426preserves these files for inspection and possible debugging purposes. If
Andrew Geissler517393d2023-01-13 08:55:19 -06002427you would rather have these files deleted to save disk space as the build
2428progresses, you can enable :ref:`ref-classes-rm-work` by adding the following to
Patrick Williams2390b1b2022-11-03 13:47:49 -05002429your ``local.conf`` file, which is found in the :term:`Build Directory`::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002430
2431 INHERIT += "rm_work"
2432
Andrew Geissler517393d2023-01-13 08:55:19 -06002433If you are modifying and building source code out of the work directory for a
2434recipe, enabling :ref:`ref-classes-rm-work` will potentially result in your
2435changes to the source being lost. To exclude some recipes from having their work
2436directories deleted by :ref:`ref-classes-rm-work`, you can add the names of the
2437recipe or recipes you are working on to the :term:`RM_WORK_EXCLUDE` variable,
2438which can also be set in your ``local.conf`` file. Here is an example::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002439
2440 RM_WORK_EXCLUDE += "busybox glibc"
2441
2442.. _ref-classes-rootfs*:
2443
Andrew Geissler517393d2023-01-13 08:55:19 -06002444``rootfs*``
2445===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002446
Andrew Geissler517393d2023-01-13 08:55:19 -06002447The :ref:`ref-classes-rootfs*` classes support creating the root filesystem for an
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002448image and consist of the following classes:
2449
Patrick Williams2390b1b2022-11-03 13:47:49 -05002450- The :ref:`rootfs-postcommands <ref-classes-rootfs*>` class, which defines filesystem
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002451 post-processing functions for image recipes.
2452
Patrick Williams2390b1b2022-11-03 13:47:49 -05002453- The :ref:`rootfs_deb <ref-classes-rootfs*>` class, which supports creation of root filesystems
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002454 for images built using ``.deb`` packages.
2455
Patrick Williams2390b1b2022-11-03 13:47:49 -05002456- The :ref:`rootfs_rpm <ref-classes-rootfs*>` class, which supports creation of root filesystems
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002457 for images built using ``.rpm`` packages.
2458
Patrick Williams2390b1b2022-11-03 13:47:49 -05002459- The :ref:`rootfs_ipk <ref-classes-rootfs*>` class, which supports creation of root filesystems
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002460 for images built using ``.ipk`` packages.
2461
Patrick Williams2390b1b2022-11-03 13:47:49 -05002462- The :ref:`rootfsdebugfiles <ref-classes-rootfs*>` class, which installs additional files found
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002463 on the build host directly into the root filesystem.
2464
2465The root filesystem is created from packages using one of the
Andrew Geissler517393d2023-01-13 08:55:19 -06002466:ref:`ref-classes-rootfs*` files as determined by the :term:`PACKAGE_CLASSES`
2467variable.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002468
2469For information on how root filesystem images are created, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -06002470":ref:`overview-manual/concepts:image generation`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002471section in the Yocto Project Overview and Concepts Manual.
2472
2473.. _ref-classes-sanity:
2474
Andrew Geissler517393d2023-01-13 08:55:19 -06002475``sanity``
2476==========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002477
Andrew Geissler517393d2023-01-13 08:55:19 -06002478The :ref:`ref-classes-sanity` class checks to see if prerequisite software is present
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002479on the host system so that users can be notified of potential problems
2480that might affect their build. The class also performs basic user
2481configuration checks from the ``local.conf`` configuration file to
2482prevent common mistakes that cause build failures. Distribution policy
2483usually determines whether to include this class.
2484
2485.. _ref-classes-scons:
2486
Andrew Geissler517393d2023-01-13 08:55:19 -06002487``scons``
2488=========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002489
Andrew Geissler517393d2023-01-13 08:55:19 -06002490The :ref:`ref-classes-scons` class supports recipes that need to build software
2491that uses the SCons build system. You can use the :term:`EXTRA_OESCONS`
2492variable to specify additional configuration options you want to pass SCons
2493command line.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002494
2495.. _ref-classes-sdl:
2496
Andrew Geissler517393d2023-01-13 08:55:19 -06002497``sdl``
2498=======
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002499
Andrew Geissler517393d2023-01-13 08:55:19 -06002500The :ref:`ref-classes-sdl` class supports recipes that need to build software that uses
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002501the Simple DirectMedia Layer (SDL) library.
2502
Patrick Williams45852732022-04-02 08:58:32 -05002503.. _ref-classes-python_setuptools_build_meta:
Andrew Geissler9aee5002022-03-30 16:27:02 +00002504
Andrew Geissler517393d2023-01-13 08:55:19 -06002505``python_setuptools_build_meta``
2506================================
Andrew Geissler9aee5002022-03-30 16:27:02 +00002507
Andrew Geissler517393d2023-01-13 08:55:19 -06002508The :ref:`ref-classes-python_setuptools_build_meta` class enables building
2509Python modules which declare the
Andrew Geissler9aee5002022-03-30 16:27:02 +00002510`PEP-517 <https://www.python.org/dev/peps/pep-0517/>`__ compliant
2511``setuptools.build_meta`` ``build-backend`` in the ``[build-system]``
2512section of ``pyproject.toml`` (See `PEP-518 <https://www.python.org/dev/peps/pep-0518/>`__).
2513
2514Python modules built with ``setuptools.build_meta`` can be pure Python or
2515include ``C`` or ``Rust`` extensions).
2516
Andrew Geissler517393d2023-01-13 08:55:19 -06002517Internally this uses the :ref:`ref-classes-python_pep517` class.
Andrew Geissler9aee5002022-03-30 16:27:02 +00002518
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002519.. _ref-classes-setuptools3:
2520
Andrew Geissler517393d2023-01-13 08:55:19 -06002521``setuptools3``
2522===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002523
Andrew Geissler517393d2023-01-13 08:55:19 -06002524The :ref:`ref-classes-setuptools3` class supports Python version 3.x extensions
2525that use build systems based on ``setuptools`` (e.g. only have a ``setup.py``
2526and have not migrated to the official ``pyproject.toml`` format). If your recipe
2527uses these build systems, the recipe needs to inherit the
2528:ref:`ref-classes-setuptools3` class.
Andrew Geissler9aee5002022-03-30 16:27:02 +00002529
2530 .. note::
2531
Andrew Geissler517393d2023-01-13 08:55:19 -06002532 The :ref:`ref-classes-setuptools3` class :ref:`ref-tasks-compile` task now calls
Andrew Geissler9aee5002022-03-30 16:27:02 +00002533 ``setup.py bdist_wheel`` to build the ``wheel`` binary archive format
2534 (See `PEP-427 <https://www.python.org/dev/peps/pep-0427/>`__).
2535
2536 A consequence of this is that legacy software still using deprecated
2537 ``distutils`` from the Python standard library cannot be packaged as
2538 ``wheels``. A common solution is the replace
2539 ``from distutils.core import setup`` with ``from setuptools import setup``.
2540
2541 .. note::
2542
Andrew Geissler517393d2023-01-13 08:55:19 -06002543 The :ref:`ref-classes-setuptools3` class :ref:`ref-tasks-install` task now
2544 installs the ``wheel`` binary archive. In current versions of
2545 ``setuptools`` the legacy ``setup.py install`` method is deprecated. If
2546 the ``setup.py`` cannot be used with wheels, for example it creates files
2547 outside of the Python module or standard entry points, then
2548 :ref:`ref-classes-setuptools3_legacy` should be used.
Andrew Geissler9aee5002022-03-30 16:27:02 +00002549
2550.. _ref-classes-setuptools3_legacy:
2551
Andrew Geissler517393d2023-01-13 08:55:19 -06002552``setuptools3_legacy``
2553======================
Andrew Geissler9aee5002022-03-30 16:27:02 +00002554
Andrew Geissler517393d2023-01-13 08:55:19 -06002555The :ref:`ref-classes-setuptools3_legacy` class supports
2556Python version 3.x extensions that use build systems based on ``setuptools``
2557(e.g. only have a ``setup.py`` and have not migrated to the official
2558``pyproject.toml`` format). Unlike :ref:`ref-classes-setuptools3`,
2559this uses the traditional ``setup.py`` ``build`` and ``install`` commands and
2560not wheels. This use of ``setuptools`` like this is
Patrick Williams2390b1b2022-11-03 13:47:49 -05002561`deprecated <https://github.com/pypa/setuptools/blob/main/CHANGES.rst#v5830>`__
Andrew Geissler9aee5002022-03-30 16:27:02 +00002562but still relatively common.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002563
Andrew Geissler595f6302022-01-24 19:11:47 +00002564.. _ref-classes-setuptools3-base:
2565
Andrew Geissler517393d2023-01-13 08:55:19 -06002566``setuptools3-base``
2567====================
Andrew Geissler595f6302022-01-24 19:11:47 +00002568
Andrew Geissler517393d2023-01-13 08:55:19 -06002569The :ref:`ref-classes-setuptools3-base` class provides a reusable base for
2570other classes that support building Python version 3.x extensions. If you need
2571functionality that is not provided by the :ref:`ref-classes-setuptools3` class,
2572you may want to ``inherit setuptools3-base``. Some recipes do not need the tasks
2573in the :ref:`ref-classes-setuptools3` class and inherit this class instead.
Andrew Geissler595f6302022-01-24 19:11:47 +00002574
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002575.. _ref-classes-sign_rpm:
2576
Andrew Geissler517393d2023-01-13 08:55:19 -06002577``sign_rpm``
2578============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002579
Andrew Geissler517393d2023-01-13 08:55:19 -06002580The :ref:`ref-classes-sign_rpm` class supports generating signed RPM packages.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002581
2582.. _ref-classes-siteconfig:
2583
Andrew Geissler517393d2023-01-13 08:55:19 -06002584``siteconfig``
2585==============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002586
Andrew Geissler517393d2023-01-13 08:55:19 -06002587The :ref:`ref-classes-siteconfig` class provides functionality for handling site
2588configuration. The class is used by the :ref:`ref-classes-autotools` class to
2589accelerate the :ref:`ref-tasks-configure` task.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002590
2591.. _ref-classes-siteinfo:
2592
Andrew Geissler517393d2023-01-13 08:55:19 -06002593``siteinfo``
2594============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002595
Andrew Geissler517393d2023-01-13 08:55:19 -06002596The :ref:`ref-classes-siteinfo` class provides information about the targets
2597that might be needed by other classes or recipes.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002598
2599As an example, consider Autotools, which can require tests that must
2600execute on the target hardware. Since this is not possible in general
2601when cross compiling, site information is used to provide cached test
2602results so these tests can be skipped over but still make the correct
2603values available. The ``meta/site directory`` contains test results
2604sorted into different categories such as architecture, endianness, and
2605the ``libc`` used. Site information provides a list of files containing
Andrew Geissler09036742021-06-25 14:25:14 -05002606data relevant to the current build in the :term:`CONFIG_SITE` variable that
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002607Autotools automatically picks up.
2608
Andrew Geissler09036742021-06-25 14:25:14 -05002609The class also provides variables like :term:`SITEINFO_ENDIANNESS` and
2610:term:`SITEINFO_BITS` that can be used elsewhere in the metadata.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002611
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002612.. _ref-classes-sstate:
2613
Andrew Geissler517393d2023-01-13 08:55:19 -06002614``sstate``
2615==========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002616
Andrew Geissler517393d2023-01-13 08:55:19 -06002617The :ref:`ref-classes-sstate` class provides support for Shared State (sstate).
2618By default, the class is enabled through the :term:`INHERIT_DISTRO` variable's
2619default value.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002620
2621For more information on sstate, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -06002622":ref:`overview-manual/concepts:shared state cache`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002623section in the Yocto Project Overview and Concepts Manual.
2624
2625.. _ref-classes-staging:
2626
Andrew Geissler517393d2023-01-13 08:55:19 -06002627``staging``
2628===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002629
Andrew Geissler517393d2023-01-13 08:55:19 -06002630The :ref:`ref-classes-staging` class installs files into individual recipe work
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002631directories for sysroots. The class contains the following key tasks:
2632
2633- The :ref:`ref-tasks-populate_sysroot` task,
2634 which is responsible for handing the files that end up in the recipe
2635 sysroots.
2636
2637- The
2638 :ref:`ref-tasks-prepare_recipe_sysroot`
2639 task (a "partner" task to the ``populate_sysroot`` task), which
2640 installs the files into the individual recipe work directories (i.e.
2641 :term:`WORKDIR`).
2642
Andrew Geissler517393d2023-01-13 08:55:19 -06002643The code in the :ref:`ref-classes-staging` class is complex and basically works
2644in two stages:
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002645
2646- *Stage One:* The first stage addresses recipes that have files they
2647 want to share with other recipes that have dependencies on the
2648 originating recipe. Normally these dependencies are installed through
2649 the :ref:`ref-tasks-install` task into
Patrick Williams2194f502022-10-16 14:26:09 -05002650 ``${``\ :term:`D`\ ``}``. The :ref:`ref-tasks-populate_sysroot` task
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002651 copies a subset of these files into ``${SYSROOT_DESTDIR}``. This
2652 subset of files is controlled by the
2653 :term:`SYSROOT_DIRS`,
2654 :term:`SYSROOT_DIRS_NATIVE`, and
Andrew Geissler9aee5002022-03-30 16:27:02 +00002655 :term:`SYSROOT_DIRS_IGNORE`
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002656 variables.
2657
2658 .. note::
2659
2660 Additionally, a recipe can customize the files further by
Andrew Geissler09036742021-06-25 14:25:14 -05002661 declaring a processing function in the :term:`SYSROOT_PREPROCESS_FUNCS`
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002662 variable.
2663
2664 A shared state (sstate) object is built from these files and the
2665 files are placed into a subdirectory of
Andrew Geissler4c19ea12020-10-27 13:52:24 -05002666 :ref:`structure-build-tmp-sysroots-components`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002667 The files are scanned for hardcoded paths to the original
2668 installation location. If the location is found in text files, the
2669 hardcoded locations are replaced by tokens and a list of the files
2670 needing such replacements is created. These adjustments are referred
2671 to as "FIXMEs". The list of files that are scanned for paths is
2672 controlled by the :term:`SSTATE_SCAN_FILES`
2673 variable.
2674
2675- *Stage Two:* The second stage addresses recipes that want to use
2676 something from another recipe and declare a dependency on that recipe
2677 through the :term:`DEPENDS` variable. The recipe will
2678 have a
2679 :ref:`ref-tasks-prepare_recipe_sysroot`
2680 task and when this task executes, it creates the ``recipe-sysroot``
2681 and ``recipe-sysroot-native`` in the recipe work directory (i.e.
2682 :term:`WORKDIR`). The OpenEmbedded build system
2683 creates hard links to copies of the relevant files from
2684 ``sysroots-components`` into the recipe work directory.
2685
2686 .. note::
2687
2688 If hard links are not possible, the build system uses actual
2689 copies.
2690
2691 The build system then addresses any "FIXMEs" to paths as defined from
2692 the list created in the first stage.
2693
2694 Finally, any files in ``${bindir}`` within the sysroot that have the
2695 prefix "``postinst-``" are executed.
2696
2697 .. note::
2698
2699 Although such sysroot post installation scripts are not
2700 recommended for general use, the files do allow some issues such
2701 as user creation and module indexes to be addressed.
2702
Andrew Geissler09036742021-06-25 14:25:14 -05002703 Because recipes can have other dependencies outside of :term:`DEPENDS`
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002704 (e.g. ``do_unpack[depends] += "tar-native:do_populate_sysroot"``),
2705 the sysroot creation function ``extend_recipe_sysroot`` is also added
2706 as a pre-function for those tasks whose dependencies are not through
Andrew Geissler09036742021-06-25 14:25:14 -05002707 :term:`DEPENDS` but operate similarly.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002708
2709 When installing dependencies into the sysroot, the code traverses the
2710 dependency graph and processes dependencies in exactly the same way
2711 as the dependencies would or would not be when installed from sstate.
2712 This processing means, for example, a native tool would have its
2713 native dependencies added but a target library would not have its
2714 dependencies traversed or installed. The same sstate dependency code
2715 is used so that builds should be identical regardless of whether
2716 sstate was used or not. For a closer look, see the
Andrew Geissler517393d2023-01-13 08:55:19 -06002717 ``setscene_depvalid()`` function in the :ref:`ref-classes-sstate` class.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002718
2719 The build system is careful to maintain manifests of the files it
2720 installs so that any given dependency can be installed as needed. The
2721 sstate hash of the installed item is also stored so that if it
2722 changes, the build system can reinstall it.
2723
2724.. _ref-classes-syslinux:
2725
Andrew Geissler517393d2023-01-13 08:55:19 -06002726``syslinux``
2727============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002728
Andrew Geissler517393d2023-01-13 08:55:19 -06002729The :ref:`ref-classes-syslinux` class provides syslinux-specific functions for
2730building bootable images.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002731
2732The class supports the following variables:
2733
2734- :term:`INITRD`: Indicates list of filesystem images to
2735 concatenate and use as an initial RAM disk (initrd). This variable is
2736 optional.
2737
2738- :term:`ROOTFS`: Indicates a filesystem image to include
2739 as the root filesystem. This variable is optional.
2740
2741- :term:`AUTO_SYSLINUXMENU`: Enables creating
2742 an automatic menu when set to "1".
2743
2744- :term:`LABELS`: Lists targets for automatic
2745 configuration.
2746
2747- :term:`APPEND`: Lists append string overrides for each
2748 label.
2749
2750- :term:`SYSLINUX_OPTS`: Lists additional options
2751 to add to the syslinux file. Semicolon characters separate multiple
2752 options.
2753
2754- :term:`SYSLINUX_SPLASH`: Lists a background
2755 for the VGA boot menu when you are using the boot menu.
2756
2757- :term:`SYSLINUX_DEFAULT_CONSOLE`: Set
2758 to "console=ttyX" to change kernel boot default console.
2759
2760- :term:`SYSLINUX_SERIAL`: Sets an alternate
2761 serial port. Or, turns off serial when the variable is set with an
2762 empty string.
2763
2764- :term:`SYSLINUX_SERIAL_TTY`: Sets an
2765 alternate "console=tty..." kernel boot argument.
2766
2767.. _ref-classes-systemd:
2768
Andrew Geissler517393d2023-01-13 08:55:19 -06002769``systemd``
2770===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002771
Andrew Geissler517393d2023-01-13 08:55:19 -06002772The :ref:`ref-classes-systemd` class provides support for recipes that install
2773systemd unit files.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002774
2775The functionality for this class is disabled unless you have "systemd"
2776in :term:`DISTRO_FEATURES`.
2777
2778Under this class, the recipe or Makefile (i.e. whatever the recipe is
2779calling during the :ref:`ref-tasks-install` task)
2780installs unit files into
2781``${``\ :term:`D`\ ``}${systemd_unitdir}/system``. If the unit
2782files being installed go into packages other than the main package, you
2783need to set :term:`SYSTEMD_PACKAGES` in your
2784recipe to identify the packages in which the files will be installed.
2785
2786You should set :term:`SYSTEMD_SERVICE` to the
2787name of the service file. You should also use a package name override to
2788indicate the package to which the value applies. If the value applies to
2789the recipe's main package, use ``${``\ :term:`PN`\ ``}``. Here
Andrew Geisslerc926e172021-05-07 16:11:35 -05002790is an example from the connman recipe::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002791
Patrick Williams0ca19cc2021-08-16 14:03:13 -05002792 SYSTEMD_SERVICE:${PN} = "connman.service"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002793
2794Services are set up to start on boot automatically
2795unless you have set
2796:term:`SYSTEMD_AUTO_ENABLE` to "disable".
2797
Andrew Geissler517393d2023-01-13 08:55:19 -06002798For more information on :ref:`ref-classes-systemd`, see the
2799":ref:`dev-manual/init-manager:selecting an initialization manager`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002800section in the Yocto Project Development Tasks Manual.
2801
2802.. _ref-classes-systemd-boot:
2803
Andrew Geissler517393d2023-01-13 08:55:19 -06002804``systemd-boot``
2805================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002806
Andrew Geissler517393d2023-01-13 08:55:19 -06002807The :ref:`ref-classes-systemd-boot` class provides functions specific to the
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002808systemd-boot bootloader for building bootable images. This is an
2809internal class and is not intended to be used directly.
2810
2811.. note::
2812
Andrew Geissler517393d2023-01-13 08:55:19 -06002813 The :ref:`ref-classes-systemd-boot` class is a result from merging the ``gummiboot`` class
Andrew Geissler4c19ea12020-10-27 13:52:24 -05002814 used in previous Yocto Project releases with the ``systemd`` project.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002815
Andrew Geissler517393d2023-01-13 08:55:19 -06002816Set the :term:`EFI_PROVIDER` variable to ":ref:`ref-classes-systemd-boot`" to
2817use this class. Doing so creates a standalone EFI bootloader that is not
2818dependent on systemd.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002819
2820For information on more variables used and supported in this class, see
2821the :term:`SYSTEMD_BOOT_CFG`,
2822:term:`SYSTEMD_BOOT_ENTRIES`, and
2823:term:`SYSTEMD_BOOT_TIMEOUT` variables.
2824
2825You can also see the `Systemd-boot
Andrew Geisslerd1e89492021-02-12 15:35:20 -06002826documentation <https://www.freedesktop.org/wiki/Software/systemd/systemd-boot/>`__
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002827for more information.
2828
2829.. _ref-classes-terminal:
2830
Andrew Geissler517393d2023-01-13 08:55:19 -06002831``terminal``
2832============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002833
Andrew Geissler517393d2023-01-13 08:55:19 -06002834The :ref:`ref-classes-terminal` class provides support for starting a terminal
2835session. The :term:`OE_TERMINAL` variable controls which terminal emulator is
2836used for the session.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002837
Andrew Geissler517393d2023-01-13 08:55:19 -06002838Other classes use the :ref:`ref-classes-terminal` class anywhere a separate
2839terminal session needs to be started. For example, the :ref:`ref-classes-patch`
2840class assuming :term:`PATCHRESOLVE` is set to "user", the
2841:ref:`ref-classes-cml1` class, and the :ref:`ref-classes-devshell` class all
2842use the :ref:`ref-classes-terminal` class.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002843
Patrick Williams975a06f2022-10-21 14:42:47 -05002844.. _ref-classes-testimage:
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002845
Andrew Geissler517393d2023-01-13 08:55:19 -06002846``testimage``
2847=============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002848
Andrew Geissler517393d2023-01-13 08:55:19 -06002849The :ref:`ref-classes-testimage` class supports running automated tests against
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002850images using QEMU and on actual hardware. The classes handle loading the
2851tests and starting the image. To use the classes, you need to perform
2852steps to set up the environment.
2853
Patrick Williams975a06f2022-10-21 14:42:47 -05002854To enable this class, add the following to your configuration::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002855
Patrick Williams975a06f2022-10-21 14:42:47 -05002856 IMAGE_CLASSES += "testimage"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002857
2858The tests are commands that run on the target system over ``ssh``. Each
2859test is written in Python and makes use of the ``unittest`` module.
2860
Andrew Geissler517393d2023-01-13 08:55:19 -06002861The :ref:`ref-classes-testimage` class runs tests on an image when called using the
Andrew Geisslerc926e172021-05-07 16:11:35 -05002862following::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002863
2864 $ bitbake -c testimage image
2865
Patrick Williams975a06f2022-10-21 14:42:47 -05002866Alternatively, if you wish to have tests automatically run for each image
2867after it is built, you can set :term:`TESTIMAGE_AUTO`::
2868
2869 TESTIMAGE_AUTO = "1"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002870
2871For information on how to enable, run, and create new tests, see the
Andrew Geissler517393d2023-01-13 08:55:19 -06002872":ref:`dev-manual/runtime-testing:performing automated runtime testing`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002873section in the Yocto Project Development Tasks Manual.
2874
2875.. _ref-classes-testsdk:
2876
Andrew Geissler517393d2023-01-13 08:55:19 -06002877``testsdk``
2878===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002879
2880This class supports running automated tests against software development
Andrew Geissler517393d2023-01-13 08:55:19 -06002881kits (SDKs). The :ref:`ref-classes-testsdk` class runs tests on an SDK when called
Andrew Geisslerc926e172021-05-07 16:11:35 -05002882using the following::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002883
2884 $ bitbake -c testsdk image
2885
2886.. note::
2887
Andrew Geissler4c19ea12020-10-27 13:52:24 -05002888 Best practices include using :term:`IMAGE_CLASSES` rather than
Andrew Geissler517393d2023-01-13 08:55:19 -06002889 :term:`INHERIT` to inherit the :ref:`ref-classes-testsdk` class for automated SDK
Andrew Geissler4c19ea12020-10-27 13:52:24 -05002890 testing.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002891
2892.. _ref-classes-texinfo:
2893
Andrew Geissler517393d2023-01-13 08:55:19 -06002894``texinfo``
2895===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002896
2897This class should be inherited by recipes whose upstream packages invoke
2898the ``texinfo`` utilities at build-time. Native and cross recipes are
2899made to use the dummy scripts provided by ``texinfo-dummy-native``, for
2900improved performance. Target architecture recipes use the genuine
2901Texinfo utilities. By default, they use the Texinfo utilities on the
2902host system.
2903
2904.. note::
2905
2906 If you want to use the Texinfo recipe shipped with the build system,
Andrew Geissler4c19ea12020-10-27 13:52:24 -05002907 you can remove "texinfo-native" from :term:`ASSUME_PROVIDED` and makeinfo
2908 from :term:`SANITY_REQUIRED_UTILITIES`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002909
2910.. _ref-classes-toaster:
2911
Andrew Geissler517393d2023-01-13 08:55:19 -06002912``toaster``
2913===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002914
Andrew Geissler517393d2023-01-13 08:55:19 -06002915The :ref:`ref-classes-toaster` class collects information about packages and images and
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002916sends them as events that the BitBake user interface can receive. The
2917class is enabled when the Toaster user interface is running.
2918
2919This class is not intended to be used directly.
2920
2921.. _ref-classes-toolchain-scripts:
2922
Andrew Geissler517393d2023-01-13 08:55:19 -06002923``toolchain-scripts``
2924=====================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002925
Andrew Geissler517393d2023-01-13 08:55:19 -06002926The :ref:`ref-classes-toolchain-scripts` class provides the scripts used for setting up
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002927the environment for installed SDKs.
2928
2929.. _ref-classes-typecheck:
2930
Andrew Geissler517393d2023-01-13 08:55:19 -06002931``typecheck``
2932=============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002933
Andrew Geissler517393d2023-01-13 08:55:19 -06002934The :ref:`ref-classes-typecheck` class provides support for validating the values of
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002935variables set at the configuration level against their defined types.
2936The OpenEmbedded build system allows you to define the type of a
Andrew Geisslerc926e172021-05-07 16:11:35 -05002937variable using the "type" varflag. Here is an example::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002938
2939 IMAGE_FEATURES[type] = "list"
2940
2941.. _ref-classes-uboot-config:
2942
Andrew Geissler517393d2023-01-13 08:55:19 -06002943``uboot-config``
2944================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002945
Andrew Geissler517393d2023-01-13 08:55:19 -06002946The :ref:`ref-classes-uboot-config` class provides support for U-Boot configuration for
Andrew Geisslerc926e172021-05-07 16:11:35 -05002947a machine. Specify the machine in your recipe as follows::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002948
2949 UBOOT_CONFIG ??= <default>
2950 UBOOT_CONFIG[foo] = "config,images"
2951
Andrew Geisslerc926e172021-05-07 16:11:35 -05002952You can also specify the machine using this method::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002953
2954 UBOOT_MACHINE = "config"
2955
2956See the :term:`UBOOT_CONFIG` and :term:`UBOOT_MACHINE` variables for additional
2957information.
2958
2959.. _ref-classes-uninative:
2960
Andrew Geissler517393d2023-01-13 08:55:19 -06002961``uninative``
2962=============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002963
2964Attempts to isolate the build system from the host distribution's C
2965library in order to make re-use of native shared state artifacts across
2966different host distributions practical. With this class enabled, a
2967tarball containing a pre-built C library is downloaded at the start of
2968the build. In the Poky reference distribution this is enabled by default
2969through ``meta/conf/distro/include/yocto-uninative.inc``. Other
2970distributions that do not derive from poky can also
2971"``require conf/distro/include/yocto-uninative.inc``" to use this.
2972Alternatively if you prefer, you can build the uninative-tarball recipe
2973yourself, publish the resulting tarball (e.g. via HTTP) and set
2974``UNINATIVE_URL`` and ``UNINATIVE_CHECKSUM`` appropriately. For an
2975example, see the ``meta/conf/distro/include/yocto-uninative.inc``.
2976
Andrew Geissler517393d2023-01-13 08:55:19 -06002977The :ref:`ref-classes-uninative` class is also used unconditionally by the extensible
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002978SDK. When building the extensible SDK, ``uninative-tarball`` is built
2979and the resulting tarball is included within the SDK.
2980
2981.. _ref-classes-update-alternatives:
2982
Andrew Geissler517393d2023-01-13 08:55:19 -06002983``update-alternatives``
2984=======================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002985
Andrew Geissler517393d2023-01-13 08:55:19 -06002986The :ref:`ref-classes-update-alternatives` class helps the alternatives system when
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002987multiple sources provide the same command. This situation occurs when
2988several programs that have the same or similar function are installed
2989with the same name. For example, the ``ar`` command is available from
2990the ``busybox``, ``binutils`` and ``elfutils`` packages. The
Andrew Geissler517393d2023-01-13 08:55:19 -06002991:ref:`ref-classes-update-alternatives` class handles renaming the binaries so that
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002992multiple packages can be installed without conflicts. The ``ar`` command
2993still works regardless of which packages are installed or subsequently
2994removed. The class renames the conflicting binary in each package and
2995symlinks the highest priority binary during installation or removal of
2996packages.
2997
2998To use this class, you need to define a number of variables:
2999
3000- :term:`ALTERNATIVE`
3001
3002- :term:`ALTERNATIVE_LINK_NAME`
3003
3004- :term:`ALTERNATIVE_TARGET`
3005
3006- :term:`ALTERNATIVE_PRIORITY`
3007
3008These variables list alternative commands needed by a package, provide
3009pathnames for links, default links for targets, and so forth. For
3010details on how to use this class, see the comments in the
Patrick Williams975a06f2022-10-21 14:42:47 -05003011:yocto_git:`update-alternatives.bbclass </poky/tree/meta/classes-recipe/update-alternatives.bbclass>`
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003012file.
3013
3014.. note::
3015
Andrew Geissler4c19ea12020-10-27 13:52:24 -05003016 You can use the ``update-alternatives`` command directly in your recipes.
3017 However, this class simplifies things in most cases.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003018
3019.. _ref-classes-update-rc.d:
3020
Andrew Geissler517393d2023-01-13 08:55:19 -06003021``update-rc.d``
3022===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003023
Andrew Geissler517393d2023-01-13 08:55:19 -06003024The :ref:`ref-classes-update-rc.d` class uses ``update-rc.d`` to safely install an
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003025initialization script on behalf of the package. The OpenEmbedded build
3026system takes care of details such as making sure the script is stopped
3027before a package is removed and started when the package is installed.
3028
Andrew Geissler09036742021-06-25 14:25:14 -05003029Three variables control this class: :term:`INITSCRIPT_PACKAGES`,
3030:term:`INITSCRIPT_NAME` and :term:`INITSCRIPT_PARAMS`. See the variable links
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003031for details.
3032
3033.. _ref-classes-useradd:
3034
Andrew Geissler517393d2023-01-13 08:55:19 -06003035``useradd*``
3036============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003037
Patrick Williams2390b1b2022-11-03 13:47:49 -05003038The :ref:`useradd* <ref-classes-useradd>` classes support the addition of users or groups for
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003039usage by the package on the target. For example, if you have packages
3040that contain system services that should be run under their own user or
3041group, you can use these classes to enable creation of the user or
Andrew Geissler595f6302022-01-24 19:11:47 +00003042group. The :oe_git:`meta-skeleton/recipes-skeleton/useradd/useradd-example.bb
3043</openembedded-core/tree/meta-skeleton/recipes-skeleton/useradd/useradd-example.bb>`
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003044recipe in the :term:`Source Directory` provides a simple
3045example that shows how to add three users and groups to two packages.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003046
Patrick Williams2390b1b2022-11-03 13:47:49 -05003047The :ref:`useradd_base <ref-classes-useradd>` class provides basic functionality for user or
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003048groups settings.
3049
Patrick Williams2390b1b2022-11-03 13:47:49 -05003050The :ref:`useradd* <ref-classes-useradd>` classes support the
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003051:term:`USERADD_PACKAGES`,
3052:term:`USERADD_PARAM`,
3053:term:`GROUPADD_PARAM`, and
3054:term:`GROUPMEMS_PARAM` variables.
3055
Patrick Williams2390b1b2022-11-03 13:47:49 -05003056The :ref:`useradd-staticids <ref-classes-useradd>` class supports the addition of users or groups
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003057that have static user identification (``uid``) and group identification
3058(``gid``) values.
3059
3060The default behavior of the OpenEmbedded build system for assigning
3061``uid`` and ``gid`` values when packages add users and groups during
3062package install time is to add them dynamically. This works fine for
3063programs that do not care what the values of the resulting users and
3064groups become. In these cases, the order of the installation determines
3065the final ``uid`` and ``gid`` values. However, if non-deterministic
3066``uid`` and ``gid`` values are a problem, you can override the default,
3067dynamic application of these values by setting static values. When you
3068set static values, the OpenEmbedded build system looks in
3069:term:`BBPATH` for ``files/passwd`` and ``files/group``
3070files for the values.
3071
Andrew Geissler517393d2023-01-13 08:55:19 -06003072To use static ``uid`` and ``gid`` values, you need to set some variables. See
3073the :term:`USERADDEXTENSION`, :term:`USERADD_UID_TABLES`,
3074:term:`USERADD_GID_TABLES`, and :term:`USERADD_ERROR_DYNAMIC` variables.
3075You can also see the :ref:`ref-classes-useradd` class for additional
3076information.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003077
3078.. note::
3079
Patrick Williams2390b1b2022-11-03 13:47:49 -05003080 You do not use the :ref:`useradd-staticids <ref-classes-useradd>` class directly. You either enable
Andrew Geissler09036742021-06-25 14:25:14 -05003081 or disable the class by setting the :term:`USERADDEXTENSION` variable. If you
Andrew Geissler4c19ea12020-10-27 13:52:24 -05003082 enable or disable the class in a configured system, :term:`TMPDIR` might
Andrew Geissler09036742021-06-25 14:25:14 -05003083 contain incorrect ``uid`` and ``gid`` values. Deleting the :term:`TMPDIR`
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003084 directory will correct this condition.
3085
3086.. _ref-classes-utility-tasks:
3087
Andrew Geissler517393d2023-01-13 08:55:19 -06003088``utility-tasks``
3089=================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003090
Andrew Geissler517393d2023-01-13 08:55:19 -06003091The :ref:`ref-classes-utility-tasks` class provides support for various
3092"utility" type tasks that are applicable to all recipes, such as
3093:ref:`ref-tasks-clean` and :ref:`ref-tasks-listtasks`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003094
3095This class is enabled by default because it is inherited by the
Andrew Geissler517393d2023-01-13 08:55:19 -06003096:ref:`ref-classes-base` class.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003097
3098.. _ref-classes-utils:
3099
Andrew Geissler517393d2023-01-13 08:55:19 -06003100``utils``
3101=========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003102
Andrew Geissler517393d2023-01-13 08:55:19 -06003103The :ref:`ref-classes-utils` class provides some useful Python functions that are
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003104typically used in inline Python expressions (e.g. ``${@...}``). One
3105example use is for ``bb.utils.contains()``.
3106
3107This class is enabled by default because it is inherited by the
Andrew Geissler517393d2023-01-13 08:55:19 -06003108:ref:`ref-classes-base` class.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003109
3110.. _ref-classes-vala:
3111
Andrew Geissler517393d2023-01-13 08:55:19 -06003112``vala``
3113========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003114
Andrew Geissler517393d2023-01-13 08:55:19 -06003115The :ref:`ref-classes-vala` class supports recipes that need to build software written
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003116using the Vala programming language.
3117
3118.. _ref-classes-waf:
3119
Andrew Geissler517393d2023-01-13 08:55:19 -06003120``waf``
3121=======
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003122
Andrew Geissler517393d2023-01-13 08:55:19 -06003123The :ref:`ref-classes-waf` class supports recipes that need to build software that uses
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003124the Waf build system. You can use the
3125:term:`EXTRA_OECONF` or
3126:term:`PACKAGECONFIG_CONFARGS` variables
3127to specify additional configuration options to be passed on the Waf
3128command line.