summaryrefslogtreecommitdiffstats
path: root/documentation/ref-manual
diff options
context:
space:
mode:
authorAntonin Godard <antonin.godard@bootlin.com>2025-09-26 15:06:23 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-10-03 17:53:57 +0100
commite86a3d2236d7a9fe77483f8db1f07de8be6fab6c (patch)
tree0ebc388c251421408c83d2e0f6fa8b035d7b1788 /documentation/ref-manual
parentbb64a9adcf222a7b7fc9faf37582b6083c95196b (diff)
downloadpoky-e86a3d2236d7a9fe77483f8db1f07de8be6fab6c.tar.gz
Add documentation on fragments
- terms.rst: Provide the definitions of a Configuration Fragment and a Built-in Fragment. - ref-manual: Add a quick reference guide on bitbake-config-build, and list the available fragments in OE-Core. Document the underlying variables related to fragments in the glossary. - dev-manual: give instructions on how to create new custom fragments. (From yocto-docs rev: 0820b71c830cab4151b0219b6d4013c41f461c6e) Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/ref-manual')
-rw-r--r--documentation/ref-manual/fragments.rst258
-rw-r--r--documentation/ref-manual/index.rst1
-rw-r--r--documentation/ref-manual/terms.rst92
-rw-r--r--documentation/ref-manual/variables.rst39
4 files changed, 390 insertions, 0 deletions
diff --git a/documentation/ref-manual/fragments.rst b/documentation/ref-manual/fragments.rst
new file mode 100644
index 0000000000..c0118876c8
--- /dev/null
+++ b/documentation/ref-manual/fragments.rst
@@ -0,0 +1,258 @@
1.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
2
3*****************************
4Using Configuration Fragments
5*****************************
6
7:term:`Configuration Fragments <Configuration Fragment>` define top level build
8configuration features that can be independently enabled and disabled using
9standard tooling. Such features are made of one or several build configuration
10statements that are either contained in a fragment file, or are set indirectly
11using the :term:`Built-in Fragment` mechanism.
12
13This document provides a quick reference of the :oe_git:`bitbake-config-build
14</bitbake/tree/bin/bitbake-config-build>` tool and lists the
15:term:`Configuration Fragments <Configuration Fragment>` and :term:`Built-in
16Fragments <Built-in Fragment>` available in the :term:`OpenEmbedded Build
17System` core repositories.
18
19.. note::
20
21 For details on how to define new fragments in your build, see the
22 :doc:`/dev-manual/creating-fragments` section of the Yocto Project Development
23 Tasks Manual.
24
25``bitbake-config-build`` Quick Reference
26========================================
27
28:term:`Configuration Fragments <Configuration Fragment>` are managed with the
29:oe_git:`bitbake-config-build </bitbake/tree/bin/bitbake-config-build>`
30command-line tool, which is available after :ref:`dev-manual/start:Initializing
31the Build Environment`.
32
33The ``bitbake-config-build`` command-line tool uses sub-commands to manage
34fragments, which are detailed in the sections below. For each sub-command, the
35``--help`` flag can be passed to get more information on the sub-command.
36
37.. _ref-bitbake-config-build-list-fragments:
38
39``bitbake-config-build list-fragments``
40---------------------------------------
41
42The :ref:`ref-bitbake-config-build-list-fragments` command will list the :term:`Built-in
43Fragments <Built-in Fragment>` and :term:`Configuration Fragments <Configuration
44Fragment>` that are currently available, and will also print which fragments are
45enabled or disabled.
46
47.. _ref-bitbake-config-build-show-fragment:
48
49``bitbake-config-build show-fragment``
50--------------------------------------
51
52The :ref:`ref-bitbake-config-build-show-fragment` command is used to show the
53location and value of a fragment. For example, running ``bitbake-config-build
54show-fragment core/yocto/sstate-mirror-cdn`` will show the content of the
55:ref:`ref-fragments-core-yocto-sstate-mirror-cdn` fragment.
56
57.. _ref-bitbake-config-build-enable-fragment:
58
59``bitbake-config-build enable-fragment``
60----------------------------------------
61
62The :ref:`ref-bitbake-config-build-enable-fragment` command is used to enable a
63fragment. When a fragment is enabled, the configuration variables of this
64fragment are parsed by :term:`BitBake` and their values are available globally
65in your build.
66
67From the list obtained with the :ref:`ref-bitbake-config-build-list-fragments`
68command, you can determine which fragments can be enabled for your build.
69
70For example, the following command would enable the
71:ref:`ref-fragments-core-yocto-sstate-mirror-cdn` fragment::
72
73 bitbake-config-build enable-fragment core/yocto/sstate-mirror-cdn
74
75.. note::
76
77 Multiple fragments can be enabled at once with the same command::
78
79 bitbake-config-build enable-fragment <fragment1> <fragment2> ...
80
81:term:`Built-in fragments <Built-in Fragment>` are enabled the same way, and
82their values are defined from the command-line directly. For example, the
83following command sets the ``qemuarm64`` :term:`MACHINE` through the
84:ref:`ref-fragments-builtin-core-machine` fragment::
85
86 bitbake-config-build enable-fragment machine/qemuarm64
87
88This fragment can be overridden from the command-line by setting it to another
89value, for example::
90
91 bitbake-config-build enable-fragment machine/qemux86-64
92
93Note that in this case, the fragment will be defined twice in
94:term:`OE_FRAGMENTS`, and the last value is taken into account:
95
96.. code-block::
97 :caption: build/conf/auto.conf
98
99 OE_FRAGMENTS += " ... machine/qemuarm64 machine/qemux86-64"
100
101In the above example, the value of :term:`MACHINE` is thus equal to
102``qemux86-64``.
103
104When a fragment is enabled with :ref:`ref-bitbake-config-build-enable-fragment`,
105its name is automatically appended to the :term:`OE_FRAGMENTS` variable in
106:ref:`structure-build-conf-auto.conf`.
107
108.. note::
109
110 It is also possible to manually remove or add fragments by modifying the
111 :term:`OE_FRAGMENTS` variable in a configuration file such as
112 :ref:`structure-build-conf-local.conf`.
113
114.. _ref-bitbake-config-build-disable-fragment:
115
116``bitbake-config-build disable-fragment``
117-----------------------------------------
118
119Any fragment enabled with the :ref:`ref-bitbake-config-build-enable-fragment`
120command can be disabled with the :ref:`ref-bitbake-config-build-disable-fragment`
121command. The list of enabled fragments can be obtained with
122:ref:`ref-bitbake-config-build-list-fragments`.
123
124For example, the following command disables the
125:ref:`ref-fragments-core-yocto-sstate-mirror-cdn` fragment::
126
127 bitbake-config-build disable-fragment core/yocto/sstate-mirror-cdn
128
129Likewise, :term:`Built-in Fragments <Built-in Fragment>` are disabled the
130same way. For example, this would disable the ``machine/qemuarm64`` fragment::
131
132 bitbake-config-build disable-fragment machine/qemuarm64
133
134.. note::
135
136 Multiple fragments can be disabled at once with the same command::
137
138 bitbake-config-build disable-fragment <fragment1> <fragment2>
139
140.. _ref-bitbake-config-build-disable-all-fragments:
141
142``bitbake-config-build disable-all-fragments``
143----------------------------------------------
144
145The :ref:`ref-bitbake-config-build-disable-all-fragments` command disables all of the
146currently enabled fragments. The list of enabled fragments can be obtained with
147:ref:`ref-bitbake-config-build-list-fragments`.
148
149This command is run without arguments::
150
151 bitbake-config-build disable-all-fragments
152
153Core Fragments
154==============
155
156Core Built-in Fragments
157-----------------------
158
159:term:`Built-in Fragments <Built-in Fragment>` are used to assign a single
160variable globally. The :term:`OpenEmbedded Build System` defines multiple
161built-in fragments that are detailed in this section.
162
163.. _ref-fragments-builtin-core-machine:
164
165``machine/``
166~~~~~~~~~~~~
167
168The ``machine/`` :term:`built-in fragment` can be used to assign the value of
169the :term:`MACHINE` variable globally.
170
171.. _ref-fragments-builtin-core-distro:
172
173``distro/``
174~~~~~~~~~~~
175
176The ``distro/`` :term:`built-in fragment` can be used to assign the value of
177the :term:`DISTRO` variable globally.
178
179Core Configuration Fragments
180----------------------------
181
182Yocto Project Fragments
183~~~~~~~~~~~~~~~~~~~~~~~
184
185This group defines fragments related to the Yocto Project infrastructure in
186general.
187
188.. _ref-fragments-core-yocto-sstate-mirror-cdn:
189
190``core/yocto/sstate-mirror-cdn``
191^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
192
193The ``core/yocto/sstate-mirror-cdn`` :term:`configuration fragment` can be used
194to set up :term:`BB_HASHSERVE_UPSTREAM` and :term:`SSTATE_MIRRORS` to use
195pre-built :ref:`shared state cache <overview-manual/concepts:shared state
196cache>` artifacts for standard Yocto build configurations.
197
198This will mean the build will query the Yocto Project mirrors to check for
199artifacts at the start of builds, which does slow it down initially but it will
200then speed up the builds by not having to build things if they are present in
201the cache. It assumes you can download something faster than you can build it
202which will depend on your network configuration.
203
204Yocto Project Autobuilder Fragments
205~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
206
207This group defines fragment used for the Yocto Project Autobuilder. For details,
208see the :ref:`test-manual/intro:Yocto Project Autobuilder Overview` section of
209the Yocto Project Test Environment Manual.
210
211.. _ref-fragment-core-yocto-autobuilder-autobuilder:
212
213``core/yocto-autobuilder/autobuilder``
214^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
215
216The ``core/yocto-autobuilder/autobuilder`` fragment defines common variables
217used in builds started by the Yocto Project Autobuilder.
218
219.. _ref-fragment-core-yocto-autobuilder-autobuilder-resource-constraints:
220
221``core/yocto-autobuilder/autobuilder-resource-constraints``
222^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
223
224The ``core/yocto-autobuilder/autobuilder`` fragment defines variables for
225limiting the resources used by the Yocto Project Autobuilder during builds. For
226more details on how to limit resources, see the :doc:`/dev-manual/limiting-resources`
227section of the Yocto Project Development Tasks Manual.
228
229.. _ref-fragment-core-yocto-autobuilder-multilib-mips64-n32:
230
231``core/yocto-autobuilder/multilib-mips64-n32``
232^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
233
234The ``core/yocto-autobuilder/multilib-mips64-n32`` fragment enables
235tri-architecture :ref:`multilib <dev-manual/libraries:Combining Multiple
236Versions of Library Files into One Image>` configurations for :wikipedia:`MIPS64
237<MIPS_architecture>` machines, which includes ``mips64-n32``, ``mips64``, and
238``mips32r2``.
239
240.. _ref-fragment-core-yocto-autobuilder-multilib-x86-lib32:
241
242``core/yocto-autobuilder/multilib-x86-lib32``
243^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
244
245The ``core/yocto-autobuilder/multilib-x86-lib32`` fragment enables
246:ref:`multilib <dev-manual/libraries:Combining Multiple Versions of Library
247Files into One Image>` configurations for supporting 32-bit libraries on 64-bit
248:wikipedia:`X86 <X86>` builds.
249
250.. _ref-fragment-core-yocto-autobuilder-multilib-x86-lib64:
251
252``core/yocto-autobuilder/multilib-x86-lib64``
253^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
254
255The ``core/yocto-autobuilder/multilib-x86-lib64`` fragment enables
256:ref:`multilib <dev-manual/libraries:Combining Multiple Versions of Library
257Files into One Image>` configurations for supporting 64-bit libraries on 32-bit
258:wikipedia:`X86 <X86>` builds.
diff --git a/documentation/ref-manual/index.rst b/documentation/ref-manual/index.rst
index 53fa98cc99..aa1a63e050 100644
--- a/documentation/ref-manual/index.rst
+++ b/documentation/ref-manual/index.rst
@@ -17,6 +17,7 @@ Yocto Project Reference Manual
17 structure 17 structure
18 classes 18 classes
19 tasks 19 tasks
20 fragments
20 devtool-reference 21 devtool-reference
21 kickstart 22 kickstart
22 qa-checks 23 qa-checks
diff --git a/documentation/ref-manual/terms.rst b/documentation/ref-manual/terms.rst
index f3d3d059d1..e25c714d9b 100644
--- a/documentation/ref-manual/terms.rst
+++ b/documentation/ref-manual/terms.rst
@@ -131,6 +131,53 @@ universal, the list includes them just in case:
131 A variant of :term:`buildtools`, just providing the required 131 A variant of :term:`buildtools`, just providing the required
132 version of ``make`` to run the OpenEmbedded build system. 132 version of ``make`` to run the OpenEmbedded build system.
133 133
134 :term:`Built-in Fragment`
135 A built-in fragment is a specific kind of :term:`Configuration Fragment`
136 that affects the value of a single variable globally. :term:`Built-in
137 Fragments <Built-in Fragment>` do not require a separate configuration
138 file, but like a standard :term:`Configuration Fragment`, Built-in
139 Fragments can be enabled or disabled using the :oe_git:`bitbake-config-build
140 </bitbake/tree/bin/bitbake-config-build>` command-line utility.
141
142 When declared, a built-in fragment follows the following naming
143 convention::
144
145 <fragment>:<variable name>
146
147 Where:
148
149 - ``<fragment>`` is the name of the built-in fragment.
150 - ``<variable name>`` is the name of the variable to be modified by this
151 fragment.
152
153 For example::
154
155 machine:MACHINE
156
157 Will setup the ``machine`` Built-in Fragment for modifying the value of
158 the :term:`MACHINE` variable.
159
160 Setting the :term:`MACHINE` variable through this fragment must follow
161 this syntax::
162
163 machine/qemux86-64
164
165 This sets the value of :term:`MACHINE` to ``qemux86-64``.
166
167 In :term:`OpenEmbedded-Core (OE-Core)`, the list of available
168 :term:`Built-in Fragments <Built-in Fragment>` can be obtained from the
169 :term:`OE_FRAGMENTS_BUILTIN` variable.
170
171 For more details on fragments, see:
172
173 - The :doc:`/ref-manual/fragments` section of the Yocto Project Reference
174 Manual for a list of fragments the :term:`OpenEmbedded Build System`
175 supports, and a quick reference guide on how to manage fragments.
176
177 - The :doc:`/dev-manual/creating-fragments` section of the Yocto Project
178 Development Tasks Manual for details on how to create new fragments
179 in your build.
180
134 :term:`Classes` 181 :term:`Classes`
135 Files that provide for logic encapsulation and inheritance so that 182 Files that provide for logic encapsulation and inheritance so that
136 commonly used patterns can be defined once and then easily used in 183 commonly used patterns can be defined once and then easily used in
@@ -154,6 +201,51 @@ universal, the list includes them just in case:
154 only used when building for that target (e.g. the 201 only used when building for that target (e.g. the
155 :file:`machine/beaglebone.conf` configuration file defines variables for 202 :file:`machine/beaglebone.conf` configuration file defines variables for
156 the Texas Instruments ARM Cortex-A8 development board). 203 the Texas Instruments ARM Cortex-A8 development board).
204 :term:`Configuration Fragments <Configuration Fragment>` such as
205 :ref:`ref-fragments-core-yocto-sstate-mirror-cdn` define snippets of
206 configuration that can be enabled from the command-line.
207
208 :term:`Configuration Fragment`
209 A :term:`Configuration Fragment` (also called Standard :term:`Configuration
210 Fragment`) is a :term:`configuration file` that contains configuration
211 statements such as variable assignments, affecting the build at a
212 global-level when the fragment is enabled. By default, configuration
213 fragments are located in the :file:`conf/fragments/` directory of a
214 :term:`Layer`.
215
216 .. note::
217
218 Another form of fragment not to be confounded with Standard
219 :term:`Configuration Fragments <Configuration Fragment>` are
220 :term:`Built-in Fragments <Built-in Fragment>` which are used to assign
221 a single variable value globally.
222
223 A fragment :term:`configuration file` must contain a summary
224 (:term:`BB_CONF_FRAGMENT_SUMMARY`) and a description
225 (:term:`BB_CONF_FRAGMENT_DESCRIPTION`) explaining the purpose of the
226 fragment.
227
228 In :term:`OpenEmbedded-Core (OE-Core)`, the location of fragments and what
229 variables are required in a fragment is specified in :oe_git:`bitbake.conf
230 </openembedded-core/tree/meta/conf/bitbake.conf>` thanks to the
231 :ref:`addfragments <bitbake-user-manual/bitbake-user-manual-metadata:\`\`addfragments\`\`
232 directive>` directive and the :term:`OE_FRAGMENTS`,
233 :term:`OE_FRAGMENTS_METADATA_VARS` and :term:`OE_FRAGMENTS_BUILTIN`
234 variables.
235
236 Fragments can be listed, enabled and disabled with the
237 :oe_git:`bitbake-config-build </bitbake/tree/bin/bitbake-config-build>`
238 command-line utility.
239
240 For more details on fragments, see:
241
242 - The :doc:`/ref-manual/fragments` section of the Yocto Project Reference
243 Manual for a list of fragments the :term:`OpenEmbedded Build System`
244 supports, and a quick reference guide on how to manage fragments.
245
246 - The :doc:`/dev-manual/creating-fragments` section of the Yocto Project
247 Development Tasks Manual for details on how to create new fragments
248 in your build.
157 249
158 :term:`Container Layer` 250 :term:`Container Layer`
159 A flexible definition that typically refers to a single Git checkout 251 A flexible definition that typically refers to a single Git checkout
diff --git a/documentation/ref-manual/variables.rst b/documentation/ref-manual/variables.rst
index 2f9f1a9d80..aefe598a56 100644
--- a/documentation/ref-manual/variables.rst
+++ b/documentation/ref-manual/variables.rst
@@ -397,6 +397,18 @@ system and gives an overview of their function and contents.
397 :term:`BB_CHECK_SSL_CERTS` 397 :term:`BB_CHECK_SSL_CERTS`
398 See :term:`bitbake:BB_CHECK_SSL_CERTS` in the BitBake manual. 398 See :term:`bitbake:BB_CHECK_SSL_CERTS` in the BitBake manual.
399 399
400 :term:`BB_CONF_FRAGMENT_DESCRIPTION`
401 The :term:`BB_CONF_FRAGMENT_DESCRIPTION` variable defines the textual
402 description of a :term:`Configuration Fragment`. For details on how to use
403 fragments, see the :doc:`/ref-manual/fragments` section of the Yocto
404 Project Reference Manual.
405
406 :term:`BB_CONF_FRAGMENT_SUMMARY`
407 The :term:`BB_CONF_FRAGMENT_SUMMARY` variable defines the one-line textual
408 summary of a :term:`Configuration Fragment`. For details on how to use
409 fragments, see the :doc:`/ref-manual/fragments` section of the Yocto
410 Project Reference Manual.
411
400 :term:`BB_CONSOLELOG` 412 :term:`BB_CONSOLELOG`
401 See :term:`bitbake:BB_CONSOLELOG` in the BitBake manual. 413 See :term:`bitbake:BB_CONSOLELOG` in the BitBake manual.
402 414
@@ -6230,6 +6242,33 @@ system and gives an overview of their function and contents.
6230 :term:`Source Directory` for details on how this class 6242 :term:`Source Directory` for details on how this class
6231 applies these additional sed command arguments. 6243 applies these additional sed command arguments.
6232 6244
6245 :term:`OE_FRAGMENTS`
6246 The :term:`OE_FRAGMENTS` variable holds the list of :term:`Configuration
6247 Fragments <Configuration Fragment>` currently enabled for the build. For
6248 details on how to use fragments, see the :doc:`/ref-manual/fragments`
6249 section of the Yocto Project Reference Manual.
6250
6251 :term:`OE_FRAGMENTS_BUILTIN`
6252 The :term:`OE_FRAGMENTS_BUILTIN` variable holds the list of
6253 :term:`Built-in Fragments <Built-in Fragment>` available for being set with
6254 :oe_git:`bitbake-config-build </bitbake/tree/bin/bitbake-config-build>`.
6255 For details on how to use fragments, see the :doc:`/ref-manual/fragments`
6256 section of the Yocto Project Reference Manual.
6257
6258 :term:`OE_FRAGMENTS_METADATA_VARS`
6259 The :term:`OE_FRAGMENTS_METADATA_VARS` variable holds the list of
6260 variables that are required to set in a standard :term:`Configuration
6261 Fragment` file. In :term:`OpenEmbedded-Core (OE-Core)`, these variables
6262 are :term:`BB_CONF_FRAGMENT_SUMMARY` and
6263 :term:`BB_CONF_FRAGMENT_DESCRIPTION`.
6264
6265 :term:`OE_FRAGMENTS_PREFIX`
6266 The :term:`OE_FRAGMENTS_PREFIX` variable defines the prefix where
6267 :term:`BitBake` tries to locate :term:`Configuration Fragments
6268 <Configuration Fragment>` in :term:`layers <Layer>`. For details on how to
6269 use fragments, see the :doc:`/ref-manual/fragments` section of the Yocto
6270 Project Reference Manual.
6271
6233 :term:`OE_INIT_ENV_SCRIPT` 6272 :term:`OE_INIT_ENV_SCRIPT`
6234 The name of the build environment setup script for the purposes of 6273 The name of the build environment setup script for the purposes of
6235 setting up the environment within the extensible SDK. The default 6274 setting up the environment within the extensible SDK. The default