diff options
| author | Antonin Godard <antonin.godard@bootlin.com> | 2025-11-07 12:16:45 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-11-07 13:15:33 +0000 |
| commit | ef4ac510f6da2b6f34256159b57887f4c2117b2a (patch) | |
| tree | 1e71ed4bd778e848c5306ecbec23bbb6e814f200 /bitbake/doc | |
| parent | 524bac56d1c5c1ccc995ecd3b4d2eb2476b115c5 (diff) | |
| download | poky-ef4ac510f6da2b6f34256159b57887f4c2117b2a.tar.gz | |
bitbake: Add bitbake-setup documentation
Add documentation for bitbake-setup. This is split in 6 sections,
including a quick start guide, terminology and reference.
(Bitbake rev: 3089497efc7a1f3f143e151b9d5d024809269b9e)
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/doc')
| -rw-r--r-- | bitbake/doc/bitbake-user-manual/bitbake-user-manual-environment-setup.rst | 822 | ||||
| -rw-r--r-- | bitbake/doc/index.rst | 1 |
2 files changed, 823 insertions, 0 deletions
diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-environment-setup.rst b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-environment-setup.rst new file mode 100644 index 0000000000..66c0b0fa68 --- /dev/null +++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-environment-setup.rst | |||
| @@ -0,0 +1,822 @@ | |||
| 1 | .. SPDX-License-Identifier: CC-BY-2.5 | ||
| 2 | |||
| 3 | ============================================= | ||
| 4 | Setting Up The Environment With bitbake-setup | ||
| 5 | ============================================= | ||
| 6 | |||
| 7 | | | ||
| 8 | |||
| 9 | Setting up layers and configuring builds can be done with the | ||
| 10 | ``bitbake-setup`` tool. This tool acts as a top-level utility which can perform | ||
| 11 | the following tasks: | ||
| 12 | |||
| 13 | - Parse a JSON configuration file that describes what layers and which snippets | ||
| 14 | of configuration to use. | ||
| 15 | |||
| 16 | - Clone the layers onto the versions specified in the configuration file. | ||
| 17 | |||
| 18 | - Create and setup a directory ready for building what is specified in | ||
| 19 | configuration files. | ||
| 20 | |||
| 21 | - Behave according to global or per-project settings. | ||
| 22 | |||
| 23 | - Synchronize with upstream configuration changes. | ||
| 24 | |||
| 25 | Quick Start | ||
| 26 | =========== | ||
| 27 | |||
| 28 | #. ``bitbake-setup`` is part of the BitBake repository under | ||
| 29 | ``./bin/bitbake-setup``. To start, run: | ||
| 30 | |||
| 31 | .. code-block:: shell | ||
| 32 | |||
| 33 | $ ./bin/bitbake-setup init | ||
| 34 | |||
| 35 | This command will ask you to choose which configurations to use available as | ||
| 36 | part of the default BitBake :term:`generic configurations <generic | ||
| 37 | Configuration>`. | ||
| 38 | |||
| 39 | .. note:: | ||
| 40 | |||
| 41 | These default configurations are located in ``./bitbake/default-registry/``. | ||
| 42 | See the :ref:`ref-bbsetup-section-config-reference` section to learn more | ||
| 43 | about ``bitbake-setup`` input configuration files. | ||
| 44 | |||
| 45 | #. With the default choices, the ``bitbake-setup init`` command creates the | ||
| 46 | following directories:: | ||
| 47 | |||
| 48 | ~/bitbake-builds/ | ||
| 49 | └── poky-master-poky-distro_poky-machine_qemux86-64/ | ||
| 50 | ├── build/ | ||
| 51 | ├── config/ | ||
| 52 | └── layers/ | ||
| 53 | |||
| 54 | With: | ||
| 55 | |||
| 56 | - ``~/bitbake-build``: the :term:`Top Directory`, where ``bitbake-setup`` | ||
| 57 | configures everything. This directory can be configured with the | ||
| 58 | :ref:`ref-bbsetup-setting-top-dir-prefix` and | ||
| 59 | :ref:`ref-bbsetup-setting-top-dir-name` settings. | ||
| 60 | |||
| 61 | - ``poky-master-poky-distro_poky-machine_qemux86-64``: a :term:`Setup` | ||
| 62 | directory, which holds a :term:`Setup`: a result of the choices made | ||
| 63 | during the ``bitbake-setup init`` execution. | ||
| 64 | |||
| 65 | The name of the directory will vary depending on the choices. | ||
| 66 | |||
| 67 | - ``config/``: holds the :term:`Specific Configuration`, which embeds the | ||
| 68 | :term:`Generic Configuration` (first choice of the :ref:`ref-bbsetup-command-init` command) | ||
| 69 | and the choices made during the initialization. | ||
| 70 | |||
| 71 | - ``build/``: the :term:`BitBake Build` directory, where BitBake stores | ||
| 72 | its own configuration and outputs for the builds. | ||
| 73 | |||
| 74 | - ``layers/``: the directory where :ref:`layers | ||
| 75 | <bitbake-user-manual/bitbake-user-manual-intro:Layers>` and other | ||
| 76 | repositories managed by ``bitbake-setup`` are stored and updated. | ||
| 77 | |||
| 78 | #. Source the ``init-build-env`` file present in the :term:`BitBake Build` | ||
| 79 | directory: | ||
| 80 | |||
| 81 | .. code-block:: shell | ||
| 82 | |||
| 83 | $ source ./poky-master-poky-distro_poky-machine_qemux86-64/build/init-build-env | ||
| 84 | |||
| 85 | This command will prepare your current shell with the BitBake environment. | ||
| 86 | |||
| 87 | #. You can then start running ``bitbake`` in the current shell. For more information | ||
| 88 | on how to use ``bitbake``, see the :doc:`/bitbake-user-manual/bitbake-user-manual-execution` | ||
| 89 | section of this manual. | ||
| 90 | |||
| 91 | Terminology | ||
| 92 | =========== | ||
| 93 | |||
| 94 | The ``bitbake-setup`` tool revolves around some common terms we define in this | ||
| 95 | section. | ||
| 96 | |||
| 97 | ``bitbake-setup`` works with a specific hierarchy of directories, that can be | ||
| 98 | represented as follows:: | ||
| 99 | |||
| 100 | Top Directory | ||
| 101 | ├── Setup 1 | ||
| 102 | │ ├── build/ | ||
| 103 | │ ├── config/ | ||
| 104 | │ └── layers/ | ||
| 105 | ├── Setup 2 | ||
| 106 | │ ├── build/ | ||
| 107 | │ ├── config/ | ||
| 108 | │ └── layers/ | ||
| 109 | ... | ||
| 110 | |||
| 111 | The "Top Directory" and "Setup" directories are defined as follows: | ||
| 112 | |||
| 113 | .. glossary:: | ||
| 114 | :term:`Top Directory` | ||
| 115 | The top directory is the working directory of ``bitbake-setup``, where its | ||
| 116 | outputs end-up (unless otherwise configured by :term:`settings` such as | ||
| 117 | :ref:`ref-bbsetup-setting-dl-dir`). | ||
| 118 | |||
| 119 | The location of this directory can be changed with the | ||
| 120 | :ref:`ref-bbsetup-setting-top-dir-prefix` and | ||
| 121 | :ref:`ref-bbsetup-setting-top-dir-name` settings. | ||
| 122 | |||
| 123 | The top directory contains one or more :term:`Setup` directories, each of | ||
| 124 | them containing a :term:`Setup`. | ||
| 125 | |||
| 126 | :term:`Setup` | ||
| 127 | A Setup is the result of the :ref:`ref-bbsetup-command-init` | ||
| 128 | command, which creates a :term:`Setup` directory. It is constructed from a | ||
| 129 | :term:`Generic Configuration` and choices made during the ``init`` command. | ||
| 130 | |||
| 131 | It contains at least: | ||
| 132 | |||
| 133 | - A :term:`BitBake Build` (``build/`` directory). | ||
| 134 | - A :term:`Specific Configuration` (``config/`` directory). | ||
| 135 | - Sources such as :ref:`layers | ||
| 136 | <bitbake-user-manual/bitbake-user-manual-intro:Layers>` or other | ||
| 137 | repositories managed by ``bitbake-setup`` (``layers/`` directory). | ||
| 138 | |||
| 139 | The following components are involved to create the content of these directories: | ||
| 140 | |||
| 141 | .. glossary:: | ||
| 142 | :term:`BitBake Build` | ||
| 143 | A BitBake Build is a sub-tree inside a :term:`Setup` that BitBake itself | ||
| 144 | operates on. The files in the ``conf/`` directory of a :term:`BitBake | ||
| 145 | Build` constitute the :ref:`BitBake configuration | ||
| 146 | <bitbake-user-manual/bitbake-user-manual-intro:Configuration Files>`. | ||
| 147 | |||
| 148 | :term:`Generic Configuration` | ||
| 149 | A Generic Configuration is a file in JSON format containing a template to | ||
| 150 | create a :term:`Setup`. These files are used during the :ref:`ref-bbsetup-command-init` | ||
| 151 | command as a starting point to configure the :term:`Setup`. When the | ||
| 152 | command runs, the user may be prompted with choices to further specify the | ||
| 153 | :term:`Setup` to create. | ||
| 154 | |||
| 155 | It is also possible to specify the choices on the command line for a | ||
| 156 | completely non-interactive initialization. | ||
| 157 | |||
| 158 | :term:`Generic Configuration` files are stored in :term:`registries | ||
| 159 | <Registry>`, and can be listed with the :ref:`ref-bbsetup-command-list` | ||
| 160 | command. | ||
| 161 | |||
| 162 | :term:`Generic Configuration` files must end with the ``.conf.json`` | ||
| 163 | suffix for ``bitbake-setup`` to locate them. | ||
| 164 | |||
| 165 | .. note:: | ||
| 166 | |||
| 167 | The default :term:`Generic Configurations <Generic Configuration>` are | ||
| 168 | located in the BitBake repository in a local registry. the | ||
| 169 | ``default-registry/`` directory. This can be modified with the | ||
| 170 | :ref:`ref-bbsetup-setting-registry` setting. | ||
| 171 | |||
| 172 | :ref:`ref-bbsetup-command-status` will tell if a :term:`Setup` | ||
| 173 | is in sync with the :term:`Generic Configuration` it was constructed from | ||
| 174 | (typically: layer updates). | ||
| 175 | |||
| 176 | :ref:`ref-bbsetup-command-update` will bring a :term:`Setup` | ||
| 177 | in sync with its :term:`Generic Configuration`. | ||
| 178 | |||
| 179 | :term:`Specific Configuration` | ||
| 180 | The :term:`Specific Configuration` is stored in the ``config/`` directory | ||
| 181 | in a :term:`Setup`. It embeds the :term:`Generic Configuration` and the | ||
| 182 | choices made during the initialization. | ||
| 183 | |||
| 184 | It is also a Git repository, that contains a history of the specific | ||
| 185 | configuration and updates made to it via :ref:`ref-bbsetup-command-update`. | ||
| 186 | |||
| 187 | :term:`Registry` | ||
| 188 | A configuration registry is a place where one or more :term:`Generic | ||
| 189 | Configurations <Generic Configuration>` are stored. | ||
| 190 | |||
| 191 | The directory structure of the registry can be any: ``bitbake-setup`` | ||
| 192 | recursively find files ending with ``.conf.json`` and consider it a | ||
| 193 | :term:`Generic Configuration`. | ||
| 194 | |||
| 195 | The registry location is configured through the | ||
| 196 | :ref:`ref-bbsetup-setting-registry` setting. This location can be the URL to | ||
| 197 | a Git repository, a local directory, or any URI supported by the BitBake | ||
| 198 | fetcher (see the :doc:`/bitbake-user-manual/bitbake-user-manual-fetching` | ||
| 199 | section for more information on fetchers). | ||
| 200 | |||
| 201 | :term:`Settings` | ||
| 202 | Settings are operational parameters that are global to all builds under a | ||
| 203 | :term:`Top Directory`, stored in a ``settings.conf`` file. For example, | ||
| 204 | this could be the location of the configuration registry, or where the | ||
| 205 | BitBake fetcher should store the downloads. | ||
| 206 | |||
| 207 | There are also global settings, common to all top directories that are | ||
| 208 | stored in ``~/.config/bitbake-setup/settings.conf``. | ||
| 209 | |||
| 210 | See the :ref:`bitbake-user-manual/bitbake-user-manual-environment-setup:Settings` | ||
| 211 | section to see the supported settings and where they can be stored. | ||
| 212 | |||
| 213 | :term:`Source Override` | ||
| 214 | A source override is a JSON file that can be used to modify revisions and | ||
| 215 | origins of layers or other sources that need to be checked out into a | ||
| 216 | :term:`Setup` (in the ``layers/`` directory). It can be useful for example | ||
| 217 | when the master branches need to be changed to master-next for the purpose | ||
| 218 | of testing, or to set up a CI pipeline that tests code in a pull request | ||
| 219 | coming from a developer's repository and branch. | ||
| 220 | |||
| 221 | Such a file is specified with a command-line option to | ||
| 222 | :ref:`ref-bbsetup-command-init`. | ||
| 223 | |||
| 224 | See the :ref:`ref-bbsetup-source-overrides` section for more information on | ||
| 225 | the format of these files. | ||
| 226 | |||
| 227 | The ``bitbake-setup`` command | ||
| 228 | ============================= | ||
| 229 | |||
| 230 | The ``bitbake-setup`` program has general options and sub-commands. These can be | ||
| 231 | obtained using ``bitbake-setup --help``. | ||
| 232 | |||
| 233 | The general options, common to all commands, are: | ||
| 234 | |||
| 235 | - ``-h`` or ``--help``: Show the help message and exit. | ||
| 236 | - ``-d`` or ``--debug``: Enable debug outputs. | ||
| 237 | - ``-q`` or ``--quiet``: Print only errors. | ||
| 238 | - ``--color``: Colorize output (where COLOR is auto, always, never). | ||
| 239 | - ``--no-network``: Do not check whether configuration repositories and layer | ||
| 240 | repositories have been updated; use only the local cache. | ||
| 241 | - ``--global-settings``: Path to the global settings file. | ||
| 242 | - ``--setting``: Modify a setting (for this bitbake-setup invocation only). | ||
| 243 | For example ``--setting default top-dir-prefix /path/to/top-dir``. | ||
| 244 | |||
| 245 | .. _ref-bbsetup-command-init: | ||
| 246 | |||
| 247 | ``bitbake-setup init`` | ||
| 248 | ---------------------- | ||
| 249 | |||
| 250 | The ``bitbake-setup init`` sub-command helps initializing a :term:`Setup`. | ||
| 251 | |||
| 252 | This command can be run without any arguments to prompt the user with | ||
| 253 | configuration options to choose from. These configuration options are taken from | ||
| 254 | the input :term:`Generic Configuration` files in the :term:`registry`. | ||
| 255 | |||
| 256 | .. note:: | ||
| 257 | |||
| 258 | The registry location can be set with the :ref:`ref-bbsetup-setting-registry` | ||
| 259 | setting and the :ref:`ref-bbsetup-command-settings` command. | ||
| 260 | |||
| 261 | Otherwise, the first argument to :ref:`ref-bbsetup-command-init` can be: | ||
| 262 | |||
| 263 | - A generic configuration ID in the registry. | ||
| 264 | - A path to a generic configuration file on a local disk. | ||
| 265 | - An HTTP URI to the generic configuration file. | ||
| 266 | |||
| 267 | The choices made during the bare ``bitbake-setup init`` command can also be | ||
| 268 | passed directly on the command-line, for example:: | ||
| 269 | |||
| 270 | bitbake-setup init <generic config> poky distro/poky-tiny ... | ||
| 271 | |||
| 272 | ``bitbake-setup`` will stop and ask to make a choice if the above command does | ||
| 273 | not contain all of the required configurations to complete the sequence of | ||
| 274 | choices. | ||
| 275 | |||
| 276 | In addition, the command can take the following arguments: | ||
| 277 | |||
| 278 | - ``--non-interactive``: can be used to create :term:`Setups <Setup>` | ||
| 279 | without interactions from the user. The command will fail if not all the | ||
| 280 | required choices are provided in the command. | ||
| 281 | |||
| 282 | - ``--source-overrides``: can be used to pass one or more | ||
| 283 | :ref:`source override <ref-bbsetup-source-overrides>`. See the | ||
| 284 | :ref:`ref-bbsetup-source-overrides` section. | ||
| 285 | |||
| 286 | - ``--setup-dir-name``: can be used to configure the name of the :term:`Setup` | ||
| 287 | directory. | ||
| 288 | |||
| 289 | - ``--skip-selection``: can be used to skip some of the choices | ||
| 290 | (which may result in an incomplete :term:`Setup`!) | ||
| 291 | |||
| 292 | ``bitbake-setup init`` Examples | ||
| 293 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 294 | |||
| 295 | - This example prompts the user to choose a :term:`Generic Configuration` from | ||
| 296 | a custom registry: | ||
| 297 | |||
| 298 | .. code-block:: shell | ||
| 299 | |||
| 300 | $ ./bitbake/bin/bitbake-setup \ | ||
| 301 | --setting default registry 'git://example.com/bitbake-setup-configurations.git;protocol=https;branch=main;rev=main' \ | ||
| 302 | init | ||
| 303 | |||
| 304 | - This example takes a :term:`Generic Configuration` from a remote location | ||
| 305 | (here, one of the default configuration in BitBake): | ||
| 306 | |||
| 307 | .. code-block:: shell | ||
| 308 | |||
| 309 | $ ./bitbake/bin/bitbake-setup init https://git.openembedded.org/bitbake/plain/default-registry/configurations/oe-nodistro.conf.json | ||
| 310 | |||
| 311 | - This example initializes a :term:`Setup` with: | ||
| 312 | |||
| 313 | - A custom :ref:`ref-bbsetup-setting-top-dir-prefix` and :ref:`ref-bbsetup-setting-top-dir-name` | ||
| 314 | - A :term:`source override`. | ||
| 315 | - A standalone :term:`generic configuration` file. | ||
| 316 | - Choices passed on the command-line, applied non-interactively. | ||
| 317 | |||
| 318 | .. code-block:: shell | ||
| 319 | |||
| 320 | $ ./bitbake/bin/bitbake-setup \ | ||
| 321 | --setting default top-dir-prefix /work/bitbake-setup \ | ||
| 322 | --setting default top-dir-name custom-project \ | ||
| 323 | init \ | ||
| 324 | --non-interactive \ | ||
| 325 | --source-overrides develop-branch.json \ | ||
| 326 | ./gadget_master.conf.json \ | ||
| 327 | gadget distro/gadget machine/gadget | ||
| 328 | |||
| 329 | .. _ref-bbsetup-command-list: | ||
| 330 | |||
| 331 | ``bitbake-setup list`` | ||
| 332 | ---------------------- | ||
| 333 | |||
| 334 | The ``bitbake-setup list`` sub-command lists the available :term:`generic | ||
| 335 | configurations <generic configuration>` in the current :term:`registry`. | ||
| 336 | |||
| 337 | In addition, the command can take the following arguments: | ||
| 338 | |||
| 339 | - ``--with-expired``: list the expired configuration (e.g. older Yocto releases | ||
| 340 | that have reached their End-Of-Life dates). | ||
| 341 | |||
| 342 | - ``--write-json``: write the configurations into a JSON file so they can be | ||
| 343 | programmatically processed. | ||
| 344 | |||
| 345 | .. _ref-bbsetup-command-status: | ||
| 346 | |||
| 347 | ``bitbake-setup status`` | ||
| 348 | ------------------------ | ||
| 349 | |||
| 350 | The ``bitbake-setup status`` sub-command shows the status of a | ||
| 351 | :term:`Setup`. Any differences between the local copy of the :term:`generic | ||
| 352 | configuration` and the upstream one are printed on the console. | ||
| 353 | |||
| 354 | If the BitBake environment is sourced and ready to build, the ``bitbake-setup | ||
| 355 | status`` command (without any arguments) will show the status of the current | ||
| 356 | :term:`Setup`. | ||
| 357 | |||
| 358 | In addition, the command can take the following arguments: | ||
| 359 | |||
| 360 | - ``--setup-dir``: path to the :term:`Setup` to check to status for. Not | ||
| 361 | required if the command is invoked from an initialized BitBake environment | ||
| 362 | that contains :term:`BBPATH`. | ||
| 363 | |||
| 364 | .. _ref-bbsetup-command-update: | ||
| 365 | |||
| 366 | ``bitbake-setup update`` | ||
| 367 | ------------------------ | ||
| 368 | |||
| 369 | The ``bitbake-setup update`` sub-command updates a :term:`Setup` to sync with | ||
| 370 | the latest changes from a :term:`generic configuration` it was constructed from. | ||
| 371 | The :ref:`ref-bbsetup-command-status` command can be used to show the current | ||
| 372 | status of the :term:`Setup` before updating it. | ||
| 373 | |||
| 374 | In addition, the command can take the following arguments: | ||
| 375 | |||
| 376 | - ``--setup-dir``: path to the :term:`Setup` to update. Not required if the | ||
| 377 | command is invoked from an initialized BitBake environment that contains | ||
| 378 | :term:`BBPATH`. | ||
| 379 | |||
| 380 | .. _ref-bbsetup-command-install-buildtools: | ||
| 381 | |||
| 382 | ``bitbake-setup install-buildtools`` | ||
| 383 | ------------------------------------ | ||
| 384 | |||
| 385 | The ``bitbake-setup install-buildtools`` sub-command installs and extracts a | ||
| 386 | buildtools tarball into the specified :term:`Setup`. | ||
| 387 | |||
| 388 | After completion, help is printed to help the user on how to use the extracted | ||
| 389 | tarball. | ||
| 390 | |||
| 391 | .. note:: | ||
| 392 | |||
| 393 | The purpose of the Buildtools tarball is to provide tools needed to run | ||
| 394 | BitBake on build machines where such tools cannot be easily obtained from the | ||
| 395 | host Linux distribution (for example on older distribution versions that do | ||
| 396 | not contain a recent enough GCC compiler or Python interpreter, or machines | ||
| 397 | where the user running BitBake cannot easily install additional software into | ||
| 398 | the system). This command requires that the OpenEmbedded-core layer is | ||
| 399 | present in the BitBake configuration. | ||
| 400 | |||
| 401 | See https://docs.yoctoproject.org/ref-manual/system-requirements.html#required-git-tar-python-make-and-gcc-versions | ||
| 402 | for more information. | ||
| 403 | |||
| 404 | In addition, the command can take the following arguments: | ||
| 405 | |||
| 406 | - ``--force``: force the re-installation of the tarball. | ||
| 407 | |||
| 408 | - ``--setup-dir``: path to the :term:`Setup` to check to status for. Not | ||
| 409 | required if :term:`BBPATH` is already configured. | ||
| 410 | |||
| 411 | .. _ref-bbsetup-command-settings: | ||
| 412 | |||
| 413 | ``bitbake-setup settings`` | ||
| 414 | -------------------------- | ||
| 415 | |||
| 416 | The ``bitbake-setup settings`` sub-command helps modifying the settings of | ||
| 417 | ``bitbake-setup``. This sub-command has sub-commands itself: | ||
| 418 | |||
| 419 | - ``bitbake-setup settings list`` lists the current settings and their value. | ||
| 420 | - ``bitbake-setup settings set`` sets a setting. | ||
| 421 | - ``bitbake-setup settings unset`` removes a setting. | ||
| 422 | |||
| 423 | Settings must be set with a section and a value, for example:: | ||
| 424 | |||
| 425 | bitbake-setup setting set default top-dir-name bitbake-builds | ||
| 426 | |||
| 427 | Will set the value of ``top-dir-name`` in the ``default`` section to | ||
| 428 | "bitbake-builds". | ||
| 429 | |||
| 430 | In addition, the command can take the following arguments: | ||
| 431 | |||
| 432 | - ``--global``: write to the global settings | ||
| 433 | (``~/.config/bitbake-setup/settings.conf``) instead of the :term:`Top | ||
| 434 | Directory` settings. | ||
| 435 | |||
| 436 | See the :ref:`bitbake-user-manual/bitbake-user-manual-environment-setup:Settings` | ||
| 437 | section to see the supported settings. | ||
| 438 | |||
| 439 | .. note:: | ||
| 440 | |||
| 441 | The supported setting listed in the | ||
| 442 | :ref:`bitbake-user-manual/bitbake-user-manual-environment-setup:Settings` | ||
| 443 | section are only affected when set in the ``default`` section. | ||
| 444 | |||
| 445 | Settings | ||
| 446 | ======== | ||
| 447 | |||
| 448 | The settings allow configuring ``bitbake-setup``. Settings are stored in a file | ||
| 449 | named ``settings.conf``, in :wikipedia:`INI <INI_file>` format. | ||
| 450 | |||
| 451 | There are multiple locations for storing settings. Settings in different | ||
| 452 | locations can override each other, but the final value of a setting is computed | ||
| 453 | from reading the files in this order: | ||
| 454 | |||
| 455 | #. Global settings file: ``~/.config/bitbake-setup/settings.conf``. | ||
| 456 | |||
| 457 | #. Local settings file, taken from a ``settings.conf`` file in the :term:`Top | ||
| 458 | Directory`. | ||
| 459 | |||
| 460 | #. Command-line settings, passed with the ``--setting`` argument. | ||
| 461 | |||
| 462 | A valid settings file would for example be: | ||
| 463 | |||
| 464 | .. code-block:: ini | ||
| 465 | |||
| 466 | [default] | ||
| 467 | top-dir-prefix = /path/to/workspace | ||
| 468 | top-dir-name = bitbake-builds | ||
| 469 | registry = /path/to/bitbake/default-registry | ||
| 470 | dl-dir = /path/to/bitbake-setup-downloads | ||
| 471 | |||
| 472 | Settings and their values can be listed and modified with the ``bitbake-setup | ||
| 473 | settings`` command. See the :ref:`ref-bbsetup-command-settings` section for | ||
| 474 | more information. | ||
| 475 | |||
| 476 | Below are the available settings. | ||
| 477 | |||
| 478 | .. _ref-bbsetup-setting-top-dir-prefix: | ||
| 479 | |||
| 480 | ``top-dir-prefix`` | ||
| 481 | ------------------ | ||
| 482 | |||
| 483 | The :ref:`ref-bbsetup-setting-top-dir-prefix` setting helps configuring the | ||
| 484 | leftmost part of the path to the :term:`Top Directory`. | ||
| 485 | |||
| 486 | For example, with: | ||
| 487 | |||
| 488 | .. code-block:: ini | ||
| 489 | |||
| 490 | [default] | ||
| 491 | top-dir-prefix = /path/to/workspace | ||
| 492 | |||
| 493 | The :term:`top directory` would be ``/path/to/workspace/<top-dir-name>`` with | ||
| 494 | the ``<top-dir-name>`` corresponding to the :ref:`ref-bbsetup-setting-top-dir-name` | ||
| 495 | setting. | ||
| 496 | |||
| 497 | This is most useful to customize on systems where the default location of the | ||
| 498 | :term:`Top Directory` (``~/bitbake-builds``) is not suitable, and there is a | ||
| 499 | dedicated directory for builds somewhere else. | ||
| 500 | |||
| 501 | .. _ref-bbsetup-setting-top-dir-name: | ||
| 502 | |||
| 503 | ``top-dir-name`` | ||
| 504 | ---------------- | ||
| 505 | |||
| 506 | The :ref:`ref-bbsetup-setting-top-dir-name` setting helps configuring the | ||
| 507 | rightmost part of the path to the :term:`Top Directory`. | ||
| 508 | |||
| 509 | For example, with: | ||
| 510 | |||
| 511 | .. code-block:: ini | ||
| 512 | |||
| 513 | [default] | ||
| 514 | top-dir-name = builds | ||
| 515 | |||
| 516 | The :term:`top directory` would be ``<top-dir-prefix>/builds`` with | ||
| 517 | the ``<top-dir-prefix>`` corresponding to the :ref:`ref-bbsetup-setting-top-dir-prefix` | ||
| 518 | setting. | ||
| 519 | |||
| 520 | .. _ref-bbsetup-setting-registry: | ||
| 521 | |||
| 522 | ``registry`` | ||
| 523 | ------------ | ||
| 524 | |||
| 525 | The :ref:`ref-bbsetup-setting-registry` setting sets the URI location of the | ||
| 526 | registry. This URI can be any URI supported by the BitBake fetcher. | ||
| 527 | |||
| 528 | A local registry would be configured as follows: | ||
| 529 | |||
| 530 | .. code-block:: ini | ||
| 531 | |||
| 532 | [default] | ||
| 533 | registry = /path/to/registry | ||
| 534 | |||
| 535 | When using another fetcher, it must be specified in the URI scheme. For example: | ||
| 536 | |||
| 537 | .. code-block:: ini | ||
| 538 | |||
| 539 | [default] | ||
| 540 | registry = git://example.com/bitbake-setup-configurations;protocol=https;branch=master;rev=master | ||
| 541 | |||
| 542 | This would fetch the remote configurations from a remote Git remote repository, | ||
| 543 | on the ``master`` branch. | ||
| 544 | |||
| 545 | See the :doc:`/bitbake-user-manual/bitbake-user-manual-fetching` section for more | ||
| 546 | information on BitBake fetchers. | ||
| 547 | |||
| 548 | .. _ref-bbsetup-setting-dl-dir: | ||
| 549 | |||
| 550 | ``dl-dir`` | ||
| 551 | ---------- | ||
| 552 | |||
| 553 | The :ref:`ref-bbsetup-setting-dl-dir` setting sets the location of the download | ||
| 554 | cache that ``bitbake-setup`` will configure for the purpose of downloading | ||
| 555 | configuration repositories, layers and other sources using BitBake fetchers. | ||
| 556 | Please see :doc:`/bitbake-user-manual/bitbake-user-manual-fetching` and the | ||
| 557 | :term:`DL_DIR` variable for more information. | ||
| 558 | |||
| 559 | The location can be set such that it is shared with :term:`DL_DIR` specified by | ||
| 560 | BitBake builds, so that there is a single directory containing a copy of | ||
| 561 | everything needed to set up and run a BitBake build offline in a reproducible | ||
| 562 | manner. | ||
| 563 | |||
| 564 | .. _ref-bbsetup-section-config-reference: | ||
| 565 | |||
| 566 | Generic Configuration Files Reference | ||
| 567 | ===================================== | ||
| 568 | |||
| 569 | :term:`Generic Configurations <Generic Configuration>` are the input files given | ||
| 570 | to ``bitbake-setup`` to configure :term:`Setups <Setup>`. | ||
| 571 | |||
| 572 | These files are written in the JSON file format and are stored in a | ||
| 573 | :term:`Registry`. They can also be standalone files directly passed to the | ||
| 574 | :ref:`ref-bbsetup-command-init` command: | ||
| 575 | |||
| 576 | .. code-block:: shell | ||
| 577 | |||
| 578 | $ bitbake-setup init /path/to/config.conf.json | ||
| 579 | |||
| 580 | They contain the following sections: | ||
| 581 | |||
| 582 | - ``version`` (**required**): version of the configuration file. | ||
| 583 | |||
| 584 | Example: | ||
| 585 | |||
| 586 | .. code-block:: json | ||
| 587 | :force: | ||
| 588 | |||
| 589 | { | ||
| 590 | "version": "1.0" | ||
| 591 | } | ||
| 592 | |||
| 593 | - ``description`` (**required**): the description of the configuration. | ||
| 594 | |||
| 595 | Example: | ||
| 596 | |||
| 597 | .. code-block:: json | ||
| 598 | :force: | ||
| 599 | |||
| 600 | { | ||
| 601 | "description": "OpenEmbedded - 'nodistro' basic configuration" | ||
| 602 | } | ||
| 603 | |||
| 604 | - ``sources`` (*optional*): Git repositories to fetch. | ||
| 605 | |||
| 606 | Example: | ||
| 607 | |||
| 608 | .. code-block:: json | ||
| 609 | :force: | ||
| 610 | |||
| 611 | { | ||
| 612 | "sources": { | ||
| 613 | "bitbake": { | ||
| 614 | "git-remote": { | ||
| 615 | "remotes": { | ||
| 616 | "origin": { | ||
| 617 | "uri": "git://git.openembedded.org/bitbake;protocol=https" | ||
| 618 | } | ||
| 619 | }, | ||
| 620 | "branch": "master", | ||
| 621 | "rev": "master" | ||
| 622 | }, | ||
| 623 | "path": "bitbake" | ||
| 624 | } | ||
| 625 | } | ||
| 626 | } | ||
| 627 | |||
| 628 | Sources can be specified with the following options: | ||
| 629 | |||
| 630 | - ``uri`` (**required**): a URI that follows the BitBake Git fetcher syntax. | ||
| 631 | See the :doc:`/bitbake-user-manual/bitbake-user-manual-fetching` section | ||
| 632 | for more information on the Git fetcher. | ||
| 633 | |||
| 634 | - ``rev`` (**required**): the revision to checkout. Can be the name of the | ||
| 635 | branch to checkout on the latest revision of the specified ``branch``. | ||
| 636 | |||
| 637 | If the value is the branch name, ``bitbake-setup`` will check out the | ||
| 638 | latest revision on that branch, and keep it updated when using the | ||
| 639 | :ref:`ref-bbsetup-command-update` command. | ||
| 640 | |||
| 641 | - ``branch`` (**required**): the Git branch, used to check that the | ||
| 642 | specified ``rev`` is indeed on that branch. | ||
| 643 | |||
| 644 | - ``path`` is where the source is extracted. | ||
| 645 | |||
| 646 | - ``expires`` (*optional*): Expiration date of the configuration. This date | ||
| 647 | should be in :wikipedia:`ISO 8601 <ISO_8601>` format (``YYYY-MM-DDTHH:MM:SS``). | ||
| 648 | |||
| 649 | - ``bitbake-setup`` (**required**): contains a list of configurations. | ||
| 650 | |||
| 651 | Example: | ||
| 652 | |||
| 653 | .. code-block:: json | ||
| 654 | |||
| 655 | { | ||
| 656 | "bitbake-setup": { | ||
| 657 | "configurations": [ | ||
| 658 | { | ||
| 659 | "bb-layers": ["openembedded-core/meta","meta-yocto/meta-yocto-bsp","meta-yocto/meta-poky"], | ||
| 660 | "bb-env-passthrough-additions": ["DL_DIR","SSTATE_DIR"], | ||
| 661 | "oe-fragments-one-of": { | ||
| 662 | "machine": { | ||
| 663 | "description": "Target machines", | ||
| 664 | "options" : ["machine/qemux86-64", "machine/qemuarm64", "machine/qemuriscv64", "machine/genericarm64", "machine/genericx86-64"] | ||
| 665 | }, | ||
| 666 | "distro": { | ||
| 667 | "description": "Distribution configuration variants", | ||
| 668 | "options" : ["distro/poky", "distro/poky-altcfg", "distro/poky-tiny"] | ||
| 669 | } | ||
| 670 | }, | ||
| 671 | "configurations": [ | ||
| 672 | { | ||
| 673 | "name": "poky", | ||
| 674 | "description": "Poky - The Yocto Project testing distribution" | ||
| 675 | }, | ||
| 676 | { | ||
| 677 | "name": "poky-with-sstate", | ||
| 678 | "description": "Poky - The Yocto Project testing distribution with internet sstate acceleration. Use with caution as it requires a completely robust local network with sufficient bandwidth.", | ||
| 679 | "oe-fragments": ["core/yocto/sstate-mirror-cdn"] | ||
| 680 | } | ||
| 681 | ] | ||
| 682 | } | ||
| 683 | ] | ||
| 684 | } | ||
| 685 | } | ||
| 686 | |||
| 687 | Configurations can be specified with the following options: | ||
| 688 | |||
| 689 | - ``name`` (**required**): the name of this configuration snippet. This is | ||
| 690 | what is prompted during the :ref:`ref-bbsetup-command-init` command | ||
| 691 | execution. | ||
| 692 | |||
| 693 | - ``description`` (**required**): the description of this configuration | ||
| 694 | snippet. This is what is prompted during the | ||
| 695 | :ref:`ref-bbsetup-command-init` command execution. | ||
| 696 | |||
| 697 | - ``configurations``: Configurations can recursively contain as many nested | ||
| 698 | configurations as needed. This will create more choices when running the | ||
| 699 | :ref:`ref-bbsetup-command-init` command. | ||
| 700 | |||
| 701 | The purpose of such nesting is to be able to scale the configurations, for | ||
| 702 | example when there is a need to create multiple configurations that share | ||
| 703 | some parameters (which are specified in their common parent), but differ | ||
| 704 | between themselves in other parameters. ``bitbake-setup`` will assemble | ||
| 705 | configuration choices by putting together information from a leaf | ||
| 706 | configuration and all of its ancestors. | ||
| 707 | |||
| 708 | - ``bb-env-passthrough-additions`` (*optional*): List of environment | ||
| 709 | variables to include in :term:`BB_ENV_PASSTHROUGH_ADDITIONS`. | ||
| 710 | |||
| 711 | - ``bb-layers`` (*optional*): List of layers to add to the ``bblayers.conf`` | ||
| 712 | file. Paths in this list are relative to the ``layers/`` directory of a | ||
| 713 | :term:`Setup`. | ||
| 714 | |||
| 715 | The ``bb-layers`` keyword cannot be used in conjunction with the | ||
| 716 | ``oe-template`` option, as the ``bblayers.conf`` file comes from the | ||
| 717 | template itself. | ||
| 718 | |||
| 719 | - ``bb-layers-file-relative`` (*optional*): List of layers that are not | ||
| 720 | managed by ``bitbake-setup`` but that need to be included as part of the | ||
| 721 | ``bblayers.conf`` file. Paths in this list are relative to the | ||
| 722 | configuration file. | ||
| 723 | |||
| 724 | This is useful when (one or more) configuration files and (one or | ||
| 725 | more) layers are hosted in the same Git repository, which is cloned | ||
| 726 | and managed independently from bitbake-setup workflows. For example:: | ||
| 727 | |||
| 728 | ├── meta-myproject/ | ||
| 729 | └── myproject.conf.json | ||
| 730 | |||
| 731 | Then ``myproject.conf.json`` can contain the following to add | ||
| 732 | ``meta-myproject`` to ``bblayers.conf``:: | ||
| 733 | |||
| 734 | { | ||
| 735 | ... | ||
| 736 | "bb-layers-file-relative": [ | ||
| 737 | "meta-myproject" | ||
| 738 | ], | ||
| 739 | ... | ||
| 740 | } | ||
| 741 | |||
| 742 | The ``bb-layers-file-relative`` keyword cannot be used in conjunction with the | ||
| 743 | ``oe-template`` keyword, as the ``bblayers.conf`` file comes from the | ||
| 744 | template itself. | ||
| 745 | |||
| 746 | - ``oe-template`` (*optional*, OpenEmbedded specific): OpenEmbedded template | ||
| 747 | to use. This cannot be used in conjunction with the | ||
| 748 | ``bb-layers`` or ``bb-layers-file-relative`` keywords as it | ||
| 749 | already provides a ready ``bblayers.conf`` file to use. | ||
| 750 | |||
| 751 | See https://docs.yoctoproject.org/dev-manual/custom-template-configuration-directory.html | ||
| 752 | for more information of OpenEmbedded templates. | ||
| 753 | |||
| 754 | - ``oe-fragments-one-of`` (*optional*, OpenEmbedded specific): the OpenEmbedded | ||
| 755 | fragments to select as part of the build. | ||
| 756 | |||
| 757 | This will trigger choices to make during the | ||
| 758 | :ref:`ref-bbsetup-command-init` command execution. | ||
| 759 | |||
| 760 | See https://docs.yoctoproject.org/dev/ref-manual/fragments.html for | ||
| 761 | more information of OpenEmbedded configuration fragments. | ||
| 762 | |||
| 763 | - ``oe-fragments`` (*optional*, OpenEmbedded specific): fragments to select | ||
| 764 | as part of the build. | ||
| 765 | |||
| 766 | See https://docs.yoctoproject.org/dev/ref-manual/fragments.html for | ||
| 767 | more information of OpenEmbedded configuration fragments. | ||
| 768 | |||
| 769 | Generic Configuration Examples | ||
| 770 | ------------------------------ | ||
| 771 | |||
| 772 | OpenEmbedded "nodistro" configuration for master branches: | ||
| 773 | |||
| 774 | .. literalinclude:: ../../default-registry/configurations/oe-nodistro.conf.json | ||
| 775 | :language: json | ||
| 776 | |||
| 777 | Poky distribution configuration for master branches: | ||
| 778 | |||
| 779 | .. literalinclude:: ../../default-registry/configurations/poky-master.conf.json | ||
| 780 | :language: json | ||
| 781 | |||
| 782 | .. _ref-bbsetup-source-overrides: | ||
| 783 | |||
| 784 | Source Overrides | ||
| 785 | ================ | ||
| 786 | |||
| 787 | See the definition of :term:`Source Override` in the Terminology section. | ||
| 788 | |||
| 789 | These files are written in the JSON file format and are optionally passed to the | ||
| 790 | ``--source-overrides`` argument of the :ref:`ref-bbsetup-command-init` command. | ||
| 791 | The ``--source-overrides`` option can be passed multiple times, in which case the | ||
| 792 | overrides are applied in the order specified in the command-line. | ||
| 793 | |||
| 794 | Here is an example file that overrides the branch of the BitBake repository to | ||
| 795 | "master-next": | ||
| 796 | |||
| 797 | .. code-block:: json | ||
| 798 | |||
| 799 | { | ||
| 800 | "description": "Source override file", | ||
| 801 | "sources": { | ||
| 802 | "bitbake": { | ||
| 803 | "git-remote": { | ||
| 804 | "branch": "master-next", | ||
| 805 | "remotes": { | ||
| 806 | "origin": { | ||
| 807 | "uri": "git://git.openembedded.org/bitbake;protocol=https" | ||
| 808 | } | ||
| 809 | }, | ||
| 810 | "rev": "master-next" | ||
| 811 | } | ||
| 812 | } | ||
| 813 | }, | ||
| 814 | "version": "1.0" | ||
| 815 | } | ||
| 816 | |||
| 817 | - The ``version`` parameter contains the version of the used configuration, and | ||
| 818 | should match the one of the :term:`Generic Configuration` file in use. | ||
| 819 | |||
| 820 | - The ``sources`` section contains the same options as the ``sources`` option | ||
| 821 | of a :term:`Generic Configuration` file. See the | ||
| 822 | :ref:`ref-bbsetup-section-config-reference` section for more information. | ||
diff --git a/bitbake/doc/index.rst b/bitbake/doc/index.rst index 546ef36c16..9f2a9067d3 100644 --- a/bitbake/doc/index.rst +++ b/bitbake/doc/index.rst | |||
| @@ -12,6 +12,7 @@ BitBake User Manual | |||
| 12 | 12 | ||
| 13 | bitbake-user-manual/bitbake-user-manual-intro | 13 | bitbake-user-manual/bitbake-user-manual-intro |
| 14 | bitbake-user-manual/bitbake-user-manual-execution | 14 | bitbake-user-manual/bitbake-user-manual-execution |
| 15 | bitbake-user-manual/bitbake-user-manual-environment-setup | ||
| 15 | bitbake-user-manual/bitbake-user-manual-metadata | 16 | bitbake-user-manual/bitbake-user-manual-metadata |
| 16 | bitbake-user-manual/bitbake-user-manual-ref-variables-context | 17 | bitbake-user-manual/bitbake-user-manual-ref-variables-context |
| 17 | bitbake-user-manual/bitbake-user-manual-fetching | 18 | bitbake-user-manual/bitbake-user-manual-fetching |
