Andrew Geissler | f034379 | 2020-11-18 10:42:21 -0600 | [diff] [blame] | 1 | .. SPDX-License-Identifier: CC-BY-SA-2.0-UK |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2 | |
| 3 | ******* |
| 4 | Classes |
| 5 | ******* |
| 6 | |
| 7 | Class files are used to abstract common functionality and share it |
| 8 | amongst multiple recipe (``.bb``) files. To use a class file, you simply |
| 9 | make sure the recipe inherits the class. In most cases, when a recipe |
| 10 | inherits a class it is enough to enable its features. There are cases, |
| 11 | however, where in the recipe you might need to set variables or override |
| 12 | some default behavior. |
| 13 | |
| 14 | Any :term:`Metadata` usually found in a recipe can also be |
| 15 | placed in a class file. Class files are identified by the extension |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 16 | ``.bbclass`` and are usually placed in one of a set of subdirectories |
| 17 | beneath 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 Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 24 | Class 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 |
| 27 | in :term:`BBPATH` using the same method by which ``.conf`` |
| 28 | files are searched. |
| 29 | |
| 30 | This chapter discusses only the most useful and important classes. Other |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 31 | classes do exist within the ``meta/classes*`` directories in the Source |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 32 | Directory. You can reference the ``.bbclass`` files directly for more |
| 33 | information. |
| 34 | |
| 35 | .. _ref-classes-allarch: |
| 36 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 37 | ``allarch`` |
| 38 | =========== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 39 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 40 | The :ref:`ref-classes-allarch` class is inherited by recipes that do not produce |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 41 | architecture-specific output. The class disables functionality that is |
| 42 | normally needed for recipes that produce executable binaries (such as |
| 43 | building the cross-compiler and a C library as pre-requisites, and |
| 44 | splitting 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 Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 52 | configured for all architectures using :ref:`ref-classes-allarch`. This is the case |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 53 | even if the recipes do not produce architecture-specific output. |
| 54 | |
| 55 | Configuring such recipes for all architectures causes the |
Patrick Williams | 2194f50 | 2022-10-16 14:26:09 -0500 | [diff] [blame] | 56 | :ref:`do_package_write_* <ref-tasks-package_write_deb>` tasks to |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 57 | have different signatures for the machines with different tunings. |
| 58 | Additionally, unnecessary rebuilds occur every time an image for a |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 59 | different :term:`MACHINE` is built even when the recipe never changes. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 60 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 61 | By default, all recipes inherit the :ref:`ref-classes-base` and |
| 62 | :ref:`ref-classes-package` classes, which enable |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 63 | functionality needed for recipes that produce executable output. If your |
| 64 | recipe, for example, only produces packages that contain configuration |
| 65 | files, media files, or scripts (e.g. Python and Perl), then it should |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 66 | inherit the :ref:`ref-classes-allarch` class. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 67 | |
| 68 | .. _ref-classes-archiver: |
| 69 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 70 | ``archiver`` |
| 71 | ============ |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 72 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 73 | The :ref:`ref-classes-archiver` class supports releasing source code and other |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 74 | materials with the binaries. |
| 75 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 76 | For 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 Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 78 | section in the Yocto Project Development Tasks Manual. You can also see |
| 79 | the :term:`ARCHIVER_MODE` variable for information |
| 80 | about the variable flags (varflags) that help control archive creation. |
| 81 | |
| 82 | .. _ref-classes-autotools: |
| 83 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 84 | ``autotools*`` |
| 85 | ============== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 86 | |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 87 | The :ref:`autotools* <ref-classes-autotools>` classes support packages built with the |
Patrick Williams | 7784c42 | 2022-11-17 07:29:11 -0600 | [diff] [blame] | 88 | :wikipedia:`GNU Autotools <GNU_Autotools>`. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 89 | |
| 90 | The ``autoconf``, ``automake``, and ``libtool`` packages bring |
| 91 | standardization. This class defines a set of tasks (e.g. ``configure``, |
| 92 | ``compile`` and so forth) that work for all Autotooled packages. It |
| 93 | should usually be enough to define a few standard variables and then |
| 94 | simply ``inherit autotools``. These classes can also work with software |
| 95 | that emulates Autotools. For more information, see the |
Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 96 | ":ref:`dev-manual/new-recipe:building an autotooled package`" section |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 97 | in the Yocto Project Development Tasks Manual. |
| 98 | |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 99 | By default, the :ref:`autotools* <ref-classes-autotools>` classes use out-of-tree builds (i.e. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 100 | ``autotools.bbclass`` building with ``B != S``). |
| 101 | |
| 102 | If the software being built by a recipe does not support using |
| 103 | out-of-tree builds, you should have the recipe inherit the |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 104 | :ref:`autotools-brokensep <ref-classes-autotools>` class. The :ref:`autotools-brokensep <ref-classes-autotools>` class behaves |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 105 | the same as the :ref:`ref-classes-autotools` class but builds with :term:`B` |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 106 | == :term:`S`. This method is useful when out-of-tree build |
| 107 | support 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 | |
| 114 | It's useful to have some idea of how the tasks defined by the |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 115 | :ref:`autotools* <ref-classes-autotools>` classes work and what they do behind the scenes. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 116 | |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame] | 117 | - :ref:`ref-tasks-configure` --- regenerates the |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 118 | configure script (using ``autoreconf``) and then launches it with a |
| 119 | standard set of arguments used during cross-compilation. You can pass |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 120 | additional parameters to ``configure`` through the :term:`EXTRA_OECONF` |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 121 | or :term:`PACKAGECONFIG_CONFARGS` |
| 122 | variables. |
| 123 | |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame] | 124 | - :ref:`ref-tasks-compile` --- runs ``make`` with |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 125 | arguments that specify the compiler and linker. You can pass |
Andrew Geissler | 5f35090 | 2021-07-23 13:09:54 -0400 | [diff] [blame] | 126 | additional arguments through the :term:`EXTRA_OEMAKE` variable. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 127 | |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame] | 128 | - :ref:`ref-tasks-install` --- runs ``make install`` and |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 129 | passes in ``${``\ :term:`D`\ ``}`` as ``DESTDIR``. |
| 130 | |
| 131 | .. _ref-classes-base: |
| 132 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 133 | ``base`` |
| 134 | ======== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 135 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 136 | The :ref:`ref-classes-base` class is special in that every ``.bb`` file implicitly |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 137 | inherits the class. This class contains definitions for standard basic |
| 138 | tasks such as fetching, unpacking, configuring (empty by default), |
| 139 | compiling (runs any ``Makefile`` present), installing (empty by default) |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 140 | and packaging (empty by default). These tasks are often overridden or |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 141 | extended by other classes such as the :ref:`ref-classes-autotools` class or the |
| 142 | :ref:`ref-classes-package` class. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 143 | |
| 144 | The 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 |
| 147 | arguments passed directly to ``oe_runmake``. |
| 148 | |
| 149 | .. _ref-classes-bash-completion: |
| 150 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 151 | ``bash-completion`` |
| 152 | =================== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 153 | |
| 154 | Sets up packaging and dependencies appropriate for recipes that build |
| 155 | software that includes bash-completion data. |
| 156 | |
| 157 | .. _ref-classes-bin-package: |
| 158 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 159 | ``bin_package`` |
| 160 | =============== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 161 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 162 | The :ref:`ref-classes-bin-package` class is a helper class for recipes that extract the |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 163 | contents of a binary package (e.g. an RPM) and install those contents |
| 164 | rather than building the binary from source. The binary package is |
| 165 | extracted and new packages in the configured output package format are |
| 166 | created. Extraction and installation of proprietary binaries is a good |
| 167 | example 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 Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 173 | 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 Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 177 | :term:`S`:: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 178 | |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 179 | SRC_URI = "git://example.com/downloads/somepackage.rpm;branch=main;subpath=${BP}" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 180 | |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 181 | 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 Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 183 | |
| 184 | .. _ref-classes-binconfig: |
| 185 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 186 | ``binconfig`` |
| 187 | ============= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 188 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 189 | The :ref:`ref-classes-binconfig` class helps to correct paths in shell scripts. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 190 | |
| 191 | Before ``pkg-config`` had become widespread, libraries shipped shell |
| 192 | scripts to give information about the libraries and include paths needed |
| 193 | to build software (usually named ``LIBNAME-config``). This class assists |
| 194 | any recipe using such scripts. |
| 195 | |
| 196 | During staging, the OpenEmbedded build system installs such scripts into |
| 197 | the ``sysroots/`` directory. Inheriting this class results in all paths |
| 198 | in these scripts being changed to point into the ``sysroots/`` directory |
| 199 | so that all builds that use the script use the correct directories for |
| 200 | the cross compiling layout. See the |
| 201 | :term:`BINCONFIG_GLOB` variable for more |
| 202 | information. |
| 203 | |
| 204 | .. _ref-classes-binconfig-disabled: |
| 205 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 206 | ``binconfig-disabled`` |
| 207 | ====================== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 208 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 209 | An alternative version of the :ref:`ref-classes-binconfig` |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 210 | class, which disables binary configuration scripts by making them return |
| 211 | an error in favor of using ``pkg-config`` to query the information. The |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 212 | scripts to be disabled should be specified using the :term:`BINCONFIG` |
| 213 | variable within the recipe inheriting the class. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 214 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 215 | .. _ref-classes-buildhistory: |
| 216 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 217 | ``buildhistory`` |
| 218 | ================ |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 219 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 220 | The :ref:`ref-classes-buildhistory` class records a history of build output metadata, |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 221 | which can be used to detect possible regressions as well as used for |
| 222 | analysis of the build output. For more information on using Build |
| 223 | History, see the |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 224 | ":ref:`dev-manual/build-quality:maintaining build output quality`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 225 | section in the Yocto Project Development Tasks Manual. |
| 226 | |
| 227 | .. _ref-classes-buildstats: |
| 228 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 229 | ``buildstats`` |
| 230 | ============== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 231 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 232 | The :ref:`ref-classes-buildstats` class records performance statistics about each task |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 233 | executed during the build (e.g. elapsed time, CPU usage, and I/O usage). |
| 234 | |
| 235 | When you use this class, the output goes into the |
| 236 | :term:`BUILDSTATS_BASE` directory, which defaults |
| 237 | to ``${TMPDIR}/buildstats/``. You can analyze the elapsed time using |
| 238 | ``scripts/pybootchartgui/pybootchartgui.py``, which produces a cascading |
| 239 | chart of the entire build process and can be useful for highlighting |
| 240 | bottlenecks. |
| 241 | |
| 242 | Collecting 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 |
| 245 | enable the class. However, if you want to disable the class, simply |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 246 | remove ":ref:`ref-classes-buildstats`" from the :term:`USER_CLASSES` list. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 247 | |
| 248 | .. _ref-classes-buildstats-summary: |
| 249 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 250 | ``buildstats-summary`` |
| 251 | ====================== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 252 | |
| 253 | When inherited globally, prints statistics at the end of the build on |
| 254 | sstate re-use. In order to function, this class requires the |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 255 | :ref:`ref-classes-buildstats` class be enabled. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 256 | |
Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 257 | .. _ref-classes-cargo: |
| 258 | |
| 259 | ``cargo`` |
| 260 | ========= |
| 261 | |
| 262 | The :ref:`ref-classes-cargo` class allows to compile Rust language programs |
| 263 | using `Cargo <https://doc.rust-lang.org/cargo/>`__. Cargo is Rust's package |
| 264 | manager, allowing to fetch package dependencies and build your program. |
| 265 | |
| 266 | Using this class makes it very easy to build Rust programs. All you need |
| 267 | is to use the :term:`SRC_URI` variable to point to a source repository |
| 268 | which can be built by Cargo, typically one that was created by the |
Andrew Geissler | 5082cc7 | 2023-09-11 08:41:39 -0400 | [diff] [blame] | 269 | ``cargo new`` command, containing a ``Cargo.toml`` file, a ``Cargo.lock`` file and a ``src`` |
Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 270 | subdirectory. |
| 271 | |
Andrew Geissler | 5082cc7 | 2023-09-11 08:41:39 -0400 | [diff] [blame] | 272 | If 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 | |
| 275 | You 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>` |
| 277 | recipe. Another example, with only crate dependencies, is the |
Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 278 | :oe_git:`uutils-coreutils </meta-openembedded/tree/meta-oe/recipes-core/uutils-coreutils>` |
| 279 | recipe, which was generated by the `cargo-bitbake <https://crates.io/crates/cargo-bitbake>`__ |
| 280 | tool. |
| 281 | |
| 282 | This class inherits the :ref:`ref-classes-cargo_common` class. |
| 283 | |
Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 284 | .. _ref-classes-cargo_c: |
| 285 | |
| 286 | ``cargo_c`` |
| 287 | =========== |
| 288 | |
| 289 | The :ref:`ref-classes-cargo_c` class can be inherited by a recipe to generate |
| 290 | a Rust library that can be called by C/C++ code. The recipe which inherits this |
| 291 | class has to only replace ``inherit cargo`` by ``inherit cargo_c``. |
| 292 | |
| 293 | See the :yocto_git:`rust-c-lib-example_git.bb |
| 294 | </poky/tree/meta-selftest/recipes-devtools/rust/rust-c-lib-example_git.bb>` |
| 295 | example recipe. |
| 296 | |
Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 297 | .. _ref-classes-cargo_common: |
| 298 | |
| 299 | ``cargo_common`` |
| 300 | ================ |
| 301 | |
| 302 | The :ref:`ref-classes-cargo_common` class is an internal class |
| 303 | that is not intended to be used directly. |
| 304 | |
| 305 | An exception is the "rust" recipe, to build the Rust compiler and runtime |
| 306 | library, which is built by Cargo but cannot use the :ref:`ref-classes-cargo` |
| 307 | class. This is why this class was introduced. |
| 308 | |
Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 309 | .. _ref-classes-cargo-update-recipe-crates: |
| 310 | |
| 311 | ``cargo-update-recipe-crates`` |
| 312 | =============================== |
| 313 | |
| 314 | The :ref:`ref-classes-cargo-update-recipe-crates` class allows |
| 315 | recipe developers to update the list of Cargo crates in :term:`SRC_URI` |
| 316 | by reading the ``Cargo.lock`` file in the source tree. |
| 317 | |
| 318 | To do so, create a recipe for your program, for example using |
| 319 | :doc:`devtool </ref-manual/devtool-reference>`, |
| 320 | make 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 | |
| 325 | This creates a ``recipe-crates.inc`` file that you can include in your |
| 326 | recipe:: |
| 327 | |
| 328 | require ${BPN}-crates.inc |
| 329 | |
| 330 | That's also something you can achieve by using the |
| 331 | `cargo-bitbake <https://crates.io/crates/cargo-bitbake>`__ tool. |
| 332 | |
Andrew Geissler | 5082cc7 | 2023-09-11 08:41:39 -0400 | [diff] [blame] | 333 | .. _ref-classes-ccache: |
| 334 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 335 | ``ccache`` |
| 336 | ========== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 337 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 338 | The :ref:`ref-classes-ccache` class enables the C/C++ Compiler Cache for the build. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 339 | This class is used to give a minor performance boost during the build. |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 340 | |
| 341 | See https://ccache.samba.org/ for information on the C/C++ Compiler |
| 342 | Cache, and the :oe_git:`ccache.bbclass </openembedded-core/tree/meta/classes/ccache.bbclass>` |
| 343 | file for details about how to enable this mechanism in your configuration |
| 344 | file, how to disable it for specific recipes, and how to share ``ccache`` |
| 345 | files between builds. |
| 346 | |
| 347 | However, using the class can lead to unexpected side-effects. Thus, using |
| 348 | this class is not recommended. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 349 | |
| 350 | .. _ref-classes-chrpath: |
| 351 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 352 | ``chrpath`` |
| 353 | =========== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 354 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 355 | The :ref:`ref-classes-chrpath` class is a wrapper around the "chrpath" utility, which |
| 356 | is 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 Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 358 | in order to make them relocatable. |
| 359 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 360 | .. _ref-classes-cmake: |
| 361 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 362 | ``cmake`` |
| 363 | ========= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 364 | |
Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 365 | The :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 |
| 368 | pass to the ``cmake`` command line. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 369 | |
Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 370 | By default, the :ref:`ref-classes-cmake` class uses |
| 371 | `Ninja <https://ninja-build.org/>`__ instead of GNU make for building, which |
| 372 | offers better build performance. If a recipe is broken with Ninja, then the |
| 373 | recipe can set the :term:`OECMAKE_GENERATOR` variable to ``Unix Makefiles`` to |
| 374 | use GNU make instead. |
| 375 | |
| 376 | If you need to install custom CMake toolchain files supplied by the application |
| 377 | being built, you should install them (during :ref:`ref-tasks-install`) to the |
| 378 | preferred CMake Module directory: ``${D}${datadir}/cmake/modules/``. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 379 | |
Patrick Williams | 705982a | 2024-01-12 09:51:57 -0600 | [diff] [blame] | 380 | .. _ref-classes-cmake-qemu: |
| 381 | |
| 382 | ``cmake-qemu`` |
| 383 | ============== |
| 384 | |
| 385 | The :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 |
| 388 | the ``CMAKE_CROSSCOMPILING_EMULATOR`` setting to ``cmake``. This allows to use |
| 389 | QEMU user-mode emulation for the execution of cross-compiled binaries on the |
| 390 | host machine. For more information about ``CMAKE_CROSSCOMPILING_EMULATOR`` |
| 391 | please refer to the `related section of the CMake documentation |
| 392 | <https://cmake.org/cmake/help/latest/variable/CMAKE_CROSSCOMPILING_EMULATOR.html>`__. |
| 393 | |
| 394 | Not 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 |
| 396 | involves a certain risk, which is also the reason why this feature is not part of |
| 397 | the main :ref:`ref-classes-cmake` class by default. |
| 398 | |
| 399 | One use case is the execution of cross-compiled unit tests with CTest on the build |
| 400 | machine. If ``CMAKE_CROSSCOMPILING_EMULATOR`` is configured:: |
| 401 | |
| 402 | cmake --build --target test |
| 403 | |
| 404 | works transparently with QEMU user-mode. |
| 405 | |
| 406 | If the CMake project is developed with this use case in mind this works very nicely. |
| 407 | This also applies to an IDE configured to use ``cmake-native`` for cross-compiling. |
| 408 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 409 | .. _ref-classes-cml1: |
| 410 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 411 | ``cml1`` |
| 412 | ======== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 413 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 414 | The :ref:`ref-classes-cml1` class provides basic support for the Linux kernel style |
Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 415 | build configuration system. "cml" stands for "Configuration Menu Language", which |
| 416 | originates from the Linux kernel but is also used in other projects such as U-Boot |
| 417 | and BusyBox. It could have been called "kconfig" too. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 418 | |
| 419 | .. _ref-classes-compress_doc: |
| 420 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 421 | ``compress_doc`` |
| 422 | ================ |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 423 | |
Patrick Williams | 03514f1 | 2024-04-05 07:04:11 -0500 | [diff] [blame] | 424 | Enables compression for manual and info pages. This class is intended |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 425 | to be inherited globally. The default compression mechanism is gz (gzip) |
| 426 | but you can select an alternative mechanism by setting the |
| 427 | :term:`DOC_COMPRESS` variable. |
| 428 | |
| 429 | .. _ref-classes-copyleft_compliance: |
| 430 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 431 | ``copyleft_compliance`` |
| 432 | ======================= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 433 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 434 | The :ref:`ref-classes-copyleft_compliance` class preserves source code for the purposes |
| 435 | of license compliance. This class is an alternative to the :ref:`ref-classes-archiver` |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 436 | class and is still used by some users even though it has been deprecated |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 437 | in favor of the :ref:`ref-classes-archiver` class. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 438 | |
| 439 | .. _ref-classes-copyleft_filter: |
| 440 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 441 | ``copyleft_filter`` |
| 442 | =================== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 443 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 444 | A class used by the :ref:`ref-classes-archiver` and |
| 445 | :ref:`ref-classes-copyleft_compliance` classes |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 446 | for filtering licenses. The ``copyleft_filter`` class is an internal |
| 447 | class and is not intended to be used directly. |
| 448 | |
| 449 | .. _ref-classes-core-image: |
| 450 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 451 | ``core-image`` |
| 452 | ============== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 453 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 454 | The :ref:`ref-classes-core-image` class provides common definitions for the |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 455 | ``core-image-*`` image recipes, such as support for additional |
| 456 | :term:`IMAGE_FEATURES`. |
| 457 | |
| 458 | .. _ref-classes-cpan: |
| 459 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 460 | ``cpan*`` |
| 461 | ========= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 462 | |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 463 | The :ref:`cpan* <ref-classes-cpan>` classes support Perl modules. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 464 | |
| 465 | Recipes for Perl modules are simple. These recipes usually only need to |
| 466 | point to the source's archive and then inherit the proper class file. |
| 467 | Building is split into two methods depending on which method the module |
| 468 | authors 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 Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 476 | Both build methods inherit the :ref:`cpan-base <ref-classes-cpan>` class for basic Perl |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 477 | support. |
| 478 | |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 479 | .. _ref-classes-create-spdx: |
| 480 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 481 | ``create-spdx`` |
| 482 | =============== |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 483 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 484 | The :ref:`ref-classes-create-spdx` class provides support for |
Patrick Williams | 7784c42 | 2022-11-17 07:29:11 -0600 | [diff] [blame] | 485 | automatically creating :term:`SPDX` :term:`SBOM` documents based upon image |
| 486 | and SDK contents. |
| 487 | |
| 488 | This class is meant to be inherited globally from a configuration file:: |
| 489 | |
| 490 | INHERIT += "create-spdx" |
| 491 | |
| 492 | The 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, |
| 495 | as well as in ``tmp/deploy/spdx``. |
| 496 | |
| 497 | The exact behaviour of this class, and the amount of output can be controlled |
| 498 | by the :term:`SPDX_PRETTY`, :term:`SPDX_ARCHIVE_PACKAGED`, |
| 499 | :term:`SPDX_ARCHIVE_SOURCES` and :term:`SPDX_INCLUDE_SOURCES` variables. |
| 500 | |
| 501 | See the description of these variables and the |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 502 | ":ref:`dev-manual/sbom:creating a software bill of materials`" |
Patrick Williams | 7784c42 | 2022-11-17 07:29:11 -0600 | [diff] [blame] | 503 | section in the Yocto Project Development Manual for more details. |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 504 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 505 | .. _ref-classes-cross: |
| 506 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 507 | ``cross`` |
| 508 | ========= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 509 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 510 | The :ref:`ref-classes-cross` class provides support for the recipes that build the |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 511 | cross-compilation tools. |
| 512 | |
| 513 | .. _ref-classes-cross-canadian: |
| 514 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 515 | ``cross-canadian`` |
| 516 | ================== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 517 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 518 | The :ref:`ref-classes-cross-canadian` class provides support for the recipes that build |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 519 | the Canadian Cross-compilation tools for SDKs. See the |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 520 | ":ref:`overview-manual/concepts:cross-development toolchain generation`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 521 | section in the Yocto Project Overview and Concepts Manual for more |
| 522 | discussion on these cross-compilation tools. |
| 523 | |
| 524 | .. _ref-classes-crosssdk: |
| 525 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 526 | ``crosssdk`` |
| 527 | ============ |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 528 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 529 | The :ref:`ref-classes-crosssdk` class provides support for the recipes that build the |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 530 | cross-compilation tools used for building SDKs. See the |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 531 | ":ref:`overview-manual/concepts:cross-development toolchain generation`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 532 | section in the Yocto Project Overview and Concepts Manual for more |
| 533 | discussion on these cross-compilation tools. |
| 534 | |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 535 | .. _ref-classes-cve-check: |
| 536 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 537 | ``cve-check`` |
| 538 | ============= |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 539 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 540 | The :ref:`ref-classes-cve-check` class looks for known CVEs (Common Vulnerabilities |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 541 | and Exposures) while building with BitBake. This class is meant to be |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 542 | inherited globally from a configuration file:: |
| 543 | |
| 544 | INHERIT += "cve-check" |
| 545 | |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 546 | To filter out obsolete CVE database entries which are known not to impact software from Poky and OE-Core, |
| 547 | add following line to the build configuration file:: |
| 548 | |
| 549 | include cve-extra-exclusions.inc |
| 550 | |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 551 | You can also look for vulnerabilities in specific packages by passing |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 552 | ``-c cve_check`` to BitBake. |
| 553 | |
| 554 | After building the software with Bitbake, CVE check output reports are available in ``tmp/deploy/cve`` |
| 555 | and image specific summaries in ``tmp/deploy/images/*.cve`` or ``tmp/deploy/images/*.json`` files. |
| 556 | |
| 557 | When building, the CVE checker will emit build time warnings for any detected |
| 558 | issues which are in the state ``Unpatched``, meaning that CVE issue seems to affect the software component |
| 559 | and version being compiled and no patches to address the issue are applied. Other states |
| 560 | for detected CVE issues are: ``Patched`` meaning that a patch to address the issue is already |
| 561 | applied, and ``Ignored`` meaning that the issue can be ignored. |
| 562 | |
| 563 | The ``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 |
| 565 | CVE metadata of format ``CVE: CVE-ID`` in the commit message of the patch file. |
| 566 | |
Patrick Williams | 2a25492 | 2023-08-11 09:48:11 -0500 | [diff] [blame] | 567 | If the recipe adds ``CVE-ID`` as flag of the :term:`CVE_STATUS` variable with status |
| 568 | mapped to ``Ignored``, then the CVE state is reported as ``Ignored``:: |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 569 | |
Patrick Williams | 2a25492 | 2023-08-11 09:48:11 -0500 | [diff] [blame] | 570 | CVE_STATUS[CVE-2020-15523] = "not-applicable-platform: Issue only applies on Windows" |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 571 | |
| 572 | If CVE check reports that a recipe contains false positives or false negatives, these may be |
| 573 | fixed in recipes by adjusting the CVE product name using :term:`CVE_PRODUCT` and :term:`CVE_VERSION` variables. |
| 574 | :term:`CVE_PRODUCT` defaults to the plain recipe name :term:`BPN` which can be adjusted to one or more CVE |
| 575 | database vendor and product pairs using the syntax:: |
| 576 | |
| 577 | CVE_PRODUCT = "flex_project:flex" |
| 578 | |
| 579 | where ``flex_project`` is the CVE database vendor name and ``flex`` is the product name. Similarly |
| 580 | if the default recipe version :term:`PV` does not match the version numbers of the software component |
| 581 | in upstream releases or the CVE database, then the :term:`CVE_VERSION` variable can be used to set the |
| 582 | CVE database compatible version number, for example:: |
| 583 | |
| 584 | CVE_VERSION = "2.39" |
| 585 | |
| 586 | Any bugs or missing or incomplete information in the CVE database entries should be fixed in the CVE database |
| 587 | via the `NVD feedback form <https://nvd.nist.gov/info/contact-form>`__. |
| 588 | |
| 589 | Users should note that security is a process, not a product, and thus also CVE checking, analyzing results, |
| 590 | patching and updating the software should be done as a regular process. The data and assumptions |
| 591 | required for CVE checker to reliably detect issues are frequently broken in various ways. |
| 592 | These can only be detected by reviewing the details of the issues and iterating over the generated reports, |
| 593 | and following what happens in other Linux distributions and in the greater open source community. |
| 594 | |
| 595 | You will find some more details in the |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 596 | ":ref:`dev-manual/vulnerabilities:checking for vulnerabilities`" |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 597 | section in the Development Tasks Manual. |
| 598 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 599 | .. _ref-classes-debian: |
| 600 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 601 | ``debian`` |
| 602 | ========== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 603 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 604 | The :ref:`ref-classes-debian` class renames output packages so that they follow the |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 605 | Debian naming policy (i.e. ``glibc`` becomes ``libc6`` and |
| 606 | ``glibc-devel`` becomes ``libc6-dev``.) Renaming includes the library |
| 607 | name and version as part of the package name. |
| 608 | |
| 609 | If a recipe creates packages for multiple libraries (shared object files |
| 610 | of ``.so`` type), use the :term:`LEAD_SONAME` |
| 611 | variable in the recipe to specify the library on which to apply the |
| 612 | naming scheme. |
| 613 | |
| 614 | .. _ref-classes-deploy: |
| 615 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 616 | ``deploy`` |
| 617 | ========== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 618 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 619 | The :ref:`ref-classes-deploy` class handles deploying files to the |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 620 | :term:`DEPLOY_DIR_IMAGE` directory. The main |
| 621 | function of this class is to allow the deploy step to be accelerated by |
| 622 | shared state. Recipes that inherit this class should define their own |
| 623 | :ref:`ref-tasks-deploy` function to copy the files to be |
| 624 | deployed to :term:`DEPLOYDIR`, and use ``addtask`` to |
| 625 | add the task at the appropriate place, which is usually after |
| 626 | :ref:`ref-tasks-compile` or |
| 627 | :ref:`ref-tasks-install`. The class then takes care of |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 628 | staging the files from :term:`DEPLOYDIR` to :term:`DEPLOY_DIR_IMAGE`. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 629 | |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 630 | .. _ref-classes-devicetree: |
| 631 | |
| 632 | ``devicetree`` |
| 633 | ============== |
| 634 | |
| 635 | The :ref:`ref-classes-devicetree` class allows to build a recipe that compiles |
| 636 | device tree source files that are not in the kernel tree. |
| 637 | |
| 638 | The compilation of out-of-tree device tree sources is the same as the kernel |
| 639 | in-tree device tree compilation process. This includes the ability to include |
| 640 | sources from the kernel such as SoC ``dtsi`` files as well as C header files, |
| 641 | such as ``gpio.h``. |
| 642 | |
| 643 | The :ref:`ref-tasks-compile` task will compile two kinds of files: |
| 644 | |
| 645 | - Regular device tree sources with a ``.dts`` extension. |
| 646 | |
| 647 | - Device tree overlays, detected from the presence of the ``/plugin/;`` |
| 648 | string in the file contents. |
| 649 | |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 650 | This class deploys the generated device tree binaries into |
| 651 | ``${``\ :term:`DEPLOY_DIR_IMAGE`\ ``}/devicetree/``. This is similar to |
| 652 | what the :ref:`ref-classes-kernel-devicetree` class does, with the added |
| 653 | ``devicetree`` subdirectory to avoid name clashes. Additionally, the device |
| 654 | trees are populated into the sysroot for access via the sysroot from within |
| 655 | other recipes. |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 656 | |
Patrick Williams | b542dec | 2023-06-09 01:26:37 -0500 | [diff] [blame] | 657 | By default, all device tree sources located in :term:`DT_FILES_PATH` directory |
| 658 | are compiled. To select only particular sources, set :term:`DT_FILES` to |
| 659 | a space-separated list of files (relative to :term:`DT_FILES_PATH`). For |
| 660 | convenience, both ``.dts`` and ``.dtb`` extensions can be used. |
| 661 | |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 662 | An extra padding is appended to non-overlay device trees binaries. This |
| 663 | can typically be used as extra space for adding extra properties at boot time. |
Patrick Williams | b542dec | 2023-06-09 01:26:37 -0500 | [diff] [blame] | 664 | The padding size can be modified by setting :term:`DT_PADDING_SIZE` |
| 665 | to the desired size, in bytes. |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 666 | |
| 667 | See :oe_git:`devicetree.bbclass sources |
Patrick Williams | 44b3caf | 2024-04-12 16:51:14 -0500 | [diff] [blame] | 668 | </openembedded-core/tree/meta/classes-recipe/devicetree.bbclass>` |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 669 | for further variables controlling this class. |
| 670 | |
| 671 | Here is an excerpt of an example ``recipes-kernel/linux/devicetree-acme.bb`` |
| 672 | recipe inheriting this class:: |
| 673 | |
| 674 | inherit devicetree |
| 675 | COMPATIBLE_MACHINE = "^mymachine$" |
| 676 | SRC_URI:mymachine = "file://mymachine.dts" |
| 677 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 678 | .. _ref-classes-devshell: |
| 679 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 680 | ``devshell`` |
| 681 | ============ |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 682 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 683 | The :ref:`ref-classes-devshell` class adds the :ref:`ref-tasks-devshell` task. Distribution |
| 684 | policy dictates whether to include this class. See the ":ref:`dev-manual/development-shell:using a development shell`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 685 | section in the Yocto Project Development Tasks Manual for more |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 686 | information about using :ref:`ref-classes-devshell`. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 687 | |
| 688 | .. _ref-classes-devupstream: |
| 689 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 690 | ``devupstream`` |
| 691 | =============== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 692 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 693 | The :ref:`ref-classes-devupstream` class uses |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 694 | :term:`BBCLASSEXTEND` to add a variant of the |
| 695 | recipe that fetches from an alternative URI (e.g. Git) instead of a |
Patrick Williams | 3965356 | 2024-03-01 08:54:02 -0600 | [diff] [blame] | 696 | tarball. Here is an example:: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 697 | |
| 698 | BBCLASSEXTEND = "devupstream:target" |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 699 | SRC_URI:class-devupstream = "git://git.example.com/example;branch=main" |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 700 | SRCREV:class-devupstream = "abcd1234" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 701 | |
| 702 | Adding the above statements to your recipe creates a variant that has |
| 703 | :term:`DEFAULT_PREFERENCE` set to "-1". |
| 704 | Consequently, you need to select the variant of the recipe to use it. |
| 705 | Any development-specific adjustments can be done by using the |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 706 | ``class-devupstream`` override. Here is an example:: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 707 | |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 708 | DEPENDS:append:class-devupstream = " gperf-native" |
| 709 | do_configure:prepend:class-devupstream() { |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 710 | touch ${S}/README |
| 711 | } |
| 712 | |
| 713 | The class |
| 714 | currently only supports creating a development variant of the target |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 715 | recipe, not :ref:`ref-classes-native` or :ref:`ref-classes-nativesdk` variants. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 716 | |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 717 | The :term:`BBCLASSEXTEND` syntax (i.e. ``devupstream:target``) provides |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 718 | support for :ref:`ref-classes-native` and :ref:`ref-classes-nativesdk` variants. Consequently, this |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 719 | functionality can be added in a future release. |
| 720 | |
| 721 | Support for other version control systems such as Subversion is limited |
| 722 | due to BitBake's automatic fetch dependencies (e.g. |
| 723 | ``subversion-native``). |
| 724 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 725 | .. _ref-classes-externalsrc: |
| 726 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 727 | ``externalsrc`` |
| 728 | =============== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 729 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 730 | The :ref:`ref-classes-externalsrc` class supports building software from source code |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 731 | that is external to the OpenEmbedded build system. Building software |
| 732 | from an external source tree means that the build system's normal fetch, |
| 733 | unpack, and patch process is not used. |
| 734 | |
| 735 | By default, the OpenEmbedded build system uses the :term:`S` |
| 736 | and :term:`B` variables to locate unpacked recipe source code |
| 737 | and to build it, respectively. When your recipe inherits the |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 738 | :ref:`ref-classes-externalsrc` class, you use the |
| 739 | :term:`EXTERNALSRC` and :term:`EXTERNALSRC_BUILD` variables to |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 740 | ultimately define :term:`S` and :term:`B`. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 741 | |
| 742 | By default, this class expects the source code to support recipe builds |
| 743 | that use the :term:`B` variable to point to the directory in |
| 744 | which the OpenEmbedded build system places the generated objects built |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 745 | from the recipes. By default, the :term:`B` directory is set to the |
| 746 | following, which is separate from the source directory (:term:`S`):: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 747 | |
Andrew Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame] | 748 | ${WORKDIR}/${BPN}-{PV}/ |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 749 | |
| 750 | See these variables for more information: |
| 751 | :term:`WORKDIR`, :term:`BPN`, and |
| 752 | :term:`PV`, |
| 753 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 754 | For more information on the :ref:`ref-classes-externalsrc` class, see the comments in |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 755 | ``meta/classes/externalsrc.bbclass`` in the :term:`Source Directory`. |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 756 | For information on how to use the :ref:`ref-classes-externalsrc` class, see the |
| 757 | ":ref:`dev-manual/building:building software from an external source`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 758 | section in the Yocto Project Development Tasks Manual. |
| 759 | |
| 760 | .. _ref-classes-extrausers: |
| 761 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 762 | ``extrausers`` |
| 763 | ============== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 764 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 765 | The :ref:`ref-classes-extrausers` class allows additional user and group configuration |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 766 | to be applied at the image level. Inheriting this class either globally |
| 767 | or from an image recipe allows additional user and group operations to |
| 768 | be performed using the |
| 769 | :term:`EXTRA_USERS_PARAMS` variable. |
| 770 | |
| 771 | .. note:: |
| 772 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 773 | The user and group operations added using the :ref:`ref-classes-extrausers` |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 774 | class are not tied to a specific recipe outside of the recipe for the |
| 775 | image. Thus, the operations can be performed across the image as a |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 776 | whole. Use the :ref:`ref-classes-useradd` class to add user and group |
| 777 | configuration to a specific recipe. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 778 | |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 779 | Here is an example that uses this class in an image recipe:: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 780 | |
| 781 | inherit extrausers |
| 782 | EXTRA_USERS_PARAMS = "\ |
| 783 | useradd -p '' tester; \ |
| 784 | groupadd developers; \ |
| 785 | userdel nobody; \ |
| 786 | groupdel -g video; \ |
| 787 | groupmod -g 1020 developers; \ |
| 788 | usermod -s /bin/sh tester; \ |
| 789 | " |
| 790 | |
| 791 | Here is an example that adds two users named "tester-jim" and "tester-sue" and assigns |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 792 | passwords. First on host, create the (escaped) password hash:: |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 793 | |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 794 | printf "%q" $(mkpasswd -m sha256crypt tester01) |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 795 | |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 796 | The resulting hash is set to a variable and used in ``useradd`` command parameters:: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 797 | |
| 798 | inherit extrausers |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 799 | PASSWD = "\$X\$ABC123\$A-Long-Hash" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 800 | EXTRA_USERS_PARAMS = "\ |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 801 | useradd -p '${PASSWD}' tester-jim; \ |
| 802 | useradd -p '${PASSWD}' tester-sue; \ |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 803 | " |
| 804 | |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 805 | Finally, here is an example that sets the root password:: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 806 | |
| 807 | inherit extrausers |
| 808 | EXTRA_USERS_PARAMS = "\ |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 809 | usermod -p '${PASSWD}' root; \ |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 810 | " |
| 811 | |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 812 | .. note:: |
| 813 | |
| 814 | From a security perspective, hardcoding a default password is not |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 815 | generally a good idea or even legal in some jurisdictions. It is |
| 816 | recommended that you do not do this if you are building a production |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 817 | image. |
| 818 | |
| 819 | |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 820 | .. _ref-classes-features_check: |
| 821 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 822 | ``features_check`` |
| 823 | ================== |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 824 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 825 | The :ref:`ref-classes-features_check` class allows individual recipes to check |
| 826 | for required and conflicting :term:`DISTRO_FEATURES`, :term:`MACHINE_FEATURES` |
| 827 | or :term:`COMBINED_FEATURES`. |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 828 | |
| 829 | This class provides support for the following variables: |
| 830 | |
| 831 | - :term:`REQUIRED_DISTRO_FEATURES` |
| 832 | - :term:`CONFLICT_DISTRO_FEATURES` |
| 833 | - :term:`ANY_OF_DISTRO_FEATURES` |
| 834 | - ``REQUIRED_MACHINE_FEATURES`` |
| 835 | - ``CONFLICT_MACHINE_FEATURES`` |
| 836 | - ``ANY_OF_MACHINE_FEATURES`` |
| 837 | - ``REQUIRED_COMBINED_FEATURES`` |
| 838 | - ``CONFLICT_COMBINED_FEATURES`` |
| 839 | - ``ANY_OF_COMBINED_FEATURES`` |
| 840 | |
| 841 | If any conditions specified in the recipe using the above |
| 842 | variables are not met, the recipe will be skipped, and if the |
| 843 | build system attempts to build the recipe then an error will be |
| 844 | triggered. |
| 845 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 846 | .. _ref-classes-fontcache: |
| 847 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 848 | ``fontcache`` |
| 849 | ============= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 850 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 851 | The :ref:`ref-classes-fontcache` class generates the proper post-install and |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 852 | post-remove (postinst and postrm) scriptlets for font packages. These |
| 853 | scriptlets call ``fc-cache`` (part of ``Fontconfig``) to add the fonts |
| 854 | to the font information cache. Since the cache files are |
| 855 | architecture-specific, ``fc-cache`` runs using QEMU if the postinst |
| 856 | scriptlets need to be run on the build host during image creation. |
| 857 | |
| 858 | If the fonts being installed are in packages other than the main |
| 859 | package, set :term:`FONT_PACKAGES` to specify the |
| 860 | packages containing the fonts. |
| 861 | |
| 862 | .. _ref-classes-fs-uuid: |
| 863 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 864 | ``fs-uuid`` |
| 865 | =========== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 866 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 867 | The :ref:`ref-classes-fs-uuid` class extracts UUID from |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 868 | ``${``\ :term:`ROOTFS`\ ``}``, which must have been built |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 869 | by the time that this function gets called. The :ref:`ref-classes-fs-uuid` class only |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 870 | works on ``ext`` file systems and depends on ``tune2fs``. |
| 871 | |
| 872 | .. _ref-classes-gconf: |
| 873 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 874 | ``gconf`` |
| 875 | ========= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 876 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 877 | The :ref:`ref-classes-gconf` class provides common functionality for recipes that need |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 878 | to install GConf schemas. The schemas will be put into a separate |
| 879 | package (``${``\ :term:`PN`\ ``}-gconf``) that is created |
| 880 | automatically when this class is inherited. This package uses the |
| 881 | appropriate post-install and post-remove (postinst/postrm) scriptlets to |
| 882 | register and unregister the schemas in the target image. |
| 883 | |
| 884 | .. _ref-classes-gettext: |
| 885 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 886 | ``gettext`` |
| 887 | =========== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 888 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 889 | The :ref:`ref-classes-gettext` class provides support for building |
| 890 | software that uses the GNU ``gettext`` internationalization and localization |
| 891 | system. All recipes building software that use ``gettext`` should inherit this |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 892 | class. |
| 893 | |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 894 | .. _ref-classes-github-releases: |
| 895 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 896 | ``github-releases`` |
| 897 | =================== |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 898 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 899 | For recipes that fetch release tarballs from github, the :ref:`ref-classes-github-releases` |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 900 | class sets up a standard way for checking available upstream versions |
| 901 | (to support ``devtool upgrade`` and the Automated Upgrade Helper (AUH)). |
| 902 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 903 | To use it, add ":ref:`ref-classes-github-releases`" to the inherit line in the recipe, |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 904 | and if the default value of :term:`GITHUB_BASE_URI` is not suitable, |
| 905 | then set your own value in the recipe. You should then use ``${GITHUB_BASE_URI}`` |
| 906 | in the value you set for :term:`SRC_URI` within the recipe. |
| 907 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 908 | .. _ref-classes-gnomebase: |
| 909 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 910 | ``gnomebase`` |
| 911 | ============= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 912 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 913 | The :ref:`ref-classes-gnomebase` class is the base class for recipes that build |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 914 | software from the GNOME stack. This class sets |
| 915 | :term:`SRC_URI` to download the source from the GNOME |
| 916 | mirrors as well as extending :term:`FILES` with the typical |
| 917 | GNOME installation paths. |
| 918 | |
Andrew Geissler | c5535c9 | 2023-01-27 16:10:19 -0600 | [diff] [blame] | 919 | .. _ref-classes-go: |
| 920 | |
| 921 | ``go`` |
| 922 | ====== |
| 923 | |
| 924 | The :ref:`ref-classes-go` class supports building Go programs. The behavior of |
| 925 | this class is controlled by the mandatory :term:`GO_IMPORT` variable, and |
| 926 | by the optional :term:`GO_INSTALL` and :term:`GO_INSTALL_FILTEROUT` ones. |
| 927 | |
| 928 | To build a Go program with the Yocto Project, you can use the |
| 929 | :yocto_git:`go-helloworld_0.1.bb </poky/tree/meta/recipes-extended/go-examples/go-helloworld_0.1.bb>` |
| 930 | recipe as an example. |
| 931 | |
| 932 | .. _ref-classes-go-mod: |
| 933 | |
| 934 | ``go-mod`` |
| 935 | ========== |
| 936 | |
| 937 | The :ref:`ref-classes-go-mod` class allows to use Go modules, and inherits the |
| 938 | :ref:`ref-classes-go` class. |
| 939 | |
| 940 | See the associated :term:`GO_WORKDIR` variable. |
| 941 | |
Patrick Williams | 44b3caf | 2024-04-12 16:51:14 -0500 | [diff] [blame] | 942 | .. _ref-classes-go-vendor: |
| 943 | |
| 944 | ``go-vendor`` |
| 945 | ============= |
| 946 | |
| 947 | The :ref:`ref-classes-go-vendor` class implements support for offline builds, |
| 948 | also known as Go vendoring. In such a scenario, the module dependencias are |
| 949 | downloaded during the :ref:`ref-tasks-fetch` task rather than when modules are |
| 950 | imported, thus being coherent with Yocto's concept of fetching every source |
| 951 | beforehand. |
| 952 | |
| 953 | The dependencies are unpacked into the modules' ``vendor`` directory, where a |
| 954 | manifest file is generated. |
| 955 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 956 | .. _ref-classes-gobject-introspection: |
| 957 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 958 | ``gobject-introspection`` |
| 959 | ========================= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 960 | |
| 961 | Provides support for recipes building software that supports GObject |
| 962 | introspection. This functionality is only enabled if the |
| 963 | "gobject-introspection-data" feature is in |
| 964 | :term:`DISTRO_FEATURES` as well as |
| 965 | "qemu-usermode" being in |
| 966 | :term:`MACHINE_FEATURES`. |
| 967 | |
| 968 | .. note:: |
| 969 | |
Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 970 | This functionality is :ref:`backfilled <ref-features-backfill>` by default |
| 971 | and, if not applicable, should be disabled through |
| 972 | :term:`DISTRO_FEATURES_BACKFILL_CONSIDERED` or |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 973 | :term:`MACHINE_FEATURES_BACKFILL_CONSIDERED`, respectively. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 974 | |
| 975 | .. _ref-classes-grub-efi: |
| 976 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 977 | ``grub-efi`` |
| 978 | ============ |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 979 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 980 | The :ref:`ref-classes-grub-efi` class provides ``grub-efi``-specific functions for |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 981 | building bootable images. |
| 982 | |
| 983 | This class supports several variables: |
| 984 | |
| 985 | - :term:`INITRD`: Indicates list of filesystem images to |
| 986 | concatenate and use as an initial RAM disk (initrd) (optional). |
| 987 | |
| 988 | - :term:`ROOTFS`: Indicates a filesystem image to include |
| 989 | as the root filesystem (optional). |
| 990 | |
| 991 | - :term:`GRUB_GFXSERIAL`: Set this to "1" to have |
| 992 | graphics and serial in the boot menu. |
| 993 | |
| 994 | - :term:`LABELS`: A list of targets for the automatic |
| 995 | configuration. |
| 996 | |
| 997 | - :term:`APPEND`: An override list of append strings for |
| 998 | each ``LABEL``. |
| 999 | |
| 1000 | - :term:`GRUB_OPTS`: Additional options to add to the |
| 1001 | configuration (optional). Options are delimited using semi-colon |
| 1002 | characters (``;``). |
| 1003 | |
| 1004 | - :term:`GRUB_TIMEOUT`: Timeout before executing |
| 1005 | the default ``LABEL`` (optional). |
| 1006 | |
| 1007 | .. _ref-classes-gsettings: |
| 1008 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1009 | ``gsettings`` |
| 1010 | ============= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1011 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1012 | The :ref:`ref-classes-gsettings` class provides common functionality for recipes that |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1013 | need to install GSettings (glib) schemas. The schemas are assumed to be |
| 1014 | part of the main package. Appropriate post-install and post-remove |
| 1015 | (postinst/postrm) scriptlets are added to register and unregister the |
| 1016 | schemas in the target image. |
| 1017 | |
| 1018 | .. _ref-classes-gtk-doc: |
| 1019 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1020 | ``gtk-doc`` |
| 1021 | =========== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1022 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1023 | The :ref:`ref-classes-gtk-doc` class is a helper class to pull in the appropriate |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1024 | ``gtk-doc`` dependencies and disable ``gtk-doc``. |
| 1025 | |
| 1026 | .. _ref-classes-gtk-icon-cache: |
| 1027 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1028 | ``gtk-icon-cache`` |
| 1029 | ================== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1030 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1031 | The :ref:`ref-classes-gtk-icon-cache` class generates the proper post-install and |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1032 | post-remove (postinst/postrm) scriptlets for packages that use GTK+ and |
| 1033 | install icons. These scriptlets call ``gtk-update-icon-cache`` to add |
| 1034 | the fonts to GTK+'s icon cache. Since the cache files are |
| 1035 | architecture-specific, ``gtk-update-icon-cache`` is run using QEMU if |
| 1036 | the postinst scriptlets need to be run on the build host during image |
| 1037 | creation. |
| 1038 | |
| 1039 | .. _ref-classes-gtk-immodules-cache: |
| 1040 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1041 | ``gtk-immodules-cache`` |
| 1042 | ======================= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1043 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1044 | The :ref:`ref-classes-gtk-immodules-cache` class generates the proper post-install and |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1045 | post-remove (postinst/postrm) scriptlets for packages that install GTK+ |
| 1046 | input method modules for virtual keyboards. These scriptlets call |
| 1047 | ``gtk-update-icon-cache`` to add the input method modules to the cache. |
| 1048 | Since the cache files are architecture-specific, |
| 1049 | ``gtk-update-icon-cache`` is run using QEMU if the postinst scriptlets |
| 1050 | need to be run on the build host during image creation. |
| 1051 | |
| 1052 | If the input method modules being installed are in packages other than |
| 1053 | the main package, set |
| 1054 | :term:`GTKIMMODULES_PACKAGES` to specify |
| 1055 | the packages containing the modules. |
| 1056 | |
| 1057 | .. _ref-classes-gzipnative: |
| 1058 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1059 | ``gzipnative`` |
| 1060 | ============== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1061 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1062 | The :ref:`ref-classes-gzipnative` class enables the use of different native versions of |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1063 | ``gzip`` and ``pigz`` rather than the versions of these tools from the |
| 1064 | build host. |
| 1065 | |
| 1066 | .. _ref-classes-icecc: |
| 1067 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1068 | ``icecc`` |
| 1069 | ========= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1070 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1071 | The :ref:`ref-classes-icecc` class supports |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1072 | `Icecream <https://github.com/icecc/icecream>`__, which facilitates |
| 1073 | taking compile jobs and distributing them among remote machines. |
| 1074 | |
| 1075 | The class stages directories with symlinks from ``gcc`` and ``g++`` to |
| 1076 | ``icecc``, for both native and cross compilers. Depending on each |
| 1077 | configure or compile, the OpenEmbedded build system adds the directories |
| 1078 | at the head of the ``PATH`` list and then sets the ``ICECC_CXX`` and |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 1079 | ``ICECC_CC`` variables, which are the paths to the ``g++`` and ``gcc`` |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1080 | compilers, respectively. |
| 1081 | |
| 1082 | For the cross compiler, the class creates a ``tar.gz`` file that |
| 1083 | contains the Yocto Project toolchain and sets ``ICECC_VERSION``, which |
| 1084 | is the version of the cross-compiler used in the cross-development |
| 1085 | toolchain, accordingly. |
| 1086 | |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 1087 | The class handles all three different compile stages (i.e native, |
| 1088 | cross-kernel and target) and creates the necessary environment |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1089 | ``tar.gz`` file to be used by the remote machines. The class also |
| 1090 | supports SDK generation. |
| 1091 | |
| 1092 | If :term:`ICECC_PATH` is not set in your |
| 1093 | ``local.conf`` file, then the class tries to locate the ``icecc`` binary |
| 1094 | using ``which``. If :term:`ICECC_ENV_EXEC` is set |
| 1095 | in your ``local.conf`` file, the variable should point to the |
| 1096 | ``icecc-create-env`` script provided by the user. If you do not point to |
| 1097 | a user-provided script, the build system uses the default script |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 1098 | provided by the recipe :oe_git:`icecc-create-env_0.1.bb |
| 1099 | </openembedded-core/tree/meta/recipes-devtools/icecc-create-env/icecc-create-env_0.1.bb>`. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1100 | |
| 1101 | .. note:: |
| 1102 | |
| 1103 | This script is a modified version and not the one that comes with |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 1104 | ``icecream``. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1105 | |
| 1106 | If you do not want the Icecream distributed compile support to apply to |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 1107 | specific recipes or classes, you can ask them to be ignored by Icecream |
| 1108 | by listing the recipes and classes using the |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 1109 | :term:`ICECC_RECIPE_DISABLE` and |
| 1110 | :term:`ICECC_CLASS_DISABLE` variables, |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1111 | respectively, in your ``local.conf`` file. Doing so causes the |
| 1112 | OpenEmbedded build system to handle these compilations locally. |
| 1113 | |
| 1114 | Additionally, you can list recipes using the |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 1115 | :term:`ICECC_RECIPE_ENABLE` variable in |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1116 | your ``local.conf`` file to force ``icecc`` to be enabled for recipes |
| 1117 | using an empty :term:`PARALLEL_MAKE` variable. |
| 1118 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1119 | Inheriting the :ref:`ref-classes-icecc` class changes all sstate signatures. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1120 | Consequently, if a development team has a dedicated build system that |
| 1121 | populates :term:`SSTATE_MIRRORS` and they want to |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 1122 | reuse sstate from :term:`SSTATE_MIRRORS`, then all developers and the build |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1123 | system need to either inherit the :ref:`ref-classes-icecc` class or nobody should. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1124 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1125 | At the distribution level, you can inherit the :ref:`ref-classes-icecc` class to be |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1126 | sure that all builders start with the same sstate signatures. After |
| 1127 | inheriting the class, you can then disable the feature by setting the |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 1128 | :term:`ICECC_DISABLED` variable to "1" as follows:: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1129 | |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 1130 | INHERIT_DISTRO:append = " icecc" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1131 | ICECC_DISABLED ??= "1" |
| 1132 | |
| 1133 | This practice |
| 1134 | makes sure everyone is using the same signatures but also requires |
| 1135 | individuals that do want to use Icecream to enable the feature |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 1136 | individually as follows in your ``local.conf`` file:: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1137 | |
| 1138 | ICECC_DISABLED = "" |
| 1139 | |
| 1140 | .. _ref-classes-image: |
| 1141 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1142 | ``image`` |
| 1143 | ========= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1144 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1145 | The :ref:`ref-classes-image` class helps support creating images in different formats. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1146 | First, the root filesystem is created from packages using one of the |
| 1147 | ``rootfs*.bbclass`` files (depending on the package format used) and |
| 1148 | then one or more image files are created. |
| 1149 | |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 1150 | - The :term:`IMAGE_FSTYPES` variable controls the types of images to |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1151 | generate. |
| 1152 | |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 1153 | - The :term:`IMAGE_INSTALL` variable controls the list of packages to |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1154 | install into the image. |
| 1155 | |
| 1156 | For information on customizing images, see the |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1157 | ":ref:`dev-manual/customizing-images:customizing images`" section |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1158 | in the Yocto Project Development Tasks Manual. For information on how |
| 1159 | images are created, see the |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 1160 | ":ref:`overview-manual/concepts:images`" section in the |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 1161 | Yocto Project Overview and Concepts Manual. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1162 | |
| 1163 | .. _ref-classes-image-buildinfo: |
| 1164 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1165 | ``image-buildinfo`` |
| 1166 | =================== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1167 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1168 | The :ref:`ref-classes-image-buildinfo` class writes a plain text file containing |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 1169 | build information to the target filesystem at ``${sysconfdir}/buildinfo`` |
Patrick Williams | 7784c42 | 2022-11-17 07:29:11 -0600 | [diff] [blame] | 1170 | by default (as specified by :term:`IMAGE_BUILDINFO_FILE`). |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 1171 | This can be useful for manually determining the origin of any given |
| 1172 | image. It writes out two sections: |
| 1173 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1174 | #. `Build Configuration`: a list of variables and their values (specified |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 1175 | by :term:`IMAGE_BUILDINFO_VARS`, which defaults to :term:`DISTRO` and |
| 1176 | :term:`DISTRO_VERSION`) |
| 1177 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1178 | #. `Layer Revisions`: the revisions of all of the layers used in the |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 1179 | build. |
| 1180 | |
| 1181 | Additionally, when building an SDK it will write the same contents |
| 1182 | to ``/buildinfo`` by default (as specified by |
| 1183 | :term:`SDK_BUILDINFO_FILE`). |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1184 | |
| 1185 | .. _ref-classes-image_types: |
| 1186 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1187 | ``image_types`` |
| 1188 | =============== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1189 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1190 | The :ref:`ref-classes-image_types` class defines all of the standard image output types |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1191 | that you can enable through the |
| 1192 | :term:`IMAGE_FSTYPES` variable. You can use this |
| 1193 | class as a reference on how to add support for custom image output |
| 1194 | types. |
| 1195 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1196 | By default, the :ref:`ref-classes-image` class automatically |
| 1197 | enables the :ref:`ref-classes-image_types` class. The :ref:`ref-classes-image` class uses the |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 1198 | ``IMGCLASSES`` variable as follows:: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1199 | |
| 1200 | IMGCLASSES = "rootfs_${IMAGE_PKGTYPE} image_types ${IMAGE_CLASSES}" |
Patrick Williams | 03514f1 | 2024-04-05 07:04:11 -0500 | [diff] [blame] | 1201 | # Only Linux SDKs support populate_sdk_ext, fall back to populate_sdk_base |
| 1202 | # in the non-Linux SDK_OS case, such as mingw32 |
| 1203 | inherit populate_sdk_base |
| 1204 | IMGCLASSES += "${@['', 'populate_sdk_ext']['linux' in d.getVar("SDK_OS")]}" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1205 | IMGCLASSES += "${@bb.utils.contains_any('IMAGE_FSTYPES', 'live iso hddimg', 'image-live', '', d)}" |
| 1206 | IMGCLASSES += "${@bb.utils.contains('IMAGE_FSTYPES', 'container', 'image-container', '', d)}" |
| 1207 | IMGCLASSES += "image_types_wic" |
| 1208 | IMGCLASSES += "rootfs-postcommands" |
| 1209 | IMGCLASSES += "image-postinst-intercepts" |
Patrick Williams | 03514f1 | 2024-04-05 07:04:11 -0500 | [diff] [blame] | 1210 | IMGCLASSES += "overlayfs-etc" |
| 1211 | inherit_defer ${IMGCLASSES} |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1212 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1213 | The :ref:`ref-classes-image_types` class also handles conversion and compression of images. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1214 | |
| 1215 | .. note:: |
| 1216 | |
| 1217 | To build a VMware VMDK image, you need to add "wic.vmdk" to |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 1218 | :term:`IMAGE_FSTYPES`. This would also be similar for Virtual Box Virtual Disk |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 1219 | Image ("vdi") and QEMU Copy On Write Version 2 ("qcow2") images. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1220 | |
| 1221 | .. _ref-classes-image-live: |
| 1222 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1223 | ``image-live`` |
| 1224 | ============== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1225 | |
| 1226 | This class controls building "live" (i.e. HDDIMG and ISO) images. Live |
| 1227 | images contain syslinux for legacy booting, as well as the bootloader |
| 1228 | specified by :term:`EFI_PROVIDER` if |
| 1229 | :term:`MACHINE_FEATURES` contains "efi". |
| 1230 | |
| 1231 | Normally, you do not use this class directly. Instead, you add "live" to |
| 1232 | :term:`IMAGE_FSTYPES`. |
| 1233 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1234 | .. _ref-classes-insane: |
| 1235 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1236 | ``insane`` |
| 1237 | ========== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1238 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1239 | The :ref:`ref-classes-insane` class adds a step to the package generation process so |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1240 | that output quality assurance checks are generated by the OpenEmbedded |
| 1241 | build system. A range of checks are performed that check the build's |
| 1242 | output for common problems that show up during runtime. Distribution |
| 1243 | policy usually dictates whether to include this class. |
| 1244 | |
| 1245 | You can configure the sanity checks so that specific test failures |
| 1246 | either raise a warning or an error message. Typically, failures for new |
| 1247 | tests generate a warning. Subsequent failures for the same test would |
| 1248 | then generate an error message once the metadata is in a known and good |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 1249 | condition. See the ":doc:`/ref-manual/qa-checks`" Chapter for a list of all the warning |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 1250 | and error messages you might encounter using a default configuration. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1251 | |
| 1252 | Use the :term:`WARN_QA` and |
| 1253 | :term:`ERROR_QA` variables to control the behavior of |
| 1254 | these checks at the global level (i.e. in your custom distro |
| 1255 | configuration). However, to skip one or more checks in recipes, you |
| 1256 | should use :term:`INSANE_SKIP`. For example, to skip |
| 1257 | the check for symbolic link ``.so`` files in the main package of a |
| 1258 | recipe, add the following to the recipe. You need to realize that the |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 1259 | package name override, in this example ``${PN}``, must be used:: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1260 | |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 1261 | INSANE_SKIP:${PN} += "dev-so" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1262 | |
| 1263 | Please keep in mind that the QA checks |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 1264 | are meant to detect real or potential problems in the packaged |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1265 | output. So exercise caution when disabling these checks. |
| 1266 | |
Patrick Williams | 3965356 | 2024-03-01 08:54:02 -0600 | [diff] [blame] | 1267 | The tests you can list with the :term:`WARN_QA` and |
| 1268 | :term:`ERROR_QA` variables are: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1269 | |
| 1270 | - ``already-stripped:`` Checks that produced binaries have not |
| 1271 | already been stripped prior to the build system extracting debug |
| 1272 | symbols. It is common for upstream software projects to default to |
| 1273 | stripping debug symbols for output binaries. In order for debugging |
| 1274 | to work on the target using ``-dbg`` packages, this stripping must be |
| 1275 | disabled. |
| 1276 | |
| 1277 | - ``arch:`` Checks the Executable and Linkable Format (ELF) type, bit |
| 1278 | size, and endianness of any binaries to ensure they match the target |
| 1279 | architecture. This test fails if any binaries do not match the type |
| 1280 | since there would be an incompatibility. The test could indicate that |
| 1281 | the wrong compiler or compiler options have been used. Sometimes |
| 1282 | software, like bootloaders, might need to bypass this check. |
| 1283 | |
| 1284 | - ``buildpaths:`` Checks for paths to locations on the build host |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 1285 | inside the output files. Not only can these leak information about |
| 1286 | the build environment, they also hinder binary reproducibility. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1287 | |
| 1288 | - ``build-deps:`` Determines if a build-time dependency that is |
| 1289 | specified through :term:`DEPENDS`, explicit |
| 1290 | :term:`RDEPENDS`, or task-level dependencies exists |
| 1291 | to match any runtime dependency. This determination is particularly |
| 1292 | useful to discover where runtime dependencies are detected and added |
| 1293 | during packaging. If no explicit dependency has been specified within |
| 1294 | the metadata, at the packaging stage it is too late to ensure that |
| 1295 | the dependency is built, and thus you can end up with an error when |
| 1296 | the package is installed into the image during the |
| 1297 | :ref:`ref-tasks-rootfs` task because the auto-detected |
| 1298 | dependency was not satisfied. An example of this would be where the |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1299 | :ref:`ref-classes-update-rc.d` class automatically |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1300 | adds a dependency on the ``initscripts-functions`` package to |
| 1301 | packages that install an initscript that refers to |
| 1302 | ``/etc/init.d/functions``. The recipe should really have an explicit |
Andrew Geissler | 5f35090 | 2021-07-23 13:09:54 -0400 | [diff] [blame] | 1303 | :term:`RDEPENDS` for the package in question on ``initscripts-functions`` |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1304 | so that the OpenEmbedded build system is able to ensure that the |
| 1305 | ``initscripts`` recipe is actually built and thus the |
| 1306 | ``initscripts-functions`` package is made available. |
| 1307 | |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 1308 | - ``configure-gettext:`` Checks that if a recipe is building something |
| 1309 | that uses automake and the automake files contain an ``AM_GNU_GETTEXT`` |
| 1310 | directive, that the recipe also inherits the :ref:`ref-classes-gettext` |
| 1311 | class to ensure that gettext is available during the build. |
| 1312 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1313 | - ``compile-host-path:`` Checks the |
| 1314 | :ref:`ref-tasks-compile` log for indications that |
| 1315 | paths to locations on the build host were used. Using such paths |
| 1316 | might result in host contamination of the build output. |
| 1317 | |
Patrick Williams | b58112e | 2024-03-07 11:16:36 -0600 | [diff] [blame] | 1318 | - ``cve_status_not_in_db:`` Checks for each component if CVEs that are ignored |
| 1319 | via :term:`CVE_STATUS`, that those are (still) reported for this component |
| 1320 | in the NIST database. If not, a warning is printed. This check is disabled |
| 1321 | by default. |
| 1322 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1323 | - ``debug-deps:`` Checks that all packages except ``-dbg`` packages |
| 1324 | do not depend on ``-dbg`` packages, which would cause a packaging |
| 1325 | bug. |
| 1326 | |
| 1327 | - ``debug-files:`` Checks for ``.debug`` directories in anything but |
| 1328 | the ``-dbg`` package. The debug files should all be in the ``-dbg`` |
| 1329 | package. Thus, anything packaged elsewhere is incorrect packaging. |
| 1330 | |
| 1331 | - ``dep-cmp:`` Checks for invalid version comparison statements in |
| 1332 | runtime dependency relationships between packages (i.e. in |
| 1333 | :term:`RDEPENDS`, |
| 1334 | :term:`RRECOMMENDS`, |
| 1335 | :term:`RSUGGESTS`, |
| 1336 | :term:`RPROVIDES`, |
| 1337 | :term:`RREPLACES`, and |
| 1338 | :term:`RCONFLICTS` variable values). Any invalid |
| 1339 | comparisons might trigger failures or undesirable behavior when |
| 1340 | passed to the package manager. |
| 1341 | |
| 1342 | - ``desktop:`` Runs the ``desktop-file-validate`` program against any |
| 1343 | ``.desktop`` files to validate their contents against the |
| 1344 | specification for ``.desktop`` files. |
| 1345 | |
| 1346 | - ``dev-deps:`` Checks that all packages except ``-dev`` or |
| 1347 | ``-staticdev`` packages do not depend on ``-dev`` packages, which |
| 1348 | would be a packaging bug. |
| 1349 | |
| 1350 | - ``dev-so:`` Checks that the ``.so`` symbolic links are in the |
| 1351 | ``-dev`` package and not in any of the other packages. In general, |
| 1352 | these symlinks are only useful for development purposes. Thus, the |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 1353 | ``-dev`` package is the correct location for them. In very rare |
| 1354 | cases, such as dynamically loaded modules, these symlinks |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1355 | are needed instead in the main package. |
| 1356 | |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 1357 | - ``empty-dirs:`` Checks that packages are not installing files to |
| 1358 | directories that are normally expected to be empty (such as ``/tmp``) |
| 1359 | The list of directories that are checked is specified by the |
| 1360 | :term:`QA_EMPTY_DIRS` variable. |
| 1361 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1362 | - ``file-rdeps:`` Checks that file-level dependencies identified by |
| 1363 | the OpenEmbedded build system at packaging time are satisfied. For |
| 1364 | example, a shell script might start with the line ``#!/bin/bash``. |
| 1365 | This line would translate to a file dependency on ``/bin/bash``. Of |
| 1366 | the three package managers that the OpenEmbedded build system |
| 1367 | supports, only RPM directly handles file-level dependencies, |
| 1368 | resolving them automatically to packages providing the files. |
| 1369 | However, the lack of that functionality in the other two package |
| 1370 | managers does not mean the dependencies do not still need resolving. |
| 1371 | This QA check attempts to ensure that explicitly declared |
| 1372 | :term:`RDEPENDS` exist to handle any file-level |
| 1373 | dependency detected in packaged files. |
| 1374 | |
| 1375 | - ``files-invalid:`` Checks for :term:`FILES` variable |
| 1376 | values that contain "//", which is invalid. |
| 1377 | |
| 1378 | - ``host-user-contaminated:`` Checks that no package produced by the |
| 1379 | recipe contains any files outside of ``/home`` with a user or group |
| 1380 | ID that matches the user running BitBake. A match usually indicates |
| 1381 | that the files are being installed with an incorrect UID/GID, since |
| 1382 | target IDs are independent from host IDs. For additional information, |
| 1383 | see the section describing the |
| 1384 | :ref:`ref-tasks-install` task. |
| 1385 | |
| 1386 | - ``incompatible-license:`` Report when packages are excluded from |
| 1387 | being created due to being marked with a license that is in |
| 1388 | :term:`INCOMPATIBLE_LICENSE`. |
| 1389 | |
| 1390 | - ``install-host-path:`` Checks the |
| 1391 | :ref:`ref-tasks-install` log for indications that |
| 1392 | paths to locations on the build host were used. Using such paths |
| 1393 | might result in host contamination of the build output. |
| 1394 | |
| 1395 | - ``installed-vs-shipped:`` Reports when files have been installed |
Patrick Williams | 2194f50 | 2022-10-16 14:26:09 -0500 | [diff] [blame] | 1396 | within :ref:`ref-tasks-install` but have not been included in any package by |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1397 | way of the :term:`FILES` variable. Files that do not |
| 1398 | appear in any package cannot be present in an image later on in the |
| 1399 | build process. Ideally, all installed files should be packaged or not |
| 1400 | installed at all. These files can be deleted at the end of |
Patrick Williams | 2194f50 | 2022-10-16 14:26:09 -0500 | [diff] [blame] | 1401 | :ref:`ref-tasks-install` if the files are not needed in any package. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1402 | |
| 1403 | - ``invalid-chars:`` Checks that the recipe metadata variables |
| 1404 | :term:`DESCRIPTION`, |
| 1405 | :term:`SUMMARY`, :term:`LICENSE`, and |
| 1406 | :term:`SECTION` do not contain non-UTF-8 characters. |
| 1407 | Some package managers do not support such characters. |
| 1408 | |
| 1409 | - ``invalid-packageconfig:`` Checks that no undefined features are |
| 1410 | being added to :term:`PACKAGECONFIG`. For |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 1411 | example, any name "foo" for which the following form does not exist:: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1412 | |
| 1413 | PACKAGECONFIG[foo] = "..." |
| 1414 | |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 1415 | - ``la:`` Checks ``.la`` files for any :term:`TMPDIR` paths. Any ``.la`` |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1416 | file containing these paths is incorrect since ``libtool`` adds the |
| 1417 | correct sysroot prefix when using the files automatically itself. |
| 1418 | |
| 1419 | - ``ldflags:`` Ensures that the binaries were linked with the |
| 1420 | :term:`LDFLAGS` options provided by the build system. |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 1421 | If this test fails, check that the :term:`LDFLAGS` variable is being |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1422 | passed to the linker command. |
| 1423 | |
| 1424 | - ``libdir:`` Checks for libraries being installed into incorrect |
| 1425 | (possibly hardcoded) installation paths. For example, this test will |
| 1426 | catch recipes that install ``/lib/bar.so`` when ``${base_libdir}`` is |
| 1427 | "lib32". Another example is when recipes install |
| 1428 | ``/usr/lib64/foo.so`` when ``${libdir}`` is "/usr/lib". |
| 1429 | |
| 1430 | - ``libexec:`` Checks if a package contains files in |
| 1431 | ``/usr/libexec``. This check is not performed if the ``libexecdir`` |
| 1432 | variable has been set explicitly to ``/usr/libexec``. |
| 1433 | |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 1434 | - ``mime:`` Check that if a package contains mime type files (``.xml`` |
| 1435 | files in ``${datadir}/mime/packages``) that the recipe also inherits |
| 1436 | the :ref:`ref-classes-mime` class in order to ensure that these get |
| 1437 | properly installed. |
| 1438 | |
| 1439 | - ``mime-xdg:`` Checks that if a package contains a .desktop file with a |
| 1440 | 'MimeType' key present, that the recipe inherits the |
| 1441 | :ref:`ref-classes-mime-xdg` class that is required in order for that |
| 1442 | to be activated. |
| 1443 | |
| 1444 | - ``missing-update-alternatives:`` Check that if a recipe sets the |
| 1445 | :term:`ALTERNATIVE` variable that the recipe also inherits |
| 1446 | :ref:`ref-classes-update-alternatives` such that the alternative will |
| 1447 | be correctly set up. |
| 1448 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1449 | - ``packages-list:`` Checks for the same package being listed |
| 1450 | multiple times through the :term:`PACKAGES` variable |
| 1451 | value. Installing the package in this manner can cause errors during |
| 1452 | packaging. |
| 1453 | |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 1454 | - ``patch-fuzz:`` Checks for fuzz in patch files that may allow |
| 1455 | them to apply incorrectly if the underlying code changes. |
| 1456 | |
| 1457 | - ``patch-status-core:`` Checks that the Upstream-Status is specified |
| 1458 | and valid in the headers of patches for recipes in the OE-Core layer. |
| 1459 | |
| 1460 | - ``patch-status-noncore:`` Checks that the Upstream-Status is specified |
| 1461 | and valid in the headers of patches for recipes in layers other than |
| 1462 | OE-Core. |
| 1463 | |
| 1464 | - ``perllocalpod:`` Checks for ``perllocal.pod`` being erroneously |
| 1465 | installed and packaged by a recipe. |
| 1466 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1467 | - ``perm-config:`` Reports lines in ``fs-perms.txt`` that have an |
| 1468 | invalid format. |
| 1469 | |
| 1470 | - ``perm-line:`` Reports lines in ``fs-perms.txt`` that have an |
| 1471 | invalid format. |
| 1472 | |
| 1473 | - ``perm-link:`` Reports lines in ``fs-perms.txt`` that specify |
| 1474 | 'link' where the specified target already exists. |
| 1475 | |
| 1476 | - ``perms:`` Currently, this check is unused but reserved. |
| 1477 | |
| 1478 | - ``pkgconfig:`` Checks ``.pc`` files for any |
| 1479 | :term:`TMPDIR`/:term:`WORKDIR` paths. |
| 1480 | Any ``.pc`` file containing these paths is incorrect since |
| 1481 | ``pkg-config`` itself adds the correct sysroot prefix when the files |
| 1482 | are accessed. |
| 1483 | |
| 1484 | - ``pkgname:`` Checks that all packages in |
| 1485 | :term:`PACKAGES` have names that do not contain |
| 1486 | invalid characters (i.e. characters other than 0-9, a-z, ., +, and |
| 1487 | -). |
| 1488 | |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 1489 | - ``pkgv-undefined:`` Checks to see if the :term:`PKGV` variable is |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1490 | undefined during :ref:`ref-tasks-package`. |
| 1491 | |
| 1492 | - ``pkgvarcheck:`` Checks through the variables |
| 1493 | :term:`RDEPENDS`, |
| 1494 | :term:`RRECOMMENDS`, |
| 1495 | :term:`RSUGGESTS`, |
| 1496 | :term:`RCONFLICTS`, |
| 1497 | :term:`RPROVIDES`, |
| 1498 | :term:`RREPLACES`, :term:`FILES`, |
| 1499 | :term:`ALLOW_EMPTY`, ``pkg_preinst``, |
| 1500 | ``pkg_postinst``, ``pkg_prerm`` and ``pkg_postrm``, and reports if |
| 1501 | there are variable sets that are not package-specific. Using these |
| 1502 | variables without a package suffix is bad practice, and might |
| 1503 | unnecessarily complicate dependencies of other packages within the |
| 1504 | same recipe or have other unintended consequences. |
| 1505 | |
| 1506 | - ``pn-overrides:`` Checks that a recipe does not have a name |
| 1507 | (:term:`PN`) value that appears in |
| 1508 | :term:`OVERRIDES`. If a recipe is named such that |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 1509 | its :term:`PN` value matches something already in :term:`OVERRIDES` (e.g. |
| 1510 | :term:`PN` happens to be the same as :term:`MACHINE` or |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1511 | :term:`DISTRO`), it can have unexpected consequences. |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 1512 | For example, assignments such as ``FILES:${PN} = "xyz"`` effectively |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1513 | turn into ``FILES = "xyz"``. |
| 1514 | |
| 1515 | - ``rpaths:`` Checks for rpaths in the binaries that contain build |
Andrew Geissler | 5f35090 | 2021-07-23 13:09:54 -0400 | [diff] [blame] | 1516 | system paths such as :term:`TMPDIR`. If this test fails, bad ``-rpath`` |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1517 | options are being passed to the linker commands and your binaries |
| 1518 | have potential security issues. |
| 1519 | |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 1520 | - ``shebang-size:`` Check that the shebang line (``#!`` in the first line) |
| 1521 | in a packaged script is not longer than 128 characters, which can cause |
| 1522 | an error at runtime depending on the operating system. |
| 1523 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1524 | - ``split-strip:`` Reports that splitting or stripping debug symbols |
| 1525 | from binaries has failed. |
| 1526 | |
| 1527 | - ``staticdev:`` Checks for static library files (``*.a``) in |
| 1528 | non-``staticdev`` packages. |
| 1529 | |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 1530 | - ``src-uri-bad:`` Checks that the :term:`SRC_URI` value set by a recipe |
| 1531 | does not contain a reference to ``${PN}`` (instead of the correct |
| 1532 | ``${BPN}``) nor refers to unstable Github archive tarballs. |
| 1533 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1534 | - ``symlink-to-sysroot:`` Checks for symlinks in packages that point |
| 1535 | into :term:`TMPDIR` on the host. Such symlinks will |
| 1536 | work on the host, but are clearly invalid when running on the target. |
| 1537 | |
| 1538 | - ``textrel:`` Checks for ELF binaries that contain relocations in |
| 1539 | their ``.text`` sections, which can result in a performance impact at |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 1540 | runtime. See the explanation for the ``ELF binary`` message in |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 1541 | ":doc:`/ref-manual/qa-checks`" for more information regarding runtime performance |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 1542 | issues. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1543 | |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 1544 | - ``unhandled-features-check:`` check that if one of the variables that |
| 1545 | the :ref:`ref-classes-features_check` class supports (e.g. |
Patrick Williams | b542dec | 2023-06-09 01:26:37 -0500 | [diff] [blame] | 1546 | :term:`REQUIRED_DISTRO_FEATURES`) is set by a recipe, then the recipe |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 1547 | also inherits :ref:`ref-classes-features_check` in order for the |
| 1548 | requirement to actually work. |
| 1549 | |
Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 1550 | - ``unimplemented-ptest:`` Checks that ptests are implemented for upstream |
| 1551 | tests. |
| 1552 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1553 | - ``unlisted-pkg-lics:`` Checks that all declared licenses applying |
| 1554 | for a package are also declared on the recipe level (i.e. any license |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 1555 | in ``LICENSE:*`` should appear in :term:`LICENSE`). |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1556 | |
| 1557 | - ``useless-rpaths:`` Checks for dynamic library load paths (rpaths) |
| 1558 | in the binaries that by default on a standard system are searched by |
| 1559 | the linker (e.g. ``/lib`` and ``/usr/lib``). While these paths will |
| 1560 | not cause any breakage, they do waste space and are unnecessary. |
| 1561 | |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 1562 | - ``usrmerge:`` If ``usrmerge`` is in :term:`DISTRO_FEATURES`, this |
| 1563 | check will ensure that no package installs files to root (``/bin``, |
| 1564 | ``/sbin``, ``/lib``, ``/lib64``) directories. |
| 1565 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1566 | - ``var-undefined:`` Reports when variables fundamental to packaging |
| 1567 | (i.e. :term:`WORKDIR`, |
| 1568 | :term:`DEPLOY_DIR`, :term:`D`, |
| 1569 | :term:`PN`, and :term:`PKGD`) are undefined |
| 1570 | during :ref:`ref-tasks-package`. |
| 1571 | |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 1572 | - ``version-going-backwards:`` If the :ref:`ref-classes-buildhistory` |
| 1573 | class is enabled, reports when a package being written out has a lower |
| 1574 | version than the previously written package under the same name. If |
| 1575 | you are placing output packages into a feed and upgrading packages on |
| 1576 | a target system using that feed, the version of a package going |
| 1577 | backwards can result in the target system not correctly upgrading to |
| 1578 | the "new" version of the package. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1579 | |
| 1580 | .. note:: |
| 1581 | |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 1582 | This is only relevant when you are using runtime package management |
| 1583 | on your target system. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1584 | |
| 1585 | - ``xorg-driver-abi:`` Checks that all packages containing Xorg |
| 1586 | drivers have ABI dependencies. The ``xserver-xorg`` recipe provides |
| 1587 | driver ABI names. All drivers should depend on the ABI versions that |
| 1588 | they have been built against. Driver recipes that include |
| 1589 | ``xorg-driver-input.inc`` or ``xorg-driver-video.inc`` will |
| 1590 | automatically get these versions. Consequently, you should only need |
| 1591 | to explicitly add dependencies to binary driver recipes. |
| 1592 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1593 | .. _ref-classes-kernel: |
| 1594 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1595 | ``kernel`` |
| 1596 | ========== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1597 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1598 | The :ref:`ref-classes-kernel` class handles building Linux kernels. The class contains |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1599 | code to build all kernel trees. All needed headers are staged into the |
Andrew Geissler | 5f35090 | 2021-07-23 13:09:54 -0400 | [diff] [blame] | 1600 | :term:`STAGING_KERNEL_DIR` directory to allow out-of-tree module builds |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1601 | using the :ref:`ref-classes-module` class. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1602 | |
Andrew Geissler | 3eeda90 | 2023-05-19 10:14:02 -0500 | [diff] [blame] | 1603 | If a file named ``defconfig`` is listed in :term:`SRC_URI`, then by default |
| 1604 | :ref:`ref-tasks-configure` copies it as ``.config`` in the build directory, |
| 1605 | so it is automatically used as the kernel configuration for the build. This |
| 1606 | copy is not performed in case ``.config`` already exists there: this allows |
| 1607 | recipes to produce a configuration by other means in |
| 1608 | ``do_configure:prepend``. |
| 1609 | |
| 1610 | Each built kernel module is packaged separately and inter-module |
| 1611 | dependencies are created by parsing the ``modinfo`` output. If all modules |
| 1612 | are required, then installing the ``kernel-modules`` package installs all |
| 1613 | packages with modules and various other kernel packages such as |
| 1614 | ``kernel-vmlinux``. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1615 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1616 | The :ref:`ref-classes-kernel` class contains logic that allows you to embed an initial |
Patrick Williams | 2194f50 | 2022-10-16 14:26:09 -0500 | [diff] [blame] | 1617 | RAM filesystem (:term:`Initramfs`) image when you build the kernel image. For |
| 1618 | information on how to build an :term:`Initramfs`, see the |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1619 | ":ref:`dev-manual/building:building an initial ram filesystem (Initramfs) image`" section in |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1620 | the Yocto Project Development Tasks Manual. |
| 1621 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1622 | Various other classes are used by the :ref:`ref-classes-kernel` and :ref:`ref-classes-module` classes |
| 1623 | internally including the :ref:`ref-classes-kernel-arch`, :ref:`ref-classes-module-base`, and |
| 1624 | :ref:`ref-classes-linux-kernel-base` classes. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1625 | |
| 1626 | .. _ref-classes-kernel-arch: |
| 1627 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1628 | ``kernel-arch`` |
| 1629 | =============== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1630 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1631 | The :ref:`ref-classes-kernel-arch` class sets the ``ARCH`` environment variable for |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1632 | Linux kernel compilation (including modules). |
| 1633 | |
| 1634 | .. _ref-classes-kernel-devicetree: |
| 1635 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1636 | ``kernel-devicetree`` |
| 1637 | ===================== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1638 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1639 | The :ref:`ref-classes-kernel-devicetree` class, which is inherited by the |
| 1640 | :ref:`ref-classes-kernel` class, supports device tree generation. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1641 | |
Patrick Williams | b542dec | 2023-06-09 01:26:37 -0500 | [diff] [blame] | 1642 | Its behavior is mainly controlled by the following variables: |
| 1643 | |
| 1644 | - :term:`KERNEL_DEVICETREE_BUNDLE`: whether to bundle the kernel and device tree |
| 1645 | - :term:`KERNEL_DTBDEST`: directory where to install DTB files |
| 1646 | - :term:`KERNEL_DTBVENDORED`: whether to keep vendor subdirectories |
| 1647 | - :term:`KERNEL_DTC_FLAGS`: flags for ``dtc``, the Device Tree Compiler |
| 1648 | - :term:`KERNEL_PACKAGE_NAME`: base name of the kernel packages |
| 1649 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1650 | .. _ref-classes-kernel-fitimage: |
| 1651 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1652 | ``kernel-fitimage`` |
| 1653 | =================== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1654 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1655 | The :ref:`ref-classes-kernel-fitimage` class provides support to pack a kernel image, |
Patrick Williams | b542dec | 2023-06-09 01:26:37 -0500 | [diff] [blame] | 1656 | device trees, a U-boot script, an :term:`Initramfs` bundle and a RAM disk |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 1657 | into a single FIT image. In theory, a FIT image can support any number |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1658 | of kernels, U-boot scripts, :term:`Initramfs` bundles, RAM disks and device-trees. |
| 1659 | However, :ref:`ref-classes-kernel-fitimage` currently only supports |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 1660 | limited usecases: just one kernel image, an optional U-boot script, |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1661 | an optional :term:`Initramfs` bundle, an optional RAM disk, and any number of |
Patrick Williams | b542dec | 2023-06-09 01:26:37 -0500 | [diff] [blame] | 1662 | device trees. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1663 | |
| 1664 | To create a FIT image, it is required that :term:`KERNEL_CLASSES` |
Patrick Williams | 2a25492 | 2023-08-11 09:48:11 -0500 | [diff] [blame] | 1665 | is set to include ":ref:`ref-classes-kernel-fitimage`" and one of :term:`KERNEL_IMAGETYPE`, |
| 1666 | :term:`KERNEL_ALT_IMAGETYPE` or :term:`KERNEL_IMAGETYPES` to include "fitImage". |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1667 | |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 1668 | The options for the device tree compiler passed to ``mkimage -D`` |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1669 | when creating the FIT image are specified using the |
| 1670 | :term:`UBOOT_MKIMAGE_DTCOPTS` variable. |
| 1671 | |
| 1672 | Only a single kernel can be added to the FIT image created by |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1673 | :ref:`ref-classes-kernel-fitimage` and the kernel image in FIT is mandatory. The |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 1674 | address where the kernel image is to be loaded by U-Boot is |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1675 | specified by :term:`UBOOT_LOADADDRESS` and the entrypoint by |
Andrew Geissler | 3eeda90 | 2023-05-19 10:14:02 -0500 | [diff] [blame] | 1676 | :term:`UBOOT_ENTRYPOINT`. Setting :term:`FIT_ADDRESS_CELLS` to "2" |
| 1677 | is necessary if such addresses are 64 bit ones. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1678 | |
| 1679 | Multiple device trees can be added to the FIT image created by |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1680 | :ref:`ref-classes-kernel-fitimage` and the device tree is optional. |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 1681 | The address where the device tree is to be loaded by U-Boot is |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1682 | specified by :term:`UBOOT_DTBO_LOADADDRESS` for device tree overlays |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 1683 | and by :term:`UBOOT_DTB_LOADADDRESS` for device tree binaries. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1684 | |
| 1685 | Only a single RAM disk can be added to the FIT image created by |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1686 | :ref:`ref-classes-kernel-fitimage` and the RAM disk in FIT is optional. |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 1687 | The address where the RAM disk image is to be loaded by U-Boot |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1688 | is specified by :term:`UBOOT_RD_LOADADDRESS` and the entrypoint by |
Patrick Williams | 2a25492 | 2023-08-11 09:48:11 -0500 | [diff] [blame] | 1689 | :term:`UBOOT_RD_ENTRYPOINT`. The ramdisk is added to the FIT image when |
| 1690 | :term:`INITRAMFS_IMAGE` is specified and requires that :term:`INITRAMFS_IMAGE_BUNDLE` |
| 1691 | is not set to 1. |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 1692 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1693 | Only a single :term:`Initramfs` bundle can be added to the FIT image created by |
| 1694 | :ref:`ref-classes-kernel-fitimage` and the :term:`Initramfs` bundle in FIT is optional. |
| 1695 | In case of :term:`Initramfs`, the kernel is configured to be bundled with the root filesystem |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 1696 | in the same binary (example: zImage-initramfs-:term:`MACHINE`.bin). |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1697 | When the kernel is copied to RAM and executed, it unpacks the :term:`Initramfs` root filesystem. |
| 1698 | The :term:`Initramfs` bundle can be enabled when :term:`INITRAMFS_IMAGE` |
Patrick Williams | 2a25492 | 2023-08-11 09:48:11 -0500 | [diff] [blame] | 1699 | is specified and requires that :term:`INITRAMFS_IMAGE_BUNDLE` is set to 1. |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1700 | The address where the :term:`Initramfs` bundle is to be loaded by U-boot is specified |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 1701 | by :term:`UBOOT_LOADADDRESS` and the entrypoint by :term:`UBOOT_ENTRYPOINT`. |
| 1702 | |
| 1703 | Only a single U-boot boot script can be added to the FIT image created by |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1704 | :ref:`ref-classes-kernel-fitimage` and the boot script is optional. |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 1705 | The boot script is specified in the ITS file as a text file containing |
| 1706 | U-boot commands. When using a boot script the user should configure the |
Patrick Williams | 2194f50 | 2022-10-16 14:26:09 -0500 | [diff] [blame] | 1707 | U-boot :ref:`ref-tasks-install` task to copy the script to sysroot. |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1708 | So the script can be included in the FIT image by the :ref:`ref-classes-kernel-fitimage` |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 1709 | class. At run-time, U-boot CONFIG_BOOTCOMMAND define can be configured to |
Patrick Williams | 2a25492 | 2023-08-11 09:48:11 -0500 | [diff] [blame] | 1710 | load the boot script from the FIT image and execute it. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1711 | |
Patrick Williams | 2a25492 | 2023-08-11 09:48:11 -0500 | [diff] [blame] | 1712 | The FIT image generated by the :ref:`ref-classes-kernel-fitimage` class is signed when the |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1713 | variables :term:`UBOOT_SIGN_ENABLE`, :term:`UBOOT_MKIMAGE_DTCOPTS`, |
| 1714 | :term:`UBOOT_SIGN_KEYDIR` and :term:`UBOOT_SIGN_KEYNAME` are set |
| 1715 | appropriately. The default values used for :term:`FIT_HASH_ALG` and |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1716 | :term:`FIT_SIGN_ALG` in :ref:`ref-classes-kernel-fitimage` are "sha256" and |
Patrick Williams | 2a25492 | 2023-08-11 09:48:11 -0500 | [diff] [blame] | 1717 | "rsa2048" respectively. The keys for signing the FIT image can be generated using |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1718 | the :ref:`ref-classes-kernel-fitimage` class when both :term:`FIT_GENERATE_KEYS` and |
Andrew Geissler | c3d88e4 | 2020-10-02 09:45:00 -0500 | [diff] [blame] | 1719 | :term:`UBOOT_SIGN_ENABLE` are set to "1". |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1720 | |
| 1721 | |
| 1722 | .. _ref-classes-kernel-grub: |
| 1723 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1724 | ``kernel-grub`` |
| 1725 | =============== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1726 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1727 | The :ref:`ref-classes-kernel-grub` class updates the boot area and the boot menu with |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1728 | the kernel as the priority boot mechanism while installing a RPM to |
| 1729 | update the kernel on a deployed target. |
| 1730 | |
| 1731 | .. _ref-classes-kernel-module-split: |
| 1732 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1733 | ``kernel-module-split`` |
| 1734 | ======================= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1735 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1736 | The :ref:`ref-classes-kernel-module-split` class provides common functionality for |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1737 | splitting Linux kernel modules into separate packages. |
| 1738 | |
| 1739 | .. _ref-classes-kernel-uboot: |
| 1740 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1741 | ``kernel-uboot`` |
| 1742 | ================ |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1743 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1744 | The :ref:`ref-classes-kernel-uboot` class provides support for building from |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1745 | vmlinux-style kernel sources. |
| 1746 | |
| 1747 | .. _ref-classes-kernel-uimage: |
| 1748 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1749 | ``kernel-uimage`` |
| 1750 | ================= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1751 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1752 | The :ref:`ref-classes-kernel-uimage` class provides support to pack uImage. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1753 | |
| 1754 | .. _ref-classes-kernel-yocto: |
| 1755 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1756 | ``kernel-yocto`` |
| 1757 | ================ |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1758 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1759 | The :ref:`ref-classes-kernel-yocto` class provides common functionality for building |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1760 | from linux-yocto style kernel source repositories. |
| 1761 | |
| 1762 | .. _ref-classes-kernelsrc: |
| 1763 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1764 | ``kernelsrc`` |
| 1765 | ============= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1766 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1767 | The :ref:`ref-classes-kernelsrc` class sets the Linux kernel source and version. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1768 | |
| 1769 | .. _ref-classes-lib_package: |
| 1770 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1771 | ``lib_package`` |
| 1772 | =============== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1773 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1774 | The :ref:`ref-classes-lib_package` class supports recipes that build libraries and |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1775 | produce executable binaries, where those binaries should not be |
| 1776 | installed by default along with the library. Instead, the binaries are |
| 1777 | added to a separate ``${``\ :term:`PN`\ ``}-bin`` package to |
| 1778 | make their installation optional. |
| 1779 | |
| 1780 | .. _ref-classes-libc*: |
| 1781 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1782 | ``libc*`` |
| 1783 | ========= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1784 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1785 | The :ref:`ref-classes-libc*` classes support recipes that build packages with ``libc``: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1786 | |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 1787 | - The :ref:`libc-common <ref-classes-libc*>` class provides common support for building with |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1788 | ``libc``. |
| 1789 | |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 1790 | - The :ref:`libc-package <ref-classes-libc*>` class supports packaging up ``glibc`` and |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1791 | ``eglibc``. |
| 1792 | |
| 1793 | .. _ref-classes-license: |
| 1794 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1795 | ``license`` |
| 1796 | =========== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1797 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1798 | The :ref:`ref-classes-license` class provides license manifest creation and license |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1799 | exclusion. This class is enabled by default using the default value for |
| 1800 | the :term:`INHERIT_DISTRO` variable. |
| 1801 | |
| 1802 | .. _ref-classes-linux-kernel-base: |
| 1803 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1804 | ``linux-kernel-base`` |
| 1805 | ===================== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1806 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1807 | The :ref:`ref-classes-linux-kernel-base` class provides common functionality for |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1808 | recipes that build out of the Linux kernel source tree. These builds |
| 1809 | goes beyond the kernel itself. For example, the Perf recipe also |
| 1810 | inherits this class. |
| 1811 | |
| 1812 | .. _ref-classes-linuxloader: |
| 1813 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1814 | ``linuxloader`` |
| 1815 | =============== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1816 | |
| 1817 | Provides the function ``linuxloader()``, which gives the value of the |
| 1818 | dynamic loader/linker provided on the platform. This value is used by a |
| 1819 | number of other classes. |
| 1820 | |
| 1821 | .. _ref-classes-logging: |
| 1822 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1823 | ``logging`` |
| 1824 | =========== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1825 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1826 | The :ref:`ref-classes-logging` class provides the standard shell functions used to log |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1827 | messages for various BitBake severity levels (i.e. ``bbplain``, |
| 1828 | ``bbnote``, ``bbwarn``, ``bberror``, ``bbfatal``, and ``bbdebug``). |
| 1829 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1830 | This class is enabled by default since it is inherited by the :ref:`ref-classes-base` |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1831 | class. |
| 1832 | |
Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 1833 | .. _ref-classes-meson: |
| 1834 | |
| 1835 | ``meson`` |
| 1836 | ========= |
| 1837 | |
| 1838 | The :ref:`ref-classes-meson` class allows to create recipes that build software |
Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 1839 | using the `Meson <https://mesonbuild.com/>`__ build system. You can use the |
| 1840 | :term:`MESON_BUILDTYPE`, :term:`MESON_TARGET` and :term:`EXTRA_OEMESON` |
| 1841 | variables to specify additional configuration options to be passed using the |
| 1842 | ``meson`` command line. |
Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 1843 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1844 | .. _ref-classes-metadata_scm: |
| 1845 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1846 | ``metadata_scm`` |
| 1847 | ================ |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1848 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1849 | The :ref:`ref-classes-metadata_scm` class provides functionality for querying the |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1850 | branch and revision of a Source Code Manager (SCM) repository. |
| 1851 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1852 | The :ref:`ref-classes-base` class uses this class to print the revisions of |
| 1853 | each layer before starting every build. The :ref:`ref-classes-metadata_scm` |
| 1854 | class is enabled by default because it is inherited by the |
| 1855 | :ref:`ref-classes-base` class. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1856 | |
| 1857 | .. _ref-classes-migrate_localcount: |
| 1858 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1859 | ``migrate_localcount`` |
| 1860 | ====================== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1861 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1862 | The :ref:`ref-classes-migrate_localcount` class verifies a recipe's localcount data and |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1863 | increments it appropriately. |
| 1864 | |
| 1865 | .. _ref-classes-mime: |
| 1866 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1867 | ``mime`` |
| 1868 | ======== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1869 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1870 | The :ref:`ref-classes-mime` class generates the proper post-install and post-remove |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1871 | (postinst/postrm) scriptlets for packages that install MIME type files. |
| 1872 | These scriptlets call ``update-mime-database`` to add the MIME types to |
| 1873 | the shared database. |
| 1874 | |
Patrick Williams | 7784c42 | 2022-11-17 07:29:11 -0600 | [diff] [blame] | 1875 | .. _ref-classes-mime-xdg: |
| 1876 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1877 | ``mime-xdg`` |
| 1878 | ============ |
Patrick Williams | 7784c42 | 2022-11-17 07:29:11 -0600 | [diff] [blame] | 1879 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1880 | The :ref:`ref-classes-mime-xdg` class generates the proper |
Patrick Williams | 7784c42 | 2022-11-17 07:29:11 -0600 | [diff] [blame] | 1881 | post-install and post-remove (postinst/postrm) scriptlets for packages |
| 1882 | that install ``.desktop`` files containing ``MimeType`` entries. |
| 1883 | These scriptlets call ``update-desktop-database`` to add the MIME types |
| 1884 | to the database of MIME types handled by desktop files. |
| 1885 | |
| 1886 | Thanks to this class, when users open a file through a file browser |
| 1887 | on recently created images, they don't have to choose the application |
| 1888 | to open the file from the pool of all known applications, even the ones |
| 1889 | that cannot open the selected file. |
| 1890 | |
| 1891 | If you have recipes installing their ``.desktop`` files as absolute |
| 1892 | symbolic links, the detection of such files cannot be done by the current |
| 1893 | implementation of this class. In this case, you have to add the corresponding |
| 1894 | package names to the :term:`MIME_XDG_PACKAGES` variable. |
| 1895 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1896 | .. _ref-classes-mirrors: |
| 1897 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1898 | ``mirrors`` |
| 1899 | =========== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1900 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1901 | The :ref:`ref-classes-mirrors` class sets up some standard |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1902 | :term:`MIRRORS` entries for source code mirrors. These |
| 1903 | mirrors provide a fall-back path in case the upstream source specified |
| 1904 | in :term:`SRC_URI` within recipes is unavailable. |
| 1905 | |
| 1906 | This class is enabled by default since it is inherited by the |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1907 | :ref:`ref-classes-base` class. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1908 | |
| 1909 | .. _ref-classes-module: |
| 1910 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1911 | ``module`` |
| 1912 | ========== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1913 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1914 | The :ref:`ref-classes-module` class provides support for building out-of-tree Linux |
| 1915 | kernel modules. The class inherits the :ref:`ref-classes-module-base` and |
| 1916 | :ref:`ref-classes-kernel-module-split` classes, and implements the |
| 1917 | :ref:`ref-tasks-compile` and :ref:`ref-tasks-install` tasks. The class provides |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1918 | everything needed to build and package a kernel module. |
| 1919 | |
| 1920 | For general information on out-of-tree Linux kernel modules, see the |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 1921 | ":ref:`kernel-dev/common:incorporating out-of-tree modules`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1922 | section in the Yocto Project Linux Kernel Development Manual. |
| 1923 | |
| 1924 | .. _ref-classes-module-base: |
| 1925 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1926 | ``module-base`` |
| 1927 | =============== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1928 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1929 | The :ref:`ref-classes-module-base` class provides the base functionality for |
| 1930 | building Linux kernel modules. Typically, a recipe that builds software that |
| 1931 | includes one or more kernel modules and has its own means of building the module |
| 1932 | inherits this class as opposed to inheriting the :ref:`ref-classes-module` |
| 1933 | class. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1934 | |
| 1935 | .. _ref-classes-multilib*: |
| 1936 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1937 | ``multilib*`` |
| 1938 | ============= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1939 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1940 | The :ref:`ref-classes-multilib*` classes provide support for building libraries with |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1941 | different target optimizations or target architectures and installing |
| 1942 | them side-by-side in the same image. |
| 1943 | |
| 1944 | For more information on using the Multilib feature, see the |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1945 | ":ref:`dev-manual/libraries:combining multiple versions of library files into one image`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1946 | section in the Yocto Project Development Tasks Manual. |
| 1947 | |
| 1948 | .. _ref-classes-native: |
| 1949 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1950 | ``native`` |
| 1951 | ========== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1952 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1953 | The :ref:`ref-classes-native` class provides common functionality for recipes that |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 1954 | build tools to run on the :term:`Build Host` (i.e. tools that use the compiler |
| 1955 | or other tools from the build host). |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1956 | |
| 1957 | You can create a recipe that builds tools that run natively on the host |
| 1958 | a couple different ways: |
| 1959 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1960 | - Create a ``myrecipe-native.bb`` recipe that inherits the :ref:`ref-classes-native` |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1961 | class. If you use this method, you must order the inherit statement |
| 1962 | in the recipe after all other inherit statements so that the |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1963 | :ref:`ref-classes-native` class is inherited last. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1964 | |
| 1965 | .. note:: |
| 1966 | |
| 1967 | When creating a recipe this way, the recipe name must follow this |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 1968 | naming convention:: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1969 | |
| 1970 | myrecipe-native.bb |
| 1971 | |
| 1972 | |
| 1973 | Not using this naming convention can lead to subtle problems |
| 1974 | caused by existing code that depends on that naming convention. |
| 1975 | |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 1976 | - Create or modify a target recipe that contains the following:: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1977 | |
| 1978 | BBCLASSEXTEND = "native" |
| 1979 | |
| 1980 | Inside the |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 1981 | recipe, use ``:class-native`` and ``:class-target`` overrides to |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1982 | specify any functionality specific to the respective native or target |
| 1983 | case. |
| 1984 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1985 | Although applied differently, the :ref:`ref-classes-native` class is used with both |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1986 | methods. The advantage of the second method is that you do not need to |
| 1987 | have two separate recipes (assuming you need both) for native and |
| 1988 | target. All common parts of the recipe are automatically shared. |
| 1989 | |
| 1990 | .. _ref-classes-nativesdk: |
| 1991 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1992 | ``nativesdk`` |
| 1993 | ============= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1994 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1995 | The :ref:`ref-classes-nativesdk` class provides common functionality for recipes that |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1996 | wish to build tools to run as part of an SDK (i.e. tools that run on |
| 1997 | :term:`SDKMACHINE`). |
| 1998 | |
| 1999 | You can create a recipe that builds tools that run on the SDK machine a |
| 2000 | couple different ways: |
| 2001 | |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 2002 | - Create a ``nativesdk-myrecipe.bb`` recipe that inherits the |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2003 | :ref:`ref-classes-nativesdk` class. If you use this method, you must order the |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2004 | inherit statement in the recipe after all other inherit statements so |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2005 | that the :ref:`ref-classes-nativesdk` class is inherited last. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2006 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2007 | - Create a :ref:`ref-classes-nativesdk` variant of any recipe by adding the following:: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2008 | |
| 2009 | BBCLASSEXTEND = "nativesdk" |
| 2010 | |
| 2011 | Inside the |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 2012 | recipe, use ``:class-nativesdk`` and ``:class-target`` overrides to |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2013 | specify any functionality specific to the respective SDK machine or |
| 2014 | target case. |
| 2015 | |
| 2016 | .. note:: |
| 2017 | |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 2018 | When creating a recipe, you must follow this naming convention:: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2019 | |
| 2020 | nativesdk-myrecipe.bb |
| 2021 | |
| 2022 | |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 2023 | Not doing so can lead to subtle problems because there is code that |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2024 | depends on the naming convention. |
| 2025 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2026 | Although applied differently, the :ref:`ref-classes-nativesdk` class is used with both |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2027 | methods. The advantage of the second method is that you do not need to |
| 2028 | have two separate recipes (assuming you need both) for the SDK machine |
| 2029 | and the target. All common parts of the recipe are automatically shared. |
| 2030 | |
| 2031 | .. _ref-classes-nopackages: |
| 2032 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2033 | ``nopackages`` |
| 2034 | ============== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2035 | |
| 2036 | Disables packaging tasks for those recipes and classes where packaging |
| 2037 | is not needed. |
| 2038 | |
| 2039 | .. _ref-classes-npm: |
| 2040 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2041 | ``npm`` |
| 2042 | ======= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2043 | |
Patrick Williams | 7784c42 | 2022-11-17 07:29:11 -0600 | [diff] [blame] | 2044 | Provides support for building Node.js software fetched using the |
| 2045 | :wikipedia:`node package manager (NPM) <Npm_(software)>`. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2046 | |
| 2047 | .. note:: |
| 2048 | |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 2049 | Currently, recipes inheriting this class must use the ``npm://`` |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2050 | fetcher to have dependencies fetched and packaged automatically. |
| 2051 | |
| 2052 | For information on how to create NPM packages, see the |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2053 | ":ref:`dev-manual/packages:creating node package manager (npm) packages`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2054 | section in the Yocto Project Development Tasks Manual. |
| 2055 | |
| 2056 | .. _ref-classes-oelint: |
| 2057 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2058 | ``oelint`` |
| 2059 | ========== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2060 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2061 | The :ref:`ref-classes-oelint` class is an obsolete lint checking tool available in |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2062 | ``meta/classes`` in the :term:`Source Directory`. |
| 2063 | |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 2064 | There are some classes that could be generally useful in OE-Core but |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2065 | are never actually used within OE-Core itself. The :ref:`ref-classes-oelint` class is |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2066 | one such example. However, being aware of this class can reduce the |
| 2067 | proliferation of different versions of similar classes across multiple |
| 2068 | layers. |
| 2069 | |
Andrew Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame] | 2070 | .. _ref-classes-overlayfs: |
| 2071 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2072 | ``overlayfs`` |
| 2073 | ============= |
Andrew Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame] | 2074 | |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 2075 | It's often desired in Embedded System design to have a read-only root filesystem. |
Andrew Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame] | 2076 | But a lot of different applications might want to have read-write access to |
| 2077 | some parts of a filesystem. It can be especially useful when your update mechanism |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 2078 | overwrites the whole root filesystem, but you may want your application data to be preserved |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2079 | between updates. The :ref:`ref-classes-overlayfs` class provides a way |
Andrew Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame] | 2080 | to achieve that by means of ``overlayfs`` and at the same time keeping the base |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 2081 | root filesystem read-only. |
Andrew Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame] | 2082 | |
| 2083 | To use this class, set a mount point for a partition ``overlayfs`` is going to use as upper |
| 2084 | layer in your machine configuration. The underlying file system can be anything that |
| 2085 | is supported by ``overlayfs``. This has to be done in your machine configuration:: |
| 2086 | |
| 2087 | OVERLAYFS_MOUNT_POINT[data] = "/data" |
| 2088 | |
| 2089 | .. note:: |
| 2090 | |
| 2091 | * QA checks fail to catch file existence if you redefine this variable in your recipe! |
| 2092 | * Only the existence of the systemd mount unit file is checked, not its contents. |
| 2093 | * To get more details on ``overlayfs``, its internals and supported operations, please refer |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 2094 | to the official documentation of the `Linux kernel <https://www.kernel.org/doc/html/latest/filesystems/overlayfs.html>`__. |
Andrew Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame] | 2095 | |
| 2096 | The class assumes you have a ``data.mount`` systemd unit defined elsewhere in your BSP |
| 2097 | (e.g. in ``systemd-machine-units`` recipe) and it's installed into the image. |
| 2098 | |
| 2099 | Then you can specify writable directories on a recipe basis (e.g. in my-application.bb):: |
| 2100 | |
| 2101 | OVERLAYFS_WRITABLE_PATHS[data] = "/usr/share/my-custom-application" |
| 2102 | |
| 2103 | To support several mount points you can use a different variable flag. Assuming we |
| 2104 | want to have a writable location on the file system, but do not need that the data |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 2105 | survives a reboot, then we could have a ``mnt-overlay.mount`` unit for a ``tmpfs`` |
| 2106 | file system. |
Andrew Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame] | 2107 | |
| 2108 | In your machine configuration:: |
| 2109 | |
| 2110 | OVERLAYFS_MOUNT_POINT[mnt-overlay] = "/mnt/overlay" |
| 2111 | |
| 2112 | and then in your recipe:: |
| 2113 | |
| 2114 | OVERLAYFS_WRITABLE_PATHS[mnt-overlay] = "/usr/share/another-application" |
| 2115 | |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 2116 | On a practical note, your application recipe might require multiple |
| 2117 | overlays to be mounted before running to avoid writing to the underlying |
| 2118 | file system (which can be forbidden in case of read-only file system) |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2119 | To achieve that :ref:`ref-classes-overlayfs` provides a ``systemd`` |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 2120 | helper service for mounting overlays. This helper service is named |
| 2121 | ``${PN}-overlays.service`` and can be depended on in your application recipe |
| 2122 | (named ``application`` in the following example) ``systemd`` unit by adding |
| 2123 | to the unit the following:: |
| 2124 | |
| 2125 | [Unit] |
| 2126 | After=application-overlays.service |
| 2127 | Requires=application-overlays.service |
| 2128 | |
Andrew Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame] | 2129 | .. note:: |
| 2130 | |
| 2131 | The class does not support the ``/etc`` directory itself, because ``systemd`` depends on it. |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2132 | In order to get ``/etc`` in overlayfs, see :ref:`ref-classes-overlayfs-etc`. |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 2133 | |
| 2134 | .. _ref-classes-overlayfs-etc: |
| 2135 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2136 | ``overlayfs-etc`` |
| 2137 | ================= |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 2138 | |
| 2139 | In order to have the ``/etc`` directory in overlayfs a special handling at early |
| 2140 | boot stage is required. The idea is to supply a custom init script that mounts |
| 2141 | ``/etc`` before launching the actual init program, because the latter already |
| 2142 | requires ``/etc`` to be mounted. |
| 2143 | |
| 2144 | Example usage in image recipe:: |
| 2145 | |
| 2146 | IMAGE_FEATURES += "overlayfs-etc" |
| 2147 | |
| 2148 | .. note:: |
| 2149 | |
| 2150 | This class must not be inherited directly. Use :term:`IMAGE_FEATURES` or :term:`EXTRA_IMAGE_FEATURES` |
| 2151 | |
| 2152 | Your machine configuration should define at least the device, mount point, and file system type |
| 2153 | you are going to use for ``overlayfs``:: |
| 2154 | |
| 2155 | OVERLAYFS_ETC_MOUNT_POINT = "/data" |
| 2156 | OVERLAYFS_ETC_DEVICE = "/dev/mmcblk0p2" |
| 2157 | OVERLAYFS_ETC_FSTYPE ?= "ext4" |
| 2158 | |
| 2159 | To control more mount options you should consider setting mount options |
| 2160 | (``defaults`` is used by default):: |
| 2161 | |
| 2162 | OVERLAYFS_ETC_MOUNT_OPTIONS = "wsync" |
| 2163 | |
| 2164 | The class provides two options for ``/sbin/init`` generation: |
| 2165 | |
| 2166 | - The default option is to rename the original ``/sbin/init`` to ``/sbin/init.orig`` |
| 2167 | and place the generated init under original name, i.e. ``/sbin/init``. It has an advantage |
| 2168 | that you won't need to change any kernel parameters in order to make it work, |
| 2169 | but it poses a restriction that package-management can't be used, because updating |
| 2170 | the init manager would remove the generated script. |
| 2171 | |
| 2172 | - If you wish to keep original init as is, you can set:: |
| 2173 | |
| 2174 | OVERLAYFS_ETC_USE_ORIG_INIT_NAME = "0" |
| 2175 | |
| 2176 | Then the generated init will be named ``/sbin/preinit`` and you would need to extend your |
| 2177 | kernel parameters manually in your bootloader configuration. |
Andrew Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame] | 2178 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2179 | .. _ref-classes-own-mirrors: |
| 2180 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2181 | ``own-mirrors`` |
| 2182 | =============== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2183 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2184 | The :ref:`ref-classes-own-mirrors` class makes it easier to set up your own |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2185 | :term:`PREMIRRORS` from which to first fetch source |
| 2186 | before attempting to fetch it from the upstream specified in |
| 2187 | :term:`SRC_URI` within each recipe. |
| 2188 | |
| 2189 | To use this class, inherit it globally and specify |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 2190 | :term:`SOURCE_MIRROR_URL`. Here is an example:: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2191 | |
| 2192 | INHERIT += "own-mirrors" |
| 2193 | SOURCE_MIRROR_URL = "http://example.com/my-source-mirror" |
| 2194 | |
| 2195 | You can specify only a single URL |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 2196 | in :term:`SOURCE_MIRROR_URL`. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2197 | |
| 2198 | .. _ref-classes-package: |
| 2199 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2200 | ``package`` |
| 2201 | =========== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2202 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2203 | The :ref:`ref-classes-package` class supports generating packages from a build's |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2204 | output. The core generic functionality is in ``package.bbclass``. The |
| 2205 | code specific to particular package types resides in these |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2206 | package-specific classes: :ref:`ref-classes-package_deb`, |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 2207 | :ref:`ref-classes-package_rpm`, :ref:`ref-classes-package_ipk`. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2208 | |
| 2209 | You can control the list of resulting package formats by using the |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 2210 | :term:`PACKAGE_CLASSES` variable defined in your ``conf/local.conf`` |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2211 | configuration file, which is located in the :term:`Build Directory`. |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 2212 | When defining the variable, you can specify one or more package types. |
| 2213 | Since images are generated from packages, a packaging class is needed |
| 2214 | to enable image generation. The first class listed in this variable is |
| 2215 | used for image generation. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2216 | |
| 2217 | If you take the optional step to set up a repository (package feed) on |
| 2218 | the development host that can be used by DNF, you can install packages |
| 2219 | from the feed while you are running the image on the target (i.e. |
| 2220 | runtime installation of packages). For more information, see the |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2221 | ":ref:`dev-manual/packages:using runtime package management`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2222 | section in the Yocto Project Development Tasks Manual. |
| 2223 | |
| 2224 | The package-specific class you choose can affect build-time performance |
| 2225 | and has space ramifications. In general, building a package with IPK |
| 2226 | takes about thirty percent less time as compared to using RPM to build |
| 2227 | the same or similar package. This comparison takes into account a |
| 2228 | complete build of the package with all dependencies previously built. |
| 2229 | The reason for this discrepancy is because the RPM package manager |
| 2230 | creates and processes more :term:`Metadata` than the IPK package |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 2231 | manager. Consequently, you might consider setting :term:`PACKAGE_CLASSES` to |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2232 | ":ref:`ref-classes-package_ipk`" if you are building smaller systems. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2233 | |
| 2234 | Before making your package manager decision, however, you should |
| 2235 | consider some further things about using RPM: |
| 2236 | |
| 2237 | - RPM starts to provide more abilities than IPK due to the fact that it |
| 2238 | processes more Metadata. For example, this information includes |
| 2239 | individual file types, file checksum generation and evaluation on |
| 2240 | install, sparse file support, conflict detection and resolution for |
| 2241 | Multilib systems, ACID style upgrade, and repackaging abilities for |
| 2242 | rollbacks. |
| 2243 | |
| 2244 | - For smaller systems, the extra space used for the Berkeley Database |
| 2245 | and the amount of metadata when using RPM can affect your ability to |
| 2246 | perform on-device upgrades. |
| 2247 | |
| 2248 | You can find additional information on the effects of the package class |
| 2249 | at these two Yocto Project mailing list links: |
| 2250 | |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 2251 | - :yocto_lists:`/pipermail/poky/2011-May/006362.html` |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2252 | |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 2253 | - :yocto_lists:`/pipermail/poky/2011-May/006363.html` |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2254 | |
| 2255 | .. _ref-classes-package_deb: |
| 2256 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2257 | ``package_deb`` |
| 2258 | =============== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2259 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2260 | The :ref:`ref-classes-package_deb` class provides support for creating packages that |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2261 | use the Debian (i.e. ``.deb``) file format. The class ensures the |
| 2262 | packages are written out in a ``.deb`` file format to the |
| 2263 | ``${``\ :term:`DEPLOY_DIR_DEB`\ ``}`` directory. |
| 2264 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2265 | This class inherits the :ref:`ref-classes-package` class and |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2266 | is enabled through the :term:`PACKAGE_CLASSES` |
| 2267 | variable in the ``local.conf`` file. |
| 2268 | |
| 2269 | .. _ref-classes-package_ipk: |
| 2270 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2271 | ``package_ipk`` |
| 2272 | =============== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2273 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2274 | The :ref:`ref-classes-package_ipk` class provides support for creating packages that |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2275 | use the IPK (i.e. ``.ipk``) file format. The class ensures the packages |
| 2276 | are written out in a ``.ipk`` file format to the |
| 2277 | ``${``\ :term:`DEPLOY_DIR_IPK`\ ``}`` directory. |
| 2278 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2279 | This class inherits the :ref:`ref-classes-package` class and |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2280 | is enabled through the :term:`PACKAGE_CLASSES` |
| 2281 | variable in the ``local.conf`` file. |
| 2282 | |
| 2283 | .. _ref-classes-package_rpm: |
| 2284 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2285 | ``package_rpm`` |
| 2286 | =============== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2287 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2288 | The :ref:`ref-classes-package_rpm` class provides support for creating packages that |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2289 | use the RPM (i.e. ``.rpm``) file format. The class ensures the packages |
| 2290 | are written out in a ``.rpm`` file format to the |
| 2291 | ``${``\ :term:`DEPLOY_DIR_RPM`\ ``}`` directory. |
| 2292 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2293 | This class inherits the :ref:`ref-classes-package` class and |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2294 | is enabled through the :term:`PACKAGE_CLASSES` |
| 2295 | variable in the ``local.conf`` file. |
| 2296 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2297 | .. _ref-classes-packagedata: |
| 2298 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2299 | ``packagedata`` |
| 2300 | =============== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2301 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2302 | The :ref:`ref-classes-packagedata` class provides common functionality for reading |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2303 | ``pkgdata`` files found in :term:`PKGDATA_DIR`. These |
| 2304 | files contain information about each output package produced by the |
| 2305 | OpenEmbedded build system. |
| 2306 | |
| 2307 | This class is enabled by default because it is inherited by the |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2308 | :ref:`ref-classes-package` class. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2309 | |
| 2310 | .. _ref-classes-packagegroup: |
| 2311 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2312 | ``packagegroup`` |
| 2313 | ================ |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2314 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2315 | The :ref:`ref-classes-packagegroup` class sets default values appropriate for package |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 2316 | group recipes (e.g. :term:`PACKAGES`, :term:`PACKAGE_ARCH`, :term:`ALLOW_EMPTY`, and |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2317 | so forth). It is highly recommended that all package group recipes |
| 2318 | inherit this class. |
| 2319 | |
| 2320 | For information on how to use this class, see the |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2321 | ":ref:`dev-manual/customizing-images:customizing images using custom package groups`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2322 | section in the Yocto Project Development Tasks Manual. |
| 2323 | |
| 2324 | Previously, this class was called the ``task`` class. |
| 2325 | |
| 2326 | .. _ref-classes-patch: |
| 2327 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2328 | ``patch`` |
| 2329 | ========= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2330 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2331 | The :ref:`ref-classes-patch` class provides all functionality for applying patches |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2332 | during the :ref:`ref-tasks-patch` task. |
| 2333 | |
| 2334 | This class is enabled by default because it is inherited by the |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2335 | :ref:`ref-classes-base` class. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2336 | |
| 2337 | .. _ref-classes-perlnative: |
| 2338 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2339 | ``perlnative`` |
| 2340 | ============== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2341 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2342 | When inherited by a recipe, the :ref:`ref-classes-perlnative` class supports using the |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2343 | native version of Perl built by the build system rather than using the |
| 2344 | version provided by the build host. |
| 2345 | |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 2346 | .. _ref-classes-pypi: |
| 2347 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2348 | ``pypi`` |
| 2349 | ======== |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 2350 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2351 | The :ref:`ref-classes-pypi` class sets variables appropriately for recipes that build |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 2352 | Python modules from `PyPI <https://pypi.org/>`__, the Python Package Index. |
| 2353 | By default it determines the PyPI package name based upon :term:`BPN` |
| 2354 | (stripping the "python-" or "python3-" prefix off if present), however in |
| 2355 | some cases you may need to set it manually in the recipe by setting |
| 2356 | :term:`PYPI_PACKAGE`. |
| 2357 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2358 | Variables set by the :ref:`ref-classes-pypi` class include :term:`SRC_URI`, :term:`SECTION`, |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 2359 | :term:`HOMEPAGE`, :term:`UPSTREAM_CHECK_URI`, :term:`UPSTREAM_CHECK_REGEX` |
| 2360 | and :term:`CVE_PRODUCT`. |
| 2361 | |
Patrick Williams | 4585273 | 2022-04-02 08:58:32 -0500 | [diff] [blame] | 2362 | .. _ref-classes-python_flit_core: |
| 2363 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2364 | ``python_flit_core`` |
| 2365 | ==================== |
Patrick Williams | 4585273 | 2022-04-02 08:58:32 -0500 | [diff] [blame] | 2366 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2367 | The :ref:`ref-classes-python_flit_core` class enables building Python modules which declare |
Patrick Williams | 4585273 | 2022-04-02 08:58:32 -0500 | [diff] [blame] | 2368 | the `PEP-517 <https://www.python.org/dev/peps/pep-0517/>`__ compliant |
| 2369 | ``flit_core.buildapi`` ``build-backend`` in the ``[build-system]`` |
| 2370 | section of ``pyproject.toml`` (See `PEP-518 <https://www.python.org/dev/peps/pep-0518/>`__). |
| 2371 | |
| 2372 | Python modules built with ``flit_core.buildapi`` are pure Python (no |
| 2373 | ``C`` or ``Rust`` extensions). |
| 2374 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2375 | Internally this uses the :ref:`ref-classes-python_pep517` class. |
Patrick Williams | 4585273 | 2022-04-02 08:58:32 -0500 | [diff] [blame] | 2376 | |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 2377 | .. _ref-classes-python_pep517: |
| 2378 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2379 | ``python_pep517`` |
| 2380 | ================= |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 2381 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2382 | The :ref:`ref-classes-python_pep517` class builds and installs a Python ``wheel`` binary |
Patrick Williams | 4585273 | 2022-04-02 08:58:32 -0500 | [diff] [blame] | 2383 | archive (see `PEP-517 <https://peps.python.org/pep-0517/>`__). |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 2384 | |
Patrick Williams | 4585273 | 2022-04-02 08:58:32 -0500 | [diff] [blame] | 2385 | Recipes wouldn't inherit this directly, instead typically another class will |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame] | 2386 | inherit this and add the relevant native dependencies. |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 2387 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2388 | Examples of classes which do this are :ref:`ref-classes-python_flit_core`, |
| 2389 | :ref:`ref-classes-python_setuptools_build_meta`, and |
| 2390 | :ref:`ref-classes-python_poetry_core`. |
Patrick Williams | 4585273 | 2022-04-02 08:58:32 -0500 | [diff] [blame] | 2391 | |
| 2392 | .. _ref-classes-python_poetry_core: |
| 2393 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2394 | ``python_poetry_core`` |
| 2395 | ====================== |
Patrick Williams | 4585273 | 2022-04-02 08:58:32 -0500 | [diff] [blame] | 2396 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2397 | The :ref:`ref-classes-python_poetry_core` class enables building Python modules which use the |
Patrick Williams | 4585273 | 2022-04-02 08:58:32 -0500 | [diff] [blame] | 2398 | `Poetry Core <https://python-poetry.org>`__ build system. |
| 2399 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2400 | Internally this uses the :ref:`ref-classes-python_pep517` class. |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 2401 | |
Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 2402 | .. _ref-classes-python_pyo3: |
| 2403 | |
| 2404 | ``python_pyo3`` |
| 2405 | =============== |
| 2406 | |
| 2407 | The :ref:`ref-classes-python_pyo3` class helps make sure that Python extensions |
| 2408 | written in Rust and built with `PyO3 <https://pyo3.rs/>`__, properly set up the |
| 2409 | environment for cross compilation. |
| 2410 | |
| 2411 | This class is internal to the :ref:`ref-classes-python-setuptools3_rust` class |
| 2412 | and is not meant to be used directly in recipes. |
| 2413 | |
| 2414 | .. _ref-classes-python-setuptools3_rust: |
| 2415 | |
| 2416 | ``python-setuptools3_rust`` |
| 2417 | =========================== |
| 2418 | |
| 2419 | The :ref:`ref-classes-python-setuptools3_rust` class enables building Python |
| 2420 | extensions implemented in Rust with `PyO3 <https://pyo3.rs/>`__, which allows |
| 2421 | to compile and distribute Python extensions written in Rust as easily |
| 2422 | as if they were written in C. |
| 2423 | |
| 2424 | This class inherits the :ref:`ref-classes-setuptools3` and |
| 2425 | :ref:`ref-classes-python_pyo3` classes. |
| 2426 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2427 | .. _ref-classes-pixbufcache: |
| 2428 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2429 | ``pixbufcache`` |
| 2430 | =============== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2431 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2432 | The :ref:`ref-classes-pixbufcache` class generates the proper post-install and |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2433 | post-remove (postinst/postrm) scriptlets for packages that install |
| 2434 | pixbuf loaders, which are used with ``gdk-pixbuf``. These scriptlets |
| 2435 | call ``update_pixbuf_cache`` to add the pixbuf loaders to the cache. |
| 2436 | Since the cache files are architecture-specific, ``update_pixbuf_cache`` |
| 2437 | is run using QEMU if the postinst scriptlets need to be run on the build |
| 2438 | host during image creation. |
| 2439 | |
| 2440 | If the pixbuf loaders being installed are in packages other than the |
| 2441 | recipe's main package, set |
| 2442 | :term:`PIXBUF_PACKAGES` to specify the packages |
| 2443 | containing the loaders. |
| 2444 | |
| 2445 | .. _ref-classes-pkgconfig: |
| 2446 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2447 | ``pkgconfig`` |
| 2448 | ============= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2449 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2450 | The :ref:`ref-classes-pkgconfig` class provides a standard way to get header and |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2451 | library information by using ``pkg-config``. This class aims to smooth |
| 2452 | integration of ``pkg-config`` into libraries that use it. |
| 2453 | |
| 2454 | During staging, BitBake installs ``pkg-config`` data into the |
| 2455 | ``sysroots/`` directory. By making use of sysroot functionality within |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2456 | ``pkg-config``, the :ref:`ref-classes-pkgconfig` class no longer has to manipulate the |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2457 | files. |
| 2458 | |
| 2459 | .. _ref-classes-populate-sdk: |
| 2460 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2461 | ``populate_sdk`` |
| 2462 | ================ |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2463 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2464 | The :ref:`ref-classes-populate-sdk` class provides support for SDK-only recipes. For |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2465 | information on advantages gained when building a cross-development |
| 2466 | toolchain using the :ref:`ref-tasks-populate_sdk` |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 2467 | task, see the ":ref:`sdk-manual/appendix-obtain:building an sdk installer`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2468 | section in the Yocto Project Application Development and the Extensible |
| 2469 | Software Development Kit (eSDK) manual. |
| 2470 | |
| 2471 | .. _ref-classes-populate-sdk-*: |
| 2472 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2473 | ``populate_sdk_*`` |
| 2474 | ================== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2475 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2476 | The :ref:`ref-classes-populate-sdk-*` classes support SDK creation and consist of the |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2477 | following classes: |
| 2478 | |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 2479 | - :ref:`populate_sdk_base <ref-classes-populate-sdk-*>`: The base class supporting SDK creation under |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2480 | all package managers (i.e. DEB, RPM, and opkg). |
| 2481 | |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 2482 | - :ref:`populate_sdk_deb <ref-classes-populate-sdk-*>`: Supports creation of the SDK given the Debian |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2483 | package manager. |
| 2484 | |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 2485 | - :ref:`populate_sdk_rpm <ref-classes-populate-sdk-*>`: Supports creation of the SDK given the RPM |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2486 | package manager. |
| 2487 | |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 2488 | - :ref:`populate_sdk_ipk <ref-classes-populate-sdk-*>`: Supports creation of the SDK given the opkg |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2489 | (IPK format) package manager. |
| 2490 | |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 2491 | - :ref:`populate_sdk_ext <ref-classes-populate-sdk-*>`: Supports extensible SDK creation under all |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2492 | package managers. |
| 2493 | |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 2494 | The :ref:`populate_sdk_base <ref-classes-populate-sdk-*>` class inherits the appropriate |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2495 | ``populate_sdk_*`` (i.e. ``deb``, ``rpm``, and ``ipk``) based on |
| 2496 | :term:`IMAGE_PKGTYPE`. |
| 2497 | |
| 2498 | The base class ensures all source and destination directories are |
| 2499 | established and then populates the SDK. After populating the SDK, the |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 2500 | :ref:`populate_sdk_base <ref-classes-populate-sdk-*>` class constructs two sysroots: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2501 | ``${``\ :term:`SDK_ARCH`\ ``}-nativesdk``, which |
| 2502 | contains the cross-compiler and associated tooling, and the target, |
| 2503 | which contains a target root filesystem that is configured for the SDK |
| 2504 | usage. These two images reside in :term:`SDK_OUTPUT`, |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 2505 | which consists of the following:: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2506 | |
| 2507 | ${SDK_OUTPUT}/${SDK_ARCH}-nativesdk-pkgs |
| 2508 | ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/target-pkgs |
| 2509 | |
| 2510 | Finally, the base populate SDK class creates the toolchain environment |
| 2511 | setup script, the tarball of the SDK, and the installer. |
| 2512 | |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 2513 | The respective :ref:`populate_sdk_deb <ref-classes-populate-sdk-*>`, :ref:`populate_sdk_rpm <ref-classes-populate-sdk-*>`, and |
| 2514 | :ref:`populate_sdk_ipk <ref-classes-populate-sdk-*>` classes each support the specific type of SDK. |
| 2515 | These classes are inherited by and used with the :ref:`populate_sdk_base <ref-classes-populate-sdk-*>` |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2516 | class. |
| 2517 | |
| 2518 | For more information on the cross-development toolchain generation, see |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 2519 | the ":ref:`overview-manual/concepts:cross-development toolchain generation`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2520 | section in the Yocto Project Overview and Concepts Manual. For |
| 2521 | information on advantages gained when building a cross-development |
| 2522 | toolchain using the :ref:`ref-tasks-populate_sdk` |
| 2523 | task, see the |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 2524 | ":ref:`sdk-manual/appendix-obtain:building an sdk installer`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2525 | section in the Yocto Project Application Development and the Extensible |
| 2526 | Software Development Kit (eSDK) manual. |
| 2527 | |
| 2528 | .. _ref-classes-prexport: |
| 2529 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2530 | ``prexport`` |
| 2531 | ============ |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2532 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2533 | The :ref:`ref-classes-prexport` class provides functionality for exporting |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2534 | :term:`PR` values. |
| 2535 | |
| 2536 | .. note:: |
| 2537 | |
| 2538 | This class is not intended to be used directly. Rather, it is enabled |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 2539 | when using "``bitbake-prserv-tool export``". |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2540 | |
| 2541 | .. _ref-classes-primport: |
| 2542 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2543 | ``primport`` |
| 2544 | ============ |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2545 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2546 | The :ref:`ref-classes-primport` class provides functionality for importing |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2547 | :term:`PR` values. |
| 2548 | |
| 2549 | .. note:: |
| 2550 | |
| 2551 | This class is not intended to be used directly. Rather, it is enabled |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 2552 | when using "``bitbake-prserv-tool import``". |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2553 | |
| 2554 | .. _ref-classes-prserv: |
| 2555 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2556 | ``prserv`` |
| 2557 | ========== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2558 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2559 | The :ref:`ref-classes-prserv` class provides functionality for using a :ref:`PR |
| 2560 | service <dev-manual/packages:working with a pr service>` in order to |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2561 | automatically manage the incrementing of the :term:`PR` |
| 2562 | variable for each recipe. |
| 2563 | |
| 2564 | This class is enabled by default because it is inherited by the |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2565 | :ref:`ref-classes-package` class. However, the OpenEmbedded |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2566 | build system will not enable the functionality of this class unless |
| 2567 | :term:`PRSERV_HOST` has been set. |
| 2568 | |
| 2569 | .. _ref-classes-ptest: |
| 2570 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2571 | ``ptest`` |
| 2572 | ========= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2573 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2574 | The :ref:`ref-classes-ptest` class provides functionality for packaging and installing |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2575 | runtime tests for recipes that build software that provides these tests. |
| 2576 | |
| 2577 | This class is intended to be inherited by individual recipes. However, |
| 2578 | the class' functionality is largely disabled unless "ptest" appears in |
| 2579 | :term:`DISTRO_FEATURES`. See the |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2580 | ":ref:`dev-manual/packages:testing packages with ptest`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2581 | section in the Yocto Project Development Tasks Manual for more information |
| 2582 | on ptest. |
| 2583 | |
Andrew Geissler | 5082cc7 | 2023-09-11 08:41:39 -0400 | [diff] [blame] | 2584 | .. _ref-classes-ptest-cargo: |
| 2585 | |
| 2586 | ``ptest-cargo`` |
| 2587 | =============== |
| 2588 | |
| 2589 | The :ref:`ref-classes-ptest-cargo` class is a class which extends the |
| 2590 | :ref:`ref-classes-cargo` class and adds ``compile_ptest_cargo`` and |
| 2591 | ``install_ptest_cargo`` steps to respectively build and install |
| 2592 | test suites defined in the ``Cargo.toml`` file, into a dedicated |
| 2593 | ``-ptest`` package. |
| 2594 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2595 | .. _ref-classes-ptest-gnome: |
| 2596 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2597 | ``ptest-gnome`` |
| 2598 | =============== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2599 | |
| 2600 | Enables package tests (ptests) specifically for GNOME packages, which |
| 2601 | have tests intended to be executed with ``gnome-desktop-testing``. |
| 2602 | |
| 2603 | For information on setting up and running ptests, see the |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2604 | ":ref:`dev-manual/packages:testing packages with ptest`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2605 | section in the Yocto Project Development Tasks Manual. |
| 2606 | |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 2607 | .. _ref-classes-python3-dir: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2608 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2609 | ``python3-dir`` |
| 2610 | =============== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2611 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2612 | The :ref:`ref-classes-python3-dir` class provides the base version, location, and site |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 2613 | package location for Python 3. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2614 | |
| 2615 | .. _ref-classes-python3native: |
| 2616 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2617 | ``python3native`` |
| 2618 | ================= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2619 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2620 | The :ref:`ref-classes-python3native` class supports using the native version of Python |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2621 | 3 built by the build system rather than support of the version provided |
| 2622 | by the build host. |
| 2623 | |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 2624 | .. _ref-classes-python3targetconfig: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2625 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2626 | ``python3targetconfig`` |
| 2627 | ======================= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2628 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2629 | The :ref:`ref-classes-python3targetconfig` class supports using the native version of Python |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 2630 | 3 built by the build system rather than support of the version provided |
| 2631 | by the build host, except that the configuration for the target machine |
| 2632 | is accessible (such as correct installation directories). This also adds a |
| 2633 | dependency on target ``python3``, so should only be used where appropriate |
| 2634 | in order to avoid unnecessarily lengthening builds. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2635 | |
| 2636 | .. _ref-classes-qemu: |
| 2637 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2638 | ``qemu`` |
| 2639 | ======== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2640 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2641 | The :ref:`ref-classes-qemu` class provides functionality for recipes that either need |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2642 | QEMU or test for the existence of QEMU. Typically, this class is used to |
| 2643 | run programs for a target system on the build host using QEMU's |
| 2644 | application emulation mode. |
| 2645 | |
| 2646 | .. _ref-classes-recipe_sanity: |
| 2647 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2648 | ``recipe_sanity`` |
| 2649 | ================= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2650 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2651 | The :ref:`ref-classes-recipe_sanity` class checks for the presence of any host system |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2652 | recipe prerequisites that might affect the build (e.g. variables that |
| 2653 | are set or software that is present). |
| 2654 | |
| 2655 | .. _ref-classes-relocatable: |
| 2656 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2657 | ``relocatable`` |
| 2658 | =============== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2659 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2660 | The :ref:`ref-classes-relocatable` class enables relocation of binaries when they are |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2661 | installed into the sysroot. |
| 2662 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2663 | This class makes use of the :ref:`ref-classes-chrpath` class and is used by |
| 2664 | both the :ref:`ref-classes-cross` and :ref:`ref-classes-native` classes. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2665 | |
| 2666 | .. _ref-classes-remove-libtool: |
| 2667 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2668 | ``remove-libtool`` |
| 2669 | ================== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2670 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2671 | The :ref:`ref-classes-remove-libtool` class adds a post function to the |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2672 | :ref:`ref-tasks-install` task to remove all ``.la`` files |
| 2673 | installed by ``libtool``. Removing these files results in them being |
| 2674 | absent from both the sysroot and target packages. |
| 2675 | |
| 2676 | If a recipe needs the ``.la`` files to be installed, then the recipe can |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 2677 | override the removal by setting ``REMOVE_LIBTOOL_LA`` to "0" as follows:: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2678 | |
| 2679 | REMOVE_LIBTOOL_LA = "0" |
| 2680 | |
| 2681 | .. note:: |
| 2682 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2683 | The :ref:`ref-classes-remove-libtool` class is not enabled by default. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2684 | |
| 2685 | .. _ref-classes-report-error: |
| 2686 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2687 | ``report-error`` |
| 2688 | ================ |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2689 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2690 | The :ref:`ref-classes-report-error` class supports enabling the :ref:`error reporting |
| 2691 | tool <dev-manual/error-reporting-tool:using the error reporting tool>`", |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2692 | which allows you to submit build error information to a central database. |
| 2693 | |
| 2694 | The class collects debug information for recipe, recipe version, task, |
| 2695 | machine, distro, build system, target system, host distro, branch, |
| 2696 | commit, and log. From the information, report files using a JSON format |
| 2697 | are created and stored in |
| 2698 | ``${``\ :term:`LOG_DIR`\ ``}/error-report``. |
| 2699 | |
| 2700 | .. _ref-classes-rm-work: |
| 2701 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2702 | ``rm_work`` |
| 2703 | =========== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2704 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2705 | The :ref:`ref-classes-rm-work` class supports deletion of temporary workspace, which |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2706 | can ease your hard drive demands during builds. |
| 2707 | |
| 2708 | The OpenEmbedded build system can use a substantial amount of disk space |
| 2709 | during the build process. A portion of this space is the work files |
| 2710 | under the ``${TMPDIR}/work`` directory for each recipe. Once the build |
| 2711 | system generates the packages for a recipe, the work files for that |
| 2712 | recipe are no longer needed. However, by default, the build system |
| 2713 | preserves these files for inspection and possible debugging purposes. If |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2714 | you would rather have these files deleted to save disk space as the build |
| 2715 | progresses, you can enable :ref:`ref-classes-rm-work` by adding the following to |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 2716 | your ``local.conf`` file, which is found in the :term:`Build Directory`:: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2717 | |
| 2718 | INHERIT += "rm_work" |
| 2719 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2720 | If you are modifying and building source code out of the work directory for a |
| 2721 | recipe, enabling :ref:`ref-classes-rm-work` will potentially result in your |
| 2722 | changes to the source being lost. To exclude some recipes from having their work |
| 2723 | directories deleted by :ref:`ref-classes-rm-work`, you can add the names of the |
| 2724 | recipe or recipes you are working on to the :term:`RM_WORK_EXCLUDE` variable, |
| 2725 | which can also be set in your ``local.conf`` file. Here is an example:: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2726 | |
| 2727 | RM_WORK_EXCLUDE += "busybox glibc" |
| 2728 | |
| 2729 | .. _ref-classes-rootfs*: |
| 2730 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2731 | ``rootfs*`` |
| 2732 | =========== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2733 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2734 | The :ref:`ref-classes-rootfs*` classes support creating the root filesystem for an |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2735 | image and consist of the following classes: |
| 2736 | |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 2737 | - The :ref:`rootfs-postcommands <ref-classes-rootfs*>` class, which defines filesystem |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2738 | post-processing functions for image recipes. |
| 2739 | |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 2740 | - The :ref:`rootfs_deb <ref-classes-rootfs*>` class, which supports creation of root filesystems |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2741 | for images built using ``.deb`` packages. |
| 2742 | |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 2743 | - The :ref:`rootfs_rpm <ref-classes-rootfs*>` class, which supports creation of root filesystems |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2744 | for images built using ``.rpm`` packages. |
| 2745 | |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 2746 | - The :ref:`rootfs_ipk <ref-classes-rootfs*>` class, which supports creation of root filesystems |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2747 | for images built using ``.ipk`` packages. |
| 2748 | |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 2749 | - The :ref:`rootfsdebugfiles <ref-classes-rootfs*>` class, which installs additional files found |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2750 | on the build host directly into the root filesystem. |
| 2751 | |
| 2752 | The root filesystem is created from packages using one of the |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2753 | :ref:`ref-classes-rootfs*` files as determined by the :term:`PACKAGE_CLASSES` |
| 2754 | variable. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2755 | |
| 2756 | For information on how root filesystem images are created, see the |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 2757 | ":ref:`overview-manual/concepts:image generation`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2758 | section in the Yocto Project Overview and Concepts Manual. |
| 2759 | |
Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 2760 | .. _ref-classes-rust: |
| 2761 | |
| 2762 | ``rust`` |
| 2763 | ======== |
| 2764 | |
| 2765 | The :ref:`ref-classes-rust` class is an internal class which is just used |
| 2766 | in the "rust" recipe, to build the Rust compiler and runtime |
| 2767 | library. Except for this recipe, it is not intended to be used directly. |
| 2768 | |
| 2769 | .. _ref-classes-rust-common: |
| 2770 | |
| 2771 | ``rust-common`` |
| 2772 | =============== |
| 2773 | |
| 2774 | The :ref:`ref-classes-rust-common` class is an internal class to the |
| 2775 | :ref:`ref-classes-cargo_common` and :ref:`ref-classes-rust` classes and is not |
| 2776 | intended to be used directly. |
| 2777 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2778 | .. _ref-classes-sanity: |
| 2779 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2780 | ``sanity`` |
| 2781 | ========== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2782 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2783 | The :ref:`ref-classes-sanity` class checks to see if prerequisite software is present |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2784 | on the host system so that users can be notified of potential problems |
| 2785 | that might affect their build. The class also performs basic user |
| 2786 | configuration checks from the ``local.conf`` configuration file to |
| 2787 | prevent common mistakes that cause build failures. Distribution policy |
| 2788 | usually determines whether to include this class. |
| 2789 | |
| 2790 | .. _ref-classes-scons: |
| 2791 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2792 | ``scons`` |
| 2793 | ========= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2794 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2795 | The :ref:`ref-classes-scons` class supports recipes that need to build software |
| 2796 | that uses the SCons build system. You can use the :term:`EXTRA_OESCONS` |
| 2797 | variable to specify additional configuration options you want to pass SCons |
| 2798 | command line. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2799 | |
| 2800 | .. _ref-classes-sdl: |
| 2801 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2802 | ``sdl`` |
| 2803 | ======= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2804 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2805 | The :ref:`ref-classes-sdl` class supports recipes that need to build software that uses |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2806 | the Simple DirectMedia Layer (SDL) library. |
| 2807 | |
Patrick Williams | 4585273 | 2022-04-02 08:58:32 -0500 | [diff] [blame] | 2808 | .. _ref-classes-python_setuptools_build_meta: |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 2809 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2810 | ``python_setuptools_build_meta`` |
| 2811 | ================================ |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 2812 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2813 | The :ref:`ref-classes-python_setuptools_build_meta` class enables building |
| 2814 | Python modules which declare the |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 2815 | `PEP-517 <https://www.python.org/dev/peps/pep-0517/>`__ compliant |
| 2816 | ``setuptools.build_meta`` ``build-backend`` in the ``[build-system]`` |
| 2817 | section of ``pyproject.toml`` (See `PEP-518 <https://www.python.org/dev/peps/pep-0518/>`__). |
| 2818 | |
| 2819 | Python modules built with ``setuptools.build_meta`` can be pure Python or |
| 2820 | include ``C`` or ``Rust`` extensions). |
| 2821 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2822 | Internally this uses the :ref:`ref-classes-python_pep517` class. |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 2823 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2824 | .. _ref-classes-setuptools3: |
| 2825 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2826 | ``setuptools3`` |
| 2827 | =============== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2828 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2829 | The :ref:`ref-classes-setuptools3` class supports Python version 3.x extensions |
| 2830 | that use build systems based on ``setuptools`` (e.g. only have a ``setup.py`` |
| 2831 | and have not migrated to the official ``pyproject.toml`` format). If your recipe |
| 2832 | uses these build systems, the recipe needs to inherit the |
| 2833 | :ref:`ref-classes-setuptools3` class. |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 2834 | |
| 2835 | .. note:: |
| 2836 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2837 | The :ref:`ref-classes-setuptools3` class :ref:`ref-tasks-compile` task now calls |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 2838 | ``setup.py bdist_wheel`` to build the ``wheel`` binary archive format |
| 2839 | (See `PEP-427 <https://www.python.org/dev/peps/pep-0427/>`__). |
| 2840 | |
| 2841 | A consequence of this is that legacy software still using deprecated |
| 2842 | ``distutils`` from the Python standard library cannot be packaged as |
| 2843 | ``wheels``. A common solution is the replace |
| 2844 | ``from distutils.core import setup`` with ``from setuptools import setup``. |
| 2845 | |
| 2846 | .. note:: |
| 2847 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2848 | The :ref:`ref-classes-setuptools3` class :ref:`ref-tasks-install` task now |
| 2849 | installs the ``wheel`` binary archive. In current versions of |
| 2850 | ``setuptools`` the legacy ``setup.py install`` method is deprecated. If |
| 2851 | the ``setup.py`` cannot be used with wheels, for example it creates files |
| 2852 | outside of the Python module or standard entry points, then |
| 2853 | :ref:`ref-classes-setuptools3_legacy` should be used. |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 2854 | |
| 2855 | .. _ref-classes-setuptools3_legacy: |
| 2856 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2857 | ``setuptools3_legacy`` |
| 2858 | ====================== |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 2859 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2860 | The :ref:`ref-classes-setuptools3_legacy` class supports |
| 2861 | Python version 3.x extensions that use build systems based on ``setuptools`` |
| 2862 | (e.g. only have a ``setup.py`` and have not migrated to the official |
| 2863 | ``pyproject.toml`` format). Unlike :ref:`ref-classes-setuptools3`, |
| 2864 | this uses the traditional ``setup.py`` ``build`` and ``install`` commands and |
| 2865 | not wheels. This use of ``setuptools`` like this is |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 2866 | `deprecated <https://github.com/pypa/setuptools/blob/main/CHANGES.rst#v5830>`__ |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 2867 | but still relatively common. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2868 | |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 2869 | .. _ref-classes-setuptools3-base: |
| 2870 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2871 | ``setuptools3-base`` |
| 2872 | ==================== |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 2873 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2874 | The :ref:`ref-classes-setuptools3-base` class provides a reusable base for |
| 2875 | other classes that support building Python version 3.x extensions. If you need |
| 2876 | functionality that is not provided by the :ref:`ref-classes-setuptools3` class, |
| 2877 | you may want to ``inherit setuptools3-base``. Some recipes do not need the tasks |
| 2878 | in the :ref:`ref-classes-setuptools3` class and inherit this class instead. |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 2879 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2880 | .. _ref-classes-sign_rpm: |
| 2881 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2882 | ``sign_rpm`` |
| 2883 | ============ |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2884 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2885 | The :ref:`ref-classes-sign_rpm` class supports generating signed RPM packages. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2886 | |
| 2887 | .. _ref-classes-siteconfig: |
| 2888 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2889 | ``siteconfig`` |
| 2890 | ============== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2891 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2892 | The :ref:`ref-classes-siteconfig` class provides functionality for handling site |
| 2893 | configuration. The class is used by the :ref:`ref-classes-autotools` class to |
| 2894 | accelerate the :ref:`ref-tasks-configure` task. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2895 | |
| 2896 | .. _ref-classes-siteinfo: |
| 2897 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2898 | ``siteinfo`` |
| 2899 | ============ |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2900 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2901 | The :ref:`ref-classes-siteinfo` class provides information about the targets |
| 2902 | that might be needed by other classes or recipes. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2903 | |
| 2904 | As an example, consider Autotools, which can require tests that must |
| 2905 | execute on the target hardware. Since this is not possible in general |
| 2906 | when cross compiling, site information is used to provide cached test |
| 2907 | results so these tests can be skipped over but still make the correct |
| 2908 | values available. The ``meta/site directory`` contains test results |
| 2909 | sorted into different categories such as architecture, endianness, and |
| 2910 | the ``libc`` used. Site information provides a list of files containing |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 2911 | data relevant to the current build in the :term:`CONFIG_SITE` variable that |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2912 | Autotools automatically picks up. |
| 2913 | |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 2914 | The class also provides variables like :term:`SITEINFO_ENDIANNESS` and |
| 2915 | :term:`SITEINFO_BITS` that can be used elsewhere in the metadata. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2916 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2917 | .. _ref-classes-sstate: |
| 2918 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2919 | ``sstate`` |
| 2920 | ========== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2921 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2922 | The :ref:`ref-classes-sstate` class provides support for Shared State (sstate). |
| 2923 | By default, the class is enabled through the :term:`INHERIT_DISTRO` variable's |
| 2924 | default value. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2925 | |
| 2926 | For more information on sstate, see the |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 2927 | ":ref:`overview-manual/concepts:shared state cache`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2928 | section in the Yocto Project Overview and Concepts Manual. |
| 2929 | |
| 2930 | .. _ref-classes-staging: |
| 2931 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2932 | ``staging`` |
| 2933 | =========== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2934 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2935 | The :ref:`ref-classes-staging` class installs files into individual recipe work |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2936 | directories for sysroots. The class contains the following key tasks: |
| 2937 | |
| 2938 | - The :ref:`ref-tasks-populate_sysroot` task, |
| 2939 | which is responsible for handing the files that end up in the recipe |
| 2940 | sysroots. |
| 2941 | |
| 2942 | - The |
| 2943 | :ref:`ref-tasks-prepare_recipe_sysroot` |
| 2944 | task (a "partner" task to the ``populate_sysroot`` task), which |
| 2945 | installs the files into the individual recipe work directories (i.e. |
| 2946 | :term:`WORKDIR`). |
| 2947 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 2948 | The code in the :ref:`ref-classes-staging` class is complex and basically works |
| 2949 | in two stages: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2950 | |
| 2951 | - *Stage One:* The first stage addresses recipes that have files they |
| 2952 | want to share with other recipes that have dependencies on the |
| 2953 | originating recipe. Normally these dependencies are installed through |
| 2954 | the :ref:`ref-tasks-install` task into |
Patrick Williams | 2194f50 | 2022-10-16 14:26:09 -0500 | [diff] [blame] | 2955 | ``${``\ :term:`D`\ ``}``. The :ref:`ref-tasks-populate_sysroot` task |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2956 | copies a subset of these files into ``${SYSROOT_DESTDIR}``. This |
| 2957 | subset of files is controlled by the |
| 2958 | :term:`SYSROOT_DIRS`, |
| 2959 | :term:`SYSROOT_DIRS_NATIVE`, and |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 2960 | :term:`SYSROOT_DIRS_IGNORE` |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2961 | variables. |
| 2962 | |
| 2963 | .. note:: |
| 2964 | |
| 2965 | Additionally, a recipe can customize the files further by |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 2966 | declaring a processing function in the :term:`SYSROOT_PREPROCESS_FUNCS` |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2967 | variable. |
| 2968 | |
| 2969 | A shared state (sstate) object is built from these files and the |
| 2970 | files are placed into a subdirectory of |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 2971 | :ref:`structure-build-tmp-sysroots-components`. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2972 | The files are scanned for hardcoded paths to the original |
| 2973 | installation location. If the location is found in text files, the |
| 2974 | hardcoded locations are replaced by tokens and a list of the files |
| 2975 | needing such replacements is created. These adjustments are referred |
| 2976 | to as "FIXMEs". The list of files that are scanned for paths is |
| 2977 | controlled by the :term:`SSTATE_SCAN_FILES` |
| 2978 | variable. |
| 2979 | |
| 2980 | - *Stage Two:* The second stage addresses recipes that want to use |
| 2981 | something from another recipe and declare a dependency on that recipe |
| 2982 | through the :term:`DEPENDS` variable. The recipe will |
| 2983 | have a |
| 2984 | :ref:`ref-tasks-prepare_recipe_sysroot` |
| 2985 | task and when this task executes, it creates the ``recipe-sysroot`` |
| 2986 | and ``recipe-sysroot-native`` in the recipe work directory (i.e. |
| 2987 | :term:`WORKDIR`). The OpenEmbedded build system |
| 2988 | creates hard links to copies of the relevant files from |
| 2989 | ``sysroots-components`` into the recipe work directory. |
| 2990 | |
| 2991 | .. note:: |
| 2992 | |
| 2993 | If hard links are not possible, the build system uses actual |
| 2994 | copies. |
| 2995 | |
| 2996 | The build system then addresses any "FIXMEs" to paths as defined from |
| 2997 | the list created in the first stage. |
| 2998 | |
| 2999 | Finally, any files in ``${bindir}`` within the sysroot that have the |
| 3000 | prefix "``postinst-``" are executed. |
| 3001 | |
| 3002 | .. note:: |
| 3003 | |
| 3004 | Although such sysroot post installation scripts are not |
| 3005 | recommended for general use, the files do allow some issues such |
| 3006 | as user creation and module indexes to be addressed. |
| 3007 | |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 3008 | Because recipes can have other dependencies outside of :term:`DEPENDS` |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3009 | (e.g. ``do_unpack[depends] += "tar-native:do_populate_sysroot"``), |
| 3010 | the sysroot creation function ``extend_recipe_sysroot`` is also added |
| 3011 | as a pre-function for those tasks whose dependencies are not through |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 3012 | :term:`DEPENDS` but operate similarly. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3013 | |
| 3014 | When installing dependencies into the sysroot, the code traverses the |
| 3015 | dependency graph and processes dependencies in exactly the same way |
| 3016 | as the dependencies would or would not be when installed from sstate. |
| 3017 | This processing means, for example, a native tool would have its |
| 3018 | native dependencies added but a target library would not have its |
| 3019 | dependencies traversed or installed. The same sstate dependency code |
| 3020 | is used so that builds should be identical regardless of whether |
| 3021 | sstate was used or not. For a closer look, see the |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3022 | ``setscene_depvalid()`` function in the :ref:`ref-classes-sstate` class. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3023 | |
| 3024 | The build system is careful to maintain manifests of the files it |
| 3025 | installs so that any given dependency can be installed as needed. The |
| 3026 | sstate hash of the installed item is also stored so that if it |
| 3027 | changes, the build system can reinstall it. |
| 3028 | |
| 3029 | .. _ref-classes-syslinux: |
| 3030 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3031 | ``syslinux`` |
| 3032 | ============ |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3033 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3034 | The :ref:`ref-classes-syslinux` class provides syslinux-specific functions for |
| 3035 | building bootable images. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3036 | |
| 3037 | The class supports the following variables: |
| 3038 | |
| 3039 | - :term:`INITRD`: Indicates list of filesystem images to |
| 3040 | concatenate and use as an initial RAM disk (initrd). This variable is |
| 3041 | optional. |
| 3042 | |
| 3043 | - :term:`ROOTFS`: Indicates a filesystem image to include |
| 3044 | as the root filesystem. This variable is optional. |
| 3045 | |
| 3046 | - :term:`AUTO_SYSLINUXMENU`: Enables creating |
| 3047 | an automatic menu when set to "1". |
| 3048 | |
| 3049 | - :term:`LABELS`: Lists targets for automatic |
| 3050 | configuration. |
| 3051 | |
| 3052 | - :term:`APPEND`: Lists append string overrides for each |
| 3053 | label. |
| 3054 | |
| 3055 | - :term:`SYSLINUX_OPTS`: Lists additional options |
| 3056 | to add to the syslinux file. Semicolon characters separate multiple |
| 3057 | options. |
| 3058 | |
| 3059 | - :term:`SYSLINUX_SPLASH`: Lists a background |
| 3060 | for the VGA boot menu when you are using the boot menu. |
| 3061 | |
| 3062 | - :term:`SYSLINUX_DEFAULT_CONSOLE`: Set |
| 3063 | to "console=ttyX" to change kernel boot default console. |
| 3064 | |
| 3065 | - :term:`SYSLINUX_SERIAL`: Sets an alternate |
| 3066 | serial port. Or, turns off serial when the variable is set with an |
| 3067 | empty string. |
| 3068 | |
| 3069 | - :term:`SYSLINUX_SERIAL_TTY`: Sets an |
| 3070 | alternate "console=tty..." kernel boot argument. |
| 3071 | |
| 3072 | .. _ref-classes-systemd: |
| 3073 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3074 | ``systemd`` |
| 3075 | =========== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3076 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3077 | The :ref:`ref-classes-systemd` class provides support for recipes that install |
| 3078 | systemd unit files. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3079 | |
| 3080 | The functionality for this class is disabled unless you have "systemd" |
| 3081 | in :term:`DISTRO_FEATURES`. |
| 3082 | |
| 3083 | Under this class, the recipe or Makefile (i.e. whatever the recipe is |
| 3084 | calling during the :ref:`ref-tasks-install` task) |
| 3085 | installs unit files into |
| 3086 | ``${``\ :term:`D`\ ``}${systemd_unitdir}/system``. If the unit |
| 3087 | files being installed go into packages other than the main package, you |
| 3088 | need to set :term:`SYSTEMD_PACKAGES` in your |
| 3089 | recipe to identify the packages in which the files will be installed. |
| 3090 | |
| 3091 | You should set :term:`SYSTEMD_SERVICE` to the |
| 3092 | name of the service file. You should also use a package name override to |
| 3093 | indicate the package to which the value applies. If the value applies to |
| 3094 | the recipe's main package, use ``${``\ :term:`PN`\ ``}``. Here |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 3095 | is an example from the connman recipe:: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3096 | |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 3097 | SYSTEMD_SERVICE:${PN} = "connman.service" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3098 | |
| 3099 | Services are set up to start on boot automatically |
| 3100 | unless you have set |
| 3101 | :term:`SYSTEMD_AUTO_ENABLE` to "disable". |
| 3102 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3103 | For more information on :ref:`ref-classes-systemd`, see the |
| 3104 | ":ref:`dev-manual/init-manager:selecting an initialization manager`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3105 | section in the Yocto Project Development Tasks Manual. |
| 3106 | |
| 3107 | .. _ref-classes-systemd-boot: |
| 3108 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3109 | ``systemd-boot`` |
| 3110 | ================ |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3111 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3112 | The :ref:`ref-classes-systemd-boot` class provides functions specific to the |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3113 | systemd-boot bootloader for building bootable images. This is an |
| 3114 | internal class and is not intended to be used directly. |
| 3115 | |
| 3116 | .. note:: |
| 3117 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3118 | The :ref:`ref-classes-systemd-boot` class is a result from merging the ``gummiboot`` class |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 3119 | used in previous Yocto Project releases with the ``systemd`` project. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3120 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3121 | Set the :term:`EFI_PROVIDER` variable to ":ref:`ref-classes-systemd-boot`" to |
| 3122 | use this class. Doing so creates a standalone EFI bootloader that is not |
| 3123 | dependent on systemd. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3124 | |
| 3125 | For information on more variables used and supported in this class, see |
| 3126 | the :term:`SYSTEMD_BOOT_CFG`, |
| 3127 | :term:`SYSTEMD_BOOT_ENTRIES`, and |
| 3128 | :term:`SYSTEMD_BOOT_TIMEOUT` variables. |
| 3129 | |
| 3130 | You can also see the `Systemd-boot |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 3131 | documentation <https://www.freedesktop.org/wiki/Software/systemd/systemd-boot/>`__ |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3132 | for more information. |
| 3133 | |
| 3134 | .. _ref-classes-terminal: |
| 3135 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3136 | ``terminal`` |
| 3137 | ============ |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3138 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3139 | The :ref:`ref-classes-terminal` class provides support for starting a terminal |
| 3140 | session. The :term:`OE_TERMINAL` variable controls which terminal emulator is |
| 3141 | used for the session. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3142 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3143 | Other classes use the :ref:`ref-classes-terminal` class anywhere a separate |
| 3144 | terminal session needs to be started. For example, the :ref:`ref-classes-patch` |
| 3145 | class assuming :term:`PATCHRESOLVE` is set to "user", the |
| 3146 | :ref:`ref-classes-cml1` class, and the :ref:`ref-classes-devshell` class all |
| 3147 | use the :ref:`ref-classes-terminal` class. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3148 | |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 3149 | .. _ref-classes-testimage: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3150 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3151 | ``testimage`` |
| 3152 | ============= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3153 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3154 | The :ref:`ref-classes-testimage` class supports running automated tests against |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3155 | images using QEMU and on actual hardware. The classes handle loading the |
| 3156 | tests and starting the image. To use the classes, you need to perform |
| 3157 | steps to set up the environment. |
| 3158 | |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 3159 | To enable this class, add the following to your configuration:: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3160 | |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 3161 | IMAGE_CLASSES += "testimage" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3162 | |
| 3163 | The tests are commands that run on the target system over ``ssh``. Each |
| 3164 | test is written in Python and makes use of the ``unittest`` module. |
| 3165 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3166 | The :ref:`ref-classes-testimage` class runs tests on an image when called using the |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 3167 | following:: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3168 | |
| 3169 | $ bitbake -c testimage image |
| 3170 | |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 3171 | Alternatively, if you wish to have tests automatically run for each image |
| 3172 | after it is built, you can set :term:`TESTIMAGE_AUTO`:: |
| 3173 | |
| 3174 | TESTIMAGE_AUTO = "1" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3175 | |
| 3176 | For information on how to enable, run, and create new tests, see the |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3177 | ":ref:`dev-manual/runtime-testing:performing automated runtime testing`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3178 | section in the Yocto Project Development Tasks Manual. |
| 3179 | |
| 3180 | .. _ref-classes-testsdk: |
| 3181 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3182 | ``testsdk`` |
| 3183 | =========== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3184 | |
| 3185 | This class supports running automated tests against software development |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3186 | kits (SDKs). The :ref:`ref-classes-testsdk` class runs tests on an SDK when called |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 3187 | using the following:: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3188 | |
| 3189 | $ bitbake -c testsdk image |
| 3190 | |
| 3191 | .. note:: |
| 3192 | |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 3193 | Best practices include using :term:`IMAGE_CLASSES` rather than |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3194 | :term:`INHERIT` to inherit the :ref:`ref-classes-testsdk` class for automated SDK |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 3195 | testing. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3196 | |
| 3197 | .. _ref-classes-texinfo: |
| 3198 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3199 | ``texinfo`` |
| 3200 | =========== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3201 | |
| 3202 | This class should be inherited by recipes whose upstream packages invoke |
| 3203 | the ``texinfo`` utilities at build-time. Native and cross recipes are |
| 3204 | made to use the dummy scripts provided by ``texinfo-dummy-native``, for |
| 3205 | improved performance. Target architecture recipes use the genuine |
| 3206 | Texinfo utilities. By default, they use the Texinfo utilities on the |
| 3207 | host system. |
| 3208 | |
| 3209 | .. note:: |
| 3210 | |
| 3211 | If you want to use the Texinfo recipe shipped with the build system, |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 3212 | you can remove "texinfo-native" from :term:`ASSUME_PROVIDED` and makeinfo |
| 3213 | from :term:`SANITY_REQUIRED_UTILITIES`. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3214 | |
| 3215 | .. _ref-classes-toaster: |
| 3216 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3217 | ``toaster`` |
| 3218 | =========== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3219 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3220 | The :ref:`ref-classes-toaster` class collects information about packages and images and |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3221 | sends them as events that the BitBake user interface can receive. The |
| 3222 | class is enabled when the Toaster user interface is running. |
| 3223 | |
| 3224 | This class is not intended to be used directly. |
| 3225 | |
| 3226 | .. _ref-classes-toolchain-scripts: |
| 3227 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3228 | ``toolchain-scripts`` |
| 3229 | ===================== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3230 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3231 | The :ref:`ref-classes-toolchain-scripts` class provides the scripts used for setting up |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3232 | the environment for installed SDKs. |
| 3233 | |
| 3234 | .. _ref-classes-typecheck: |
| 3235 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3236 | ``typecheck`` |
| 3237 | ============= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3238 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3239 | The :ref:`ref-classes-typecheck` class provides support for validating the values of |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3240 | variables set at the configuration level against their defined types. |
| 3241 | The OpenEmbedded build system allows you to define the type of a |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 3242 | variable using the "type" varflag. Here is an example:: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3243 | |
| 3244 | IMAGE_FEATURES[type] = "list" |
| 3245 | |
| 3246 | .. _ref-classes-uboot-config: |
| 3247 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3248 | ``uboot-config`` |
| 3249 | ================ |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3250 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3251 | The :ref:`ref-classes-uboot-config` class provides support for U-Boot configuration for |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 3252 | a machine. Specify the machine in your recipe as follows:: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3253 | |
| 3254 | UBOOT_CONFIG ??= <default> |
Patrick Williams | 705982a | 2024-01-12 09:51:57 -0600 | [diff] [blame] | 3255 | UBOOT_CONFIG[foo] = "config,images,binary" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3256 | |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 3257 | You can also specify the machine using this method:: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3258 | |
| 3259 | UBOOT_MACHINE = "config" |
| 3260 | |
| 3261 | See the :term:`UBOOT_CONFIG` and :term:`UBOOT_MACHINE` variables for additional |
| 3262 | information. |
| 3263 | |
Patrick Williams | b542dec | 2023-06-09 01:26:37 -0500 | [diff] [blame] | 3264 | .. _ref-classes-uboot-sign: |
| 3265 | |
| 3266 | ``uboot-sign`` |
| 3267 | ============== |
| 3268 | |
| 3269 | The :ref:`ref-classes-uboot-sign` class provides support for U-Boot verified boot. |
| 3270 | It is intended to be inherited from U-Boot recipes. |
| 3271 | |
Patrick Williams | 3965356 | 2024-03-01 08:54:02 -0600 | [diff] [blame] | 3272 | The variables used by this class are: |
Patrick Williams | b542dec | 2023-06-09 01:26:37 -0500 | [diff] [blame] | 3273 | |
| 3274 | - :term:`SPL_MKIMAGE_DTCOPTS`: DTC options for U-Boot ``mkimage`` when |
| 3275 | building the FIT image. |
| 3276 | - :term:`SPL_SIGN_ENABLE`: enable signing the FIT image. |
| 3277 | - :term:`SPL_SIGN_KEYDIR`: directory containing the signing keys. |
| 3278 | - :term:`SPL_SIGN_KEYNAME`: base filename of the signing keys. |
| 3279 | - :term:`UBOOT_FIT_ADDRESS_CELLS`: ``#address-cells`` value for the FIT image. |
| 3280 | - :term:`UBOOT_FIT_DESC`: description string encoded into the FIT image. |
| 3281 | - :term:`UBOOT_FIT_GENERATE_KEYS`: generate the keys if they don't exist yet. |
| 3282 | - :term:`UBOOT_FIT_HASH_ALG`: hash algorithm for the FIT image. |
| 3283 | - :term:`UBOOT_FIT_KEY_GENRSA_ARGS`: ``openssl genrsa`` arguments. |
| 3284 | - :term:`UBOOT_FIT_KEY_REQ_ARGS`: ``openssl req`` arguments. |
| 3285 | - :term:`UBOOT_FIT_SIGN_ALG`: signature algorithm for the FIT image. |
| 3286 | - :term:`UBOOT_FIT_SIGN_NUMBITS`: size of the private key for FIT image |
Patrick Williams | 44b3caf | 2024-04-12 16:51:14 -0500 | [diff] [blame] | 3287 | signing. |
Patrick Williams | b542dec | 2023-06-09 01:26:37 -0500 | [diff] [blame] | 3288 | - :term:`UBOOT_FIT_KEY_SIGN_PKCS`: algorithm for the public key certificate |
| 3289 | for FIT image signing. |
| 3290 | - :term:`UBOOT_FITIMAGE_ENABLE`: enable the generation of a U-Boot FIT image. |
| 3291 | - :term:`UBOOT_MKIMAGE_DTCOPTS`: DTC options for U-Boot ``mkimage`` when |
| 3292 | rebuilding the FIT image containing the kernel. |
| 3293 | |
| 3294 | See U-Boot's documentation for details about `verified boot |
| 3295 | <https://source.denx.de/u-boot/u-boot/-/blob/master/doc/uImage.FIT/verified-boot.txt>`__ |
| 3296 | and the `signature process |
| 3297 | <https://source.denx.de/u-boot/u-boot/-/blob/master/doc/uImage.FIT/signature.txt>`__. |
| 3298 | |
| 3299 | See also the description of :ref:`ref-classes-kernel-fitimage` class, which this class |
| 3300 | imitates. |
| 3301 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3302 | .. _ref-classes-uninative: |
| 3303 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3304 | ``uninative`` |
| 3305 | ============= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3306 | |
| 3307 | Attempts to isolate the build system from the host distribution's C |
| 3308 | library in order to make re-use of native shared state artifacts across |
| 3309 | different host distributions practical. With this class enabled, a |
| 3310 | tarball containing a pre-built C library is downloaded at the start of |
| 3311 | the build. In the Poky reference distribution this is enabled by default |
| 3312 | through ``meta/conf/distro/include/yocto-uninative.inc``. Other |
| 3313 | distributions that do not derive from poky can also |
| 3314 | "``require conf/distro/include/yocto-uninative.inc``" to use this. |
| 3315 | Alternatively if you prefer, you can build the uninative-tarball recipe |
| 3316 | yourself, publish the resulting tarball (e.g. via HTTP) and set |
| 3317 | ``UNINATIVE_URL`` and ``UNINATIVE_CHECKSUM`` appropriately. For an |
| 3318 | example, see the ``meta/conf/distro/include/yocto-uninative.inc``. |
| 3319 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3320 | The :ref:`ref-classes-uninative` class is also used unconditionally by the extensible |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3321 | SDK. When building the extensible SDK, ``uninative-tarball`` is built |
| 3322 | and the resulting tarball is included within the SDK. |
| 3323 | |
| 3324 | .. _ref-classes-update-alternatives: |
| 3325 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3326 | ``update-alternatives`` |
| 3327 | ======================= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3328 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3329 | The :ref:`ref-classes-update-alternatives` class helps the alternatives system when |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3330 | multiple sources provide the same command. This situation occurs when |
| 3331 | several programs that have the same or similar function are installed |
| 3332 | with the same name. For example, the ``ar`` command is available from |
| 3333 | the ``busybox``, ``binutils`` and ``elfutils`` packages. The |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3334 | :ref:`ref-classes-update-alternatives` class handles renaming the binaries so that |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3335 | multiple packages can be installed without conflicts. The ``ar`` command |
| 3336 | still works regardless of which packages are installed or subsequently |
| 3337 | removed. The class renames the conflicting binary in each package and |
| 3338 | symlinks the highest priority binary during installation or removal of |
| 3339 | packages. |
| 3340 | |
| 3341 | To use this class, you need to define a number of variables: |
| 3342 | |
| 3343 | - :term:`ALTERNATIVE` |
| 3344 | |
| 3345 | - :term:`ALTERNATIVE_LINK_NAME` |
| 3346 | |
| 3347 | - :term:`ALTERNATIVE_TARGET` |
| 3348 | |
| 3349 | - :term:`ALTERNATIVE_PRIORITY` |
| 3350 | |
| 3351 | These variables list alternative commands needed by a package, provide |
| 3352 | pathnames for links, default links for targets, and so forth. For |
| 3353 | details on how to use this class, see the comments in the |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 3354 | :yocto_git:`update-alternatives.bbclass </poky/tree/meta/classes-recipe/update-alternatives.bbclass>` |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3355 | file. |
| 3356 | |
| 3357 | .. note:: |
| 3358 | |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 3359 | You can use the ``update-alternatives`` command directly in your recipes. |
| 3360 | However, this class simplifies things in most cases. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3361 | |
| 3362 | .. _ref-classes-update-rc.d: |
| 3363 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3364 | ``update-rc.d`` |
| 3365 | =============== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3366 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3367 | The :ref:`ref-classes-update-rc.d` class uses ``update-rc.d`` to safely install an |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3368 | initialization script on behalf of the package. The OpenEmbedded build |
| 3369 | system takes care of details such as making sure the script is stopped |
| 3370 | before a package is removed and started when the package is installed. |
| 3371 | |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 3372 | Three variables control this class: :term:`INITSCRIPT_PACKAGES`, |
| 3373 | :term:`INITSCRIPT_NAME` and :term:`INITSCRIPT_PARAMS`. See the variable links |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3374 | for details. |
| 3375 | |
| 3376 | .. _ref-classes-useradd: |
| 3377 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3378 | ``useradd*`` |
| 3379 | ============ |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3380 | |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 3381 | The :ref:`useradd* <ref-classes-useradd>` classes support the addition of users or groups for |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3382 | usage by the package on the target. For example, if you have packages |
| 3383 | that contain system services that should be run under their own user or |
| 3384 | group, you can use these classes to enable creation of the user or |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 3385 | group. The :oe_git:`meta-skeleton/recipes-skeleton/useradd/useradd-example.bb |
| 3386 | </openembedded-core/tree/meta-skeleton/recipes-skeleton/useradd/useradd-example.bb>` |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3387 | recipe in the :term:`Source Directory` provides a simple |
| 3388 | example that shows how to add three users and groups to two packages. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3389 | |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 3390 | The :ref:`useradd_base <ref-classes-useradd>` class provides basic functionality for user or |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3391 | groups settings. |
| 3392 | |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 3393 | The :ref:`useradd* <ref-classes-useradd>` classes support the |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3394 | :term:`USERADD_PACKAGES`, |
| 3395 | :term:`USERADD_PARAM`, |
| 3396 | :term:`GROUPADD_PARAM`, and |
| 3397 | :term:`GROUPMEMS_PARAM` variables. |
| 3398 | |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 3399 | The :ref:`useradd-staticids <ref-classes-useradd>` class supports the addition of users or groups |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3400 | that have static user identification (``uid``) and group identification |
| 3401 | (``gid``) values. |
| 3402 | |
| 3403 | The default behavior of the OpenEmbedded build system for assigning |
| 3404 | ``uid`` and ``gid`` values when packages add users and groups during |
| 3405 | package install time is to add them dynamically. This works fine for |
| 3406 | programs that do not care what the values of the resulting users and |
| 3407 | groups become. In these cases, the order of the installation determines |
| 3408 | the final ``uid`` and ``gid`` values. However, if non-deterministic |
| 3409 | ``uid`` and ``gid`` values are a problem, you can override the default, |
| 3410 | dynamic application of these values by setting static values. When you |
| 3411 | set static values, the OpenEmbedded build system looks in |
| 3412 | :term:`BBPATH` for ``files/passwd`` and ``files/group`` |
| 3413 | files for the values. |
| 3414 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3415 | To use static ``uid`` and ``gid`` values, you need to set some variables. See |
| 3416 | the :term:`USERADDEXTENSION`, :term:`USERADD_UID_TABLES`, |
| 3417 | :term:`USERADD_GID_TABLES`, and :term:`USERADD_ERROR_DYNAMIC` variables. |
| 3418 | You can also see the :ref:`ref-classes-useradd` class for additional |
| 3419 | information. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3420 | |
| 3421 | .. note:: |
| 3422 | |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 3423 | You do not use the :ref:`useradd-staticids <ref-classes-useradd>` class directly. You either enable |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 3424 | or disable the class by setting the :term:`USERADDEXTENSION` variable. If you |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 3425 | enable or disable the class in a configured system, :term:`TMPDIR` might |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 3426 | contain incorrect ``uid`` and ``gid`` values. Deleting the :term:`TMPDIR` |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3427 | directory will correct this condition. |
| 3428 | |
| 3429 | .. _ref-classes-utility-tasks: |
| 3430 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3431 | ``utility-tasks`` |
| 3432 | ================= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3433 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3434 | The :ref:`ref-classes-utility-tasks` class provides support for various |
| 3435 | "utility" type tasks that are applicable to all recipes, such as |
| 3436 | :ref:`ref-tasks-clean` and :ref:`ref-tasks-listtasks`. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3437 | |
| 3438 | This class is enabled by default because it is inherited by the |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3439 | :ref:`ref-classes-base` class. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3440 | |
| 3441 | .. _ref-classes-utils: |
| 3442 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3443 | ``utils`` |
| 3444 | ========= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3445 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3446 | The :ref:`ref-classes-utils` class provides some useful Python functions that are |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3447 | typically used in inline Python expressions (e.g. ``${@...}``). One |
| 3448 | example use is for ``bb.utils.contains()``. |
| 3449 | |
| 3450 | This class is enabled by default because it is inherited by the |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3451 | :ref:`ref-classes-base` class. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3452 | |
| 3453 | .. _ref-classes-vala: |
| 3454 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3455 | ``vala`` |
| 3456 | ======== |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3457 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3458 | The :ref:`ref-classes-vala` class supports recipes that need to build software written |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3459 | using the Vala programming language. |
| 3460 | |
| 3461 | .. _ref-classes-waf: |
| 3462 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3463 | ``waf`` |
| 3464 | ======= |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3465 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3466 | The :ref:`ref-classes-waf` class supports recipes that need to build software that uses |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3467 | the Waf build system. You can use the |
| 3468 | :term:`EXTRA_OECONF` or |
| 3469 | :term:`PACKAGECONFIG_CONFARGS` variables |
| 3470 | to specify additional configuration options to be passed on the Waf |
| 3471 | command line. |