diff options
| author | Simone Weiß <simone.p.weiss@posteo.com> | 2024-02-23 19:20:47 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-04-11 14:53:15 +0100 |
| commit | 793b31dbf4d2dff123c93b953a761f1a5a461b79 (patch) | |
| tree | d5110c674ced054d963f07e444ea50ce5a41899d /bitbake/doc | |
| parent | ca93c215fdd2e0f3b0ab4a205ccf80e5077e5d06 (diff) | |
| download | poky-793b31dbf4d2dff123c93b953a761f1a5a461b79.tar.gz | |
bitbake: doc: Add section for variable context
This is inspired by the same section in the yocto-docs. It aims to provide
information in what contexts(recipes, .conf, bbclass,...) a variable is usually
used. For that I tried to group similar variables, so that a short overview is
given. This was inspired by [YOCTO #14072], but of course does not implement a
warning if a variable is used in an unintended context.
(Bitbake rev: 5ced476685376b1a32b7fdd9546f9b61c5962aa0)
Signed-off-by: Simone Weiß <simone.p.weiss@posteo.com>
Signed-off-by: Michael Opdenacker <michael.opdenacker@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-ref-variables-context.rst | 91 | ||||
| -rw-r--r-- | bitbake/doc/index.rst | 1 |
2 files changed, 92 insertions, 0 deletions
diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables-context.rst b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables-context.rst new file mode 100644 index 0000000000..e9c454ba11 --- /dev/null +++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables-context.rst | |||
| @@ -0,0 +1,91 @@ | |||
| 1 | .. SPDX-License-Identifier: CC-BY-2.5 | ||
| 2 | |||
| 3 | ================ | ||
| 4 | Variable Context | ||
| 5 | ================ | ||
| 6 | |||
| 7 | | | ||
| 8 | |||
| 9 | Variables might only have an impact or can be used in certain contexts. Some | ||
| 10 | should only be used in global files like ``.conf``, while others are intended only | ||
| 11 | for local files like ``.bb``. This chapter aims to describe some important variable | ||
| 12 | contexts. | ||
| 13 | |||
| 14 | .. _ref-varcontext-configuration: | ||
| 15 | |||
| 16 | BitBake's own configuration | ||
| 17 | =========================== | ||
| 18 | |||
| 19 | Variables starting with ``BB_`` usually configure the behaviour of BitBake itself. | ||
| 20 | For example, one could configure: | ||
| 21 | |||
| 22 | - System resources, like disk space to be used (:term:`BB_DISKMON_DIRS`), | ||
| 23 | or the number of tasks to be run in parallel by BitBake (:term:`BB_NUMBER_THREADS`). | ||
| 24 | |||
| 25 | - How the fetchers shall behave, e.g., :term:`BB_FETCH_PREMIRRORONLY` is used | ||
| 26 | by BitBake to determine if BitBake's fetcher shall search only | ||
| 27 | :term:`PREMIRRORS` for files. | ||
| 28 | |||
| 29 | Those variables are usually configured globally. | ||
| 30 | |||
| 31 | BitBake configuration | ||
| 32 | ===================== | ||
| 33 | |||
| 34 | There are variables: | ||
| 35 | |||
| 36 | - Like :term:`B` or :term:`T`, that are used to specify directories used by | ||
| 37 | BitBake during the build of a particular recipe. Those variables are | ||
| 38 | specified in ``bitbake.conf``. Some, like :term:`B`, are quite often | ||
| 39 | overwritten in recipes. | ||
| 40 | |||
| 41 | - Starting with ``FAKEROOT``, to configure how the ``fakeroot`` command is | ||
| 42 | handled. Those are usually set by ``bitbake.conf`` and might get adapted in a | ||
| 43 | ``bbclass``. | ||
| 44 | |||
| 45 | - Detailing where BitBake will store and fetch information from, for | ||
| 46 | data reuse between build runs like :term:`CACHE`, :term:`DL_DIR` or | ||
| 47 | :term:`PERSISTENT_DIR`. Those are usually global. | ||
| 48 | |||
| 49 | |||
| 50 | Layers and files | ||
| 51 | ================ | ||
| 52 | |||
| 53 | Variables starting with ``LAYER`` configure how BitBake handles layers. | ||
| 54 | Additionally, variables starting with ``BB`` configure how layers and files are | ||
| 55 | handled. For example: | ||
| 56 | |||
| 57 | - :term:`LAYERDEPENDS` is used to configure on which layers a given layer | ||
| 58 | depends. | ||
| 59 | |||
| 60 | - The configured layers are contained in :term:`BBLAYERS` and files in | ||
| 61 | :term:`BBFILES`. | ||
| 62 | |||
| 63 | Those variables are often used in the files ``layer.conf`` and ``bblayers.conf``. | ||
| 64 | |||
| 65 | Recipes and packages | ||
| 66 | ==================== | ||
| 67 | |||
| 68 | Variables handling recipes and packages can be split into: | ||
| 69 | |||
| 70 | - :term:`PN`, :term:`PV` or :term:`PF` for example, contain information about | ||
| 71 | the name or revision of a recipe or package. Usually, the default set in | ||
| 72 | ``bitbake.conf`` is used, but those are from time to time overwritten in | ||
| 73 | recipes. | ||
| 74 | |||
| 75 | - :term:`SUMMARY`, :term:`DESCRIPTION`, :term:`LICENSE` or :term:`HOMEPAGE` | ||
| 76 | contain the expected information and should be set specifically for every | ||
| 77 | recipe. | ||
| 78 | |||
| 79 | - In recipes, variables are also used to control build and runtime | ||
| 80 | dependencies between recipes/packages with other recipes/packages. The | ||
| 81 | most common should be: :term:`PROVIDES`, :term:`RPROVIDES`, :term:`DEPENDS`, | ||
| 82 | and :term:`RDEPENDS`. | ||
| 83 | |||
| 84 | - There are further variables starting with ``SRC`` that specify the sources in | ||
| 85 | a recipe like :term:`SRC_URI` or :term:`SRCDATE`. Those are also usually set | ||
| 86 | in recipes. | ||
| 87 | |||
| 88 | - Which version or provider of a recipe should be given preference when | ||
| 89 | multiple recipes would provide the same item, is controlled by variables | ||
| 90 | starting with ``PREFERRED_``. Those are normally set in the configuration | ||
| 91 | files of a ``MACHINE`` or ``DISTRO``. | ||
diff --git a/bitbake/doc/index.rst b/bitbake/doc/index.rst index 3ff8b1580f..ee1660ac15 100644 --- a/bitbake/doc/index.rst +++ b/bitbake/doc/index.rst | |||
| @@ -13,6 +13,7 @@ BitBake User Manual | |||
| 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-metadata | 15 | bitbake-user-manual/bitbake-user-manual-metadata |
| 16 | bitbake-user-manual/bitbake-user-manual-ref-variables-context | ||
| 16 | bitbake-user-manual/bitbake-user-manual-fetching | 17 | bitbake-user-manual/bitbake-user-manual-fetching |
| 17 | bitbake-user-manual/bitbake-user-manual-ref-variables | 18 | bitbake-user-manual/bitbake-user-manual-ref-variables |
| 18 | bitbake-user-manual/bitbake-user-manual-hello | 19 | bitbake-user-manual/bitbake-user-manual-hello |
