diff options
Diffstat (limited to 'documentation/ref-manual/fragments.rst')
-rw-r--r-- | documentation/ref-manual/fragments.rst | 258 |
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 | ***************************** | ||
4 | Using Configuration Fragments | ||
5 | ***************************** | ||
6 | |||
7 | :term:`Configuration Fragments <Configuration Fragment>` define top level build | ||
8 | configuration features that can be independently enabled and disabled using | ||
9 | standard tooling. Such features are made of one or several build configuration | ||
10 | statements that are either contained in a fragment file, or are set indirectly | ||
11 | using the :term:`Built-in Fragment` mechanism. | ||
12 | |||
13 | This 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 | ||
16 | Fragments <Built-in Fragment>` available in the :term:`OpenEmbedded Build | ||
17 | System` 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>` | ||
30 | command-line tool, which is available after :ref:`dev-manual/start:Initializing | ||
31 | the Build Environment`. | ||
32 | |||
33 | The ``bitbake-config-build`` command-line tool uses sub-commands to manage | ||
34 | fragments, 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 | |||
42 | The :ref:`ref-bitbake-config-build-list-fragments` command will list the :term:`Built-in | ||
43 | Fragments <Built-in Fragment>` and :term:`Configuration Fragments <Configuration | ||
44 | Fragment>` that are currently available, and will also print which fragments are | ||
45 | enabled or disabled. | ||
46 | |||
47 | .. _ref-bitbake-config-build-show-fragment: | ||
48 | |||
49 | ``bitbake-config-build show-fragment`` | ||
50 | -------------------------------------- | ||
51 | |||
52 | The :ref:`ref-bitbake-config-build-show-fragment` command is used to show the | ||
53 | location and value of a fragment. For example, running ``bitbake-config-build | ||
54 | show-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 | |||
62 | The :ref:`ref-bitbake-config-build-enable-fragment` command is used to enable a | ||
63 | fragment. When a fragment is enabled, the configuration variables of this | ||
64 | fragment are parsed by :term:`BitBake` and their values are available globally | ||
65 | in your build. | ||
66 | |||
67 | From the list obtained with the :ref:`ref-bitbake-config-build-list-fragments` | ||
68 | command, you can determine which fragments can be enabled for your build. | ||
69 | |||
70 | For 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 | ||
82 | their values are defined from the command-line directly. For example, the | ||
83 | following 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 | |||
88 | This fragment can be overridden from the command-line by setting it to another | ||
89 | value, for example:: | ||
90 | |||
91 | bitbake-config-build enable-fragment machine/qemux86-64 | ||
92 | |||
93 | Note 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 | |||
101 | In the above example, the value of :term:`MACHINE` is thus equal to | ||
102 | ``qemux86-64``. | ||
103 | |||
104 | When a fragment is enabled with :ref:`ref-bitbake-config-build-enable-fragment`, | ||
105 | its 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 | |||
119 | Any fragment enabled with the :ref:`ref-bitbake-config-build-enable-fragment` | ||
120 | command can be disabled with the :ref:`ref-bitbake-config-build-disable-fragment` | ||
121 | command. The list of enabled fragments can be obtained with | ||
122 | :ref:`ref-bitbake-config-build-list-fragments`. | ||
123 | |||
124 | For 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 | |||
129 | Likewise, :term:`Built-in Fragments <Built-in Fragment>` are disabled the | ||
130 | same 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 | |||
145 | The :ref:`ref-bitbake-config-build-disable-all-fragments` command disables all of the | ||
146 | currently enabled fragments. The list of enabled fragments can be obtained with | ||
147 | :ref:`ref-bitbake-config-build-list-fragments`. | ||
148 | |||
149 | This command is run without arguments:: | ||
150 | |||
151 | bitbake-config-build disable-all-fragments | ||
152 | |||
153 | Core Fragments | ||
154 | ============== | ||
155 | |||
156 | Core Built-in Fragments | ||
157 | ----------------------- | ||
158 | |||
159 | :term:`Built-in Fragments <Built-in Fragment>` are used to assign a single | ||
160 | variable globally. The :term:`OpenEmbedded Build System` defines multiple | ||
161 | built-in fragments that are detailed in this section. | ||
162 | |||
163 | .. _ref-fragments-builtin-core-machine: | ||
164 | |||
165 | ``machine/`` | ||
166 | ~~~~~~~~~~~~ | ||
167 | |||
168 | The ``machine/`` :term:`built-in fragment` can be used to assign the value of | ||
169 | the :term:`MACHINE` variable globally. | ||
170 | |||
171 | .. _ref-fragments-builtin-core-distro: | ||
172 | |||
173 | ``distro/`` | ||
174 | ~~~~~~~~~~~ | ||
175 | |||
176 | The ``distro/`` :term:`built-in fragment` can be used to assign the value of | ||
177 | the :term:`DISTRO` variable globally. | ||
178 | |||
179 | Core Configuration Fragments | ||
180 | ---------------------------- | ||
181 | |||
182 | Yocto Project Fragments | ||
183 | ~~~~~~~~~~~~~~~~~~~~~~~ | ||
184 | |||
185 | This group defines fragments related to the Yocto Project infrastructure in | ||
186 | general. | ||
187 | |||
188 | .. _ref-fragments-core-yocto-sstate-mirror-cdn: | ||
189 | |||
190 | ``core/yocto/sstate-mirror-cdn`` | ||
191 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
192 | |||
193 | The ``core/yocto/sstate-mirror-cdn`` :term:`configuration fragment` can be used | ||
194 | to set up :term:`BB_HASHSERVE_UPSTREAM` and :term:`SSTATE_MIRRORS` to use | ||
195 | pre-built :ref:`shared state cache <overview-manual/concepts:shared state | ||
196 | cache>` artifacts for standard Yocto build configurations. | ||
197 | |||
198 | This will mean the build will query the Yocto Project mirrors to check for | ||
199 | artifacts at the start of builds, which does slow it down initially but it will | ||
200 | then speed up the builds by not having to build things if they are present in | ||
201 | the cache. It assumes you can download something faster than you can build it | ||
202 | which will depend on your network configuration. | ||
203 | |||
204 | Yocto Project Autobuilder Fragments | ||
205 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
206 | |||
207 | This group defines fragment used for the Yocto Project Autobuilder. For details, | ||
208 | see the :ref:`test-manual/intro:Yocto Project Autobuilder Overview` section of | ||
209 | the Yocto Project Test Environment Manual. | ||
210 | |||
211 | .. _ref-fragment-core-yocto-autobuilder-autobuilder: | ||
212 | |||
213 | ``core/yocto-autobuilder/autobuilder`` | ||
214 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
215 | |||
216 | The ``core/yocto-autobuilder/autobuilder`` fragment defines common variables | ||
217 | used 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 | |||
224 | The ``core/yocto-autobuilder/autobuilder`` fragment defines variables for | ||
225 | limiting the resources used by the Yocto Project Autobuilder during builds. For | ||
226 | more details on how to limit resources, see the :doc:`/dev-manual/limiting-resources` | ||
227 | section 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 | |||
234 | The ``core/yocto-autobuilder/multilib-mips64-n32`` fragment enables | ||
235 | tri-architecture :ref:`multilib <dev-manual/libraries:Combining Multiple | ||
236 | Versions 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 | |||
245 | The ``core/yocto-autobuilder/multilib-x86-lib32`` fragment enables | ||
246 | :ref:`multilib <dev-manual/libraries:Combining Multiple Versions of Library | ||
247 | Files 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 | |||
255 | The ``core/yocto-autobuilder/multilib-x86-lib64`` fragment enables | ||
256 | :ref:`multilib <dev-manual/libraries:Combining Multiple Versions of Library | ||
257 | Files into One Image>` configurations for supporting 64-bit libraries on 32-bit | ||
258 | :wikipedia:`X86 <X86>` builds. | ||