| 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 | Source Directory Structure | 
 | 5 | ************************** | 
 | 6 |  | 
 | 7 | The :term:`Source Directory` consists of numerous files, | 
 | 8 | directories and subdirectories; understanding their locations and | 
 | 9 | contents is key to using the Yocto Project effectively. This chapter | 
 | 10 | describes the Source Directory and gives information about those files | 
 | 11 | and directories. | 
 | 12 |  | 
 | 13 | For information on how to establish a local Source Directory on your | 
 | 14 | development system, see the | 
| Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 15 | ":ref:`dev-manual/start:locating yocto project source files`" | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 16 | section in the Yocto Project Development Tasks Manual. | 
 | 17 |  | 
 | 18 | .. note:: | 
 | 19 |  | 
 | 20 |    The OpenEmbedded build system does not support file or directory | 
 | 21 |    names that contain spaces. Be sure that the Source Directory you use | 
 | 22 |    does not contain these types of names. | 
 | 23 |  | 
 | 24 | .. _structure-core: | 
 | 25 |  | 
 | 26 | Top-Level Core Components | 
 | 27 | ========================= | 
 | 28 |  | 
 | 29 | This section describes the top-level components of the :term:`Source Directory`. | 
 | 30 |  | 
 | 31 | .. _structure-core-bitbake: | 
 | 32 |  | 
 | 33 | ``bitbake/`` | 
 | 34 | ------------ | 
 | 35 |  | 
 | 36 | This directory includes a copy of BitBake for ease of use. The copy | 
 | 37 | usually matches the current stable BitBake release from the BitBake | 
 | 38 | project. BitBake, a :term:`Metadata` interpreter, reads the | 
 | 39 | Yocto Project Metadata and runs the tasks defined by that data. Failures | 
 | 40 | are usually caused by errors in your Metadata and not from BitBake | 
| William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 41 | itself. | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 42 |  | 
 | 43 | When you run the ``bitbake`` command, the main BitBake executable (which | 
 | 44 | resides in the ``bitbake/bin/`` directory) starts. Sourcing the | 
 | 45 | environment setup script (i.e. :ref:`structure-core-script`) places | 
 | 46 | the ``scripts/`` and ``bitbake/bin/`` directories (in that order) into | 
 | 47 | the shell's ``PATH`` environment variable. | 
 | 48 |  | 
 | 49 | For more information on BitBake, see the :doc:`BitBake User Manual | 
 | 50 | <bitbake:index>`. | 
 | 51 |  | 
 | 52 | .. _structure-core-build: | 
 | 53 |  | 
 | 54 | ``build/`` | 
 | 55 | ---------- | 
 | 56 |  | 
 | 57 | This directory contains user configuration files and the output | 
 | 58 | generated by the OpenEmbedded build system in its standard configuration | 
 | 59 | where the source tree is combined with the output. The :term:`Build Directory` | 
| Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 60 | is created initially when you ``source`` the OpenEmbedded build environment | 
 | 61 | setup script (i.e. :ref:`structure-core-script`). | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 62 |  | 
 | 63 | It is also possible to place output and configuration files in a | 
 | 64 | directory separate from the :term:`Source Directory` by | 
 | 65 | providing a directory name when you ``source`` the setup script. For | 
 | 66 | information on separating output from your local Source Directory files | 
 | 67 | (commonly described as an "out of tree" build), see the | 
 | 68 | ":ref:`structure-core-script`" section. | 
 | 69 |  | 
| Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 70 | See the ":ref:`The Build Directory --- build/ <structure-build>`" section for details | 
 | 71 | about the contents of the :term:`Build Directory`. | 
 | 72 |  | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 73 | .. _handbook: | 
 | 74 |  | 
 | 75 | ``documentation/`` | 
 | 76 | ------------------ | 
 | 77 |  | 
 | 78 | This directory holds the source for the Yocto Project documentation as | 
 | 79 | well as templates and tools that allow you to generate PDF and HTML | 
 | 80 | versions of the manuals. Each manual is contained in its own sub-folder; | 
 | 81 | for example, the files for this reference manual reside in the | 
 | 82 | ``ref-manual/`` directory. | 
 | 83 |  | 
 | 84 | .. _structure-core-meta: | 
 | 85 |  | 
 | 86 | ``meta/`` | 
 | 87 | --------- | 
 | 88 |  | 
 | 89 | This directory contains the minimal, underlying OpenEmbedded-Core | 
 | 90 | metadata. The directory holds recipes, common classes, and machine | 
 | 91 | configuration for strictly emulated targets (``qemux86``, ``qemuarm``, | 
 | 92 | and so forth.) | 
 | 93 |  | 
 | 94 | .. _structure-core-meta-poky: | 
 | 95 |  | 
 | 96 | ``meta-poky/`` | 
 | 97 | -------------- | 
 | 98 |  | 
 | 99 | Designed above the ``meta/`` content, this directory adds just enough | 
 | 100 | metadata to define the Poky reference distribution. | 
 | 101 |  | 
 | 102 | .. _structure-core-meta-yocto-bsp: | 
 | 103 |  | 
 | 104 | ``meta-yocto-bsp/`` | 
 | 105 | ------------------- | 
 | 106 |  | 
 | 107 | This directory contains the Yocto Project reference hardware Board | 
 | 108 | Support Packages (BSPs). For more information on BSPs, see the | 
| Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 109 | :doc:`/bsp-guide/index`. | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 110 |  | 
 | 111 | .. _structure-meta-selftest: | 
 | 112 |  | 
 | 113 | ``meta-selftest/`` | 
 | 114 | ------------------ | 
 | 115 |  | 
 | 116 | This directory adds additional recipes and append files used by the | 
 | 117 | OpenEmbedded selftests to verify the behavior of the build system. You | 
 | 118 | do not have to add this layer to your ``bblayers.conf`` file unless you | 
 | 119 | want to run the selftests. | 
 | 120 |  | 
 | 121 | .. _structure-meta-skeleton: | 
 | 122 |  | 
 | 123 | ``meta-skeleton/`` | 
 | 124 | ------------------ | 
 | 125 |  | 
 | 126 | This directory contains template recipes for BSP and kernel development. | 
 | 127 |  | 
 | 128 | .. _structure-core-scripts: | 
 | 129 |  | 
 | 130 | ``scripts/`` | 
 | 131 | ------------ | 
 | 132 |  | 
 | 133 | This directory contains various integration scripts that implement extra | 
 | 134 | functionality in the Yocto Project environment (e.g. QEMU scripts). The | 
 | 135 | :ref:`structure-core-script` script prepends this directory to the | 
 | 136 | shell's ``PATH`` environment variable. | 
 | 137 |  | 
 | 138 | The ``scripts`` directory has useful scripts that assist in contributing | 
 | 139 | back to the Yocto Project, such as ``create-pull-request`` and | 
 | 140 | ``send-pull-request``. | 
 | 141 |  | 
 | 142 | .. _structure-core-script: | 
 | 143 |  | 
 | 144 | ``oe-init-build-env`` | 
 | 145 | --------------------- | 
 | 146 |  | 
 | 147 | This script sets up the OpenEmbedded build environment. Running this | 
 | 148 | script with the ``source`` command in a shell makes changes to ``PATH`` | 
 | 149 | and sets other core BitBake variables based on the current working | 
 | 150 | directory. You need to run an environment setup script before running | 
 | 151 | BitBake commands. The script uses other scripts within the ``scripts`` | 
 | 152 | directory to do the bulk of the work. | 
 | 153 |  | 
 | 154 | When you run this script, your Yocto Project environment is set up, a | 
| Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 155 | :term:`Build Directory` is created, your working directory becomes the | 
 | 156 | :term:`Build Directory`, and you are presented with some simple | 
 | 157 | suggestions as to what to do next, including a list of some possible | 
 | 158 | targets to build. Here is an example:: | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 159 |  | 
 | 160 |    $ source oe-init-build-env | 
 | 161 |  | 
 | 162 |    ### Shell environment set up for builds. ### | 
 | 163 |  | 
 | 164 |    You can now run 'bitbake <target>' | 
 | 165 |  | 
 | 166 |    Common targets are: | 
 | 167 |        core-image-minimal | 
 | 168 |        core-image-sato | 
 | 169 |        meta-toolchain | 
 | 170 |        meta-ide-support | 
 | 171 |  | 
| Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 172 |    You can also run generated QEMU images with a command like 'runqemu qemux86-64' | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 173 |  | 
 | 174 | The default output of the ``oe-init-build-env`` script is from the | 
 | 175 | ``conf-notes.txt`` file, which is found in the ``meta-poky`` directory | 
 | 176 | within the :term:`Source Directory`. If you design a | 
 | 177 | custom distribution, you can include your own version of this | 
 | 178 | configuration file to mention the targets defined by your distribution. | 
 | 179 | See the | 
| Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 180 | ":ref:`dev-manual/common-tasks:creating a custom template configuration directory`" | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 181 | section in the Yocto Project Development Tasks Manual for more | 
 | 182 | information. | 
 | 183 |  | 
| Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 184 | By default, running this script without a :term:`Build Directory` argument | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 185 | creates the ``build/`` directory in your current working directory. If | 
| Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 186 | you provide a :term:`Build Directory` argument when you ``source`` the script, | 
 | 187 | you direct the OpenEmbedded build system to create a :term:`Build Directory` of | 
 | 188 | your choice. For example, the following command creates a | 
 | 189 | :term:`Build Directory` named ``mybuilds/`` that is outside of the | 
 | 190 | :term:`Source Directory`:: | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 191 |  | 
| Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 192 |    $ source oe-init-build-env ~/mybuilds | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 193 |  | 
 | 194 | The OpenEmbedded build system uses the template configuration files, which | 
| Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 195 | are found by default in the ``meta-poky/conf/templates/default`` directory in the Source | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 196 | Directory. See the | 
| Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 197 | ":ref:`dev-manual/common-tasks:creating a custom template configuration directory`" | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 198 | section in the Yocto Project Development Tasks Manual for more | 
 | 199 | information. | 
 | 200 |  | 
 | 201 | .. note:: | 
 | 202 |  | 
 | 203 |    The OpenEmbedded build system does not support file or directory | 
| Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 204 |    names that contain spaces. If you attempt to run the ``oe-init-build-env`` | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 205 |    script from a Source Directory that contains spaces in either the | 
 | 206 |    filenames or directory names, the script returns an error indicating | 
 | 207 |    no such file or directory. Be sure to use a Source Directory free of | 
 | 208 |    names containing spaces. | 
 | 209 |  | 
 | 210 | .. _structure-basic-top-level: | 
 | 211 |  | 
 | 212 | ``LICENSE, README, and README.hardware`` | 
 | 213 | ---------------------------------------- | 
 | 214 |  | 
 | 215 | These files are standard top-level files. | 
 | 216 |  | 
 | 217 | .. _structure-build: | 
 | 218 |  | 
| Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame] | 219 | The Build Directory --- ``build/`` | 
 | 220 | ================================== | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 221 |  | 
| Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 222 | The OpenEmbedded build system creates the :term:`Build Directory` when you run | 
 | 223 | the build environment setup script :ref:`structure-core-script`. If you do not | 
 | 224 | give the :term:`Build Directory` a specific name when you run the setup script, | 
 | 225 | the name defaults to ``build/``. | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 226 |  | 
 | 227 | For subsequent parsing and processing, the name of the Build directory | 
 | 228 | is available via the :term:`TOPDIR` variable. | 
 | 229 |  | 
 | 230 | .. _structure-build-buildhistory: | 
 | 231 |  | 
 | 232 | ``build/buildhistory/`` | 
 | 233 | ----------------------- | 
 | 234 |  | 
 | 235 | The OpenEmbedded build system creates this directory when you enable | 
| Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 236 | build history via the :ref:`buildhistory <ref-classes-buildhistory>` class file. The directory | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 237 | organizes build information into image, packages, and SDK | 
 | 238 | subdirectories. For information on the build history feature, see the | 
| Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 239 | ":ref:`dev-manual/common-tasks:maintaining build output quality`" | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 240 | section in the Yocto Project Development Tasks Manual. | 
 | 241 |  | 
| Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 242 | .. _structure-build-cache: | 
 | 243 |  | 
 | 244 | ``build/cache/`` | 
 | 245 | ---------------- | 
 | 246 |  | 
 | 247 | This directory contains several internal files used by the OpenEmbedded | 
 | 248 | build system. | 
 | 249 |  | 
 | 250 | It also contains ``sanity_info``, a text file keeping track of important | 
 | 251 | build information such as the values of :term:`TMPDIR`, :term:`SSTATE_DIR`, | 
 | 252 | as well as the name and version of the host distribution. | 
 | 253 |  | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 254 | .. _structure-build-conf-local.conf: | 
 | 255 |  | 
 | 256 | ``build/conf/local.conf`` | 
 | 257 | ------------------------- | 
 | 258 |  | 
 | 259 | This configuration file contains all the local user configurations for | 
 | 260 | your build environment. The ``local.conf`` file contains documentation | 
 | 261 | on the various configuration options. Any variable set here overrides | 
 | 262 | any variable set elsewhere within the environment unless that variable | 
 | 263 | is hard-coded within a file (e.g. by using '=' instead of '?='). Some | 
 | 264 | variables are hard-coded for various reasons but such variables are | 
 | 265 | relatively rare. | 
 | 266 |  | 
 | 267 | At a minimum, you would normally edit this file to select the target | 
| Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 268 | :term:`MACHINE`, which package types you wish to use | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 269 | (:term:`PACKAGE_CLASSES`), and the location from | 
| Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 270 | which you want to access downloaded files (:term:`DL_DIR`). | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 271 |  | 
 | 272 | If ``local.conf`` is not present when you start the build, the | 
 | 273 | OpenEmbedded build system creates it from ``local.conf.sample`` when you | 
 | 274 | ``source`` the top-level build environment setup script | 
 | 275 | :ref:`structure-core-script`. | 
 | 276 |  | 
 | 277 | The source ``local.conf.sample`` file used depends on the | 
| Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 278 | :term:`TEMPLATECONF` script variable, which defaults to ``meta-poky/conf/templates/default`` | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 279 | when you are building from the Yocto Project development environment, | 
| Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 280 | and to ``meta/conf/templates/default`` when you are building from the OpenEmbedded-Core | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 281 | environment. Because the script variable points to the source of the | 
 | 282 | ``local.conf.sample`` file, this implies that you can configure your | 
 | 283 | build environment from any layer by setting the variable in the | 
| Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 284 | top-level build environment setup script as follows:: | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 285 |  | 
| Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 286 |    TEMPLATECONF=your_layer/conf/templates/your_template_name | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 287 |  | 
 | 288 | Once the build process gets the sample | 
 | 289 | file, it uses ``sed`` to substitute final | 
 | 290 | ``${``\ :term:`OEROOT`\ ``}`` values for all | 
 | 291 | ``##OEROOT##`` values. | 
 | 292 |  | 
 | 293 | .. note:: | 
 | 294 |  | 
| Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame] | 295 |    You can see how the :term:`TEMPLATECONF` variable is used by looking at the | 
| William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 296 |    ``scripts/oe-setup-builddir`` script in the :term:`Source Directory`. | 
| Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 297 |    You can find the Yocto Project version of the ``local.conf.sample`` file in | 
| Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 298 |    the ``meta-poky/conf/templates/default`` directory. | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 299 |  | 
 | 300 | .. _structure-build-conf-bblayers.conf: | 
 | 301 |  | 
 | 302 | ``build/conf/bblayers.conf`` | 
 | 303 | ---------------------------- | 
 | 304 |  | 
 | 305 | This configuration file defines | 
| Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 306 | :ref:`layers <dev-manual/common-tasks:understanding and creating layers>`, | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 307 | which are directory trees, traversed (or walked) by BitBake. The | 
 | 308 | ``bblayers.conf`` file uses the :term:`BBLAYERS` | 
 | 309 | variable to list the layers BitBake tries to find. | 
 | 310 |  | 
 | 311 | If ``bblayers.conf`` is not present when you start the build, the | 
 | 312 | OpenEmbedded build system creates it from ``bblayers.conf.sample`` when | 
 | 313 | you ``source`` the top-level build environment setup script (i.e. | 
 | 314 | :ref:`structure-core-script`). | 
 | 315 |  | 
 | 316 | As with the ``local.conf`` file, the source ``bblayers.conf.sample`` | 
| Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame] | 317 | file used depends on the :term:`TEMPLATECONF` script variable, which | 
| Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 318 | defaults to ``meta-poky/conf/templates/default`` when you are building from the Yocto | 
 | 319 | Project development environment, and to ``meta/conf/templates/default`` when you are | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 320 | building from the OpenEmbedded-Core environment. Because the script | 
 | 321 | variable points to the source of the ``bblayers.conf.sample`` file, this | 
 | 322 | implies that you can base your build from any layer by setting the | 
| Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 323 | variable in the top-level build environment setup script as follows:: | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 324 |  | 
| Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 325 |    TEMPLATECONF=your_layer/conf/templates/your_template_name | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 326 |  | 
 | 327 | Once the build process gets the sample file, it uses ``sed`` to substitute final | 
 | 328 | ``${``\ :term:`OEROOT`\ ``}`` values for all ``##OEROOT##`` values. | 
 | 329 |  | 
 | 330 | .. note:: | 
 | 331 |  | 
| Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame] | 332 |    You can see how the :term:`TEMPLATECONF` variable is defined by the ``scripts/oe-setup-builddir`` | 
| Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 333 |    script in the :term:`Source Directory`. You can find the Yocto Project | 
| Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 334 |    version of the ``bblayers.conf.sample`` file in the ``meta-poky/conf/templates/default`` | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 335 |    directory. | 
 | 336 |  | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 337 | .. _structure-build-downloads: | 
 | 338 |  | 
 | 339 | ``build/downloads/`` | 
 | 340 | -------------------- | 
 | 341 |  | 
 | 342 | This directory contains downloaded upstream source tarballs. You can | 
 | 343 | reuse the directory for multiple builds or move the directory to another | 
 | 344 | location. You can control the location of this directory through the | 
| Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 345 | :term:`DL_DIR` variable. | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 346 |  | 
 | 347 | .. _structure-build-sstate-cache: | 
 | 348 |  | 
 | 349 | ``build/sstate-cache/`` | 
 | 350 | ----------------------- | 
 | 351 |  | 
 | 352 | This directory contains the shared state cache. You can reuse the | 
 | 353 | directory for multiple builds or move the directory to another location. | 
 | 354 | You can control the location of this directory through the | 
| Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 355 | :term:`SSTATE_DIR` variable. | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 356 |  | 
 | 357 | .. _structure-build-tmp: | 
 | 358 |  | 
 | 359 | ``build/tmp/`` | 
 | 360 | -------------- | 
 | 361 |  | 
 | 362 | The OpenEmbedded build system creates and uses this directory for all | 
 | 363 | the build system's output. The :term:`TMPDIR` variable | 
 | 364 | points to this directory. | 
 | 365 |  | 
 | 366 | BitBake creates this directory if it does not exist. As a last resort, | 
 | 367 | to clean up a build and start it from scratch (other than the | 
 | 368 | downloads), you can remove everything in the ``tmp`` directory or get | 
 | 369 | rid of the directory completely. If you do, you should also completely | 
 | 370 | remove the ``build/sstate-cache`` directory. | 
 | 371 |  | 
 | 372 | .. _structure-build-tmp-buildstats: | 
 | 373 |  | 
 | 374 | ``build/tmp/buildstats/`` | 
| Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 375 | ~~~~~~~~~~~~~~~~~~~~~~~~~ | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 376 |  | 
 | 377 | This directory stores the build statistics. | 
 | 378 |  | 
 | 379 | .. _structure-build-tmp-cache: | 
 | 380 |  | 
 | 381 | ``build/tmp/cache/`` | 
| Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 382 | ~~~~~~~~~~~~~~~~~~~~ | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 383 |  | 
 | 384 | When BitBake parses the metadata (recipes and configuration files), it | 
 | 385 | caches the results in ``build/tmp/cache/`` to speed up future builds. | 
 | 386 | The results are stored on a per-machine basis. | 
 | 387 |  | 
 | 388 | During subsequent builds, BitBake checks each recipe (together with, for | 
 | 389 | example, any files included or appended to it) to see if they have been | 
 | 390 | modified. Changes can be detected, for example, through file | 
 | 391 | modification time (mtime) changes and hashing of file contents. If no | 
 | 392 | changes to the file are detected, then the parsed result stored in the | 
 | 393 | cache is reused. If the file has changed, it is reparsed. | 
 | 394 |  | 
 | 395 | .. _structure-build-tmp-deploy: | 
 | 396 |  | 
 | 397 | ``build/tmp/deploy/`` | 
| Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 398 | ~~~~~~~~~~~~~~~~~~~~~ | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 399 |  | 
 | 400 | This directory contains any "end result" output from the OpenEmbedded | 
 | 401 | build process. The :term:`DEPLOY_DIR` variable points | 
 | 402 | to this directory. For more detail on the contents of the ``deploy`` | 
 | 403 | directory, see the | 
| Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 404 | ":ref:`overview-manual/concepts:images`" and | 
 | 405 | ":ref:`overview-manual/concepts:application development sdk`" sections in the Yocto | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 406 | Project Overview and Concepts Manual. | 
 | 407 |  | 
 | 408 | .. _structure-build-tmp-deploy-deb: | 
 | 409 |  | 
 | 410 | ``build/tmp/deploy/deb/`` | 
| Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 411 | ^^^^^^^^^^^^^^^^^^^^^^^^^ | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 412 |  | 
 | 413 | This directory receives any ``.deb`` packages produced by the build | 
 | 414 | process. The packages are sorted into feeds for different architecture | 
 | 415 | types. | 
 | 416 |  | 
 | 417 | .. _structure-build-tmp-deploy-rpm: | 
 | 418 |  | 
 | 419 | ``build/tmp/deploy/rpm/`` | 
| Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 420 | ^^^^^^^^^^^^^^^^^^^^^^^^^ | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 421 |  | 
 | 422 | This directory receives any ``.rpm`` packages produced by the build | 
 | 423 | process. The packages are sorted into feeds for different architecture | 
 | 424 | types. | 
 | 425 |  | 
 | 426 | .. _structure-build-tmp-deploy-ipk: | 
 | 427 |  | 
 | 428 | ``build/tmp/deploy/ipk/`` | 
| Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 429 | ^^^^^^^^^^^^^^^^^^^^^^^^^ | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 430 |  | 
 | 431 | This directory receives ``.ipk`` packages produced by the build process. | 
 | 432 |  | 
 | 433 | .. _structure-build-tmp-deploy-licenses: | 
 | 434 |  | 
 | 435 | ``build/tmp/deploy/licenses/`` | 
| Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 436 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 437 |  | 
 | 438 | This directory receives package licensing information. For example, the | 
 | 439 | directory contains sub-directories for ``bash``, ``busybox``, and | 
 | 440 | ``glibc`` (among others) that in turn contain appropriate ``COPYING`` | 
 | 441 | license files with other licensing information. For information on | 
 | 442 | licensing, see the | 
| Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 443 | ":ref:`dev-manual/common-tasks:maintaining open source license compliance during your product's lifecycle`" | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 444 | section in the Yocto Project Development Tasks Manual. | 
 | 445 |  | 
 | 446 | .. _structure-build-tmp-deploy-images: | 
 | 447 |  | 
 | 448 | ``build/tmp/deploy/images/`` | 
| Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 449 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 450 |  | 
 | 451 | This directory is populated with the basic output objects of the build | 
 | 452 | (think of them as the "generated artifacts" of the build process), | 
 | 453 | including things like the boot loader image, kernel, root filesystem and | 
 | 454 | more. If you want to flash the resulting image from a build onto a | 
 | 455 | device, look here for the necessary components. | 
 | 456 |  | 
 | 457 | Be careful when deleting files in this directory. You can safely delete | 
 | 458 | old images from this directory (e.g. ``core-image-*``). However, the | 
 | 459 | kernel (``*zImage*``, ``*uImage*``, etc.), bootloader and other | 
 | 460 | supplementary files might be deployed here prior to building an image. | 
 | 461 | Because these files are not directly produced from the image, if you | 
 | 462 | delete them they will not be automatically re-created when you build the | 
 | 463 | image again. | 
 | 464 |  | 
 | 465 | If you do accidentally delete files here, you will need to force them to | 
 | 466 | be re-created. In order to do that, you will need to know the target | 
 | 467 | that produced them. For example, these commands rebuild and re-create | 
| Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 468 | the kernel files:: | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 469 |  | 
 | 470 |    $ bitbake -c clean virtual/kernel | 
 | 471 |    $ bitbake virtual/kernel | 
 | 472 |  | 
 | 473 | .. _structure-build-tmp-deploy-sdk: | 
 | 474 |  | 
 | 475 | ``build/tmp/deploy/sdk/`` | 
| Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 476 | ^^^^^^^^^^^^^^^^^^^^^^^^^ | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 477 |  | 
 | 478 | The OpenEmbedded build system creates this directory to hold toolchain | 
 | 479 | installer scripts which, when executed, install the sysroot that matches | 
 | 480 | your target hardware. You can find out more about these installers in | 
| Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 481 | the ":ref:`sdk-manual/appendix-obtain:building an sdk installer`" | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 482 | section in the Yocto Project Application Development and the Extensible | 
 | 483 | Software Development Kit (eSDK) manual. | 
 | 484 |  | 
 | 485 | .. _structure-build-tmp-sstate-control: | 
 | 486 |  | 
 | 487 | ``build/tmp/sstate-control/`` | 
| Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 488 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 489 |  | 
 | 490 | The OpenEmbedded build system uses this directory for the shared state | 
 | 491 | manifest files. The shared state code uses these files to record the | 
 | 492 | files installed by each sstate task so that the files can be removed | 
 | 493 | when cleaning the recipe or when a newer version is about to be | 
 | 494 | installed. The build system also uses the manifests to detect and | 
 | 495 | produce a warning when files from one task are overwriting those from | 
 | 496 | another. | 
 | 497 |  | 
 | 498 | .. _structure-build-tmp-sysroots-components: | 
 | 499 |  | 
 | 500 | ``build/tmp/sysroots-components/`` | 
| Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 501 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 502 |  | 
 | 503 | This directory is the location of the sysroot contents that the task | 
 | 504 | :ref:`ref-tasks-prepare_recipe_sysroot` | 
 | 505 | links or copies into the recipe-specific sysroot for each recipe listed | 
 | 506 | in :term:`DEPENDS`. Population of this directory is | 
 | 507 | handled through shared state, while the path is specified by the | 
 | 508 | :term:`COMPONENTS_DIR` variable. Apart from a few | 
 | 509 | unusual circumstances, handling of the ``sysroots-components`` directory | 
 | 510 | should be automatic, and recipes should not directly reference | 
 | 511 | ``build/tmp/sysroots-components``. | 
 | 512 |  | 
 | 513 | .. _structure-build-tmp-sysroots: | 
 | 514 |  | 
 | 515 | ``build/tmp/sysroots/`` | 
| Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 516 | ~~~~~~~~~~~~~~~~~~~~~~~ | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 517 |  | 
 | 518 | Previous versions of the OpenEmbedded build system used to create a | 
| William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 519 | global shared sysroot per machine along with a native sysroot. Since | 
 | 520 | the 2.3 version of the Yocto Project, there are sysroots in | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 521 | recipe-specific :term:`WORKDIR` directories. Thus, the | 
 | 522 | ``build/tmp/sysroots/`` directory is unused. | 
 | 523 |  | 
 | 524 | .. note:: | 
 | 525 |  | 
| Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 526 |    The ``build/tmp/sysroots/`` directory can still be populated using the | 
 | 527 |    ``bitbake build-sysroots`` command and can be used for compatibility in some | 
 | 528 |    cases. However, in general it is not recommended to populate this directory. | 
 | 529 |    Individual recipe-specific sysroots should be used. | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 530 |  | 
 | 531 | .. _structure-build-tmp-stamps: | 
 | 532 |  | 
 | 533 | ``build/tmp/stamps/`` | 
| Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 534 | ~~~~~~~~~~~~~~~~~~~~~ | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 535 |  | 
 | 536 | This directory holds information that BitBake uses for accounting | 
 | 537 | purposes to track what tasks have run and when they have run. The | 
 | 538 | directory is sub-divided by architecture, package name, and version. | 
| Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 539 | Following is an example:: | 
| Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 540 |  | 
 | 541 |       stamps/all-poky-linux/distcc-config/1.0-r0.do_build-2fdd....2do | 
 | 542 |  | 
 | 543 | Although the files in the directory are empty of data, BitBake uses the filenames | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 544 | and timestamps for tracking purposes. | 
 | 545 |  | 
 | 546 | For information on how BitBake uses stamp files to determine if a task | 
 | 547 | should be rerun, see the | 
| Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 548 | ":ref:`overview-manual/concepts:stamp files and the rerunning of tasks`" | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 549 | section in the Yocto Project Overview and Concepts Manual. | 
 | 550 |  | 
 | 551 | .. _structure-build-tmp-log: | 
 | 552 |  | 
 | 553 | ``build/tmp/log/`` | 
| Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 554 | ~~~~~~~~~~~~~~~~~~ | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 555 |  | 
 | 556 | This directory contains general logs that are not otherwise placed using | 
| Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 557 | the package's :term:`WORKDIR`. Examples of logs are the output from the | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 558 | ``do_check_pkg`` or ``do_distro_check`` tasks. Running a build does not | 
 | 559 | necessarily mean this directory is created. | 
 | 560 |  | 
 | 561 | .. _structure-build-tmp-work: | 
 | 562 |  | 
 | 563 | ``build/tmp/work/`` | 
| Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 564 | ~~~~~~~~~~~~~~~~~~~ | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 565 |  | 
 | 566 | This directory contains architecture-specific work sub-directories for | 
 | 567 | packages built by BitBake. All tasks execute from the appropriate work | 
 | 568 | directory. For example, the source for a particular package is unpacked, | 
 | 569 | patched, configured and compiled all within its own work directory. | 
 | 570 | Within the work directory, organization is based on the package group | 
 | 571 | and version for which the source is being compiled as defined by the | 
 | 572 | :term:`WORKDIR`. | 
 | 573 |  | 
 | 574 | It is worth considering the structure of a typical work directory. As an | 
 | 575 | example, consider ``linux-yocto-kernel-3.0`` on the machine ``qemux86`` | 
 | 576 | built within the Yocto Project. For this package, a work directory of | 
 | 577 | ``tmp/work/qemux86-poky-linux/linux-yocto/3.0+git1+<.....>``, referred | 
| Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 578 | to as the :term:`WORKDIR`, is created. Within this directory, the source is | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 579 | unpacked to ``linux-qemux86-standard-build`` and then patched by Quilt. | 
| Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 580 | (See the ":ref:`dev-manual/common-tasks:using quilt in your workflow`" section in | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 581 | the Yocto Project Development Tasks Manual for more information.) Within | 
 | 582 | the ``linux-qemux86-standard-build`` directory, standard Quilt | 
 | 583 | directories ``linux-3.0/patches`` and ``linux-3.0/.pc`` are created, and | 
 | 584 | standard Quilt commands can be used. | 
 | 585 |  | 
| Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 586 | There are other directories generated within :term:`WORKDIR`. The most | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 587 | important directory is ``WORKDIR/temp/``, which has log files for each | 
 | 588 | task (``log.do_*.pid``) and contains the scripts BitBake runs for each | 
 | 589 | task (``run.do_*.pid``). The ``WORKDIR/image/`` directory is where "make | 
 | 590 | install" places its output that is then split into sub-packages within | 
 | 591 | ``WORKDIR/packages-split/``. | 
 | 592 |  | 
 | 593 | .. _structure-build-tmp-work-tunearch-recipename-version: | 
 | 594 |  | 
 | 595 | ``build/tmp/work/tunearch/recipename/version/`` | 
| Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 596 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 597 |  | 
| Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame] | 598 | The recipe work directory --- ``${WORKDIR}``. | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 599 |  | 
 | 600 | As described earlier in the | 
| Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 601 | ":ref:`structure-build-tmp-sysroots`" section, | 
 | 602 | beginning with the 2.3 release of the Yocto Project, the OpenEmbedded | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 603 | build system builds each recipe in its own work directory (i.e. | 
 | 604 | :term:`WORKDIR`). The path to the work directory is | 
 | 605 | constructed using the architecture of the given build (e.g. | 
| Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 606 | :term:`TUNE_PKGARCH`, :term:`MACHINE_ARCH`, or "allarch"), the recipe | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 607 | name, and the version of the recipe (i.e. | 
 | 608 | :term:`PE`\ ``:``\ :term:`PV`\ ``-``\ :term:`PR`). | 
 | 609 |  | 
| William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 610 | Here are key subdirectories within each recipe work directory: | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 611 |  | 
 | 612 | -  ``${WORKDIR}/temp``: Contains the log files of each task executed for | 
 | 613 |    this recipe, the "run" files for each executed task, which contain | 
 | 614 |    the code run, and a ``log.task_order`` file, which lists the order in | 
 | 615 |    which tasks were executed. | 
 | 616 |  | 
 | 617 | -  ``${WORKDIR}/image``: Contains the output of the | 
 | 618 |    :ref:`ref-tasks-install` task, which corresponds to | 
 | 619 |    the ``${``\ :term:`D`\ ``}`` variable in that task. | 
 | 620 |  | 
 | 621 | -  ``${WORKDIR}/pseudo``: Contains the pseudo database and log for any | 
 | 622 |    tasks executed under pseudo for the recipe. | 
 | 623 |  | 
 | 624 | -  ``${WORKDIR}/sysroot-destdir``: Contains the output of the | 
 | 625 |    :ref:`ref-tasks-populate_sysroot` task. | 
 | 626 |  | 
 | 627 | -  ``${WORKDIR}/package``: Contains the output of the | 
 | 628 |    :ref:`ref-tasks-package` task before the output is | 
 | 629 |    split into individual packages. | 
 | 630 |  | 
 | 631 | -  ``${WORKDIR}/packages-split``: Contains the output of the | 
| Patrick Williams | 2194f50 | 2022-10-16 14:26:09 -0500 | [diff] [blame] | 632 |    :ref:`ref-tasks-package` task after the output has been split into individual | 
| William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 633 |    packages. There are subdirectories for each individual package created by | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 634 |    the recipe. | 
 | 635 |  | 
 | 636 | -  ``${WORKDIR}/recipe-sysroot``: A directory populated with the target | 
 | 637 |    dependencies of the recipe. This directory looks like the target | 
 | 638 |    filesystem and contains libraries that the recipe might need to link | 
 | 639 |    against (e.g. the C library). | 
 | 640 |  | 
 | 641 | -  ``${WORKDIR}/recipe-sysroot-native``: A directory populated with the | 
 | 642 |    native dependencies of the recipe. This directory contains the tools | 
 | 643 |    the recipe needs to build (e.g. the compiler, Autoconf, libtool, and | 
 | 644 |    so forth). | 
 | 645 |  | 
 | 646 | -  ``${WORKDIR}/build``: This subdirectory applies only to recipes that | 
 | 647 |    support builds where the source is separate from the build artifacts. | 
 | 648 |    The OpenEmbedded build system uses this directory as a separate build | 
 | 649 |    directory (i.e. ``${``\ :term:`B`\ ``}``). | 
 | 650 |  | 
 | 651 | .. _structure-build-work-shared: | 
 | 652 |  | 
 | 653 | ``build/tmp/work-shared/`` | 
| Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 654 | ~~~~~~~~~~~~~~~~~~~~~~~~~~ | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 655 |  | 
 | 656 | For efficiency, the OpenEmbedded build system creates and uses this | 
 | 657 | directory to hold recipes that share a work directory with other | 
 | 658 | recipes. In practice, this is only used for ``gcc`` and its variants | 
 | 659 | (e.g. ``gcc-cross``, ``libgcc``, ``gcc-runtime``, and so forth). | 
 | 660 |  | 
 | 661 | .. _structure-meta: | 
 | 662 |  | 
| Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame] | 663 | The Metadata --- ``meta/`` | 
 | 664 | ========================== | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 665 |  | 
 | 666 | As mentioned previously, :term:`Metadata` is the core of the | 
 | 667 | Yocto Project. Metadata has several important subdivisions: | 
 | 668 |  | 
 | 669 | .. _structure-meta-classes: | 
 | 670 |  | 
| Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 671 | ``meta/classes*/`` | 
 | 672 | ------------------ | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 673 |  | 
| Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 674 | These directories contain the ``*.bbclass`` files. Class files are used to | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 675 | abstract common code so it can be reused by multiple packages. Every | 
| Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 676 | package inherits the :ref:`ref-classes-base` file. Examples of other important | 
 | 677 | classes are :ref:`ref-classes-autotools`, which in theory allows any | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 678 | Autotool-enabled package to work with the Yocto Project with minimal | 
| Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 679 | effort. Another example is :ref:`ref-classes-kernel` that contains common code | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 680 | and functions for working with the Linux kernel. Functions like image | 
 | 681 | generation or packaging also have their specific class files such as | 
| Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 682 | :ref:`ref-classes-image`, :ref:`ref-classes-rootfs*` and | 
 | 683 | :ref:`package*.bbclass <ref-classes-package>`. | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 684 |  | 
 | 685 | For reference information on classes, see the | 
| Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 686 | ":doc:`/ref-manual/classes`" chapter. | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 687 |  | 
 | 688 | .. _structure-meta-conf: | 
 | 689 |  | 
 | 690 | ``meta/conf/`` | 
 | 691 | -------------- | 
 | 692 |  | 
 | 693 | This directory contains the core set of configuration files that start | 
 | 694 | from ``bitbake.conf`` and from which all other configuration files are | 
 | 695 | included. See the include statements at the end of the ``bitbake.conf`` | 
 | 696 | file and you will note that even ``local.conf`` is loaded from there. | 
 | 697 | While ``bitbake.conf`` sets up the defaults, you can often override | 
 | 698 | these by using the (``local.conf``) file, machine file or the | 
 | 699 | distribution configuration file. | 
 | 700 |  | 
 | 701 | .. _structure-meta-conf-machine: | 
 | 702 |  | 
 | 703 | ``meta/conf/machine/`` | 
| Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 704 | ~~~~~~~~~~~~~~~~~~~~~~ | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 705 |  | 
 | 706 | This directory contains all the machine configuration files. If you set | 
 | 707 | ``MACHINE = "qemux86"``, the OpenEmbedded build system looks for a | 
 | 708 | ``qemux86.conf`` file in this directory. The ``include`` directory | 
 | 709 | contains various data common to multiple machines. If you want to add | 
 | 710 | support for a new machine to the Yocto Project, look in this directory. | 
 | 711 |  | 
 | 712 | .. _structure-meta-conf-distro: | 
 | 713 |  | 
 | 714 | ``meta/conf/distro/`` | 
| Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 715 | ~~~~~~~~~~~~~~~~~~~~~ | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 716 |  | 
 | 717 | The contents of this directory controls any distribution-specific | 
 | 718 | configurations. For the Yocto Project, the ``defaultsetup.conf`` is the | 
| Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 719 | main file here. This directory includes the versions and the :term:`SRCDATE` | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 720 | definitions for applications that are configured here. An example of an | 
 | 721 | alternative configuration might be ``poky-bleeding.conf``. Although this | 
 | 722 | file mainly inherits its configuration from Poky. | 
 | 723 |  | 
 | 724 | .. _structure-meta-conf-machine-sdk: | 
 | 725 |  | 
 | 726 | ``meta/conf/machine-sdk/`` | 
| Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 727 | ~~~~~~~~~~~~~~~~~~~~~~~~~~ | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 728 |  | 
 | 729 | The OpenEmbedded build system searches this directory for configuration | 
 | 730 | files that correspond to the value of | 
 | 731 | :term:`SDKMACHINE`. By default, 32-bit and 64-bit x86 | 
 | 732 | files ship with the Yocto Project that support some SDK hosts. However, | 
 | 733 | it is possible to extend that support to other SDK hosts by adding | 
 | 734 | additional configuration files in this subdirectory within another | 
 | 735 | layer. | 
 | 736 |  | 
 | 737 | .. _structure-meta-files: | 
 | 738 |  | 
 | 739 | ``meta/files/`` | 
 | 740 | --------------- | 
 | 741 |  | 
 | 742 | This directory contains common license files and several text files used | 
 | 743 | by the build system. The text files contain minimal device information | 
 | 744 | and lists of files and directories with known permissions. | 
 | 745 |  | 
 | 746 | .. _structure-meta-lib: | 
 | 747 |  | 
 | 748 | ``meta/lib/`` | 
 | 749 | ------------- | 
 | 750 |  | 
 | 751 | This directory contains OpenEmbedded Python library code used during the | 
 | 752 | build process. | 
 | 753 |  | 
 | 754 | .. _structure-meta-recipes-bsp: | 
 | 755 |  | 
 | 756 | ``meta/recipes-bsp/`` | 
 | 757 | --------------------- | 
 | 758 |  | 
 | 759 | This directory contains anything linking to specific hardware or | 
 | 760 | hardware configuration information such as "u-boot" and "grub". | 
 | 761 |  | 
 | 762 | .. _structure-meta-recipes-connectivity: | 
 | 763 |  | 
 | 764 | ``meta/recipes-connectivity/`` | 
 | 765 | ------------------------------ | 
 | 766 |  | 
 | 767 | This directory contains libraries and applications related to | 
 | 768 | communication with other devices. | 
 | 769 |  | 
 | 770 | .. _structure-meta-recipes-core: | 
 | 771 |  | 
 | 772 | ``meta/recipes-core/`` | 
 | 773 | ---------------------- | 
 | 774 |  | 
 | 775 | This directory contains what is needed to build a basic working Linux | 
 | 776 | image including commonly used dependencies. | 
 | 777 |  | 
 | 778 | .. _structure-meta-recipes-devtools: | 
 | 779 |  | 
 | 780 | ``meta/recipes-devtools/`` | 
 | 781 | -------------------------- | 
 | 782 |  | 
 | 783 | This directory contains tools that are primarily used by the build | 
 | 784 | system. The tools, however, can also be used on targets. | 
 | 785 |  | 
 | 786 | .. _structure-meta-recipes-extended: | 
 | 787 |  | 
 | 788 | ``meta/recipes-extended/`` | 
 | 789 | -------------------------- | 
 | 790 |  | 
 | 791 | This directory contains non-essential applications that add features | 
 | 792 | compared to the alternatives in core. You might need this directory for | 
| William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 793 | full tool functionality. | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 794 |  | 
 | 795 | .. _structure-meta-recipes-gnome: | 
 | 796 |  | 
 | 797 | ``meta/recipes-gnome/`` | 
 | 798 | ----------------------- | 
 | 799 |  | 
 | 800 | This directory contains all things related to the GTK+ application | 
 | 801 | framework. | 
 | 802 |  | 
 | 803 | .. _structure-meta-recipes-graphics: | 
 | 804 |  | 
 | 805 | ``meta/recipes-graphics/`` | 
 | 806 | -------------------------- | 
 | 807 |  | 
 | 808 | This directory contains X and other graphically related system | 
 | 809 | libraries. | 
 | 810 |  | 
 | 811 | .. _structure-meta-recipes-kernel: | 
 | 812 |  | 
 | 813 | ``meta/recipes-kernel/`` | 
 | 814 | ------------------------ | 
 | 815 |  | 
 | 816 | This directory contains the kernel and generic applications and | 
 | 817 | libraries that have strong kernel dependencies. | 
 | 818 |  | 
| Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 819 | .. _structure-meta-recipes-multimedia: | 
 | 820 |  | 
 | 821 | ``meta/recipes-multimedia/`` | 
 | 822 | ---------------------------- | 
 | 823 |  | 
 | 824 | This directory contains codecs and support utilities for audio, images | 
 | 825 | and video. | 
 | 826 |  | 
 | 827 | .. _structure-meta-recipes-rt: | 
 | 828 |  | 
 | 829 | ``meta/recipes-rt/`` | 
 | 830 | -------------------- | 
 | 831 |  | 
 | 832 | This directory contains package and image recipes for using and testing | 
 | 833 | the ``PREEMPT_RT`` kernel. | 
 | 834 |  | 
 | 835 | .. _structure-meta-recipes-sato: | 
 | 836 |  | 
 | 837 | ``meta/recipes-sato/`` | 
 | 838 | ---------------------- | 
 | 839 |  | 
 | 840 | This directory contains the Sato demo/reference UI/UX and its associated | 
 | 841 | applications and configuration data. | 
 | 842 |  | 
 | 843 | .. _structure-meta-recipes-support: | 
 | 844 |  | 
 | 845 | ``meta/recipes-support/`` | 
 | 846 | ------------------------- | 
 | 847 |  | 
 | 848 | This directory contains recipes used by other recipes, but that are not | 
 | 849 | directly included in images (i.e. dependencies of other recipes). | 
 | 850 |  | 
 | 851 | .. _structure-meta-site: | 
 | 852 |  | 
 | 853 | ``meta/site/`` | 
 | 854 | -------------- | 
 | 855 |  | 
 | 856 | This directory contains a list of cached results for various | 
 | 857 | architectures. Because certain "autoconf" test results cannot be | 
 | 858 | determined when cross-compiling due to the tests not able to run on a | 
 | 859 | live system, the information in this directory is passed to "autoconf" | 
 | 860 | for the various architectures. | 
 | 861 |  | 
 | 862 | .. _structure-meta-recipes-txt: | 
 | 863 |  | 
 | 864 | ``meta/recipes.txt`` | 
 | 865 | -------------------- | 
 | 866 |  | 
 | 867 | This file is a description of the contents of ``recipes-*``. |