summaryrefslogtreecommitdiffstats
path: root/documentation/ref-manual/fragments.rst
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/ref-manual/fragments.rst')
-rw-r--r--documentation/ref-manual/fragments.rst258
1 files changed, 258 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.