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