blob: 9520d0bf7cd1c2b0e0b6ed238967f7d538e2e190 [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 Geissler6aa7eec2023-03-03 12:41:14 -060096":ref:`dev-manual/new-recipe:building an 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)
Patrick Williams8e7b46e2023-05-01 14:19:06 -0500140and packaging (empty by default). These tasks 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
Andrew Geissler6aa7eec2023-03-03 12:41:14 -0600257.. _ref-classes-cargo:
258
259``cargo``
260=========
261
262The :ref:`ref-classes-cargo` class allows to compile Rust language programs
263using `Cargo <https://doc.rust-lang.org/cargo/>`__. Cargo is Rust's package
264manager, allowing to fetch package dependencies and build your program.
265
266Using this class makes it very easy to build Rust programs. All you need
267is to use the :term:`SRC_URI` variable to point to a source repository
268which can be built by Cargo, typically one that was created by the
Andrew Geissler5082cc72023-09-11 08:41:39 -0400269``cargo new`` command, containing a ``Cargo.toml`` file, a ``Cargo.lock`` file and a ``src``
Andrew Geissler6aa7eec2023-03-03 12:41:14 -0600270subdirectory.
271
Andrew Geissler5082cc72023-09-11 08:41:39 -0400272If you want to build and package tests of the program, inherit the
273:ref:`ref-classes-ptest-cargo` class instead of :ref:`ref-classes-cargo`.
274
275You will find an example (that show also how to handle possible git source dependencies) in the
276:oe_git:`zvariant_3.12.0.bb </openembedded-core/tree/meta-selftest/recipes-extended/zvariant/zvariant_3.12.0.bb>`
277recipe. Another example, with only crate dependencies, is the
Andrew Geissler6aa7eec2023-03-03 12:41:14 -0600278:oe_git:`uutils-coreutils </meta-openembedded/tree/meta-oe/recipes-core/uutils-coreutils>`
279recipe, which was generated by the `cargo-bitbake <https://crates.io/crates/cargo-bitbake>`__
280tool.
281
282This class inherits the :ref:`ref-classes-cargo_common` class.
283
Patrick Williamsac13d5f2023-11-24 18:59:46 -0600284.. _ref-classes-cargo_c:
285
286``cargo_c``
287===========
288
289The :ref:`ref-classes-cargo_c` class can be inherited by a recipe to generate
290a Rust library that can be called by C/C++ code. The recipe which inherits this
291class has to only replace ``inherit cargo`` by ``inherit cargo_c``.
292
293See the :yocto_git:`rust-c-lib-example_git.bb
294</poky/tree/meta-selftest/recipes-devtools/rust/rust-c-lib-example_git.bb>`
295example recipe.
296
Andrew Geissler6aa7eec2023-03-03 12:41:14 -0600297.. _ref-classes-cargo_common:
298
299``cargo_common``
300================
301
302The :ref:`ref-classes-cargo_common` class is an internal class
303that is not intended to be used directly.
304
305An exception is the "rust" recipe, to build the Rust compiler and runtime
306library, which is built by Cargo but cannot use the :ref:`ref-classes-cargo`
307class. This is why this class was introduced.
308
Andrew Geissler6aa7eec2023-03-03 12:41:14 -0600309.. _ref-classes-cargo-update-recipe-crates:
310
311``cargo-update-recipe-crates``
312===============================
313
314The :ref:`ref-classes-cargo-update-recipe-crates` class allows
315recipe developers to update the list of Cargo crates in :term:`SRC_URI`
316by reading the ``Cargo.lock`` file in the source tree.
317
318To do so, create a recipe for your program, for example using
319:doc:`devtool </ref-manual/devtool-reference>`,
320make it inherit the :ref:`ref-classes-cargo` and
321:ref:`ref-classes-cargo-update-recipe-crates` and run::
322
323 bitbake -c update_crates recipe
324
325This creates a ``recipe-crates.inc`` file that you can include in your
326recipe::
327
328 require ${BPN}-crates.inc
329
330That's also something you can achieve by using the
331`cargo-bitbake <https://crates.io/crates/cargo-bitbake>`__ tool.
332
Andrew Geissler5082cc72023-09-11 08:41:39 -0400333.. _ref-classes-ccache:
334
Andrew Geissler517393d2023-01-13 08:55:19 -0600335``ccache``
336==========
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500337
Andrew Geissler517393d2023-01-13 08:55:19 -0600338The :ref:`ref-classes-ccache` class enables the C/C++ Compiler Cache for the build.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500339This class is used to give a minor performance boost during the build.
Andrew Geissler7e0e3c02022-02-25 20:34:39 +0000340
341See https://ccache.samba.org/ for information on the C/C++ Compiler
342Cache, and the :oe_git:`ccache.bbclass </openembedded-core/tree/meta/classes/ccache.bbclass>`
343file for details about how to enable this mechanism in your configuration
344file, how to disable it for specific recipes, and how to share ``ccache``
345files between builds.
346
347However, using the class can lead to unexpected side-effects. Thus, using
348this class is not recommended.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500349
350.. _ref-classes-chrpath:
351
Andrew Geissler517393d2023-01-13 08:55:19 -0600352``chrpath``
353===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500354
Andrew Geissler517393d2023-01-13 08:55:19 -0600355The :ref:`ref-classes-chrpath` class is a wrapper around the "chrpath" utility, which
356is used during the build process for :ref:`ref-classes-nativesdk`, :ref:`ref-classes-cross`, and
357:ref:`ref-classes-cross-canadian` recipes to change ``RPATH`` records within binaries
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500358in order to make them relocatable.
359
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500360.. _ref-classes-cmake:
361
Andrew Geissler517393d2023-01-13 08:55:19 -0600362``cmake``
363=========
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500364
Andrew Geissler6aa7eec2023-03-03 12:41:14 -0600365The :ref:`ref-classes-cmake` class allows recipes to build software using the
366`CMake <https://cmake.org/overview/>`__ build system. You can use the
367:term:`EXTRA_OECMAKE` variable to specify additional configuration options to
368pass to the ``cmake`` command line.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500369
Andrew Geissler6aa7eec2023-03-03 12:41:14 -0600370By default, the :ref:`ref-classes-cmake` class uses
371`Ninja <https://ninja-build.org/>`__ instead of GNU make for building, which
372offers better build performance. If a recipe is broken with Ninja, then the
373recipe can set the :term:`OECMAKE_GENERATOR` variable to ``Unix Makefiles`` to
374use GNU make instead.
375
376If you need to install custom CMake toolchain files supplied by the application
377being built, you should install them (during :ref:`ref-tasks-install`) to the
378preferred CMake Module directory: ``${D}${datadir}/cmake/modules/``.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500379
Patrick Williams705982a2024-01-12 09:51:57 -0600380.. _ref-classes-cmake-qemu:
381
382``cmake-qemu``
383==============
384
385The :ref:`ref-classes-cmake-qemu` class might be used instead of the
386:ref:`ref-classes-cmake` class. In addition to the features provided by the
387:ref:`ref-classes-cmake` class, the :ref:`ref-classes-cmake-qemu` class passes
388the ``CMAKE_CROSSCOMPILING_EMULATOR`` setting to ``cmake``. This allows to use
389QEMU user-mode emulation for the execution of cross-compiled binaries on the
390host machine. For more information about ``CMAKE_CROSSCOMPILING_EMULATOR``
391please refer to the `related section of the CMake documentation
392<https://cmake.org/cmake/help/latest/variable/CMAKE_CROSSCOMPILING_EMULATOR.html>`__.
393
394Not all platforms are supported by QEMU. This class only works for machines with
395``qemu-usermode`` in the :ref:`ref-features-machine`. Using QEMU user-mode therefore
396involves a certain risk, which is also the reason why this feature is not part of
397the main :ref:`ref-classes-cmake` class by default.
398
399One use case is the execution of cross-compiled unit tests with CTest on the build
400machine. If ``CMAKE_CROSSCOMPILING_EMULATOR`` is configured::
401
402 cmake --build --target test
403
404works transparently with QEMU user-mode.
405
406If the CMake project is developed with this use case in mind this works very nicely.
407This also applies to an IDE configured to use ``cmake-native`` for cross-compiling.
408
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500409.. _ref-classes-cml1:
410
Andrew Geissler517393d2023-01-13 08:55:19 -0600411``cml1``
412========
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500413
Andrew Geissler517393d2023-01-13 08:55:19 -0600414The :ref:`ref-classes-cml1` class provides basic support for the Linux kernel style
Patrick Williamsac13d5f2023-11-24 18:59:46 -0600415build configuration system. "cml" stands for "Configuration Menu Language", which
416originates from the Linux kernel but is also used in other projects such as U-Boot
417and BusyBox. It could have been called "kconfig" too.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500418
419.. _ref-classes-compress_doc:
420
Andrew Geissler517393d2023-01-13 08:55:19 -0600421``compress_doc``
422================
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500423
Patrick Williams03514f12024-04-05 07:04:11 -0500424Enables compression for manual and info pages. This class is intended
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500425to be inherited globally. The default compression mechanism is gz (gzip)
426but you can select an alternative mechanism by setting the
427:term:`DOC_COMPRESS` variable.
428
429.. _ref-classes-copyleft_compliance:
430
Andrew Geissler517393d2023-01-13 08:55:19 -0600431``copyleft_compliance``
432=======================
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500433
Andrew Geissler517393d2023-01-13 08:55:19 -0600434The :ref:`ref-classes-copyleft_compliance` class preserves source code for the purposes
435of license compliance. This class is an alternative to the :ref:`ref-classes-archiver`
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500436class and is still used by some users even though it has been deprecated
Andrew Geissler517393d2023-01-13 08:55:19 -0600437in favor of the :ref:`ref-classes-archiver` class.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500438
439.. _ref-classes-copyleft_filter:
440
Andrew Geissler517393d2023-01-13 08:55:19 -0600441``copyleft_filter``
442===================
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500443
Andrew Geissler517393d2023-01-13 08:55:19 -0600444A class used by the :ref:`ref-classes-archiver` and
445:ref:`ref-classes-copyleft_compliance` classes
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500446for filtering licenses. The ``copyleft_filter`` class is an internal
447class and is not intended to be used directly.
448
449.. _ref-classes-core-image:
450
Andrew Geissler517393d2023-01-13 08:55:19 -0600451``core-image``
452==============
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500453
Andrew Geissler517393d2023-01-13 08:55:19 -0600454The :ref:`ref-classes-core-image` class provides common definitions for the
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500455``core-image-*`` image recipes, such as support for additional
456:term:`IMAGE_FEATURES`.
457
458.. _ref-classes-cpan:
459
Andrew Geissler517393d2023-01-13 08:55:19 -0600460``cpan*``
461=========
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500462
Patrick Williams2390b1b2022-11-03 13:47:49 -0500463The :ref:`cpan* <ref-classes-cpan>` classes support Perl modules.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500464
465Recipes for Perl modules are simple. These recipes usually only need to
466point to the source's archive and then inherit the proper class file.
467Building is split into two methods depending on which method the module
468authors used.
469
470- Modules that use old ``Makefile.PL``-based build system require
471 ``cpan.bbclass`` in their recipes.
472
473- Modules that use ``Build.PL``-based build system require using
474 ``cpan_build.bbclass`` in their recipes.
475
Patrick Williams2390b1b2022-11-03 13:47:49 -0500476Both build methods inherit the :ref:`cpan-base <ref-classes-cpan>` class for basic Perl
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500477support.
478
Patrick Williams975a06f2022-10-21 14:42:47 -0500479.. _ref-classes-create-spdx:
480
Andrew Geissler517393d2023-01-13 08:55:19 -0600481``create-spdx``
482===============
Patrick Williams975a06f2022-10-21 14:42:47 -0500483
Andrew Geissler517393d2023-01-13 08:55:19 -0600484The :ref:`ref-classes-create-spdx` class provides support for
Patrick Williams7784c422022-11-17 07:29:11 -0600485automatically creating :term:`SPDX` :term:`SBOM` documents based upon image
486and SDK contents.
487
488This class is meant to be inherited globally from a configuration file::
489
490 INHERIT += "create-spdx"
491
492The toplevel :term:`SPDX` output file is generated in JSON format as a
493``IMAGE-MACHINE.spdx.json`` file in ``tmp/deploy/images/MACHINE/`` inside the
494:term:`Build Directory`. There are other related files in the same directory,
495as well as in ``tmp/deploy/spdx``.
496
497The exact behaviour of this class, and the amount of output can be controlled
498by the :term:`SPDX_PRETTY`, :term:`SPDX_ARCHIVE_PACKAGED`,
499:term:`SPDX_ARCHIVE_SOURCES` and :term:`SPDX_INCLUDE_SOURCES` variables.
500
501See the description of these variables and the
Andrew Geissler517393d2023-01-13 08:55:19 -0600502":ref:`dev-manual/sbom:creating a software bill of materials`"
Patrick Williams7784c422022-11-17 07:29:11 -0600503section in the Yocto Project Development Manual for more details.
Patrick Williams975a06f2022-10-21 14:42:47 -0500504
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500505.. _ref-classes-cross:
506
Andrew Geissler517393d2023-01-13 08:55:19 -0600507``cross``
508=========
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500509
Andrew Geissler517393d2023-01-13 08:55:19 -0600510The :ref:`ref-classes-cross` class provides support for the recipes that build the
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500511cross-compilation tools.
512
513.. _ref-classes-cross-canadian:
514
Andrew Geissler517393d2023-01-13 08:55:19 -0600515``cross-canadian``
516==================
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500517
Andrew Geissler517393d2023-01-13 08:55:19 -0600518The :ref:`ref-classes-cross-canadian` class provides support for the recipes that build
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500519the Canadian Cross-compilation tools for SDKs. See the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600520":ref:`overview-manual/concepts:cross-development toolchain generation`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500521section in the Yocto Project Overview and Concepts Manual for more
522discussion on these cross-compilation tools.
523
524.. _ref-classes-crosssdk:
525
Andrew Geissler517393d2023-01-13 08:55:19 -0600526``crosssdk``
527============
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500528
Andrew Geissler517393d2023-01-13 08:55:19 -0600529The :ref:`ref-classes-crosssdk` class provides support for the recipes that build the
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500530cross-compilation tools used for building SDKs. See the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600531":ref:`overview-manual/concepts:cross-development toolchain generation`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500532section in the Yocto Project Overview and Concepts Manual for more
533discussion on these cross-compilation tools.
534
Patrick Williams0ca19cc2021-08-16 14:03:13 -0500535.. _ref-classes-cve-check:
536
Andrew Geissler517393d2023-01-13 08:55:19 -0600537``cve-check``
538=============
Patrick Williams0ca19cc2021-08-16 14:03:13 -0500539
Andrew Geissler517393d2023-01-13 08:55:19 -0600540The :ref:`ref-classes-cve-check` class looks for known CVEs (Common Vulnerabilities
Patrick Williams2390b1b2022-11-03 13:47:49 -0500541and Exposures) while building with BitBake. This class is meant to be
Patrick Williams0ca19cc2021-08-16 14:03:13 -0500542inherited globally from a configuration file::
543
544 INHERIT += "cve-check"
545
Patrick Williams2390b1b2022-11-03 13:47:49 -0500546To filter out obsolete CVE database entries which are known not to impact software from Poky and OE-Core,
547add following line to the build configuration file::
548
549 include cve-extra-exclusions.inc
550
Patrick Williams0ca19cc2021-08-16 14:03:13 -0500551You can also look for vulnerabilities in specific packages by passing
Patrick Williams2390b1b2022-11-03 13:47:49 -0500552``-c cve_check`` to BitBake.
553
554After building the software with Bitbake, CVE check output reports are available in ``tmp/deploy/cve``
555and image specific summaries in ``tmp/deploy/images/*.cve`` or ``tmp/deploy/images/*.json`` files.
556
557When building, the CVE checker will emit build time warnings for any detected
558issues which are in the state ``Unpatched``, meaning that CVE issue seems to affect the software component
559and version being compiled and no patches to address the issue are applied. Other states
560for detected CVE issues are: ``Patched`` meaning that a patch to address the issue is already
561applied, and ``Ignored`` meaning that the issue can be ignored.
562
563The ``Patched`` state of a CVE issue is detected from patch files with the format
564``CVE-ID.patch``, e.g. ``CVE-2019-20633.patch``, in the :term:`SRC_URI` and using
565CVE metadata of format ``CVE: CVE-ID`` in the commit message of the patch file.
566
Patrick Williams2f814a62024-04-16 16:28:03 -0500567.. note::
568
569 Commit message metadata (``CVE: CVE-ID`` in a patch header) will not be scanned
570 in any patches that are remote, i.e. that are anything other than local files
571 referenced via ``file://`` in SRC_URI. However, a ``CVE-ID`` in a remote patch
572 file name itself will be registered.
573
Patrick Williams2a254922023-08-11 09:48:11 -0500574If the recipe adds ``CVE-ID`` as flag of the :term:`CVE_STATUS` variable with status
575mapped to ``Ignored``, then the CVE state is reported as ``Ignored``::
Patrick Williams2390b1b2022-11-03 13:47:49 -0500576
Patrick Williams2a254922023-08-11 09:48:11 -0500577 CVE_STATUS[CVE-2020-15523] = "not-applicable-platform: Issue only applies on Windows"
Patrick Williams2390b1b2022-11-03 13:47:49 -0500578
579If CVE check reports that a recipe contains false positives or false negatives, these may be
580fixed in recipes by adjusting the CVE product name using :term:`CVE_PRODUCT` and :term:`CVE_VERSION` variables.
581:term:`CVE_PRODUCT` defaults to the plain recipe name :term:`BPN` which can be adjusted to one or more CVE
582database vendor and product pairs using the syntax::
583
584 CVE_PRODUCT = "flex_project:flex"
585
586where ``flex_project`` is the CVE database vendor name and ``flex`` is the product name. Similarly
587if the default recipe version :term:`PV` does not match the version numbers of the software component
588in upstream releases or the CVE database, then the :term:`CVE_VERSION` variable can be used to set the
589CVE database compatible version number, for example::
590
591 CVE_VERSION = "2.39"
592
593Any bugs or missing or incomplete information in the CVE database entries should be fixed in the CVE database
594via the `NVD feedback form <https://nvd.nist.gov/info/contact-form>`__.
595
596Users should note that security is a process, not a product, and thus also CVE checking, analyzing results,
597patching and updating the software should be done as a regular process. The data and assumptions
598required for CVE checker to reliably detect issues are frequently broken in various ways.
599These can only be detected by reviewing the details of the issues and iterating over the generated reports,
600and following what happens in other Linux distributions and in the greater open source community.
601
602You will find some more details in the
Andrew Geissler517393d2023-01-13 08:55:19 -0600603":ref:`dev-manual/vulnerabilities:checking for vulnerabilities`"
Patrick Williams0ca19cc2021-08-16 14:03:13 -0500604section in the Development Tasks Manual.
605
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500606.. _ref-classes-debian:
607
Andrew Geissler517393d2023-01-13 08:55:19 -0600608``debian``
609==========
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500610
Andrew Geissler517393d2023-01-13 08:55:19 -0600611The :ref:`ref-classes-debian` class renames output packages so that they follow the
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500612Debian naming policy (i.e. ``glibc`` becomes ``libc6`` and
613``glibc-devel`` becomes ``libc6-dev``.) Renaming includes the library
614name and version as part of the package name.
615
616If a recipe creates packages for multiple libraries (shared object files
617of ``.so`` type), use the :term:`LEAD_SONAME`
618variable in the recipe to specify the library on which to apply the
619naming scheme.
620
621.. _ref-classes-deploy:
622
Andrew Geissler517393d2023-01-13 08:55:19 -0600623``deploy``
624==========
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500625
Andrew Geissler517393d2023-01-13 08:55:19 -0600626The :ref:`ref-classes-deploy` class handles deploying files to the
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500627:term:`DEPLOY_DIR_IMAGE` directory. The main
628function of this class is to allow the deploy step to be accelerated by
629shared state. Recipes that inherit this class should define their own
630:ref:`ref-tasks-deploy` function to copy the files to be
631deployed to :term:`DEPLOYDIR`, and use ``addtask`` to
632add the task at the appropriate place, which is usually after
633:ref:`ref-tasks-compile` or
634:ref:`ref-tasks-install`. The class then takes care of
Andrew Geissler09036742021-06-25 14:25:14 -0500635staging the files from :term:`DEPLOYDIR` to :term:`DEPLOY_DIR_IMAGE`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500636
Patrick Williams8e7b46e2023-05-01 14:19:06 -0500637.. _ref-classes-devicetree:
638
639``devicetree``
640==============
641
642The :ref:`ref-classes-devicetree` class allows to build a recipe that compiles
643device tree source files that are not in the kernel tree.
644
645The compilation of out-of-tree device tree sources is the same as the kernel
646in-tree device tree compilation process. This includes the ability to include
647sources from the kernel such as SoC ``dtsi`` files as well as C header files,
648such as ``gpio.h``.
649
650The :ref:`ref-tasks-compile` task will compile two kinds of files:
651
652- Regular device tree sources with a ``.dts`` extension.
653
654- Device tree overlays, detected from the presence of the ``/plugin/;``
655 string in the file contents.
656
Patrick Williams520786c2023-06-25 16:20:36 -0500657This class deploys the generated device tree binaries into
658``${``\ :term:`DEPLOY_DIR_IMAGE`\ ``}/devicetree/``. This is similar to
659what the :ref:`ref-classes-kernel-devicetree` class does, with the added
660``devicetree`` subdirectory to avoid name clashes. Additionally, the device
661trees are populated into the sysroot for access via the sysroot from within
662other recipes.
Patrick Williams8e7b46e2023-05-01 14:19:06 -0500663
Patrick Williamsb542dec2023-06-09 01:26:37 -0500664By default, all device tree sources located in :term:`DT_FILES_PATH` directory
665are compiled. To select only particular sources, set :term:`DT_FILES` to
666a space-separated list of files (relative to :term:`DT_FILES_PATH`). For
667convenience, both ``.dts`` and ``.dtb`` extensions can be used.
668
Patrick Williams8e7b46e2023-05-01 14:19:06 -0500669An extra padding is appended to non-overlay device trees binaries. This
670can typically be used as extra space for adding extra properties at boot time.
Patrick Williamsb542dec2023-06-09 01:26:37 -0500671The padding size can be modified by setting :term:`DT_PADDING_SIZE`
672to the desired size, in bytes.
Patrick Williams8e7b46e2023-05-01 14:19:06 -0500673
674See :oe_git:`devicetree.bbclass sources
Patrick Williams44b3caf2024-04-12 16:51:14 -0500675</openembedded-core/tree/meta/classes-recipe/devicetree.bbclass>`
Patrick Williams8e7b46e2023-05-01 14:19:06 -0500676for further variables controlling this class.
677
678Here is an excerpt of an example ``recipes-kernel/linux/devicetree-acme.bb``
679recipe inheriting this class::
680
681 inherit devicetree
682 COMPATIBLE_MACHINE = "^mymachine$"
683 SRC_URI:mymachine = "file://mymachine.dts"
684
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500685.. _ref-classes-devshell:
686
Andrew Geissler517393d2023-01-13 08:55:19 -0600687``devshell``
688============
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500689
Andrew Geissler517393d2023-01-13 08:55:19 -0600690The :ref:`ref-classes-devshell` class adds the :ref:`ref-tasks-devshell` task. Distribution
691policy dictates whether to include this class. See the ":ref:`dev-manual/development-shell:using a development shell`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500692section in the Yocto Project Development Tasks Manual for more
Andrew Geissler517393d2023-01-13 08:55:19 -0600693information about using :ref:`ref-classes-devshell`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500694
695.. _ref-classes-devupstream:
696
Andrew Geissler517393d2023-01-13 08:55:19 -0600697``devupstream``
698===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500699
Andrew Geissler517393d2023-01-13 08:55:19 -0600700The :ref:`ref-classes-devupstream` class uses
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500701:term:`BBCLASSEXTEND` to add a variant of the
702recipe that fetches from an alternative URI (e.g. Git) instead of a
Patrick Williams39653562024-03-01 08:54:02 -0600703tarball. Here is an example::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500704
705 BBCLASSEXTEND = "devupstream:target"
Andrew Geissler9aee5002022-03-30 16:27:02 +0000706 SRC_URI:class-devupstream = "git://git.example.com/example;branch=main"
Patrick Williams0ca19cc2021-08-16 14:03:13 -0500707 SRCREV:class-devupstream = "abcd1234"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500708
709Adding the above statements to your recipe creates a variant that has
710:term:`DEFAULT_PREFERENCE` set to "-1".
711Consequently, you need to select the variant of the recipe to use it.
712Any development-specific adjustments can be done by using the
Andrew Geisslerc926e172021-05-07 16:11:35 -0500713``class-devupstream`` override. Here is an example::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500714
Patrick Williams0ca19cc2021-08-16 14:03:13 -0500715 DEPENDS:append:class-devupstream = " gperf-native"
716 do_configure:prepend:class-devupstream() {
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500717 touch ${S}/README
718 }
719
720The class
721currently only supports creating a development variant of the target
Andrew Geissler517393d2023-01-13 08:55:19 -0600722recipe, not :ref:`ref-classes-native` or :ref:`ref-classes-nativesdk` variants.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500723
Andrew Geissler09036742021-06-25 14:25:14 -0500724The :term:`BBCLASSEXTEND` syntax (i.e. ``devupstream:target``) provides
Andrew Geissler517393d2023-01-13 08:55:19 -0600725support for :ref:`ref-classes-native` and :ref:`ref-classes-nativesdk` variants. Consequently, this
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500726functionality can be added in a future release.
727
728Support for other version control systems such as Subversion is limited
729due to BitBake's automatic fetch dependencies (e.g.
730``subversion-native``).
731
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500732.. _ref-classes-externalsrc:
733
Andrew Geissler517393d2023-01-13 08:55:19 -0600734``externalsrc``
735===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500736
Andrew Geissler517393d2023-01-13 08:55:19 -0600737The :ref:`ref-classes-externalsrc` class supports building software from source code
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500738that is external to the OpenEmbedded build system. Building software
739from an external source tree means that the build system's normal fetch,
740unpack, and patch process is not used.
741
742By default, the OpenEmbedded build system uses the :term:`S`
743and :term:`B` variables to locate unpacked recipe source code
744and to build it, respectively. When your recipe inherits the
Andrew Geissler517393d2023-01-13 08:55:19 -0600745:ref:`ref-classes-externalsrc` class, you use the
746:term:`EXTERNALSRC` and :term:`EXTERNALSRC_BUILD` variables to
Andrew Geissler09036742021-06-25 14:25:14 -0500747ultimately define :term:`S` and :term:`B`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500748
749By default, this class expects the source code to support recipe builds
750that use the :term:`B` variable to point to the directory in
751which the OpenEmbedded build system places the generated objects built
Andrew Geissler09036742021-06-25 14:25:14 -0500752from the recipes. By default, the :term:`B` directory is set to the
753following, which is separate from the source directory (:term:`S`)::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500754
Andrew Geissler5199d832021-09-24 16:47:35 -0500755 ${WORKDIR}/${BPN}-{PV}/
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500756
757See these variables for more information:
758:term:`WORKDIR`, :term:`BPN`, and
759:term:`PV`,
760
Andrew Geissler517393d2023-01-13 08:55:19 -0600761For more information on the :ref:`ref-classes-externalsrc` class, see the comments in
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500762``meta/classes/externalsrc.bbclass`` in the :term:`Source Directory`.
Andrew Geissler517393d2023-01-13 08:55:19 -0600763For information on how to use the :ref:`ref-classes-externalsrc` class, see the
764":ref:`dev-manual/building:building software from an external source`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500765section in the Yocto Project Development Tasks Manual.
766
767.. _ref-classes-extrausers:
768
Andrew Geissler517393d2023-01-13 08:55:19 -0600769``extrausers``
770==============
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500771
Andrew Geissler517393d2023-01-13 08:55:19 -0600772The :ref:`ref-classes-extrausers` class allows additional user and group configuration
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500773to be applied at the image level. Inheriting this class either globally
774or from an image recipe allows additional user and group operations to
775be performed using the
776:term:`EXTRA_USERS_PARAMS` variable.
777
778.. note::
779
Andrew Geissler517393d2023-01-13 08:55:19 -0600780 The user and group operations added using the :ref:`ref-classes-extrausers`
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500781 class are not tied to a specific recipe outside of the recipe for the
782 image. Thus, the operations can be performed across the image as a
Andrew Geissler517393d2023-01-13 08:55:19 -0600783 whole. Use the :ref:`ref-classes-useradd` class to add user and group
784 configuration to a specific recipe.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500785
Andrew Geisslerc926e172021-05-07 16:11:35 -0500786Here is an example that uses this class in an image recipe::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500787
788 inherit extrausers
789 EXTRA_USERS_PARAMS = "\
790 useradd -p '' tester; \
791 groupadd developers; \
792 userdel nobody; \
793 groupdel -g video; \
794 groupmod -g 1020 developers; \
795 usermod -s /bin/sh tester; \
796 "
797
798Here is an example that adds two users named "tester-jim" and "tester-sue" and assigns
Andrew Geissler9aee5002022-03-30 16:27:02 +0000799passwords. First on host, create the (escaped) password hash::
Andrew Geisslereff27472021-10-29 15:35:00 -0500800
Andrew Geissler9aee5002022-03-30 16:27:02 +0000801 printf "%q" $(mkpasswd -m sha256crypt tester01)
Andrew Geisslereff27472021-10-29 15:35:00 -0500802
Andrew Geissler9aee5002022-03-30 16:27:02 +0000803The resulting hash is set to a variable and used in ``useradd`` command parameters::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500804
805 inherit extrausers
Andrew Geisslereff27472021-10-29 15:35:00 -0500806 PASSWD = "\$X\$ABC123\$A-Long-Hash"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500807 EXTRA_USERS_PARAMS = "\
Andrew Geisslereff27472021-10-29 15:35:00 -0500808 useradd -p '${PASSWD}' tester-jim; \
809 useradd -p '${PASSWD}' tester-sue; \
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500810 "
811
Andrew Geisslereff27472021-10-29 15:35:00 -0500812Finally, here is an example that sets the root password::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500813
814 inherit extrausers
815 EXTRA_USERS_PARAMS = "\
Andrew Geisslereff27472021-10-29 15:35:00 -0500816 usermod -p '${PASSWD}' root; \
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500817 "
818
Patrick Williams03907ee2022-05-01 06:28:52 -0500819.. note::
820
821 From a security perspective, hardcoding a default password is not
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500822 generally a good idea or even legal in some jurisdictions. It is
823 recommended that you do not do this if you are building a production
Patrick Williams03907ee2022-05-01 06:28:52 -0500824 image.
825
826
Andrew Geissler6ce62a22020-11-30 19:58:47 -0600827.. _ref-classes-features_check:
828
Andrew Geissler517393d2023-01-13 08:55:19 -0600829``features_check``
830==================
Andrew Geissler6ce62a22020-11-30 19:58:47 -0600831
Andrew Geissler517393d2023-01-13 08:55:19 -0600832The :ref:`ref-classes-features_check` class allows individual recipes to check
833for required and conflicting :term:`DISTRO_FEATURES`, :term:`MACHINE_FEATURES`
834or :term:`COMBINED_FEATURES`.
Andrew Geissler6ce62a22020-11-30 19:58:47 -0600835
836This class provides support for the following variables:
837
838- :term:`REQUIRED_DISTRO_FEATURES`
839- :term:`CONFLICT_DISTRO_FEATURES`
840- :term:`ANY_OF_DISTRO_FEATURES`
841- ``REQUIRED_MACHINE_FEATURES``
842- ``CONFLICT_MACHINE_FEATURES``
843- ``ANY_OF_MACHINE_FEATURES``
844- ``REQUIRED_COMBINED_FEATURES``
845- ``CONFLICT_COMBINED_FEATURES``
846- ``ANY_OF_COMBINED_FEATURES``
847
848If any conditions specified in the recipe using the above
849variables are not met, the recipe will be skipped, and if the
850build system attempts to build the recipe then an error will be
851triggered.
852
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500853.. _ref-classes-fontcache:
854
Andrew Geissler517393d2023-01-13 08:55:19 -0600855``fontcache``
856=============
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500857
Andrew Geissler517393d2023-01-13 08:55:19 -0600858The :ref:`ref-classes-fontcache` class generates the proper post-install and
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500859post-remove (postinst and postrm) scriptlets for font packages. These
860scriptlets call ``fc-cache`` (part of ``Fontconfig``) to add the fonts
861to the font information cache. Since the cache files are
862architecture-specific, ``fc-cache`` runs using QEMU if the postinst
863scriptlets need to be run on the build host during image creation.
864
865If the fonts being installed are in packages other than the main
866package, set :term:`FONT_PACKAGES` to specify the
867packages containing the fonts.
868
869.. _ref-classes-fs-uuid:
870
Andrew Geissler517393d2023-01-13 08:55:19 -0600871``fs-uuid``
872===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500873
Andrew Geissler517393d2023-01-13 08:55:19 -0600874The :ref:`ref-classes-fs-uuid` class extracts UUID from
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500875``${``\ :term:`ROOTFS`\ ``}``, which must have been built
Andrew Geissler517393d2023-01-13 08:55:19 -0600876by the time that this function gets called. The :ref:`ref-classes-fs-uuid` class only
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500877works on ``ext`` file systems and depends on ``tune2fs``.
878
879.. _ref-classes-gconf:
880
Andrew Geissler517393d2023-01-13 08:55:19 -0600881``gconf``
882=========
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500883
Andrew Geissler517393d2023-01-13 08:55:19 -0600884The :ref:`ref-classes-gconf` class provides common functionality for recipes that need
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500885to install GConf schemas. The schemas will be put into a separate
886package (``${``\ :term:`PN`\ ``}-gconf``) that is created
887automatically when this class is inherited. This package uses the
888appropriate post-install and post-remove (postinst/postrm) scriptlets to
889register and unregister the schemas in the target image.
890
891.. _ref-classes-gettext:
892
Andrew Geissler517393d2023-01-13 08:55:19 -0600893``gettext``
894===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500895
Andrew Geissler517393d2023-01-13 08:55:19 -0600896The :ref:`ref-classes-gettext` class provides support for building
897software that uses the GNU ``gettext`` internationalization and localization
898system. All recipes building software that use ``gettext`` should inherit this
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500899class.
900
Patrick Williams975a06f2022-10-21 14:42:47 -0500901.. _ref-classes-github-releases:
902
Andrew Geissler517393d2023-01-13 08:55:19 -0600903``github-releases``
904===================
Patrick Williams975a06f2022-10-21 14:42:47 -0500905
Andrew Geissler517393d2023-01-13 08:55:19 -0600906For recipes that fetch release tarballs from github, the :ref:`ref-classes-github-releases`
Patrick Williams975a06f2022-10-21 14:42:47 -0500907class sets up a standard way for checking available upstream versions
908(to support ``devtool upgrade`` and the Automated Upgrade Helper (AUH)).
909
Andrew Geissler517393d2023-01-13 08:55:19 -0600910To use it, add ":ref:`ref-classes-github-releases`" to the inherit line in the recipe,
Patrick Williams975a06f2022-10-21 14:42:47 -0500911and if the default value of :term:`GITHUB_BASE_URI` is not suitable,
912then set your own value in the recipe. You should then use ``${GITHUB_BASE_URI}``
913in the value you set for :term:`SRC_URI` within the recipe.
914
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500915.. _ref-classes-gnomebase:
916
Andrew Geissler517393d2023-01-13 08:55:19 -0600917``gnomebase``
918=============
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500919
Andrew Geissler517393d2023-01-13 08:55:19 -0600920The :ref:`ref-classes-gnomebase` class is the base class for recipes that build
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500921software from the GNOME stack. This class sets
922:term:`SRC_URI` to download the source from the GNOME
923mirrors as well as extending :term:`FILES` with the typical
924GNOME installation paths.
925
Andrew Geisslerc5535c92023-01-27 16:10:19 -0600926.. _ref-classes-go:
927
928``go``
929======
930
931The :ref:`ref-classes-go` class supports building Go programs. The behavior of
932this class is controlled by the mandatory :term:`GO_IMPORT` variable, and
933by the optional :term:`GO_INSTALL` and :term:`GO_INSTALL_FILTEROUT` ones.
934
935To build a Go program with the Yocto Project, you can use the
936:yocto_git:`go-helloworld_0.1.bb </poky/tree/meta/recipes-extended/go-examples/go-helloworld_0.1.bb>`
937recipe as an example.
938
939.. _ref-classes-go-mod:
940
941``go-mod``
942==========
943
944The :ref:`ref-classes-go-mod` class allows to use Go modules, and inherits the
945:ref:`ref-classes-go` class.
946
947See the associated :term:`GO_WORKDIR` variable.
948
Patrick Williams44b3caf2024-04-12 16:51:14 -0500949.. _ref-classes-go-vendor:
950
951``go-vendor``
952=============
953
954The :ref:`ref-classes-go-vendor` class implements support for offline builds,
955also known as Go vendoring. In such a scenario, the module dependencias are
956downloaded during the :ref:`ref-tasks-fetch` task rather than when modules are
957imported, thus being coherent with Yocto's concept of fetching every source
958beforehand.
959
960The dependencies are unpacked into the modules' ``vendor`` directory, where a
961manifest file is generated.
962
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500963.. _ref-classes-gobject-introspection:
964
Andrew Geissler517393d2023-01-13 08:55:19 -0600965``gobject-introspection``
966=========================
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500967
968Provides support for recipes building software that supports GObject
969introspection. This functionality is only enabled if the
970"gobject-introspection-data" feature is in
971:term:`DISTRO_FEATURES` as well as
972"qemu-usermode" being in
973:term:`MACHINE_FEATURES`.
974
975.. note::
976
Andrew Geisslerfc113ea2023-03-31 09:59:46 -0500977 This functionality is :ref:`backfilled <ref-features-backfill>` by default
978 and, if not applicable, should be disabled through
979 :term:`DISTRO_FEATURES_BACKFILL_CONSIDERED` or
Andrew Geissler09036742021-06-25 14:25:14 -0500980 :term:`MACHINE_FEATURES_BACKFILL_CONSIDERED`, respectively.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500981
982.. _ref-classes-grub-efi:
983
Andrew Geissler517393d2023-01-13 08:55:19 -0600984``grub-efi``
985============
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500986
Andrew Geissler517393d2023-01-13 08:55:19 -0600987The :ref:`ref-classes-grub-efi` class provides ``grub-efi``-specific functions for
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500988building bootable images.
989
990This class supports several variables:
991
992- :term:`INITRD`: Indicates list of filesystem images to
993 concatenate and use as an initial RAM disk (initrd) (optional).
994
995- :term:`ROOTFS`: Indicates a filesystem image to include
996 as the root filesystem (optional).
997
998- :term:`GRUB_GFXSERIAL`: Set this to "1" to have
999 graphics and serial in the boot menu.
1000
1001- :term:`LABELS`: A list of targets for the automatic
1002 configuration.
1003
1004- :term:`APPEND`: An override list of append strings for
1005 each ``LABEL``.
1006
1007- :term:`GRUB_OPTS`: Additional options to add to the
1008 configuration (optional). Options are delimited using semi-colon
1009 characters (``;``).
1010
1011- :term:`GRUB_TIMEOUT`: Timeout before executing
1012 the default ``LABEL`` (optional).
1013
1014.. _ref-classes-gsettings:
1015
Andrew Geissler517393d2023-01-13 08:55:19 -06001016``gsettings``
1017=============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001018
Andrew Geissler517393d2023-01-13 08:55:19 -06001019The :ref:`ref-classes-gsettings` class provides common functionality for recipes that
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001020need to install GSettings (glib) schemas. The schemas are assumed to be
1021part of the main package. Appropriate post-install and post-remove
1022(postinst/postrm) scriptlets are added to register and unregister the
1023schemas in the target image.
1024
1025.. _ref-classes-gtk-doc:
1026
Andrew Geissler517393d2023-01-13 08:55:19 -06001027``gtk-doc``
1028===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001029
Andrew Geissler517393d2023-01-13 08:55:19 -06001030The :ref:`ref-classes-gtk-doc` class is a helper class to pull in the appropriate
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001031``gtk-doc`` dependencies and disable ``gtk-doc``.
1032
1033.. _ref-classes-gtk-icon-cache:
1034
Andrew Geissler517393d2023-01-13 08:55:19 -06001035``gtk-icon-cache``
1036==================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001037
Andrew Geissler517393d2023-01-13 08:55:19 -06001038The :ref:`ref-classes-gtk-icon-cache` class generates the proper post-install and
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001039post-remove (postinst/postrm) scriptlets for packages that use GTK+ and
1040install icons. These scriptlets call ``gtk-update-icon-cache`` to add
1041the fonts to GTK+'s icon cache. Since the cache files are
1042architecture-specific, ``gtk-update-icon-cache`` is run using QEMU if
1043the postinst scriptlets need to be run on the build host during image
1044creation.
1045
1046.. _ref-classes-gtk-immodules-cache:
1047
Andrew Geissler517393d2023-01-13 08:55:19 -06001048``gtk-immodules-cache``
1049=======================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001050
Andrew Geissler517393d2023-01-13 08:55:19 -06001051The :ref:`ref-classes-gtk-immodules-cache` class generates the proper post-install and
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001052post-remove (postinst/postrm) scriptlets for packages that install GTK+
1053input method modules for virtual keyboards. These scriptlets call
1054``gtk-update-icon-cache`` to add the input method modules to the cache.
1055Since the cache files are architecture-specific,
1056``gtk-update-icon-cache`` is run using QEMU if the postinst scriptlets
1057need to be run on the build host during image creation.
1058
1059If the input method modules being installed are in packages other than
1060the main package, set
1061:term:`GTKIMMODULES_PACKAGES` to specify
1062the packages containing the modules.
1063
1064.. _ref-classes-gzipnative:
1065
Andrew Geissler517393d2023-01-13 08:55:19 -06001066``gzipnative``
1067==============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001068
Andrew Geissler517393d2023-01-13 08:55:19 -06001069The :ref:`ref-classes-gzipnative` class enables the use of different native versions of
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001070``gzip`` and ``pigz`` rather than the versions of these tools from the
1071build host.
1072
1073.. _ref-classes-icecc:
1074
Andrew Geissler517393d2023-01-13 08:55:19 -06001075``icecc``
1076=========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001077
Andrew Geissler517393d2023-01-13 08:55:19 -06001078The :ref:`ref-classes-icecc` class supports
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001079`Icecream <https://github.com/icecc/icecream>`__, which facilitates
1080taking compile jobs and distributing them among remote machines.
1081
1082The class stages directories with symlinks from ``gcc`` and ``g++`` to
1083``icecc``, for both native and cross compilers. Depending on each
1084configure or compile, the OpenEmbedded build system adds the directories
1085at the head of the ``PATH`` list and then sets the ``ICECC_CXX`` and
Andrew Geissler87f5cff2022-09-30 13:13:31 -05001086``ICECC_CC`` variables, which are the paths to the ``g++`` and ``gcc``
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001087compilers, respectively.
1088
1089For the cross compiler, the class creates a ``tar.gz`` file that
1090contains the Yocto Project toolchain and sets ``ICECC_VERSION``, which
1091is the version of the cross-compiler used in the cross-development
1092toolchain, accordingly.
1093
Andrew Geissler87f5cff2022-09-30 13:13:31 -05001094The class handles all three different compile stages (i.e native,
1095cross-kernel and target) and creates the necessary environment
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001096``tar.gz`` file to be used by the remote machines. The class also
1097supports SDK generation.
1098
1099If :term:`ICECC_PATH` is not set in your
1100``local.conf`` file, then the class tries to locate the ``icecc`` binary
1101using ``which``. If :term:`ICECC_ENV_EXEC` is set
1102in your ``local.conf`` file, the variable should point to the
1103``icecc-create-env`` script provided by the user. If you do not point to
1104a user-provided script, the build system uses the default script
Andrew Geissler87f5cff2022-09-30 13:13:31 -05001105provided by the recipe :oe_git:`icecc-create-env_0.1.bb
1106</openembedded-core/tree/meta/recipes-devtools/icecc-create-env/icecc-create-env_0.1.bb>`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001107
1108.. note::
1109
1110 This script is a modified version and not the one that comes with
Andrew Geissler87f5cff2022-09-30 13:13:31 -05001111 ``icecream``.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001112
1113If you do not want the Icecream distributed compile support to apply to
Andrew Geissler595f6302022-01-24 19:11:47 +00001114specific recipes or classes, you can ask them to be ignored by Icecream
1115by listing the recipes and classes using the
Andrew Geissler9aee5002022-03-30 16:27:02 +00001116:term:`ICECC_RECIPE_DISABLE` and
1117:term:`ICECC_CLASS_DISABLE` variables,
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001118respectively, in your ``local.conf`` file. Doing so causes the
1119OpenEmbedded build system to handle these compilations locally.
1120
1121Additionally, you can list recipes using the
Andrew Geissler9aee5002022-03-30 16:27:02 +00001122:term:`ICECC_RECIPE_ENABLE` variable in
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001123your ``local.conf`` file to force ``icecc`` to be enabled for recipes
1124using an empty :term:`PARALLEL_MAKE` variable.
1125
Andrew Geissler517393d2023-01-13 08:55:19 -06001126Inheriting the :ref:`ref-classes-icecc` class changes all sstate signatures.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001127Consequently, if a development team has a dedicated build system that
1128populates :term:`SSTATE_MIRRORS` and they want to
Andrew Geissler09036742021-06-25 14:25:14 -05001129reuse sstate from :term:`SSTATE_MIRRORS`, then all developers and the build
Andrew Geissler517393d2023-01-13 08:55:19 -06001130system need to either inherit the :ref:`ref-classes-icecc` class or nobody should.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001131
Andrew Geissler517393d2023-01-13 08:55:19 -06001132At the distribution level, you can inherit the :ref:`ref-classes-icecc` class to be
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001133sure that all builders start with the same sstate signatures. After
1134inheriting the class, you can then disable the feature by setting the
Andrew Geisslerc926e172021-05-07 16:11:35 -05001135:term:`ICECC_DISABLED` variable to "1" as follows::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001136
Patrick Williams0ca19cc2021-08-16 14:03:13 -05001137 INHERIT_DISTRO:append = " icecc"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001138 ICECC_DISABLED ??= "1"
1139
1140This practice
1141makes sure everyone is using the same signatures but also requires
1142individuals that do want to use Icecream to enable the feature
Andrew Geisslerc926e172021-05-07 16:11:35 -05001143individually as follows in your ``local.conf`` file::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001144
1145 ICECC_DISABLED = ""
1146
1147.. _ref-classes-image:
1148
Andrew Geissler517393d2023-01-13 08:55:19 -06001149``image``
1150=========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001151
Andrew Geissler517393d2023-01-13 08:55:19 -06001152The :ref:`ref-classes-image` class helps support creating images in different formats.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001153First, the root filesystem is created from packages using one of the
1154``rootfs*.bbclass`` files (depending on the package format used) and
1155then one or more image files are created.
1156
Andrew Geissler09036742021-06-25 14:25:14 -05001157- The :term:`IMAGE_FSTYPES` variable controls the types of images to
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001158 generate.
1159
Andrew Geissler09036742021-06-25 14:25:14 -05001160- The :term:`IMAGE_INSTALL` variable controls the list of packages to
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001161 install into the image.
1162
1163For information on customizing images, see the
Andrew Geissler517393d2023-01-13 08:55:19 -06001164":ref:`dev-manual/customizing-images:customizing images`" section
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001165in the Yocto Project Development Tasks Manual. For information on how
1166images are created, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -06001167":ref:`overview-manual/concepts:images`" section in the
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001168Yocto Project Overview and Concepts Manual.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001169
1170.. _ref-classes-image-buildinfo:
1171
Andrew Geissler517393d2023-01-13 08:55:19 -06001172``image-buildinfo``
1173===================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001174
Andrew Geissler517393d2023-01-13 08:55:19 -06001175The :ref:`ref-classes-image-buildinfo` class writes a plain text file containing
Patrick Williams975a06f2022-10-21 14:42:47 -05001176build information to the target filesystem at ``${sysconfdir}/buildinfo``
Patrick Williams7784c422022-11-17 07:29:11 -06001177by default (as specified by :term:`IMAGE_BUILDINFO_FILE`).
Patrick Williams975a06f2022-10-21 14:42:47 -05001178This can be useful for manually determining the origin of any given
1179image. It writes out two sections:
1180
Andrew Geissler517393d2023-01-13 08:55:19 -06001181#. `Build Configuration`: a list of variables and their values (specified
Patrick Williams975a06f2022-10-21 14:42:47 -05001182 by :term:`IMAGE_BUILDINFO_VARS`, which defaults to :term:`DISTRO` and
1183 :term:`DISTRO_VERSION`)
1184
Andrew Geissler517393d2023-01-13 08:55:19 -06001185#. `Layer Revisions`: the revisions of all of the layers used in the
Patrick Williams975a06f2022-10-21 14:42:47 -05001186 build.
1187
1188Additionally, when building an SDK it will write the same contents
1189to ``/buildinfo`` by default (as specified by
1190:term:`SDK_BUILDINFO_FILE`).
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001191
1192.. _ref-classes-image_types:
1193
Andrew Geissler517393d2023-01-13 08:55:19 -06001194``image_types``
1195===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001196
Andrew Geissler517393d2023-01-13 08:55:19 -06001197The :ref:`ref-classes-image_types` class defines all of the standard image output types
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001198that you can enable through the
1199:term:`IMAGE_FSTYPES` variable. You can use this
1200class as a reference on how to add support for custom image output
1201types.
1202
Andrew Geissler517393d2023-01-13 08:55:19 -06001203By default, the :ref:`ref-classes-image` class automatically
1204enables the :ref:`ref-classes-image_types` class. The :ref:`ref-classes-image` class uses the
Andrew Geisslerc926e172021-05-07 16:11:35 -05001205``IMGCLASSES`` variable as follows::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001206
1207 IMGCLASSES = "rootfs_${IMAGE_PKGTYPE} image_types ${IMAGE_CLASSES}"
Patrick Williams03514f12024-04-05 07:04:11 -05001208 # Only Linux SDKs support populate_sdk_ext, fall back to populate_sdk_base
1209 # in the non-Linux SDK_OS case, such as mingw32
1210 inherit populate_sdk_base
1211 IMGCLASSES += "${@['', 'populate_sdk_ext']['linux' in d.getVar("SDK_OS")]}"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001212 IMGCLASSES += "${@bb.utils.contains_any('IMAGE_FSTYPES', 'live iso hddimg', 'image-live', '', d)}"
1213 IMGCLASSES += "${@bb.utils.contains('IMAGE_FSTYPES', 'container', 'image-container', '', d)}"
1214 IMGCLASSES += "image_types_wic"
1215 IMGCLASSES += "rootfs-postcommands"
1216 IMGCLASSES += "image-postinst-intercepts"
Patrick Williams03514f12024-04-05 07:04:11 -05001217 IMGCLASSES += "overlayfs-etc"
1218 inherit_defer ${IMGCLASSES}
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001219
Andrew Geissler517393d2023-01-13 08:55:19 -06001220The :ref:`ref-classes-image_types` class also handles conversion and compression of images.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001221
1222.. note::
1223
1224 To build a VMware VMDK image, you need to add "wic.vmdk" to
Andrew Geissler09036742021-06-25 14:25:14 -05001225 :term:`IMAGE_FSTYPES`. This would also be similar for Virtual Box Virtual Disk
Andrew Geissler4c19ea12020-10-27 13:52:24 -05001226 Image ("vdi") and QEMU Copy On Write Version 2 ("qcow2") images.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001227
1228.. _ref-classes-image-live:
1229
Andrew Geissler517393d2023-01-13 08:55:19 -06001230``image-live``
1231==============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001232
1233This class controls building "live" (i.e. HDDIMG and ISO) images. Live
1234images contain syslinux for legacy booting, as well as the bootloader
1235specified by :term:`EFI_PROVIDER` if
1236:term:`MACHINE_FEATURES` contains "efi".
1237
1238Normally, you do not use this class directly. Instead, you add "live" to
1239:term:`IMAGE_FSTYPES`.
1240
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001241.. _ref-classes-insane:
1242
Andrew Geissler517393d2023-01-13 08:55:19 -06001243``insane``
1244==========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001245
Andrew Geissler517393d2023-01-13 08:55:19 -06001246The :ref:`ref-classes-insane` class adds a step to the package generation process so
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001247that output quality assurance checks are generated by the OpenEmbedded
1248build system. A range of checks are performed that check the build's
1249output for common problems that show up during runtime. Distribution
1250policy usually dictates whether to include this class.
1251
1252You can configure the sanity checks so that specific test failures
1253either raise a warning or an error message. Typically, failures for new
1254tests generate a warning. Subsequent failures for the same test would
1255then generate an error message once the metadata is in a known and good
Andrew Geissler09209ee2020-12-13 08:44:15 -06001256condition. See the ":doc:`/ref-manual/qa-checks`" Chapter for a list of all the warning
Andrew Geissler4c19ea12020-10-27 13:52:24 -05001257and error messages you might encounter using a default configuration.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001258
1259Use the :term:`WARN_QA` and
1260:term:`ERROR_QA` variables to control the behavior of
1261these checks at the global level (i.e. in your custom distro
1262configuration). However, to skip one or more checks in recipes, you
1263should use :term:`INSANE_SKIP`. For example, to skip
1264the check for symbolic link ``.so`` files in the main package of a
1265recipe, add the following to the recipe. You need to realize that the
Andrew Geisslerc926e172021-05-07 16:11:35 -05001266package name override, in this example ``${PN}``, must be used::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001267
Patrick Williams0ca19cc2021-08-16 14:03:13 -05001268 INSANE_SKIP:${PN} += "dev-so"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001269
1270Please keep in mind that the QA checks
William A. Kennington IIIac69b482021-06-02 12:28:27 -07001271are meant to detect real or potential problems in the packaged
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001272output. So exercise caution when disabling these checks.
1273
Patrick Williams39653562024-03-01 08:54:02 -06001274The tests you can list with the :term:`WARN_QA` and
1275:term:`ERROR_QA` variables are:
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001276
1277- ``already-stripped:`` Checks that produced binaries have not
1278 already been stripped prior to the build system extracting debug
1279 symbols. It is common for upstream software projects to default to
1280 stripping debug symbols for output binaries. In order for debugging
1281 to work on the target using ``-dbg`` packages, this stripping must be
1282 disabled.
1283
1284- ``arch:`` Checks the Executable and Linkable Format (ELF) type, bit
1285 size, and endianness of any binaries to ensure they match the target
1286 architecture. This test fails if any binaries do not match the type
1287 since there would be an incompatibility. The test could indicate that
1288 the wrong compiler or compiler options have been used. Sometimes
1289 software, like bootloaders, might need to bypass this check.
1290
1291- ``buildpaths:`` Checks for paths to locations on the build host
Patrick Williams975a06f2022-10-21 14:42:47 -05001292 inside the output files. Not only can these leak information about
1293 the build environment, they also hinder binary reproducibility.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001294
1295- ``build-deps:`` Determines if a build-time dependency that is
1296 specified through :term:`DEPENDS`, explicit
1297 :term:`RDEPENDS`, or task-level dependencies exists
1298 to match any runtime dependency. This determination is particularly
1299 useful to discover where runtime dependencies are detected and added
1300 during packaging. If no explicit dependency has been specified within
1301 the metadata, at the packaging stage it is too late to ensure that
1302 the dependency is built, and thus you can end up with an error when
1303 the package is installed into the image during the
1304 :ref:`ref-tasks-rootfs` task because the auto-detected
1305 dependency was not satisfied. An example of this would be where the
Andrew Geissler517393d2023-01-13 08:55:19 -06001306 :ref:`ref-classes-update-rc.d` class automatically
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001307 adds a dependency on the ``initscripts-functions`` package to
1308 packages that install an initscript that refers to
1309 ``/etc/init.d/functions``. The recipe should really have an explicit
Andrew Geissler5f350902021-07-23 13:09:54 -04001310 :term:`RDEPENDS` for the package in question on ``initscripts-functions``
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001311 so that the OpenEmbedded build system is able to ensure that the
1312 ``initscripts`` recipe is actually built and thus the
1313 ``initscripts-functions`` package is made available.
1314
Patrick Williams8e7b46e2023-05-01 14:19:06 -05001315- ``configure-gettext:`` Checks that if a recipe is building something
1316 that uses automake and the automake files contain an ``AM_GNU_GETTEXT``
1317 directive, that the recipe also inherits the :ref:`ref-classes-gettext`
1318 class to ensure that gettext is available during the build.
1319
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001320- ``compile-host-path:`` Checks the
1321 :ref:`ref-tasks-compile` log for indications that
1322 paths to locations on the build host were used. Using such paths
1323 might result in host contamination of the build output.
1324
Patrick Williamsb58112e2024-03-07 11:16:36 -06001325- ``cve_status_not_in_db:`` Checks for each component if CVEs that are ignored
1326 via :term:`CVE_STATUS`, that those are (still) reported for this component
1327 in the NIST database. If not, a warning is printed. This check is disabled
1328 by default.
1329
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001330- ``debug-deps:`` Checks that all packages except ``-dbg`` packages
1331 do not depend on ``-dbg`` packages, which would cause a packaging
1332 bug.
1333
1334- ``debug-files:`` Checks for ``.debug`` directories in anything but
1335 the ``-dbg`` package. The debug files should all be in the ``-dbg``
1336 package. Thus, anything packaged elsewhere is incorrect packaging.
1337
1338- ``dep-cmp:`` Checks for invalid version comparison statements in
1339 runtime dependency relationships between packages (i.e. in
1340 :term:`RDEPENDS`,
1341 :term:`RRECOMMENDS`,
1342 :term:`RSUGGESTS`,
1343 :term:`RPROVIDES`,
1344 :term:`RREPLACES`, and
1345 :term:`RCONFLICTS` variable values). Any invalid
1346 comparisons might trigger failures or undesirable behavior when
1347 passed to the package manager.
1348
1349- ``desktop:`` Runs the ``desktop-file-validate`` program against any
1350 ``.desktop`` files to validate their contents against the
1351 specification for ``.desktop`` files.
1352
1353- ``dev-deps:`` Checks that all packages except ``-dev`` or
1354 ``-staticdev`` packages do not depend on ``-dev`` packages, which
1355 would be a packaging bug.
1356
1357- ``dev-so:`` Checks that the ``.so`` symbolic links are in the
1358 ``-dev`` package and not in any of the other packages. In general,
1359 these symlinks are only useful for development purposes. Thus, the
William A. Kennington IIIac69b482021-06-02 12:28:27 -07001360 ``-dev`` package is the correct location for them. In very rare
1361 cases, such as dynamically loaded modules, these symlinks
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001362 are needed instead in the main package.
1363
Patrick Williams03907ee2022-05-01 06:28:52 -05001364- ``empty-dirs:`` Checks that packages are not installing files to
1365 directories that are normally expected to be empty (such as ``/tmp``)
1366 The list of directories that are checked is specified by the
1367 :term:`QA_EMPTY_DIRS` variable.
1368
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001369- ``file-rdeps:`` Checks that file-level dependencies identified by
1370 the OpenEmbedded build system at packaging time are satisfied. For
1371 example, a shell script might start with the line ``#!/bin/bash``.
1372 This line would translate to a file dependency on ``/bin/bash``. Of
1373 the three package managers that the OpenEmbedded build system
1374 supports, only RPM directly handles file-level dependencies,
1375 resolving them automatically to packages providing the files.
1376 However, the lack of that functionality in the other two package
1377 managers does not mean the dependencies do not still need resolving.
1378 This QA check attempts to ensure that explicitly declared
1379 :term:`RDEPENDS` exist to handle any file-level
1380 dependency detected in packaged files.
1381
1382- ``files-invalid:`` Checks for :term:`FILES` variable
1383 values that contain "//", which is invalid.
1384
1385- ``host-user-contaminated:`` Checks that no package produced by the
1386 recipe contains any files outside of ``/home`` with a user or group
1387 ID that matches the user running BitBake. A match usually indicates
1388 that the files are being installed with an incorrect UID/GID, since
1389 target IDs are independent from host IDs. For additional information,
1390 see the section describing the
1391 :ref:`ref-tasks-install` task.
1392
1393- ``incompatible-license:`` Report when packages are excluded from
1394 being created due to being marked with a license that is in
1395 :term:`INCOMPATIBLE_LICENSE`.
1396
1397- ``install-host-path:`` Checks the
1398 :ref:`ref-tasks-install` log for indications that
1399 paths to locations on the build host were used. Using such paths
1400 might result in host contamination of the build output.
1401
1402- ``installed-vs-shipped:`` Reports when files have been installed
Patrick Williams2194f502022-10-16 14:26:09 -05001403 within :ref:`ref-tasks-install` but have not been included in any package by
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001404 way of the :term:`FILES` variable. Files that do not
1405 appear in any package cannot be present in an image later on in the
1406 build process. Ideally, all installed files should be packaged or not
1407 installed at all. These files can be deleted at the end of
Patrick Williams2194f502022-10-16 14:26:09 -05001408 :ref:`ref-tasks-install` if the files are not needed in any package.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001409
1410- ``invalid-chars:`` Checks that the recipe metadata variables
1411 :term:`DESCRIPTION`,
1412 :term:`SUMMARY`, :term:`LICENSE`, and
1413 :term:`SECTION` do not contain non-UTF-8 characters.
1414 Some package managers do not support such characters.
1415
1416- ``invalid-packageconfig:`` Checks that no undefined features are
1417 being added to :term:`PACKAGECONFIG`. For
Andrew Geisslerc926e172021-05-07 16:11:35 -05001418 example, any name "foo" for which the following form does not exist::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001419
1420 PACKAGECONFIG[foo] = "..."
1421
Andrew Geissler09036742021-06-25 14:25:14 -05001422- ``la:`` Checks ``.la`` files for any :term:`TMPDIR` paths. Any ``.la``
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001423 file containing these paths is incorrect since ``libtool`` adds the
1424 correct sysroot prefix when using the files automatically itself.
1425
1426- ``ldflags:`` Ensures that the binaries were linked with the
1427 :term:`LDFLAGS` options provided by the build system.
Andrew Geissler09036742021-06-25 14:25:14 -05001428 If this test fails, check that the :term:`LDFLAGS` variable is being
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001429 passed to the linker command.
1430
1431- ``libdir:`` Checks for libraries being installed into incorrect
1432 (possibly hardcoded) installation paths. For example, this test will
1433 catch recipes that install ``/lib/bar.so`` when ``${base_libdir}`` is
1434 "lib32". Another example is when recipes install
1435 ``/usr/lib64/foo.so`` when ``${libdir}`` is "/usr/lib".
1436
1437- ``libexec:`` Checks if a package contains files in
1438 ``/usr/libexec``. This check is not performed if the ``libexecdir``
1439 variable has been set explicitly to ``/usr/libexec``.
1440
Patrick Williams8e7b46e2023-05-01 14:19:06 -05001441- ``mime:`` Check that if a package contains mime type files (``.xml``
1442 files in ``${datadir}/mime/packages``) that the recipe also inherits
1443 the :ref:`ref-classes-mime` class in order to ensure that these get
1444 properly installed.
1445
1446- ``mime-xdg:`` Checks that if a package contains a .desktop file with a
1447 'MimeType' key present, that the recipe inherits the
1448 :ref:`ref-classes-mime-xdg` class that is required in order for that
1449 to be activated.
1450
1451- ``missing-update-alternatives:`` Check that if a recipe sets the
1452 :term:`ALTERNATIVE` variable that the recipe also inherits
1453 :ref:`ref-classes-update-alternatives` such that the alternative will
1454 be correctly set up.
1455
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001456- ``packages-list:`` Checks for the same package being listed
1457 multiple times through the :term:`PACKAGES` variable
1458 value. Installing the package in this manner can cause errors during
1459 packaging.
1460
Patrick Williams8e7b46e2023-05-01 14:19:06 -05001461- ``patch-fuzz:`` Checks for fuzz in patch files that may allow
1462 them to apply incorrectly if the underlying code changes.
1463
1464- ``patch-status-core:`` Checks that the Upstream-Status is specified
1465 and valid in the headers of patches for recipes in the OE-Core layer.
1466
1467- ``patch-status-noncore:`` Checks that the Upstream-Status is specified
1468 and valid in the headers of patches for recipes in layers other than
1469 OE-Core.
1470
1471- ``perllocalpod:`` Checks for ``perllocal.pod`` being erroneously
1472 installed and packaged by a recipe.
1473
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001474- ``perm-config:`` Reports lines in ``fs-perms.txt`` that have an
1475 invalid format.
1476
1477- ``perm-line:`` Reports lines in ``fs-perms.txt`` that have an
1478 invalid format.
1479
1480- ``perm-link:`` Reports lines in ``fs-perms.txt`` that specify
1481 'link' where the specified target already exists.
1482
1483- ``perms:`` Currently, this check is unused but reserved.
1484
1485- ``pkgconfig:`` Checks ``.pc`` files for any
1486 :term:`TMPDIR`/:term:`WORKDIR` paths.
1487 Any ``.pc`` file containing these paths is incorrect since
1488 ``pkg-config`` itself adds the correct sysroot prefix when the files
1489 are accessed.
1490
1491- ``pkgname:`` Checks that all packages in
1492 :term:`PACKAGES` have names that do not contain
1493 invalid characters (i.e. characters other than 0-9, a-z, ., +, and
1494 -).
1495
Andrew Geissler09036742021-06-25 14:25:14 -05001496- ``pkgv-undefined:`` Checks to see if the :term:`PKGV` variable is
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001497 undefined during :ref:`ref-tasks-package`.
1498
1499- ``pkgvarcheck:`` Checks through the variables
1500 :term:`RDEPENDS`,
1501 :term:`RRECOMMENDS`,
1502 :term:`RSUGGESTS`,
1503 :term:`RCONFLICTS`,
1504 :term:`RPROVIDES`,
1505 :term:`RREPLACES`, :term:`FILES`,
1506 :term:`ALLOW_EMPTY`, ``pkg_preinst``,
1507 ``pkg_postinst``, ``pkg_prerm`` and ``pkg_postrm``, and reports if
1508 there are variable sets that are not package-specific. Using these
1509 variables without a package suffix is bad practice, and might
1510 unnecessarily complicate dependencies of other packages within the
1511 same recipe or have other unintended consequences.
1512
1513- ``pn-overrides:`` Checks that a recipe does not have a name
1514 (:term:`PN`) value that appears in
1515 :term:`OVERRIDES`. If a recipe is named such that
Andrew Geissler09036742021-06-25 14:25:14 -05001516 its :term:`PN` value matches something already in :term:`OVERRIDES` (e.g.
1517 :term:`PN` happens to be the same as :term:`MACHINE` or
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001518 :term:`DISTRO`), it can have unexpected consequences.
Patrick Williams0ca19cc2021-08-16 14:03:13 -05001519 For example, assignments such as ``FILES:${PN} = "xyz"`` effectively
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001520 turn into ``FILES = "xyz"``.
1521
1522- ``rpaths:`` Checks for rpaths in the binaries that contain build
Andrew Geissler5f350902021-07-23 13:09:54 -04001523 system paths such as :term:`TMPDIR`. If this test fails, bad ``-rpath``
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001524 options are being passed to the linker commands and your binaries
1525 have potential security issues.
1526
Patrick Williams8e7b46e2023-05-01 14:19:06 -05001527- ``shebang-size:`` Check that the shebang line (``#!`` in the first line)
1528 in a packaged script is not longer than 128 characters, which can cause
1529 an error at runtime depending on the operating system.
1530
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001531- ``split-strip:`` Reports that splitting or stripping debug symbols
1532 from binaries has failed.
1533
1534- ``staticdev:`` Checks for static library files (``*.a``) in
1535 non-``staticdev`` packages.
1536
Patrick Williams8e7b46e2023-05-01 14:19:06 -05001537- ``src-uri-bad:`` Checks that the :term:`SRC_URI` value set by a recipe
1538 does not contain a reference to ``${PN}`` (instead of the correct
1539 ``${BPN}``) nor refers to unstable Github archive tarballs.
1540
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001541- ``symlink-to-sysroot:`` Checks for symlinks in packages that point
1542 into :term:`TMPDIR` on the host. Such symlinks will
1543 work on the host, but are clearly invalid when running on the target.
1544
1545- ``textrel:`` Checks for ELF binaries that contain relocations in
1546 their ``.text`` sections, which can result in a performance impact at
Andrew Geissler4c19ea12020-10-27 13:52:24 -05001547 runtime. See the explanation for the ``ELF binary`` message in
Andrew Geissler09209ee2020-12-13 08:44:15 -06001548 ":doc:`/ref-manual/qa-checks`" for more information regarding runtime performance
Andrew Geissler4c19ea12020-10-27 13:52:24 -05001549 issues.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001550
Patrick Williams8e7b46e2023-05-01 14:19:06 -05001551- ``unhandled-features-check:`` check that if one of the variables that
1552 the :ref:`ref-classes-features_check` class supports (e.g.
Patrick Williamsb542dec2023-06-09 01:26:37 -05001553 :term:`REQUIRED_DISTRO_FEATURES`) is set by a recipe, then the recipe
Patrick Williams8e7b46e2023-05-01 14:19:06 -05001554 also inherits :ref:`ref-classes-features_check` in order for the
1555 requirement to actually work.
1556
Patrick Williamsac13d5f2023-11-24 18:59:46 -06001557- ``unimplemented-ptest:`` Checks that ptests are implemented for upstream
1558 tests.
1559
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001560- ``unlisted-pkg-lics:`` Checks that all declared licenses applying
1561 for a package are also declared on the recipe level (i.e. any license
Patrick Williams0ca19cc2021-08-16 14:03:13 -05001562 in ``LICENSE:*`` should appear in :term:`LICENSE`).
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001563
1564- ``useless-rpaths:`` Checks for dynamic library load paths (rpaths)
1565 in the binaries that by default on a standard system are searched by
1566 the linker (e.g. ``/lib`` and ``/usr/lib``). While these paths will
1567 not cause any breakage, they do waste space and are unnecessary.
1568
Patrick Williams8e7b46e2023-05-01 14:19:06 -05001569- ``usrmerge:`` If ``usrmerge`` is in :term:`DISTRO_FEATURES`, this
1570 check will ensure that no package installs files to root (``/bin``,
1571 ``/sbin``, ``/lib``, ``/lib64``) directories.
1572
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001573- ``var-undefined:`` Reports when variables fundamental to packaging
1574 (i.e. :term:`WORKDIR`,
1575 :term:`DEPLOY_DIR`, :term:`D`,
1576 :term:`PN`, and :term:`PKGD`) are undefined
1577 during :ref:`ref-tasks-package`.
1578
Patrick Williams8e7b46e2023-05-01 14:19:06 -05001579- ``version-going-backwards:`` If the :ref:`ref-classes-buildhistory`
1580 class is enabled, reports when a package being written out has a lower
1581 version than the previously written package under the same name. If
1582 you are placing output packages into a feed and upgrading packages on
1583 a target system using that feed, the version of a package going
1584 backwards can result in the target system not correctly upgrading to
1585 the "new" version of the package.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001586
1587 .. note::
1588
William A. Kennington IIIac69b482021-06-02 12:28:27 -07001589 This is only relevant when you are using runtime package management
1590 on your target system.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001591
Patrick Williams2f814a62024-04-16 16:28:03 -05001592- ``virtual-slash:`` Checks to see if ``virtual/`` is being used in
1593 :term:`RDEPENDS` or :term:`RPROVIDES`, which is not good practice ---
1594 ``virtual/`` is a convention intended for use in the build context
1595 (i.e. :term:`PROVIDES` and :term:`DEPENDS`) rather than the runtime
1596 context.
1597
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001598- ``xorg-driver-abi:`` Checks that all packages containing Xorg
1599 drivers have ABI dependencies. The ``xserver-xorg`` recipe provides
1600 driver ABI names. All drivers should depend on the ABI versions that
1601 they have been built against. Driver recipes that include
1602 ``xorg-driver-input.inc`` or ``xorg-driver-video.inc`` will
1603 automatically get these versions. Consequently, you should only need
1604 to explicitly add dependencies to binary driver recipes.
1605
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001606.. _ref-classes-kernel:
1607
Andrew Geissler517393d2023-01-13 08:55:19 -06001608``kernel``
1609==========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001610
Andrew Geissler517393d2023-01-13 08:55:19 -06001611The :ref:`ref-classes-kernel` class handles building Linux kernels. The class contains
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001612code to build all kernel trees. All needed headers are staged into the
Andrew Geissler5f350902021-07-23 13:09:54 -04001613:term:`STAGING_KERNEL_DIR` directory to allow out-of-tree module builds
Andrew Geissler517393d2023-01-13 08:55:19 -06001614using the :ref:`ref-classes-module` class.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001615
Andrew Geissler3eeda902023-05-19 10:14:02 -05001616If a file named ``defconfig`` is listed in :term:`SRC_URI`, then by default
1617:ref:`ref-tasks-configure` copies it as ``.config`` in the build directory,
1618so it is automatically used as the kernel configuration for the build. This
1619copy is not performed in case ``.config`` already exists there: this allows
1620recipes to produce a configuration by other means in
1621``do_configure:prepend``.
1622
1623Each built kernel module is packaged separately and inter-module
1624dependencies are created by parsing the ``modinfo`` output. If all modules
1625are required, then installing the ``kernel-modules`` package installs all
1626packages with modules and various other kernel packages such as
1627``kernel-vmlinux``.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001628
Andrew Geissler517393d2023-01-13 08:55:19 -06001629The :ref:`ref-classes-kernel` class contains logic that allows you to embed an initial
Patrick Williams2194f502022-10-16 14:26:09 -05001630RAM filesystem (:term:`Initramfs`) image when you build the kernel image. For
1631information on how to build an :term:`Initramfs`, see the
Andrew Geissler517393d2023-01-13 08:55:19 -06001632":ref:`dev-manual/building:building an initial ram filesystem (Initramfs) image`" section in
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001633the Yocto Project Development Tasks Manual.
1634
Andrew Geissler517393d2023-01-13 08:55:19 -06001635Various other classes are used by the :ref:`ref-classes-kernel` and :ref:`ref-classes-module` classes
1636internally including the :ref:`ref-classes-kernel-arch`, :ref:`ref-classes-module-base`, and
1637:ref:`ref-classes-linux-kernel-base` classes.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001638
1639.. _ref-classes-kernel-arch:
1640
Andrew Geissler517393d2023-01-13 08:55:19 -06001641``kernel-arch``
1642===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001643
Andrew Geissler517393d2023-01-13 08:55:19 -06001644The :ref:`ref-classes-kernel-arch` class sets the ``ARCH`` environment variable for
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001645Linux kernel compilation (including modules).
1646
1647.. _ref-classes-kernel-devicetree:
1648
Andrew Geissler517393d2023-01-13 08:55:19 -06001649``kernel-devicetree``
1650=====================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001651
Andrew Geissler517393d2023-01-13 08:55:19 -06001652The :ref:`ref-classes-kernel-devicetree` class, which is inherited by the
1653:ref:`ref-classes-kernel` class, supports device tree generation.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001654
Patrick Williamsb542dec2023-06-09 01:26:37 -05001655Its behavior is mainly controlled by the following variables:
1656
1657- :term:`KERNEL_DEVICETREE_BUNDLE`: whether to bundle the kernel and device tree
1658- :term:`KERNEL_DTBDEST`: directory where to install DTB files
1659- :term:`KERNEL_DTBVENDORED`: whether to keep vendor subdirectories
1660- :term:`KERNEL_DTC_FLAGS`: flags for ``dtc``, the Device Tree Compiler
1661- :term:`KERNEL_PACKAGE_NAME`: base name of the kernel packages
1662
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001663.. _ref-classes-kernel-fitimage:
1664
Andrew Geissler517393d2023-01-13 08:55:19 -06001665``kernel-fitimage``
1666===================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001667
Andrew Geissler517393d2023-01-13 08:55:19 -06001668The :ref:`ref-classes-kernel-fitimage` class provides support to pack a kernel image,
Patrick Williamsb542dec2023-06-09 01:26:37 -05001669device trees, a U-boot script, an :term:`Initramfs` bundle and a RAM disk
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001670into a single FIT image. In theory, a FIT image can support any number
Andrew Geissler517393d2023-01-13 08:55:19 -06001671of kernels, U-boot scripts, :term:`Initramfs` bundles, RAM disks and device-trees.
1672However, :ref:`ref-classes-kernel-fitimage` currently only supports
Patrick Williams975a06f2022-10-21 14:42:47 -05001673limited usecases: just one kernel image, an optional U-boot script,
Andrew Geissler517393d2023-01-13 08:55:19 -06001674an optional :term:`Initramfs` bundle, an optional RAM disk, and any number of
Patrick Williamsb542dec2023-06-09 01:26:37 -05001675device trees.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001676
1677To create a FIT image, it is required that :term:`KERNEL_CLASSES`
Patrick Williams2a254922023-08-11 09:48:11 -05001678is set to include ":ref:`ref-classes-kernel-fitimage`" and one of :term:`KERNEL_IMAGETYPE`,
1679:term:`KERNEL_ALT_IMAGETYPE` or :term:`KERNEL_IMAGETYPES` to include "fitImage".
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001680
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001681The options for the device tree compiler passed to ``mkimage -D``
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001682when creating the FIT image are specified using the
1683:term:`UBOOT_MKIMAGE_DTCOPTS` variable.
1684
1685Only a single kernel can be added to the FIT image created by
Andrew Geissler517393d2023-01-13 08:55:19 -06001686:ref:`ref-classes-kernel-fitimage` and the kernel image in FIT is mandatory. The
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001687address where the kernel image is to be loaded by U-Boot is
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001688specified by :term:`UBOOT_LOADADDRESS` and the entrypoint by
Andrew Geissler3eeda902023-05-19 10:14:02 -05001689:term:`UBOOT_ENTRYPOINT`. Setting :term:`FIT_ADDRESS_CELLS` to "2"
1690is necessary if such addresses are 64 bit ones.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001691
1692Multiple device trees can be added to the FIT image created by
Andrew Geissler517393d2023-01-13 08:55:19 -06001693:ref:`ref-classes-kernel-fitimage` and the device tree is optional.
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001694The address where the device tree is to be loaded by U-Boot is
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001695specified by :term:`UBOOT_DTBO_LOADADDRESS` for device tree overlays
Andrew Geissler4c19ea12020-10-27 13:52:24 -05001696and by :term:`UBOOT_DTB_LOADADDRESS` for device tree binaries.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001697
1698Only a single RAM disk can be added to the FIT image created by
Andrew Geissler517393d2023-01-13 08:55:19 -06001699:ref:`ref-classes-kernel-fitimage` and the RAM disk in FIT is optional.
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001700The address where the RAM disk image is to be loaded by U-Boot
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001701is specified by :term:`UBOOT_RD_LOADADDRESS` and the entrypoint by
Patrick Williams2a254922023-08-11 09:48:11 -05001702:term:`UBOOT_RD_ENTRYPOINT`. The ramdisk is added to the FIT image when
1703:term:`INITRAMFS_IMAGE` is specified and requires that :term:`INITRAMFS_IMAGE_BUNDLE`
1704is not set to 1.
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001705
Andrew Geissler517393d2023-01-13 08:55:19 -06001706Only a single :term:`Initramfs` bundle can be added to the FIT image created by
1707:ref:`ref-classes-kernel-fitimage` and the :term:`Initramfs` bundle in FIT is optional.
1708In case of :term:`Initramfs`, the kernel is configured to be bundled with the root filesystem
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001709in the same binary (example: zImage-initramfs-:term:`MACHINE`.bin).
Andrew Geissler517393d2023-01-13 08:55:19 -06001710When the kernel is copied to RAM and executed, it unpacks the :term:`Initramfs` root filesystem.
1711The :term:`Initramfs` bundle can be enabled when :term:`INITRAMFS_IMAGE`
Patrick Williams2a254922023-08-11 09:48:11 -05001712is specified and requires that :term:`INITRAMFS_IMAGE_BUNDLE` is set to 1.
Andrew Geissler517393d2023-01-13 08:55:19 -06001713The address where the :term:`Initramfs` bundle is to be loaded by U-boot is specified
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001714by :term:`UBOOT_LOADADDRESS` and the entrypoint by :term:`UBOOT_ENTRYPOINT`.
1715
1716Only a single U-boot boot script can be added to the FIT image created by
Andrew Geissler517393d2023-01-13 08:55:19 -06001717:ref:`ref-classes-kernel-fitimage` and the boot script is optional.
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001718The boot script is specified in the ITS file as a text file containing
1719U-boot commands. When using a boot script the user should configure the
Patrick Williams2194f502022-10-16 14:26:09 -05001720U-boot :ref:`ref-tasks-install` task to copy the script to sysroot.
Andrew Geissler517393d2023-01-13 08:55:19 -06001721So the script can be included in the FIT image by the :ref:`ref-classes-kernel-fitimage`
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001722class. At run-time, U-boot CONFIG_BOOTCOMMAND define can be configured to
Patrick Williams2a254922023-08-11 09:48:11 -05001723load the boot script from the FIT image and execute it.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001724
Patrick Williams2a254922023-08-11 09:48:11 -05001725The FIT image generated by the :ref:`ref-classes-kernel-fitimage` class is signed when the
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001726variables :term:`UBOOT_SIGN_ENABLE`, :term:`UBOOT_MKIMAGE_DTCOPTS`,
1727:term:`UBOOT_SIGN_KEYDIR` and :term:`UBOOT_SIGN_KEYNAME` are set
1728appropriately. The default values used for :term:`FIT_HASH_ALG` and
Andrew Geissler517393d2023-01-13 08:55:19 -06001729:term:`FIT_SIGN_ALG` in :ref:`ref-classes-kernel-fitimage` are "sha256" and
Patrick Williams2a254922023-08-11 09:48:11 -05001730"rsa2048" respectively. The keys for signing the FIT image can be generated using
Andrew Geissler517393d2023-01-13 08:55:19 -06001731the :ref:`ref-classes-kernel-fitimage` class when both :term:`FIT_GENERATE_KEYS` and
Andrew Geisslerc3d88e42020-10-02 09:45:00 -05001732:term:`UBOOT_SIGN_ENABLE` are set to "1".
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001733
1734
1735.. _ref-classes-kernel-grub:
1736
Andrew Geissler517393d2023-01-13 08:55:19 -06001737``kernel-grub``
1738===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001739
Andrew Geissler517393d2023-01-13 08:55:19 -06001740The :ref:`ref-classes-kernel-grub` class updates the boot area and the boot menu with
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001741the kernel as the priority boot mechanism while installing a RPM to
1742update the kernel on a deployed target.
1743
1744.. _ref-classes-kernel-module-split:
1745
Andrew Geissler517393d2023-01-13 08:55:19 -06001746``kernel-module-split``
1747=======================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001748
Andrew Geissler517393d2023-01-13 08:55:19 -06001749The :ref:`ref-classes-kernel-module-split` class provides common functionality for
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001750splitting Linux kernel modules into separate packages.
1751
1752.. _ref-classes-kernel-uboot:
1753
Andrew Geissler517393d2023-01-13 08:55:19 -06001754``kernel-uboot``
1755================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001756
Andrew Geissler517393d2023-01-13 08:55:19 -06001757The :ref:`ref-classes-kernel-uboot` class provides support for building from
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001758vmlinux-style kernel sources.
1759
1760.. _ref-classes-kernel-uimage:
1761
Andrew Geissler517393d2023-01-13 08:55:19 -06001762``kernel-uimage``
1763=================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001764
Andrew Geissler517393d2023-01-13 08:55:19 -06001765The :ref:`ref-classes-kernel-uimage` class provides support to pack uImage.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001766
1767.. _ref-classes-kernel-yocto:
1768
Andrew Geissler517393d2023-01-13 08:55:19 -06001769``kernel-yocto``
1770================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001771
Andrew Geissler517393d2023-01-13 08:55:19 -06001772The :ref:`ref-classes-kernel-yocto` class provides common functionality for building
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001773from linux-yocto style kernel source repositories.
1774
1775.. _ref-classes-kernelsrc:
1776
Andrew Geissler517393d2023-01-13 08:55:19 -06001777``kernelsrc``
1778=============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001779
Andrew Geissler517393d2023-01-13 08:55:19 -06001780The :ref:`ref-classes-kernelsrc` class sets the Linux kernel source and version.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001781
1782.. _ref-classes-lib_package:
1783
Andrew Geissler517393d2023-01-13 08:55:19 -06001784``lib_package``
1785===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001786
Andrew Geissler517393d2023-01-13 08:55:19 -06001787The :ref:`ref-classes-lib_package` class supports recipes that build libraries and
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001788produce executable binaries, where those binaries should not be
1789installed by default along with the library. Instead, the binaries are
1790added to a separate ``${``\ :term:`PN`\ ``}-bin`` package to
1791make their installation optional.
1792
1793.. _ref-classes-libc*:
1794
Andrew Geissler517393d2023-01-13 08:55:19 -06001795``libc*``
1796=========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001797
Andrew Geissler517393d2023-01-13 08:55:19 -06001798The :ref:`ref-classes-libc*` classes support recipes that build packages with ``libc``:
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001799
Patrick Williams2390b1b2022-11-03 13:47:49 -05001800- The :ref:`libc-common <ref-classes-libc*>` class provides common support for building with
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001801 ``libc``.
1802
Patrick Williams2390b1b2022-11-03 13:47:49 -05001803- The :ref:`libc-package <ref-classes-libc*>` class supports packaging up ``glibc`` and
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001804 ``eglibc``.
1805
1806.. _ref-classes-license:
1807
Andrew Geissler517393d2023-01-13 08:55:19 -06001808``license``
1809===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001810
Andrew Geissler517393d2023-01-13 08:55:19 -06001811The :ref:`ref-classes-license` class provides license manifest creation and license
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001812exclusion. This class is enabled by default using the default value for
1813the :term:`INHERIT_DISTRO` variable.
1814
1815.. _ref-classes-linux-kernel-base:
1816
Andrew Geissler517393d2023-01-13 08:55:19 -06001817``linux-kernel-base``
1818=====================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001819
Andrew Geissler517393d2023-01-13 08:55:19 -06001820The :ref:`ref-classes-linux-kernel-base` class provides common functionality for
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001821recipes that build out of the Linux kernel source tree. These builds
1822goes beyond the kernel itself. For example, the Perf recipe also
1823inherits this class.
1824
1825.. _ref-classes-linuxloader:
1826
Andrew Geissler517393d2023-01-13 08:55:19 -06001827``linuxloader``
1828===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001829
1830Provides the function ``linuxloader()``, which gives the value of the
1831dynamic loader/linker provided on the platform. This value is used by a
1832number of other classes.
1833
1834.. _ref-classes-logging:
1835
Andrew Geissler517393d2023-01-13 08:55:19 -06001836``logging``
1837===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001838
Andrew Geissler517393d2023-01-13 08:55:19 -06001839The :ref:`ref-classes-logging` class provides the standard shell functions used to log
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001840messages for various BitBake severity levels (i.e. ``bbplain``,
1841``bbnote``, ``bbwarn``, ``bberror``, ``bbfatal``, and ``bbdebug``).
1842
Andrew Geissler517393d2023-01-13 08:55:19 -06001843This class is enabled by default since it is inherited by the :ref:`ref-classes-base`
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001844class.
1845
Andrew Geissler6aa7eec2023-03-03 12:41:14 -06001846.. _ref-classes-meson:
1847
1848``meson``
1849=========
1850
1851The :ref:`ref-classes-meson` class allows to create recipes that build software
Patrick Williamsac13d5f2023-11-24 18:59:46 -06001852using the `Meson <https://mesonbuild.com/>`__ build system. You can use the
1853:term:`MESON_BUILDTYPE`, :term:`MESON_TARGET` and :term:`EXTRA_OEMESON`
1854variables to specify additional configuration options to be passed using the
1855``meson`` command line.
Andrew Geissler6aa7eec2023-03-03 12:41:14 -06001856
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001857.. _ref-classes-metadata_scm:
1858
Andrew Geissler517393d2023-01-13 08:55:19 -06001859``metadata_scm``
1860================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001861
Andrew Geissler517393d2023-01-13 08:55:19 -06001862The :ref:`ref-classes-metadata_scm` class provides functionality for querying the
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001863branch and revision of a Source Code Manager (SCM) repository.
1864
Andrew Geissler517393d2023-01-13 08:55:19 -06001865The :ref:`ref-classes-base` class uses this class to print the revisions of
1866each layer before starting every build. The :ref:`ref-classes-metadata_scm`
1867class is enabled by default because it is inherited by the
1868:ref:`ref-classes-base` class.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001869
1870.. _ref-classes-migrate_localcount:
1871
Andrew Geissler517393d2023-01-13 08:55:19 -06001872``migrate_localcount``
1873======================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001874
Andrew Geissler517393d2023-01-13 08:55:19 -06001875The :ref:`ref-classes-migrate_localcount` class verifies a recipe's localcount data and
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001876increments it appropriately.
1877
1878.. _ref-classes-mime:
1879
Andrew Geissler517393d2023-01-13 08:55:19 -06001880``mime``
1881========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001882
Andrew Geissler517393d2023-01-13 08:55:19 -06001883The :ref:`ref-classes-mime` class generates the proper post-install and post-remove
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001884(postinst/postrm) scriptlets for packages that install MIME type files.
1885These scriptlets call ``update-mime-database`` to add the MIME types to
1886the shared database.
1887
Patrick Williams7784c422022-11-17 07:29:11 -06001888.. _ref-classes-mime-xdg:
1889
Andrew Geissler517393d2023-01-13 08:55:19 -06001890``mime-xdg``
1891============
Patrick Williams7784c422022-11-17 07:29:11 -06001892
Andrew Geissler517393d2023-01-13 08:55:19 -06001893The :ref:`ref-classes-mime-xdg` class generates the proper
Patrick Williams7784c422022-11-17 07:29:11 -06001894post-install and post-remove (postinst/postrm) scriptlets for packages
1895that install ``.desktop`` files containing ``MimeType`` entries.
1896These scriptlets call ``update-desktop-database`` to add the MIME types
1897to the database of MIME types handled by desktop files.
1898
1899Thanks to this class, when users open a file through a file browser
1900on recently created images, they don't have to choose the application
1901to open the file from the pool of all known applications, even the ones
1902that cannot open the selected file.
1903
1904If you have recipes installing their ``.desktop`` files as absolute
1905symbolic links, the detection of such files cannot be done by the current
1906implementation of this class. In this case, you have to add the corresponding
1907package names to the :term:`MIME_XDG_PACKAGES` variable.
1908
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001909.. _ref-classes-mirrors:
1910
Andrew Geissler517393d2023-01-13 08:55:19 -06001911``mirrors``
1912===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001913
Andrew Geissler517393d2023-01-13 08:55:19 -06001914The :ref:`ref-classes-mirrors` class sets up some standard
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001915:term:`MIRRORS` entries for source code mirrors. These
1916mirrors provide a fall-back path in case the upstream source specified
1917in :term:`SRC_URI` within recipes is unavailable.
1918
1919This class is enabled by default since it is inherited by the
Andrew Geissler517393d2023-01-13 08:55:19 -06001920:ref:`ref-classes-base` class.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001921
1922.. _ref-classes-module:
1923
Andrew Geissler517393d2023-01-13 08:55:19 -06001924``module``
1925==========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001926
Andrew Geissler517393d2023-01-13 08:55:19 -06001927The :ref:`ref-classes-module` class provides support for building out-of-tree Linux
1928kernel modules. The class inherits the :ref:`ref-classes-module-base` and
1929:ref:`ref-classes-kernel-module-split` classes, and implements the
1930:ref:`ref-tasks-compile` and :ref:`ref-tasks-install` tasks. The class provides
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001931everything needed to build and package a kernel module.
1932
1933For general information on out-of-tree Linux kernel modules, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -06001934":ref:`kernel-dev/common:incorporating out-of-tree modules`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001935section in the Yocto Project Linux Kernel Development Manual.
1936
1937.. _ref-classes-module-base:
1938
Andrew Geissler517393d2023-01-13 08:55:19 -06001939``module-base``
1940===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001941
Andrew Geissler517393d2023-01-13 08:55:19 -06001942The :ref:`ref-classes-module-base` class provides the base functionality for
1943building Linux kernel modules. Typically, a recipe that builds software that
1944includes one or more kernel modules and has its own means of building the module
1945inherits this class as opposed to inheriting the :ref:`ref-classes-module`
1946class.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001947
1948.. _ref-classes-multilib*:
1949
Andrew Geissler517393d2023-01-13 08:55:19 -06001950``multilib*``
1951=============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001952
Andrew Geissler517393d2023-01-13 08:55:19 -06001953The :ref:`ref-classes-multilib*` classes provide support for building libraries with
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001954different target optimizations or target architectures and installing
1955them side-by-side in the same image.
1956
1957For more information on using the Multilib feature, see the
Andrew Geissler517393d2023-01-13 08:55:19 -06001958":ref:`dev-manual/libraries:combining multiple versions of library files into one image`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001959section in the Yocto Project Development Tasks Manual.
1960
1961.. _ref-classes-native:
1962
Andrew Geissler517393d2023-01-13 08:55:19 -06001963``native``
1964==========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001965
Andrew Geissler517393d2023-01-13 08:55:19 -06001966The :ref:`ref-classes-native` class provides common functionality for recipes that
Andrew Geissler4c19ea12020-10-27 13:52:24 -05001967build tools to run on the :term:`Build Host` (i.e. tools that use the compiler
1968or other tools from the build host).
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001969
1970You can create a recipe that builds tools that run natively on the host
1971a couple different ways:
1972
Andrew Geissler517393d2023-01-13 08:55:19 -06001973- Create a ``myrecipe-native.bb`` recipe that inherits the :ref:`ref-classes-native`
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001974 class. If you use this method, you must order the inherit statement
1975 in the recipe after all other inherit statements so that the
Andrew Geissler517393d2023-01-13 08:55:19 -06001976 :ref:`ref-classes-native` class is inherited last.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001977
1978 .. note::
1979
1980 When creating a recipe this way, the recipe name must follow this
Andrew Geisslerc926e172021-05-07 16:11:35 -05001981 naming convention::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001982
1983 myrecipe-native.bb
1984
1985
1986 Not using this naming convention can lead to subtle problems
1987 caused by existing code that depends on that naming convention.
1988
Andrew Geisslerc926e172021-05-07 16:11:35 -05001989- Create or modify a target recipe that contains the following::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001990
1991 BBCLASSEXTEND = "native"
1992
1993 Inside the
Patrick Williams0ca19cc2021-08-16 14:03:13 -05001994 recipe, use ``:class-native`` and ``:class-target`` overrides to
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001995 specify any functionality specific to the respective native or target
1996 case.
1997
Andrew Geissler517393d2023-01-13 08:55:19 -06001998Although applied differently, the :ref:`ref-classes-native` class is used with both
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001999methods. The advantage of the second method is that you do not need to
2000have two separate recipes (assuming you need both) for native and
2001target. All common parts of the recipe are automatically shared.
2002
2003.. _ref-classes-nativesdk:
2004
Andrew Geissler517393d2023-01-13 08:55:19 -06002005``nativesdk``
2006=============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002007
Andrew Geissler517393d2023-01-13 08:55:19 -06002008The :ref:`ref-classes-nativesdk` class provides common functionality for recipes that
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002009wish to build tools to run as part of an SDK (i.e. tools that run on
2010:term:`SDKMACHINE`).
2011
2012You can create a recipe that builds tools that run on the SDK machine a
2013couple different ways:
2014
Andrew Geisslereff27472021-10-29 15:35:00 -05002015- Create a ``nativesdk-myrecipe.bb`` recipe that inherits the
Andrew Geissler517393d2023-01-13 08:55:19 -06002016 :ref:`ref-classes-nativesdk` class. If you use this method, you must order the
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002017 inherit statement in the recipe after all other inherit statements so
Andrew Geissler517393d2023-01-13 08:55:19 -06002018 that the :ref:`ref-classes-nativesdk` class is inherited last.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002019
Andrew Geissler517393d2023-01-13 08:55:19 -06002020- Create a :ref:`ref-classes-nativesdk` variant of any recipe by adding the following::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002021
2022 BBCLASSEXTEND = "nativesdk"
2023
2024 Inside the
Patrick Williams0ca19cc2021-08-16 14:03:13 -05002025 recipe, use ``:class-nativesdk`` and ``:class-target`` overrides to
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002026 specify any functionality specific to the respective SDK machine or
2027 target case.
2028
2029.. note::
2030
Andrew Geisslerc926e172021-05-07 16:11:35 -05002031 When creating a recipe, you must follow this naming convention::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002032
2033 nativesdk-myrecipe.bb
2034
2035
William A. Kennington IIIac69b482021-06-02 12:28:27 -07002036 Not doing so can lead to subtle problems because there is code that
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002037 depends on the naming convention.
2038
Andrew Geissler517393d2023-01-13 08:55:19 -06002039Although applied differently, the :ref:`ref-classes-nativesdk` class is used with both
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002040methods. The advantage of the second method is that you do not need to
2041have two separate recipes (assuming you need both) for the SDK machine
2042and the target. All common parts of the recipe are automatically shared.
2043
2044.. _ref-classes-nopackages:
2045
Andrew Geissler517393d2023-01-13 08:55:19 -06002046``nopackages``
2047==============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002048
2049Disables packaging tasks for those recipes and classes where packaging
2050is not needed.
2051
2052.. _ref-classes-npm:
2053
Andrew Geissler517393d2023-01-13 08:55:19 -06002054``npm``
2055=======
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002056
Patrick Williams7784c422022-11-17 07:29:11 -06002057Provides support for building Node.js software fetched using the
2058:wikipedia:`node package manager (NPM) <Npm_(software)>`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002059
2060.. note::
2061
Andrew Geissler4c19ea12020-10-27 13:52:24 -05002062 Currently, recipes inheriting this class must use the ``npm://``
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002063 fetcher to have dependencies fetched and packaged automatically.
2064
2065For information on how to create NPM packages, see the
Andrew Geissler517393d2023-01-13 08:55:19 -06002066":ref:`dev-manual/packages:creating node package manager (npm) packages`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002067section in the Yocto Project Development Tasks Manual.
2068
2069.. _ref-classes-oelint:
2070
Andrew Geissler517393d2023-01-13 08:55:19 -06002071``oelint``
2072==========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002073
Andrew Geissler517393d2023-01-13 08:55:19 -06002074The :ref:`ref-classes-oelint` class is an obsolete lint checking tool available in
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002075``meta/classes`` in the :term:`Source Directory`.
2076
William A. Kennington IIIac69b482021-06-02 12:28:27 -07002077There are some classes that could be generally useful in OE-Core but
Andrew Geissler517393d2023-01-13 08:55:19 -06002078are never actually used within OE-Core itself. The :ref:`ref-classes-oelint` class is
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002079one such example. However, being aware of this class can reduce the
2080proliferation of different versions of similar classes across multiple
2081layers.
2082
Andrew Geissler5199d832021-09-24 16:47:35 -05002083.. _ref-classes-overlayfs:
2084
Andrew Geissler517393d2023-01-13 08:55:19 -06002085``overlayfs``
2086=============
Andrew Geissler5199d832021-09-24 16:47:35 -05002087
Andrew Geissler595f6302022-01-24 19:11:47 +00002088It's often desired in Embedded System design to have a read-only root filesystem.
Andrew Geissler5199d832021-09-24 16:47:35 -05002089But a lot of different applications might want to have read-write access to
2090some parts of a filesystem. It can be especially useful when your update mechanism
Andrew Geissler595f6302022-01-24 19:11:47 +00002091overwrites the whole root filesystem, but you may want your application data to be preserved
Andrew Geissler517393d2023-01-13 08:55:19 -06002092between updates. The :ref:`ref-classes-overlayfs` class provides a way
Andrew Geissler5199d832021-09-24 16:47:35 -05002093to achieve that by means of ``overlayfs`` and at the same time keeping the base
Andrew Geissler595f6302022-01-24 19:11:47 +00002094root filesystem read-only.
Andrew Geissler5199d832021-09-24 16:47:35 -05002095
2096To use this class, set a mount point for a partition ``overlayfs`` is going to use as upper
2097layer in your machine configuration. The underlying file system can be anything that
2098is supported by ``overlayfs``. This has to be done in your machine configuration::
2099
2100 OVERLAYFS_MOUNT_POINT[data] = "/data"
2101
2102.. note::
2103
2104 * QA checks fail to catch file existence if you redefine this variable in your recipe!
2105 * Only the existence of the systemd mount unit file is checked, not its contents.
2106 * To get more details on ``overlayfs``, its internals and supported operations, please refer
Patrick Williams2390b1b2022-11-03 13:47:49 -05002107 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 -05002108
2109The class assumes you have a ``data.mount`` systemd unit defined elsewhere in your BSP
2110(e.g. in ``systemd-machine-units`` recipe) and it's installed into the image.
2111
2112Then you can specify writable directories on a recipe basis (e.g. in my-application.bb)::
2113
2114 OVERLAYFS_WRITABLE_PATHS[data] = "/usr/share/my-custom-application"
2115
2116To support several mount points you can use a different variable flag. Assuming we
2117want to have a writable location on the file system, but do not need that the data
Andrew Geissler595f6302022-01-24 19:11:47 +00002118survives a reboot, then we could have a ``mnt-overlay.mount`` unit for a ``tmpfs``
2119file system.
Andrew Geissler5199d832021-09-24 16:47:35 -05002120
2121In your machine configuration::
2122
2123 OVERLAYFS_MOUNT_POINT[mnt-overlay] = "/mnt/overlay"
2124
2125and then in your recipe::
2126
2127 OVERLAYFS_WRITABLE_PATHS[mnt-overlay] = "/usr/share/another-application"
2128
Andrew Geissler595f6302022-01-24 19:11:47 +00002129On a practical note, your application recipe might require multiple
2130overlays to be mounted before running to avoid writing to the underlying
2131file system (which can be forbidden in case of read-only file system)
Andrew Geissler517393d2023-01-13 08:55:19 -06002132To achieve that :ref:`ref-classes-overlayfs` provides a ``systemd``
Andrew Geissler595f6302022-01-24 19:11:47 +00002133helper service for mounting overlays. This helper service is named
2134``${PN}-overlays.service`` and can be depended on in your application recipe
2135(named ``application`` in the following example) ``systemd`` unit by adding
2136to the unit the following::
2137
2138 [Unit]
2139 After=application-overlays.service
2140 Requires=application-overlays.service
2141
Andrew Geissler5199d832021-09-24 16:47:35 -05002142.. note::
2143
2144 The class does not support the ``/etc`` directory itself, because ``systemd`` depends on it.
Andrew Geissler517393d2023-01-13 08:55:19 -06002145 In order to get ``/etc`` in overlayfs, see :ref:`ref-classes-overlayfs-etc`.
Andrew Geissler595f6302022-01-24 19:11:47 +00002146
2147.. _ref-classes-overlayfs-etc:
2148
Andrew Geissler517393d2023-01-13 08:55:19 -06002149``overlayfs-etc``
2150=================
Andrew Geissler595f6302022-01-24 19:11:47 +00002151
2152In order to have the ``/etc`` directory in overlayfs a special handling at early
2153boot stage is required. The idea is to supply a custom init script that mounts
2154``/etc`` before launching the actual init program, because the latter already
2155requires ``/etc`` to be mounted.
2156
2157Example usage in image recipe::
2158
2159 IMAGE_FEATURES += "overlayfs-etc"
2160
2161.. note::
2162
2163 This class must not be inherited directly. Use :term:`IMAGE_FEATURES` or :term:`EXTRA_IMAGE_FEATURES`
2164
2165Your machine configuration should define at least the device, mount point, and file system type
2166you are going to use for ``overlayfs``::
2167
2168 OVERLAYFS_ETC_MOUNT_POINT = "/data"
2169 OVERLAYFS_ETC_DEVICE = "/dev/mmcblk0p2"
2170 OVERLAYFS_ETC_FSTYPE ?= "ext4"
2171
2172To control more mount options you should consider setting mount options
2173(``defaults`` is used by default)::
2174
2175 OVERLAYFS_ETC_MOUNT_OPTIONS = "wsync"
2176
2177The class provides two options for ``/sbin/init`` generation:
2178
2179- The default option is to rename the original ``/sbin/init`` to ``/sbin/init.orig``
2180 and place the generated init under original name, i.e. ``/sbin/init``. It has an advantage
2181 that you won't need to change any kernel parameters in order to make it work,
2182 but it poses a restriction that package-management can't be used, because updating
2183 the init manager would remove the generated script.
2184
2185- If you wish to keep original init as is, you can set::
2186
2187 OVERLAYFS_ETC_USE_ORIG_INIT_NAME = "0"
2188
2189 Then the generated init will be named ``/sbin/preinit`` and you would need to extend your
2190 kernel parameters manually in your bootloader configuration.
Andrew Geissler5199d832021-09-24 16:47:35 -05002191
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002192.. _ref-classes-own-mirrors:
2193
Andrew Geissler517393d2023-01-13 08:55:19 -06002194``own-mirrors``
2195===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002196
Andrew Geissler517393d2023-01-13 08:55:19 -06002197The :ref:`ref-classes-own-mirrors` class makes it easier to set up your own
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002198:term:`PREMIRRORS` from which to first fetch source
2199before attempting to fetch it from the upstream specified in
2200:term:`SRC_URI` within each recipe.
2201
2202To use this class, inherit it globally and specify
Andrew Geisslerc926e172021-05-07 16:11:35 -05002203:term:`SOURCE_MIRROR_URL`. Here is an example::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002204
2205 INHERIT += "own-mirrors"
2206 SOURCE_MIRROR_URL = "http://example.com/my-source-mirror"
2207
2208You can specify only a single URL
Andrew Geissler09036742021-06-25 14:25:14 -05002209in :term:`SOURCE_MIRROR_URL`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002210
2211.. _ref-classes-package:
2212
Andrew Geissler517393d2023-01-13 08:55:19 -06002213``package``
2214===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002215
Andrew Geissler517393d2023-01-13 08:55:19 -06002216The :ref:`ref-classes-package` class supports generating packages from a build's
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002217output. The core generic functionality is in ``package.bbclass``. The
2218code specific to particular package types resides in these
Andrew Geissler517393d2023-01-13 08:55:19 -06002219package-specific classes: :ref:`ref-classes-package_deb`,
Patrick Williams8e7b46e2023-05-01 14:19:06 -05002220:ref:`ref-classes-package_rpm`, :ref:`ref-classes-package_ipk`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002221
2222You can control the list of resulting package formats by using the
Andrew Geissler09036742021-06-25 14:25:14 -05002223:term:`PACKAGE_CLASSES` variable defined in your ``conf/local.conf``
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002224configuration file, which is located in the :term:`Build Directory`.
Patrick Williams2390b1b2022-11-03 13:47:49 -05002225When defining the variable, you can specify one or more package types.
2226Since images are generated from packages, a packaging class is needed
2227to enable image generation. The first class listed in this variable is
2228used for image generation.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002229
2230If you take the optional step to set up a repository (package feed) on
2231the development host that can be used by DNF, you can install packages
2232from the feed while you are running the image on the target (i.e.
2233runtime installation of packages). For more information, see the
Andrew Geissler517393d2023-01-13 08:55:19 -06002234":ref:`dev-manual/packages:using runtime package management`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002235section in the Yocto Project Development Tasks Manual.
2236
2237The package-specific class you choose can affect build-time performance
2238and has space ramifications. In general, building a package with IPK
2239takes about thirty percent less time as compared to using RPM to build
2240the same or similar package. This comparison takes into account a
2241complete build of the package with all dependencies previously built.
2242The reason for this discrepancy is because the RPM package manager
2243creates and processes more :term:`Metadata` than the IPK package
Andrew Geissler09036742021-06-25 14:25:14 -05002244manager. Consequently, you might consider setting :term:`PACKAGE_CLASSES` to
Andrew Geissler517393d2023-01-13 08:55:19 -06002245":ref:`ref-classes-package_ipk`" if you are building smaller systems.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002246
2247Before making your package manager decision, however, you should
2248consider some further things about using RPM:
2249
2250- RPM starts to provide more abilities than IPK due to the fact that it
2251 processes more Metadata. For example, this information includes
2252 individual file types, file checksum generation and evaluation on
2253 install, sparse file support, conflict detection and resolution for
2254 Multilib systems, ACID style upgrade, and repackaging abilities for
2255 rollbacks.
2256
2257- For smaller systems, the extra space used for the Berkeley Database
2258 and the amount of metadata when using RPM can affect your ability to
2259 perform on-device upgrades.
2260
2261You can find additional information on the effects of the package class
2262at these two Yocto Project mailing list links:
2263
Andrew Geissler4c19ea12020-10-27 13:52:24 -05002264- :yocto_lists:`/pipermail/poky/2011-May/006362.html`
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002265
Andrew Geissler4c19ea12020-10-27 13:52:24 -05002266- :yocto_lists:`/pipermail/poky/2011-May/006363.html`
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002267
2268.. _ref-classes-package_deb:
2269
Andrew Geissler517393d2023-01-13 08:55:19 -06002270``package_deb``
2271===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002272
Andrew Geissler517393d2023-01-13 08:55:19 -06002273The :ref:`ref-classes-package_deb` class provides support for creating packages that
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002274use the Debian (i.e. ``.deb``) file format. The class ensures the
2275packages are written out in a ``.deb`` file format to the
2276``${``\ :term:`DEPLOY_DIR_DEB`\ ``}`` directory.
2277
Andrew Geissler517393d2023-01-13 08:55:19 -06002278This class inherits the :ref:`ref-classes-package` class and
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002279is enabled through the :term:`PACKAGE_CLASSES`
2280variable in the ``local.conf`` file.
2281
2282.. _ref-classes-package_ipk:
2283
Andrew Geissler517393d2023-01-13 08:55:19 -06002284``package_ipk``
2285===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002286
Andrew Geissler517393d2023-01-13 08:55:19 -06002287The :ref:`ref-classes-package_ipk` class provides support for creating packages that
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002288use the IPK (i.e. ``.ipk``) file format. The class ensures the packages
2289are written out in a ``.ipk`` file format to the
2290``${``\ :term:`DEPLOY_DIR_IPK`\ ``}`` directory.
2291
Andrew Geissler517393d2023-01-13 08:55:19 -06002292This class inherits the :ref:`ref-classes-package` class and
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002293is enabled through the :term:`PACKAGE_CLASSES`
2294variable in the ``local.conf`` file.
2295
2296.. _ref-classes-package_rpm:
2297
Andrew Geissler517393d2023-01-13 08:55:19 -06002298``package_rpm``
2299===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002300
Andrew Geissler517393d2023-01-13 08:55:19 -06002301The :ref:`ref-classes-package_rpm` class provides support for creating packages that
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002302use the RPM (i.e. ``.rpm``) file format. The class ensures the packages
2303are written out in a ``.rpm`` file format to the
2304``${``\ :term:`DEPLOY_DIR_RPM`\ ``}`` directory.
2305
Andrew Geissler517393d2023-01-13 08:55:19 -06002306This class inherits the :ref:`ref-classes-package` class and
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002307is enabled through the :term:`PACKAGE_CLASSES`
2308variable in the ``local.conf`` file.
2309
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002310.. _ref-classes-packagedata:
2311
Andrew Geissler517393d2023-01-13 08:55:19 -06002312``packagedata``
2313===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002314
Andrew Geissler517393d2023-01-13 08:55:19 -06002315The :ref:`ref-classes-packagedata` class provides common functionality for reading
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002316``pkgdata`` files found in :term:`PKGDATA_DIR`. These
2317files contain information about each output package produced by the
2318OpenEmbedded build system.
2319
2320This class is enabled by default because it is inherited by the
Andrew Geissler517393d2023-01-13 08:55:19 -06002321:ref:`ref-classes-package` class.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002322
2323.. _ref-classes-packagegroup:
2324
Andrew Geissler517393d2023-01-13 08:55:19 -06002325``packagegroup``
2326================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002327
Andrew Geissler517393d2023-01-13 08:55:19 -06002328The :ref:`ref-classes-packagegroup` class sets default values appropriate for package
Andrew Geissler09036742021-06-25 14:25:14 -05002329group recipes (e.g. :term:`PACKAGES`, :term:`PACKAGE_ARCH`, :term:`ALLOW_EMPTY`, and
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002330so forth). It is highly recommended that all package group recipes
2331inherit this class.
2332
2333For information on how to use this class, see the
Andrew Geissler517393d2023-01-13 08:55:19 -06002334":ref:`dev-manual/customizing-images:customizing images using custom package groups`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002335section in the Yocto Project Development Tasks Manual.
2336
2337Previously, this class was called the ``task`` class.
2338
2339.. _ref-classes-patch:
2340
Andrew Geissler517393d2023-01-13 08:55:19 -06002341``patch``
2342=========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002343
Andrew Geissler517393d2023-01-13 08:55:19 -06002344The :ref:`ref-classes-patch` class provides all functionality for applying patches
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002345during the :ref:`ref-tasks-patch` task.
2346
2347This class is enabled by default because it is inherited by the
Andrew Geissler517393d2023-01-13 08:55:19 -06002348:ref:`ref-classes-base` class.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002349
2350.. _ref-classes-perlnative:
2351
Andrew Geissler517393d2023-01-13 08:55:19 -06002352``perlnative``
2353==============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002354
Andrew Geissler517393d2023-01-13 08:55:19 -06002355When inherited by a recipe, the :ref:`ref-classes-perlnative` class supports using the
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002356native version of Perl built by the build system rather than using the
2357version provided by the build host.
2358
Patrick Williams975a06f2022-10-21 14:42:47 -05002359.. _ref-classes-pypi:
2360
Andrew Geissler517393d2023-01-13 08:55:19 -06002361``pypi``
2362========
Patrick Williams975a06f2022-10-21 14:42:47 -05002363
Andrew Geissler517393d2023-01-13 08:55:19 -06002364The :ref:`ref-classes-pypi` class sets variables appropriately for recipes that build
Patrick Williams975a06f2022-10-21 14:42:47 -05002365Python modules from `PyPI <https://pypi.org/>`__, the Python Package Index.
2366By default it determines the PyPI package name based upon :term:`BPN`
2367(stripping the "python-" or "python3-" prefix off if present), however in
2368some cases you may need to set it manually in the recipe by setting
2369:term:`PYPI_PACKAGE`.
2370
Andrew Geissler517393d2023-01-13 08:55:19 -06002371Variables set by the :ref:`ref-classes-pypi` class include :term:`SRC_URI`, :term:`SECTION`,
Patrick Williams975a06f2022-10-21 14:42:47 -05002372:term:`HOMEPAGE`, :term:`UPSTREAM_CHECK_URI`, :term:`UPSTREAM_CHECK_REGEX`
2373and :term:`CVE_PRODUCT`.
2374
Patrick Williams45852732022-04-02 08:58:32 -05002375.. _ref-classes-python_flit_core:
2376
Andrew Geissler517393d2023-01-13 08:55:19 -06002377``python_flit_core``
2378====================
Patrick Williams45852732022-04-02 08:58:32 -05002379
Andrew Geissler517393d2023-01-13 08:55:19 -06002380The :ref:`ref-classes-python_flit_core` class enables building Python modules which declare
Patrick Williams45852732022-04-02 08:58:32 -05002381the `PEP-517 <https://www.python.org/dev/peps/pep-0517/>`__ compliant
2382``flit_core.buildapi`` ``build-backend`` in the ``[build-system]``
2383section of ``pyproject.toml`` (See `PEP-518 <https://www.python.org/dev/peps/pep-0518/>`__).
2384
2385Python modules built with ``flit_core.buildapi`` are pure Python (no
2386``C`` or ``Rust`` extensions).
2387
Andrew Geissler517393d2023-01-13 08:55:19 -06002388Internally this uses the :ref:`ref-classes-python_pep517` class.
Patrick Williams45852732022-04-02 08:58:32 -05002389
Patrick Williams2f814a62024-04-16 16:28:03 -05002390.. _ref-classes-python_maturin:
2391
2392``python_maturin``
2393==================
2394
2395The :ref:`ref-classes-python_maturin` class provides support for python-maturin, a replacement
2396for setuptools_rust and another "backend" for building Python Wheels.
2397
2398.. _ref-classes-python_mesonpy:
2399
2400``python_mesonpy``
2401==================
2402
2403The :ref:`ref-classes-python_mesonpy` class enables building Python modules which use the
2404meson-python build system.
2405
2406Internally this uses the :ref:`ref-classes-python_pep517` class.
2407
Andrew Geissler9aee5002022-03-30 16:27:02 +00002408.. _ref-classes-python_pep517:
2409
Andrew Geissler517393d2023-01-13 08:55:19 -06002410``python_pep517``
2411=================
Andrew Geissler9aee5002022-03-30 16:27:02 +00002412
Andrew Geissler517393d2023-01-13 08:55:19 -06002413The :ref:`ref-classes-python_pep517` class builds and installs a Python ``wheel`` binary
Patrick Williams45852732022-04-02 08:58:32 -05002414archive (see `PEP-517 <https://peps.python.org/pep-0517/>`__).
Andrew Geissler9aee5002022-03-30 16:27:02 +00002415
Patrick Williams45852732022-04-02 08:58:32 -05002416Recipes wouldn't inherit this directly, instead typically another class will
Andrew Geissler615f2f12022-07-15 14:00:58 -05002417inherit this and add the relevant native dependencies.
Andrew Geissler9aee5002022-03-30 16:27:02 +00002418
Andrew Geissler517393d2023-01-13 08:55:19 -06002419Examples of classes which do this are :ref:`ref-classes-python_flit_core`,
2420:ref:`ref-classes-python_setuptools_build_meta`, and
2421:ref:`ref-classes-python_poetry_core`.
Patrick Williams45852732022-04-02 08:58:32 -05002422
2423.. _ref-classes-python_poetry_core:
2424
Andrew Geissler517393d2023-01-13 08:55:19 -06002425``python_poetry_core``
2426======================
Patrick Williams45852732022-04-02 08:58:32 -05002427
Andrew Geissler517393d2023-01-13 08:55:19 -06002428The :ref:`ref-classes-python_poetry_core` class enables building Python modules which use the
Patrick Williams45852732022-04-02 08:58:32 -05002429`Poetry Core <https://python-poetry.org>`__ build system.
2430
Andrew Geissler517393d2023-01-13 08:55:19 -06002431Internally this uses the :ref:`ref-classes-python_pep517` class.
Andrew Geissler9aee5002022-03-30 16:27:02 +00002432
Andrew Geissler6aa7eec2023-03-03 12:41:14 -06002433.. _ref-classes-python_pyo3:
2434
2435``python_pyo3``
2436===============
2437
2438The :ref:`ref-classes-python_pyo3` class helps make sure that Python extensions
2439written in Rust and built with `PyO3 <https://pyo3.rs/>`__, properly set up the
2440environment for cross compilation.
2441
2442This class is internal to the :ref:`ref-classes-python-setuptools3_rust` class
2443and is not meant to be used directly in recipes.
2444
2445.. _ref-classes-python-setuptools3_rust:
2446
2447``python-setuptools3_rust``
2448===========================
2449
2450The :ref:`ref-classes-python-setuptools3_rust` class enables building Python
2451extensions implemented in Rust with `PyO3 <https://pyo3.rs/>`__, which allows
2452to compile and distribute Python extensions written in Rust as easily
2453as if they were written in C.
2454
2455This class inherits the :ref:`ref-classes-setuptools3` and
2456:ref:`ref-classes-python_pyo3` classes.
2457
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002458.. _ref-classes-pixbufcache:
2459
Andrew Geissler517393d2023-01-13 08:55:19 -06002460``pixbufcache``
2461===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002462
Andrew Geissler517393d2023-01-13 08:55:19 -06002463The :ref:`ref-classes-pixbufcache` class generates the proper post-install and
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002464post-remove (postinst/postrm) scriptlets for packages that install
2465pixbuf loaders, which are used with ``gdk-pixbuf``. These scriptlets
2466call ``update_pixbuf_cache`` to add the pixbuf loaders to the cache.
2467Since the cache files are architecture-specific, ``update_pixbuf_cache``
2468is run using QEMU if the postinst scriptlets need to be run on the build
2469host during image creation.
2470
2471If the pixbuf loaders being installed are in packages other than the
2472recipe's main package, set
2473:term:`PIXBUF_PACKAGES` to specify the packages
2474containing the loaders.
2475
2476.. _ref-classes-pkgconfig:
2477
Andrew Geissler517393d2023-01-13 08:55:19 -06002478``pkgconfig``
2479=============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002480
Andrew Geissler517393d2023-01-13 08:55:19 -06002481The :ref:`ref-classes-pkgconfig` class provides a standard way to get header and
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002482library information by using ``pkg-config``. This class aims to smooth
2483integration of ``pkg-config`` into libraries that use it.
2484
2485During staging, BitBake installs ``pkg-config`` data into the
2486``sysroots/`` directory. By making use of sysroot functionality within
Andrew Geissler517393d2023-01-13 08:55:19 -06002487``pkg-config``, the :ref:`ref-classes-pkgconfig` class no longer has to manipulate the
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002488files.
2489
2490.. _ref-classes-populate-sdk:
2491
Andrew Geissler517393d2023-01-13 08:55:19 -06002492``populate_sdk``
2493================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002494
Andrew Geissler517393d2023-01-13 08:55:19 -06002495The :ref:`ref-classes-populate-sdk` class provides support for SDK-only recipes. For
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002496information on advantages gained when building a cross-development
2497toolchain using the :ref:`ref-tasks-populate_sdk`
Andrew Geissler09209ee2020-12-13 08:44:15 -06002498task, see the ":ref:`sdk-manual/appendix-obtain:building an sdk installer`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002499section in the Yocto Project Application Development and the Extensible
2500Software Development Kit (eSDK) manual.
2501
2502.. _ref-classes-populate-sdk-*:
2503
Andrew Geissler517393d2023-01-13 08:55:19 -06002504``populate_sdk_*``
2505==================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002506
Andrew Geissler517393d2023-01-13 08:55:19 -06002507The :ref:`ref-classes-populate-sdk-*` classes support SDK creation and consist of the
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002508following classes:
2509
Patrick Williams2390b1b2022-11-03 13:47:49 -05002510- :ref:`populate_sdk_base <ref-classes-populate-sdk-*>`: The base class supporting SDK creation under
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002511 all package managers (i.e. DEB, RPM, and opkg).
2512
Patrick Williams2390b1b2022-11-03 13:47:49 -05002513- :ref:`populate_sdk_deb <ref-classes-populate-sdk-*>`: Supports creation of the SDK given the Debian
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002514 package manager.
2515
Patrick Williams2390b1b2022-11-03 13:47:49 -05002516- :ref:`populate_sdk_rpm <ref-classes-populate-sdk-*>`: Supports creation of the SDK given the RPM
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002517 package manager.
2518
Patrick Williams2390b1b2022-11-03 13:47:49 -05002519- :ref:`populate_sdk_ipk <ref-classes-populate-sdk-*>`: Supports creation of the SDK given the opkg
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002520 (IPK format) package manager.
2521
Patrick Williams2390b1b2022-11-03 13:47:49 -05002522- :ref:`populate_sdk_ext <ref-classes-populate-sdk-*>`: Supports extensible SDK creation under all
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002523 package managers.
2524
Patrick Williams2390b1b2022-11-03 13:47:49 -05002525The :ref:`populate_sdk_base <ref-classes-populate-sdk-*>` class inherits the appropriate
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002526``populate_sdk_*`` (i.e. ``deb``, ``rpm``, and ``ipk``) based on
2527:term:`IMAGE_PKGTYPE`.
2528
2529The base class ensures all source and destination directories are
2530established and then populates the SDK. After populating the SDK, the
Patrick Williams2390b1b2022-11-03 13:47:49 -05002531:ref:`populate_sdk_base <ref-classes-populate-sdk-*>` class constructs two sysroots:
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002532``${``\ :term:`SDK_ARCH`\ ``}-nativesdk``, which
2533contains the cross-compiler and associated tooling, and the target,
2534which contains a target root filesystem that is configured for the SDK
2535usage. These two images reside in :term:`SDK_OUTPUT`,
Andrew Geisslerc926e172021-05-07 16:11:35 -05002536which consists of the following::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002537
2538 ${SDK_OUTPUT}/${SDK_ARCH}-nativesdk-pkgs
2539 ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/target-pkgs
2540
2541Finally, the base populate SDK class creates the toolchain environment
2542setup script, the tarball of the SDK, and the installer.
2543
Patrick Williams2390b1b2022-11-03 13:47:49 -05002544The respective :ref:`populate_sdk_deb <ref-classes-populate-sdk-*>`, :ref:`populate_sdk_rpm <ref-classes-populate-sdk-*>`, and
2545:ref:`populate_sdk_ipk <ref-classes-populate-sdk-*>` classes each support the specific type of SDK.
2546These classes are inherited by and used with the :ref:`populate_sdk_base <ref-classes-populate-sdk-*>`
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002547class.
2548
2549For more information on the cross-development toolchain generation, see
Andrew Geissler09209ee2020-12-13 08:44:15 -06002550the ":ref:`overview-manual/concepts:cross-development toolchain generation`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002551section in the Yocto Project Overview and Concepts Manual. For
2552information on advantages gained when building a cross-development
2553toolchain using the :ref:`ref-tasks-populate_sdk`
2554task, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -06002555":ref:`sdk-manual/appendix-obtain:building an sdk installer`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002556section in the Yocto Project Application Development and the Extensible
2557Software Development Kit (eSDK) manual.
2558
2559.. _ref-classes-prexport:
2560
Andrew Geissler517393d2023-01-13 08:55:19 -06002561``prexport``
2562============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002563
Andrew Geissler517393d2023-01-13 08:55:19 -06002564The :ref:`ref-classes-prexport` class provides functionality for exporting
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002565:term:`PR` values.
2566
2567.. note::
2568
2569 This class is not intended to be used directly. Rather, it is enabled
Andrew Geissler4c19ea12020-10-27 13:52:24 -05002570 when using "``bitbake-prserv-tool export``".
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002571
2572.. _ref-classes-primport:
2573
Andrew Geissler517393d2023-01-13 08:55:19 -06002574``primport``
2575============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002576
Andrew Geissler517393d2023-01-13 08:55:19 -06002577The :ref:`ref-classes-primport` class provides functionality for importing
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002578:term:`PR` values.
2579
2580.. note::
2581
2582 This class is not intended to be used directly. Rather, it is enabled
Andrew Geissler4c19ea12020-10-27 13:52:24 -05002583 when using "``bitbake-prserv-tool import``".
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002584
2585.. _ref-classes-prserv:
2586
Andrew Geissler517393d2023-01-13 08:55:19 -06002587``prserv``
2588==========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002589
Andrew Geissler517393d2023-01-13 08:55:19 -06002590The :ref:`ref-classes-prserv` class provides functionality for using a :ref:`PR
2591service <dev-manual/packages:working with a pr service>` in order to
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002592automatically manage the incrementing of the :term:`PR`
2593variable for each recipe.
2594
2595This class is enabled by default because it is inherited by the
Andrew Geissler517393d2023-01-13 08:55:19 -06002596:ref:`ref-classes-package` class. However, the OpenEmbedded
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002597build system will not enable the functionality of this class unless
2598:term:`PRSERV_HOST` has been set.
2599
2600.. _ref-classes-ptest:
2601
Andrew Geissler517393d2023-01-13 08:55:19 -06002602``ptest``
2603=========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002604
Andrew Geissler517393d2023-01-13 08:55:19 -06002605The :ref:`ref-classes-ptest` class provides functionality for packaging and installing
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002606runtime tests for recipes that build software that provides these tests.
2607
2608This class is intended to be inherited by individual recipes. However,
2609the class' functionality is largely disabled unless "ptest" appears in
2610:term:`DISTRO_FEATURES`. See the
Andrew Geissler517393d2023-01-13 08:55:19 -06002611":ref:`dev-manual/packages:testing packages with ptest`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002612section in the Yocto Project Development Tasks Manual for more information
2613on ptest.
2614
Andrew Geissler5082cc72023-09-11 08:41:39 -04002615.. _ref-classes-ptest-cargo:
2616
2617``ptest-cargo``
2618===============
2619
2620The :ref:`ref-classes-ptest-cargo` class is a class which extends the
2621:ref:`ref-classes-cargo` class and adds ``compile_ptest_cargo`` and
2622``install_ptest_cargo`` steps to respectively build and install
2623test suites defined in the ``Cargo.toml`` file, into a dedicated
2624``-ptest`` package.
2625
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002626.. _ref-classes-ptest-gnome:
2627
Andrew Geissler517393d2023-01-13 08:55:19 -06002628``ptest-gnome``
2629===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002630
2631Enables package tests (ptests) specifically for GNOME packages, which
2632have tests intended to be executed with ``gnome-desktop-testing``.
2633
2634For information on setting up and running ptests, see the
Andrew Geissler517393d2023-01-13 08:55:19 -06002635":ref:`dev-manual/packages:testing packages with ptest`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002636section in the Yocto Project Development Tasks Manual.
2637
Andrew Geissler3b8a17c2021-04-15 15:55:55 -05002638.. _ref-classes-python3-dir:
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002639
Andrew Geissler517393d2023-01-13 08:55:19 -06002640``python3-dir``
2641===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002642
Andrew Geissler517393d2023-01-13 08:55:19 -06002643The :ref:`ref-classes-python3-dir` class provides the base version, location, and site
Andrew Geissler3b8a17c2021-04-15 15:55:55 -05002644package location for Python 3.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002645
2646.. _ref-classes-python3native:
2647
Andrew Geissler517393d2023-01-13 08:55:19 -06002648``python3native``
2649=================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002650
Andrew Geissler517393d2023-01-13 08:55:19 -06002651The :ref:`ref-classes-python3native` class supports using the native version of Python
Andrew Geisslerc9f78652020-09-18 14:11:35 -050026523 built by the build system rather than support of the version provided
2653by the build host.
2654
Andrew Geissler3b8a17c2021-04-15 15:55:55 -05002655.. _ref-classes-python3targetconfig:
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002656
Andrew Geissler517393d2023-01-13 08:55:19 -06002657``python3targetconfig``
2658=======================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002659
Andrew Geissler517393d2023-01-13 08:55:19 -06002660The :ref:`ref-classes-python3targetconfig` class supports using the native version of Python
Andrew Geissler3b8a17c2021-04-15 15:55:55 -050026613 built by the build system rather than support of the version provided
2662by the build host, except that the configuration for the target machine
2663is accessible (such as correct installation directories). This also adds a
2664dependency on target ``python3``, so should only be used where appropriate
2665in order to avoid unnecessarily lengthening builds.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002666
2667.. _ref-classes-qemu:
2668
Andrew Geissler517393d2023-01-13 08:55:19 -06002669``qemu``
2670========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002671
Andrew Geissler517393d2023-01-13 08:55:19 -06002672The :ref:`ref-classes-qemu` class provides functionality for recipes that either need
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002673QEMU or test for the existence of QEMU. Typically, this class is used to
2674run programs for a target system on the build host using QEMU's
2675application emulation mode.
2676
2677.. _ref-classes-recipe_sanity:
2678
Andrew Geissler517393d2023-01-13 08:55:19 -06002679``recipe_sanity``
2680=================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002681
Andrew Geissler517393d2023-01-13 08:55:19 -06002682The :ref:`ref-classes-recipe_sanity` class checks for the presence of any host system
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002683recipe prerequisites that might affect the build (e.g. variables that
2684are set or software that is present).
2685
2686.. _ref-classes-relocatable:
2687
Andrew Geissler517393d2023-01-13 08:55:19 -06002688``relocatable``
2689===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002690
Andrew Geissler517393d2023-01-13 08:55:19 -06002691The :ref:`ref-classes-relocatable` class enables relocation of binaries when they are
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002692installed into the sysroot.
2693
Andrew Geissler517393d2023-01-13 08:55:19 -06002694This class makes use of the :ref:`ref-classes-chrpath` class and is used by
2695both the :ref:`ref-classes-cross` and :ref:`ref-classes-native` classes.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002696
2697.. _ref-classes-remove-libtool:
2698
Andrew Geissler517393d2023-01-13 08:55:19 -06002699``remove-libtool``
2700==================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002701
Andrew Geissler517393d2023-01-13 08:55:19 -06002702The :ref:`ref-classes-remove-libtool` class adds a post function to the
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002703:ref:`ref-tasks-install` task to remove all ``.la`` files
2704installed by ``libtool``. Removing these files results in them being
2705absent from both the sysroot and target packages.
2706
2707If a recipe needs the ``.la`` files to be installed, then the recipe can
Andrew Geisslerc926e172021-05-07 16:11:35 -05002708override the removal by setting ``REMOVE_LIBTOOL_LA`` to "0" as follows::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002709
2710 REMOVE_LIBTOOL_LA = "0"
2711
2712.. note::
2713
Andrew Geissler517393d2023-01-13 08:55:19 -06002714 The :ref:`ref-classes-remove-libtool` class is not enabled by default.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002715
2716.. _ref-classes-report-error:
2717
Andrew Geissler517393d2023-01-13 08:55:19 -06002718``report-error``
2719================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002720
Andrew Geissler517393d2023-01-13 08:55:19 -06002721The :ref:`ref-classes-report-error` class supports enabling the :ref:`error reporting
2722tool <dev-manual/error-reporting-tool:using the error reporting tool>`",
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002723which allows you to submit build error information to a central database.
2724
2725The class collects debug information for recipe, recipe version, task,
2726machine, distro, build system, target system, host distro, branch,
2727commit, and log. From the information, report files using a JSON format
2728are created and stored in
2729``${``\ :term:`LOG_DIR`\ ``}/error-report``.
2730
2731.. _ref-classes-rm-work:
2732
Andrew Geissler517393d2023-01-13 08:55:19 -06002733``rm_work``
2734===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002735
Andrew Geissler517393d2023-01-13 08:55:19 -06002736The :ref:`ref-classes-rm-work` class supports deletion of temporary workspace, which
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002737can ease your hard drive demands during builds.
2738
2739The OpenEmbedded build system can use a substantial amount of disk space
2740during the build process. A portion of this space is the work files
2741under the ``${TMPDIR}/work`` directory for each recipe. Once the build
2742system generates the packages for a recipe, the work files for that
2743recipe are no longer needed. However, by default, the build system
2744preserves these files for inspection and possible debugging purposes. If
Andrew Geissler517393d2023-01-13 08:55:19 -06002745you would rather have these files deleted to save disk space as the build
2746progresses, you can enable :ref:`ref-classes-rm-work` by adding the following to
Patrick Williams2390b1b2022-11-03 13:47:49 -05002747your ``local.conf`` file, which is found in the :term:`Build Directory`::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002748
2749 INHERIT += "rm_work"
2750
Andrew Geissler517393d2023-01-13 08:55:19 -06002751If you are modifying and building source code out of the work directory for a
2752recipe, enabling :ref:`ref-classes-rm-work` will potentially result in your
2753changes to the source being lost. To exclude some recipes from having their work
2754directories deleted by :ref:`ref-classes-rm-work`, you can add the names of the
2755recipe or recipes you are working on to the :term:`RM_WORK_EXCLUDE` variable,
2756which can also be set in your ``local.conf`` file. Here is an example::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002757
2758 RM_WORK_EXCLUDE += "busybox glibc"
2759
2760.. _ref-classes-rootfs*:
2761
Andrew Geissler517393d2023-01-13 08:55:19 -06002762``rootfs*``
2763===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002764
Andrew Geissler517393d2023-01-13 08:55:19 -06002765The :ref:`ref-classes-rootfs*` classes support creating the root filesystem for an
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002766image and consist of the following classes:
2767
Patrick Williams2390b1b2022-11-03 13:47:49 -05002768- The :ref:`rootfs-postcommands <ref-classes-rootfs*>` class, which defines filesystem
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002769 post-processing functions for image recipes.
2770
Patrick Williams2390b1b2022-11-03 13:47:49 -05002771- The :ref:`rootfs_deb <ref-classes-rootfs*>` class, which supports creation of root filesystems
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002772 for images built using ``.deb`` packages.
2773
Patrick Williams2390b1b2022-11-03 13:47:49 -05002774- The :ref:`rootfs_rpm <ref-classes-rootfs*>` class, which supports creation of root filesystems
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002775 for images built using ``.rpm`` packages.
2776
Patrick Williams2390b1b2022-11-03 13:47:49 -05002777- The :ref:`rootfs_ipk <ref-classes-rootfs*>` class, which supports creation of root filesystems
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002778 for images built using ``.ipk`` packages.
2779
Patrick Williams2390b1b2022-11-03 13:47:49 -05002780- The :ref:`rootfsdebugfiles <ref-classes-rootfs*>` class, which installs additional files found
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002781 on the build host directly into the root filesystem.
2782
2783The root filesystem is created from packages using one of the
Andrew Geissler517393d2023-01-13 08:55:19 -06002784:ref:`ref-classes-rootfs*` files as determined by the :term:`PACKAGE_CLASSES`
2785variable.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002786
2787For information on how root filesystem images are created, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -06002788":ref:`overview-manual/concepts:image generation`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002789section in the Yocto Project Overview and Concepts Manual.
2790
Andrew Geissler6aa7eec2023-03-03 12:41:14 -06002791.. _ref-classes-rust:
2792
2793``rust``
2794========
2795
2796The :ref:`ref-classes-rust` class is an internal class which is just used
2797in the "rust" recipe, to build the Rust compiler and runtime
2798library. Except for this recipe, it is not intended to be used directly.
2799
2800.. _ref-classes-rust-common:
2801
2802``rust-common``
2803===============
2804
2805The :ref:`ref-classes-rust-common` class is an internal class to the
2806:ref:`ref-classes-cargo_common` and :ref:`ref-classes-rust` classes and is not
2807intended to be used directly.
2808
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002809.. _ref-classes-sanity:
2810
Andrew Geissler517393d2023-01-13 08:55:19 -06002811``sanity``
2812==========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002813
Andrew Geissler517393d2023-01-13 08:55:19 -06002814The :ref:`ref-classes-sanity` class checks to see if prerequisite software is present
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002815on the host system so that users can be notified of potential problems
2816that might affect their build. The class also performs basic user
2817configuration checks from the ``local.conf`` configuration file to
2818prevent common mistakes that cause build failures. Distribution policy
2819usually determines whether to include this class.
2820
2821.. _ref-classes-scons:
2822
Andrew Geissler517393d2023-01-13 08:55:19 -06002823``scons``
2824=========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002825
Andrew Geissler517393d2023-01-13 08:55:19 -06002826The :ref:`ref-classes-scons` class supports recipes that need to build software
2827that uses the SCons build system. You can use the :term:`EXTRA_OESCONS`
2828variable to specify additional configuration options you want to pass SCons
2829command line.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002830
2831.. _ref-classes-sdl:
2832
Andrew Geissler517393d2023-01-13 08:55:19 -06002833``sdl``
2834=======
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002835
Andrew Geissler517393d2023-01-13 08:55:19 -06002836The :ref:`ref-classes-sdl` class supports recipes that need to build software that uses
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002837the Simple DirectMedia Layer (SDL) library.
2838
Patrick Williams45852732022-04-02 08:58:32 -05002839.. _ref-classes-python_setuptools_build_meta:
Andrew Geissler9aee5002022-03-30 16:27:02 +00002840
Andrew Geissler517393d2023-01-13 08:55:19 -06002841``python_setuptools_build_meta``
2842================================
Andrew Geissler9aee5002022-03-30 16:27:02 +00002843
Andrew Geissler517393d2023-01-13 08:55:19 -06002844The :ref:`ref-classes-python_setuptools_build_meta` class enables building
2845Python modules which declare the
Andrew Geissler9aee5002022-03-30 16:27:02 +00002846`PEP-517 <https://www.python.org/dev/peps/pep-0517/>`__ compliant
2847``setuptools.build_meta`` ``build-backend`` in the ``[build-system]``
2848section of ``pyproject.toml`` (See `PEP-518 <https://www.python.org/dev/peps/pep-0518/>`__).
2849
2850Python modules built with ``setuptools.build_meta`` can be pure Python or
2851include ``C`` or ``Rust`` extensions).
2852
Andrew Geissler517393d2023-01-13 08:55:19 -06002853Internally this uses the :ref:`ref-classes-python_pep517` class.
Andrew Geissler9aee5002022-03-30 16:27:02 +00002854
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002855.. _ref-classes-setuptools3:
2856
Andrew Geissler517393d2023-01-13 08:55:19 -06002857``setuptools3``
2858===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002859
Andrew Geissler517393d2023-01-13 08:55:19 -06002860The :ref:`ref-classes-setuptools3` class supports Python version 3.x extensions
2861that use build systems based on ``setuptools`` (e.g. only have a ``setup.py``
2862and have not migrated to the official ``pyproject.toml`` format). If your recipe
2863uses these build systems, the recipe needs to inherit the
2864:ref:`ref-classes-setuptools3` class.
Andrew Geissler9aee5002022-03-30 16:27:02 +00002865
2866 .. note::
2867
Andrew Geissler517393d2023-01-13 08:55:19 -06002868 The :ref:`ref-classes-setuptools3` class :ref:`ref-tasks-compile` task now calls
Andrew Geissler9aee5002022-03-30 16:27:02 +00002869 ``setup.py bdist_wheel`` to build the ``wheel`` binary archive format
2870 (See `PEP-427 <https://www.python.org/dev/peps/pep-0427/>`__).
2871
2872 A consequence of this is that legacy software still using deprecated
2873 ``distutils`` from the Python standard library cannot be packaged as
2874 ``wheels``. A common solution is the replace
2875 ``from distutils.core import setup`` with ``from setuptools import setup``.
2876
2877 .. note::
2878
Andrew Geissler517393d2023-01-13 08:55:19 -06002879 The :ref:`ref-classes-setuptools3` class :ref:`ref-tasks-install` task now
2880 installs the ``wheel`` binary archive. In current versions of
2881 ``setuptools`` the legacy ``setup.py install`` method is deprecated. If
2882 the ``setup.py`` cannot be used with wheels, for example it creates files
2883 outside of the Python module or standard entry points, then
2884 :ref:`ref-classes-setuptools3_legacy` should be used.
Andrew Geissler9aee5002022-03-30 16:27:02 +00002885
2886.. _ref-classes-setuptools3_legacy:
2887
Andrew Geissler517393d2023-01-13 08:55:19 -06002888``setuptools3_legacy``
2889======================
Andrew Geissler9aee5002022-03-30 16:27:02 +00002890
Andrew Geissler517393d2023-01-13 08:55:19 -06002891The :ref:`ref-classes-setuptools3_legacy` class supports
2892Python version 3.x extensions that use build systems based on ``setuptools``
2893(e.g. only have a ``setup.py`` and have not migrated to the official
2894``pyproject.toml`` format). Unlike :ref:`ref-classes-setuptools3`,
2895this uses the traditional ``setup.py`` ``build`` and ``install`` commands and
2896not wheels. This use of ``setuptools`` like this is
Patrick Williams2390b1b2022-11-03 13:47:49 -05002897`deprecated <https://github.com/pypa/setuptools/blob/main/CHANGES.rst#v5830>`__
Andrew Geissler9aee5002022-03-30 16:27:02 +00002898but still relatively common.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002899
Andrew Geissler595f6302022-01-24 19:11:47 +00002900.. _ref-classes-setuptools3-base:
2901
Andrew Geissler517393d2023-01-13 08:55:19 -06002902``setuptools3-base``
2903====================
Andrew Geissler595f6302022-01-24 19:11:47 +00002904
Andrew Geissler517393d2023-01-13 08:55:19 -06002905The :ref:`ref-classes-setuptools3-base` class provides a reusable base for
2906other classes that support building Python version 3.x extensions. If you need
2907functionality that is not provided by the :ref:`ref-classes-setuptools3` class,
2908you may want to ``inherit setuptools3-base``. Some recipes do not need the tasks
2909in the :ref:`ref-classes-setuptools3` class and inherit this class instead.
Andrew Geissler595f6302022-01-24 19:11:47 +00002910
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002911.. _ref-classes-sign_rpm:
2912
Andrew Geissler517393d2023-01-13 08:55:19 -06002913``sign_rpm``
2914============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002915
Andrew Geissler517393d2023-01-13 08:55:19 -06002916The :ref:`ref-classes-sign_rpm` class supports generating signed RPM packages.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002917
2918.. _ref-classes-siteconfig:
2919
Andrew Geissler517393d2023-01-13 08:55:19 -06002920``siteconfig``
2921==============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002922
Andrew Geissler517393d2023-01-13 08:55:19 -06002923The :ref:`ref-classes-siteconfig` class provides functionality for handling site
2924configuration. The class is used by the :ref:`ref-classes-autotools` class to
2925accelerate the :ref:`ref-tasks-configure` task.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002926
2927.. _ref-classes-siteinfo:
2928
Andrew Geissler517393d2023-01-13 08:55:19 -06002929``siteinfo``
2930============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002931
Andrew Geissler517393d2023-01-13 08:55:19 -06002932The :ref:`ref-classes-siteinfo` class provides information about the targets
2933that might be needed by other classes or recipes.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002934
2935As an example, consider Autotools, which can require tests that must
2936execute on the target hardware. Since this is not possible in general
2937when cross compiling, site information is used to provide cached test
2938results so these tests can be skipped over but still make the correct
2939values available. The ``meta/site directory`` contains test results
2940sorted into different categories such as architecture, endianness, and
2941the ``libc`` used. Site information provides a list of files containing
Andrew Geissler09036742021-06-25 14:25:14 -05002942data relevant to the current build in the :term:`CONFIG_SITE` variable that
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002943Autotools automatically picks up.
2944
Andrew Geissler09036742021-06-25 14:25:14 -05002945The class also provides variables like :term:`SITEINFO_ENDIANNESS` and
2946:term:`SITEINFO_BITS` that can be used elsewhere in the metadata.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002947
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002948.. _ref-classes-sstate:
2949
Andrew Geissler517393d2023-01-13 08:55:19 -06002950``sstate``
2951==========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002952
Andrew Geissler517393d2023-01-13 08:55:19 -06002953The :ref:`ref-classes-sstate` class provides support for Shared State (sstate).
2954By default, the class is enabled through the :term:`INHERIT_DISTRO` variable's
2955default value.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002956
2957For more information on sstate, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -06002958":ref:`overview-manual/concepts:shared state cache`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002959section in the Yocto Project Overview and Concepts Manual.
2960
2961.. _ref-classes-staging:
2962
Andrew Geissler517393d2023-01-13 08:55:19 -06002963``staging``
2964===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002965
Andrew Geissler517393d2023-01-13 08:55:19 -06002966The :ref:`ref-classes-staging` class installs files into individual recipe work
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002967directories for sysroots. The class contains the following key tasks:
2968
2969- The :ref:`ref-tasks-populate_sysroot` task,
2970 which is responsible for handing the files that end up in the recipe
2971 sysroots.
2972
2973- The
2974 :ref:`ref-tasks-prepare_recipe_sysroot`
2975 task (a "partner" task to the ``populate_sysroot`` task), which
2976 installs the files into the individual recipe work directories (i.e.
2977 :term:`WORKDIR`).
2978
Andrew Geissler517393d2023-01-13 08:55:19 -06002979The code in the :ref:`ref-classes-staging` class is complex and basically works
2980in two stages:
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002981
2982- *Stage One:* The first stage addresses recipes that have files they
2983 want to share with other recipes that have dependencies on the
2984 originating recipe. Normally these dependencies are installed through
2985 the :ref:`ref-tasks-install` task into
Patrick Williams2194f502022-10-16 14:26:09 -05002986 ``${``\ :term:`D`\ ``}``. The :ref:`ref-tasks-populate_sysroot` task
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002987 copies a subset of these files into ``${SYSROOT_DESTDIR}``. This
2988 subset of files is controlled by the
2989 :term:`SYSROOT_DIRS`,
2990 :term:`SYSROOT_DIRS_NATIVE`, and
Andrew Geissler9aee5002022-03-30 16:27:02 +00002991 :term:`SYSROOT_DIRS_IGNORE`
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002992 variables.
2993
2994 .. note::
2995
2996 Additionally, a recipe can customize the files further by
Andrew Geissler09036742021-06-25 14:25:14 -05002997 declaring a processing function in the :term:`SYSROOT_PREPROCESS_FUNCS`
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002998 variable.
2999
3000 A shared state (sstate) object is built from these files and the
3001 files are placed into a subdirectory of
Andrew Geissler4c19ea12020-10-27 13:52:24 -05003002 :ref:`structure-build-tmp-sysroots-components`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003003 The files are scanned for hardcoded paths to the original
3004 installation location. If the location is found in text files, the
3005 hardcoded locations are replaced by tokens and a list of the files
3006 needing such replacements is created. These adjustments are referred
3007 to as "FIXMEs". The list of files that are scanned for paths is
3008 controlled by the :term:`SSTATE_SCAN_FILES`
3009 variable.
3010
3011- *Stage Two:* The second stage addresses recipes that want to use
3012 something from another recipe and declare a dependency on that recipe
3013 through the :term:`DEPENDS` variable. The recipe will
3014 have a
3015 :ref:`ref-tasks-prepare_recipe_sysroot`
3016 task and when this task executes, it creates the ``recipe-sysroot``
3017 and ``recipe-sysroot-native`` in the recipe work directory (i.e.
3018 :term:`WORKDIR`). The OpenEmbedded build system
3019 creates hard links to copies of the relevant files from
3020 ``sysroots-components`` into the recipe work directory.
3021
3022 .. note::
3023
3024 If hard links are not possible, the build system uses actual
3025 copies.
3026
3027 The build system then addresses any "FIXMEs" to paths as defined from
3028 the list created in the first stage.
3029
3030 Finally, any files in ``${bindir}`` within the sysroot that have the
3031 prefix "``postinst-``" are executed.
3032
3033 .. note::
3034
3035 Although such sysroot post installation scripts are not
3036 recommended for general use, the files do allow some issues such
3037 as user creation and module indexes to be addressed.
3038
Andrew Geissler09036742021-06-25 14:25:14 -05003039 Because recipes can have other dependencies outside of :term:`DEPENDS`
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003040 (e.g. ``do_unpack[depends] += "tar-native:do_populate_sysroot"``),
3041 the sysroot creation function ``extend_recipe_sysroot`` is also added
3042 as a pre-function for those tasks whose dependencies are not through
Andrew Geissler09036742021-06-25 14:25:14 -05003043 :term:`DEPENDS` but operate similarly.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003044
3045 When installing dependencies into the sysroot, the code traverses the
3046 dependency graph and processes dependencies in exactly the same way
3047 as the dependencies would or would not be when installed from sstate.
3048 This processing means, for example, a native tool would have its
3049 native dependencies added but a target library would not have its
3050 dependencies traversed or installed. The same sstate dependency code
3051 is used so that builds should be identical regardless of whether
3052 sstate was used or not. For a closer look, see the
Andrew Geissler517393d2023-01-13 08:55:19 -06003053 ``setscene_depvalid()`` function in the :ref:`ref-classes-sstate` class.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003054
3055 The build system is careful to maintain manifests of the files it
3056 installs so that any given dependency can be installed as needed. The
3057 sstate hash of the installed item is also stored so that if it
3058 changes, the build system can reinstall it.
3059
3060.. _ref-classes-syslinux:
3061
Andrew Geissler517393d2023-01-13 08:55:19 -06003062``syslinux``
3063============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003064
Andrew Geissler517393d2023-01-13 08:55:19 -06003065The :ref:`ref-classes-syslinux` class provides syslinux-specific functions for
3066building bootable images.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003067
3068The class supports the following variables:
3069
3070- :term:`INITRD`: Indicates list of filesystem images to
3071 concatenate and use as an initial RAM disk (initrd). This variable is
3072 optional.
3073
3074- :term:`ROOTFS`: Indicates a filesystem image to include
3075 as the root filesystem. This variable is optional.
3076
3077- :term:`AUTO_SYSLINUXMENU`: Enables creating
3078 an automatic menu when set to "1".
3079
3080- :term:`LABELS`: Lists targets for automatic
3081 configuration.
3082
3083- :term:`APPEND`: Lists append string overrides for each
3084 label.
3085
3086- :term:`SYSLINUX_OPTS`: Lists additional options
3087 to add to the syslinux file. Semicolon characters separate multiple
3088 options.
3089
3090- :term:`SYSLINUX_SPLASH`: Lists a background
3091 for the VGA boot menu when you are using the boot menu.
3092
3093- :term:`SYSLINUX_DEFAULT_CONSOLE`: Set
3094 to "console=ttyX" to change kernel boot default console.
3095
3096- :term:`SYSLINUX_SERIAL`: Sets an alternate
3097 serial port. Or, turns off serial when the variable is set with an
3098 empty string.
3099
3100- :term:`SYSLINUX_SERIAL_TTY`: Sets an
3101 alternate "console=tty..." kernel boot argument.
3102
3103.. _ref-classes-systemd:
3104
Andrew Geissler517393d2023-01-13 08:55:19 -06003105``systemd``
3106===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003107
Andrew Geissler517393d2023-01-13 08:55:19 -06003108The :ref:`ref-classes-systemd` class provides support for recipes that install
3109systemd unit files.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003110
3111The functionality for this class is disabled unless you have "systemd"
3112in :term:`DISTRO_FEATURES`.
3113
3114Under this class, the recipe or Makefile (i.e. whatever the recipe is
3115calling during the :ref:`ref-tasks-install` task)
3116installs unit files into
3117``${``\ :term:`D`\ ``}${systemd_unitdir}/system``. If the unit
3118files being installed go into packages other than the main package, you
3119need to set :term:`SYSTEMD_PACKAGES` in your
3120recipe to identify the packages in which the files will be installed.
3121
3122You should set :term:`SYSTEMD_SERVICE` to the
3123name of the service file. You should also use a package name override to
3124indicate the package to which the value applies. If the value applies to
3125the recipe's main package, use ``${``\ :term:`PN`\ ``}``. Here
Andrew Geisslerc926e172021-05-07 16:11:35 -05003126is an example from the connman recipe::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003127
Patrick Williams0ca19cc2021-08-16 14:03:13 -05003128 SYSTEMD_SERVICE:${PN} = "connman.service"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003129
3130Services are set up to start on boot automatically
3131unless you have set
3132:term:`SYSTEMD_AUTO_ENABLE` to "disable".
3133
Andrew Geissler517393d2023-01-13 08:55:19 -06003134For more information on :ref:`ref-classes-systemd`, see the
3135":ref:`dev-manual/init-manager:selecting an initialization manager`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003136section in the Yocto Project Development Tasks Manual.
3137
3138.. _ref-classes-systemd-boot:
3139
Andrew Geissler517393d2023-01-13 08:55:19 -06003140``systemd-boot``
3141================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003142
Andrew Geissler517393d2023-01-13 08:55:19 -06003143The :ref:`ref-classes-systemd-boot` class provides functions specific to the
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003144systemd-boot bootloader for building bootable images. This is an
3145internal class and is not intended to be used directly.
3146
3147.. note::
3148
Andrew Geissler517393d2023-01-13 08:55:19 -06003149 The :ref:`ref-classes-systemd-boot` class is a result from merging the ``gummiboot`` class
Andrew Geissler4c19ea12020-10-27 13:52:24 -05003150 used in previous Yocto Project releases with the ``systemd`` project.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003151
Andrew Geissler517393d2023-01-13 08:55:19 -06003152Set the :term:`EFI_PROVIDER` variable to ":ref:`ref-classes-systemd-boot`" to
3153use this class. Doing so creates a standalone EFI bootloader that is not
3154dependent on systemd.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003155
3156For information on more variables used and supported in this class, see
3157the :term:`SYSTEMD_BOOT_CFG`,
3158:term:`SYSTEMD_BOOT_ENTRIES`, and
3159:term:`SYSTEMD_BOOT_TIMEOUT` variables.
3160
3161You can also see the `Systemd-boot
Andrew Geisslerd1e89492021-02-12 15:35:20 -06003162documentation <https://www.freedesktop.org/wiki/Software/systemd/systemd-boot/>`__
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003163for more information.
3164
3165.. _ref-classes-terminal:
3166
Andrew Geissler517393d2023-01-13 08:55:19 -06003167``terminal``
3168============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003169
Andrew Geissler517393d2023-01-13 08:55:19 -06003170The :ref:`ref-classes-terminal` class provides support for starting a terminal
3171session. The :term:`OE_TERMINAL` variable controls which terminal emulator is
3172used for the session.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003173
Andrew Geissler517393d2023-01-13 08:55:19 -06003174Other classes use the :ref:`ref-classes-terminal` class anywhere a separate
3175terminal session needs to be started. For example, the :ref:`ref-classes-patch`
3176class assuming :term:`PATCHRESOLVE` is set to "user", the
3177:ref:`ref-classes-cml1` class, and the :ref:`ref-classes-devshell` class all
3178use the :ref:`ref-classes-terminal` class.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003179
Patrick Williams975a06f2022-10-21 14:42:47 -05003180.. _ref-classes-testimage:
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003181
Andrew Geissler517393d2023-01-13 08:55:19 -06003182``testimage``
3183=============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003184
Andrew Geissler517393d2023-01-13 08:55:19 -06003185The :ref:`ref-classes-testimage` class supports running automated tests against
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003186images using QEMU and on actual hardware. The classes handle loading the
3187tests and starting the image. To use the classes, you need to perform
3188steps to set up the environment.
3189
Patrick Williams975a06f2022-10-21 14:42:47 -05003190To enable this class, add the following to your configuration::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003191
Patrick Williams975a06f2022-10-21 14:42:47 -05003192 IMAGE_CLASSES += "testimage"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003193
3194The tests are commands that run on the target system over ``ssh``. Each
3195test is written in Python and makes use of the ``unittest`` module.
3196
Andrew Geissler517393d2023-01-13 08:55:19 -06003197The :ref:`ref-classes-testimage` class runs tests on an image when called using the
Andrew Geisslerc926e172021-05-07 16:11:35 -05003198following::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003199
3200 $ bitbake -c testimage image
3201
Patrick Williams975a06f2022-10-21 14:42:47 -05003202Alternatively, if you wish to have tests automatically run for each image
3203after it is built, you can set :term:`TESTIMAGE_AUTO`::
3204
3205 TESTIMAGE_AUTO = "1"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003206
3207For information on how to enable, run, and create new tests, see the
Andrew Geissler517393d2023-01-13 08:55:19 -06003208":ref:`dev-manual/runtime-testing:performing automated runtime testing`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003209section in the Yocto Project Development Tasks Manual.
3210
3211.. _ref-classes-testsdk:
3212
Andrew Geissler517393d2023-01-13 08:55:19 -06003213``testsdk``
3214===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003215
3216This class supports running automated tests against software development
Andrew Geissler517393d2023-01-13 08:55:19 -06003217kits (SDKs). The :ref:`ref-classes-testsdk` class runs tests on an SDK when called
Andrew Geisslerc926e172021-05-07 16:11:35 -05003218using the following::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003219
3220 $ bitbake -c testsdk image
3221
3222.. note::
3223
Andrew Geissler4c19ea12020-10-27 13:52:24 -05003224 Best practices include using :term:`IMAGE_CLASSES` rather than
Andrew Geissler517393d2023-01-13 08:55:19 -06003225 :term:`INHERIT` to inherit the :ref:`ref-classes-testsdk` class for automated SDK
Andrew Geissler4c19ea12020-10-27 13:52:24 -05003226 testing.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003227
3228.. _ref-classes-texinfo:
3229
Andrew Geissler517393d2023-01-13 08:55:19 -06003230``texinfo``
3231===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003232
3233This class should be inherited by recipes whose upstream packages invoke
3234the ``texinfo`` utilities at build-time. Native and cross recipes are
3235made to use the dummy scripts provided by ``texinfo-dummy-native``, for
3236improved performance. Target architecture recipes use the genuine
3237Texinfo utilities. By default, they use the Texinfo utilities on the
3238host system.
3239
3240.. note::
3241
3242 If you want to use the Texinfo recipe shipped with the build system,
Andrew Geissler4c19ea12020-10-27 13:52:24 -05003243 you can remove "texinfo-native" from :term:`ASSUME_PROVIDED` and makeinfo
3244 from :term:`SANITY_REQUIRED_UTILITIES`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003245
3246.. _ref-classes-toaster:
3247
Andrew Geissler517393d2023-01-13 08:55:19 -06003248``toaster``
3249===========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003250
Andrew Geissler517393d2023-01-13 08:55:19 -06003251The :ref:`ref-classes-toaster` class collects information about packages and images and
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003252sends them as events that the BitBake user interface can receive. The
3253class is enabled when the Toaster user interface is running.
3254
3255This class is not intended to be used directly.
3256
3257.. _ref-classes-toolchain-scripts:
3258
Andrew Geissler517393d2023-01-13 08:55:19 -06003259``toolchain-scripts``
3260=====================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003261
Andrew Geissler517393d2023-01-13 08:55:19 -06003262The :ref:`ref-classes-toolchain-scripts` class provides the scripts used for setting up
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003263the environment for installed SDKs.
3264
3265.. _ref-classes-typecheck:
3266
Andrew Geissler517393d2023-01-13 08:55:19 -06003267``typecheck``
3268=============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003269
Andrew Geissler517393d2023-01-13 08:55:19 -06003270The :ref:`ref-classes-typecheck` class provides support for validating the values of
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003271variables set at the configuration level against their defined types.
3272The OpenEmbedded build system allows you to define the type of a
Andrew Geisslerc926e172021-05-07 16:11:35 -05003273variable using the "type" varflag. Here is an example::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003274
3275 IMAGE_FEATURES[type] = "list"
3276
3277.. _ref-classes-uboot-config:
3278
Andrew Geissler517393d2023-01-13 08:55:19 -06003279``uboot-config``
3280================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003281
Andrew Geissler517393d2023-01-13 08:55:19 -06003282The :ref:`ref-classes-uboot-config` class provides support for U-Boot configuration for
Andrew Geisslerc926e172021-05-07 16:11:35 -05003283a machine. Specify the machine in your recipe as follows::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003284
3285 UBOOT_CONFIG ??= <default>
Patrick Williams705982a2024-01-12 09:51:57 -06003286 UBOOT_CONFIG[foo] = "config,images,binary"
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003287
Andrew Geisslerc926e172021-05-07 16:11:35 -05003288You can also specify the machine using this method::
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003289
3290 UBOOT_MACHINE = "config"
3291
3292See the :term:`UBOOT_CONFIG` and :term:`UBOOT_MACHINE` variables for additional
3293information.
3294
Patrick Williamsb542dec2023-06-09 01:26:37 -05003295.. _ref-classes-uboot-sign:
3296
3297``uboot-sign``
3298==============
3299
3300The :ref:`ref-classes-uboot-sign` class provides support for U-Boot verified boot.
3301It is intended to be inherited from U-Boot recipes.
3302
Patrick Williams39653562024-03-01 08:54:02 -06003303The variables used by this class are:
Patrick Williamsb542dec2023-06-09 01:26:37 -05003304
3305- :term:`SPL_MKIMAGE_DTCOPTS`: DTC options for U-Boot ``mkimage`` when
3306 building the FIT image.
3307- :term:`SPL_SIGN_ENABLE`: enable signing the FIT image.
3308- :term:`SPL_SIGN_KEYDIR`: directory containing the signing keys.
3309- :term:`SPL_SIGN_KEYNAME`: base filename of the signing keys.
3310- :term:`UBOOT_FIT_ADDRESS_CELLS`: ``#address-cells`` value for the FIT image.
3311- :term:`UBOOT_FIT_DESC`: description string encoded into the FIT image.
3312- :term:`UBOOT_FIT_GENERATE_KEYS`: generate the keys if they don't exist yet.
3313- :term:`UBOOT_FIT_HASH_ALG`: hash algorithm for the FIT image.
3314- :term:`UBOOT_FIT_KEY_GENRSA_ARGS`: ``openssl genrsa`` arguments.
3315- :term:`UBOOT_FIT_KEY_REQ_ARGS`: ``openssl req`` arguments.
3316- :term:`UBOOT_FIT_SIGN_ALG`: signature algorithm for the FIT image.
3317- :term:`UBOOT_FIT_SIGN_NUMBITS`: size of the private key for FIT image
Patrick Williams44b3caf2024-04-12 16:51:14 -05003318 signing.
Patrick Williamsb542dec2023-06-09 01:26:37 -05003319- :term:`UBOOT_FIT_KEY_SIGN_PKCS`: algorithm for the public key certificate
3320 for FIT image signing.
3321- :term:`UBOOT_FITIMAGE_ENABLE`: enable the generation of a U-Boot FIT image.
3322- :term:`UBOOT_MKIMAGE_DTCOPTS`: DTC options for U-Boot ``mkimage`` when
3323 rebuilding the FIT image containing the kernel.
3324
3325See U-Boot's documentation for details about `verified boot
3326<https://source.denx.de/u-boot/u-boot/-/blob/master/doc/uImage.FIT/verified-boot.txt>`__
3327and the `signature process
3328<https://source.denx.de/u-boot/u-boot/-/blob/master/doc/uImage.FIT/signature.txt>`__.
3329
3330See also the description of :ref:`ref-classes-kernel-fitimage` class, which this class
3331imitates.
3332
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003333.. _ref-classes-uninative:
3334
Andrew Geissler517393d2023-01-13 08:55:19 -06003335``uninative``
3336=============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003337
3338Attempts to isolate the build system from the host distribution's C
3339library in order to make re-use of native shared state artifacts across
3340different host distributions practical. With this class enabled, a
3341tarball containing a pre-built C library is downloaded at the start of
3342the build. In the Poky reference distribution this is enabled by default
3343through ``meta/conf/distro/include/yocto-uninative.inc``. Other
3344distributions that do not derive from poky can also
3345"``require conf/distro/include/yocto-uninative.inc``" to use this.
3346Alternatively if you prefer, you can build the uninative-tarball recipe
3347yourself, publish the resulting tarball (e.g. via HTTP) and set
3348``UNINATIVE_URL`` and ``UNINATIVE_CHECKSUM`` appropriately. For an
3349example, see the ``meta/conf/distro/include/yocto-uninative.inc``.
3350
Andrew Geissler517393d2023-01-13 08:55:19 -06003351The :ref:`ref-classes-uninative` class is also used unconditionally by the extensible
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003352SDK. When building the extensible SDK, ``uninative-tarball`` is built
3353and the resulting tarball is included within the SDK.
3354
3355.. _ref-classes-update-alternatives:
3356
Andrew Geissler517393d2023-01-13 08:55:19 -06003357``update-alternatives``
3358=======================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003359
Andrew Geissler517393d2023-01-13 08:55:19 -06003360The :ref:`ref-classes-update-alternatives` class helps the alternatives system when
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003361multiple sources provide the same command. This situation occurs when
3362several programs that have the same or similar function are installed
3363with the same name. For example, the ``ar`` command is available from
3364the ``busybox``, ``binutils`` and ``elfutils`` packages. The
Andrew Geissler517393d2023-01-13 08:55:19 -06003365:ref:`ref-classes-update-alternatives` class handles renaming the binaries so that
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003366multiple packages can be installed without conflicts. The ``ar`` command
3367still works regardless of which packages are installed or subsequently
3368removed. The class renames the conflicting binary in each package and
3369symlinks the highest priority binary during installation or removal of
3370packages.
3371
3372To use this class, you need to define a number of variables:
3373
3374- :term:`ALTERNATIVE`
3375
3376- :term:`ALTERNATIVE_LINK_NAME`
3377
3378- :term:`ALTERNATIVE_TARGET`
3379
3380- :term:`ALTERNATIVE_PRIORITY`
3381
3382These variables list alternative commands needed by a package, provide
3383pathnames for links, default links for targets, and so forth. For
3384details on how to use this class, see the comments in the
Patrick Williams975a06f2022-10-21 14:42:47 -05003385:yocto_git:`update-alternatives.bbclass </poky/tree/meta/classes-recipe/update-alternatives.bbclass>`
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003386file.
3387
3388.. note::
3389
Andrew Geissler4c19ea12020-10-27 13:52:24 -05003390 You can use the ``update-alternatives`` command directly in your recipes.
3391 However, this class simplifies things in most cases.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003392
3393.. _ref-classes-update-rc.d:
3394
Andrew Geissler517393d2023-01-13 08:55:19 -06003395``update-rc.d``
3396===============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003397
Andrew Geissler517393d2023-01-13 08:55:19 -06003398The :ref:`ref-classes-update-rc.d` class uses ``update-rc.d`` to safely install an
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003399initialization script on behalf of the package. The OpenEmbedded build
3400system takes care of details such as making sure the script is stopped
3401before a package is removed and started when the package is installed.
3402
Andrew Geissler09036742021-06-25 14:25:14 -05003403Three variables control this class: :term:`INITSCRIPT_PACKAGES`,
3404:term:`INITSCRIPT_NAME` and :term:`INITSCRIPT_PARAMS`. See the variable links
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003405for details.
3406
3407.. _ref-classes-useradd:
3408
Andrew Geissler517393d2023-01-13 08:55:19 -06003409``useradd*``
3410============
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003411
Patrick Williams2390b1b2022-11-03 13:47:49 -05003412The :ref:`useradd* <ref-classes-useradd>` classes support the addition of users or groups for
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003413usage by the package on the target. For example, if you have packages
3414that contain system services that should be run under their own user or
3415group, you can use these classes to enable creation of the user or
Andrew Geissler595f6302022-01-24 19:11:47 +00003416group. The :oe_git:`meta-skeleton/recipes-skeleton/useradd/useradd-example.bb
3417</openembedded-core/tree/meta-skeleton/recipes-skeleton/useradd/useradd-example.bb>`
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003418recipe in the :term:`Source Directory` provides a simple
3419example that shows how to add three users and groups to two packages.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003420
Patrick Williams2390b1b2022-11-03 13:47:49 -05003421The :ref:`useradd_base <ref-classes-useradd>` class provides basic functionality for user or
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003422groups settings.
3423
Patrick Williams2390b1b2022-11-03 13:47:49 -05003424The :ref:`useradd* <ref-classes-useradd>` classes support the
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003425:term:`USERADD_PACKAGES`,
3426:term:`USERADD_PARAM`,
3427:term:`GROUPADD_PARAM`, and
3428:term:`GROUPMEMS_PARAM` variables.
3429
Patrick Williams2390b1b2022-11-03 13:47:49 -05003430The :ref:`useradd-staticids <ref-classes-useradd>` class supports the addition of users or groups
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003431that have static user identification (``uid``) and group identification
3432(``gid``) values.
3433
3434The default behavior of the OpenEmbedded build system for assigning
3435``uid`` and ``gid`` values when packages add users and groups during
3436package install time is to add them dynamically. This works fine for
3437programs that do not care what the values of the resulting users and
3438groups become. In these cases, the order of the installation determines
3439the final ``uid`` and ``gid`` values. However, if non-deterministic
3440``uid`` and ``gid`` values are a problem, you can override the default,
3441dynamic application of these values by setting static values. When you
3442set static values, the OpenEmbedded build system looks in
3443:term:`BBPATH` for ``files/passwd`` and ``files/group``
3444files for the values.
3445
Andrew Geissler517393d2023-01-13 08:55:19 -06003446To use static ``uid`` and ``gid`` values, you need to set some variables. See
3447the :term:`USERADDEXTENSION`, :term:`USERADD_UID_TABLES`,
3448:term:`USERADD_GID_TABLES`, and :term:`USERADD_ERROR_DYNAMIC` variables.
3449You can also see the :ref:`ref-classes-useradd` class for additional
3450information.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003451
3452.. note::
3453
Patrick Williams2390b1b2022-11-03 13:47:49 -05003454 You do not use the :ref:`useradd-staticids <ref-classes-useradd>` class directly. You either enable
Andrew Geissler09036742021-06-25 14:25:14 -05003455 or disable the class by setting the :term:`USERADDEXTENSION` variable. If you
Andrew Geissler4c19ea12020-10-27 13:52:24 -05003456 enable or disable the class in a configured system, :term:`TMPDIR` might
Andrew Geissler09036742021-06-25 14:25:14 -05003457 contain incorrect ``uid`` and ``gid`` values. Deleting the :term:`TMPDIR`
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003458 directory will correct this condition.
3459
3460.. _ref-classes-utility-tasks:
3461
Andrew Geissler517393d2023-01-13 08:55:19 -06003462``utility-tasks``
3463=================
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003464
Andrew Geissler517393d2023-01-13 08:55:19 -06003465The :ref:`ref-classes-utility-tasks` class provides support for various
3466"utility" type tasks that are applicable to all recipes, such as
3467:ref:`ref-tasks-clean` and :ref:`ref-tasks-listtasks`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003468
3469This class is enabled by default because it is inherited by the
Andrew Geissler517393d2023-01-13 08:55:19 -06003470:ref:`ref-classes-base` class.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003471
3472.. _ref-classes-utils:
3473
Andrew Geissler517393d2023-01-13 08:55:19 -06003474``utils``
3475=========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003476
Andrew Geissler517393d2023-01-13 08:55:19 -06003477The :ref:`ref-classes-utils` class provides some useful Python functions that are
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003478typically used in inline Python expressions (e.g. ``${@...}``). One
3479example use is for ``bb.utils.contains()``.
3480
3481This class is enabled by default because it is inherited by the
Andrew Geissler517393d2023-01-13 08:55:19 -06003482:ref:`ref-classes-base` class.
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003483
3484.. _ref-classes-vala:
3485
Andrew Geissler517393d2023-01-13 08:55:19 -06003486``vala``
3487========
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003488
Andrew Geissler517393d2023-01-13 08:55:19 -06003489The :ref:`ref-classes-vala` class supports recipes that need to build software written
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003490using the Vala programming language.
3491
3492.. _ref-classes-waf:
3493
Andrew Geissler517393d2023-01-13 08:55:19 -06003494``waf``
3495=======
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003496
Andrew Geissler517393d2023-01-13 08:55:19 -06003497The :ref:`ref-classes-waf` class supports recipes that need to build software that uses
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003498the Waf build system. You can use the
3499:term:`EXTRA_OECONF` or
3500:term:`PACKAGECONFIG_CONFARGS` variables
3501to specify additional configuration options to be passed on the Waf
3502command line.