diff options
author | Nicolas Dechesne <nicolas.dechesne@linaro.org> | 2020-06-26 19:10:51 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-09-17 10:09:33 +0100 |
commit | 9bd69b1f1d71a9692189beeac75af9dfbad816cc (patch) | |
tree | 305347fca899074aed5610e0e82eaec180bf630c /documentation/ref-manual/ref-classes.rst | |
parent | c40a8d5904c29046f1cbbeb998e6cd7c24f9b206 (diff) | |
download | poky-9bd69b1f1d71a9692189beeac75af9dfbad816cc.tar.gz |
sphinx: initial sphinx support
This commit is autogenerated pandoc to generate an inital set
of reST files based on DocBook XML files.
A .rst file is generated for each .xml files in all manuals with this
command:
cd <manual>
for i in *.xml; do \
pandoc -f docbook -t rst --shift-heading-level-by=-1 \
$i -o $(basename $i .xml).rst \
done
The conversion was done with: pandoc 2.9.2.1-91 (Arch Linux).
Also created an initial top level index file for each document, and
added all 'books' to the top leve index.rst file.
The YP manuals layout is organized as:
Book
Chapter
Section
Section
Section
Sphinx uses section headers to create the document structure.
ReStructuredText defines sections headers like that:
To break longer text up into sections, you use section headers. These
are a single line of text (one or more words) with adornment: an
underline alone, or an underline and an overline together, in dashes
"-----", equals "======", tildes "~~~~~~" or any of the
non-alphanumeric characters = - ` : ' " ~ ^ _ * + # < > that you feel
comfortable with. An underline-only adornment is distinct from an
overline-and-underline adornment using the same character. The
underline/overline must be at least as long as the title text. Be
consistent, since all sections marked with the same adornment style
are deemed to be at the same level:
Let's define the following convention when converting from Docbook:
Book => overline === (Title)
Chapter => overline *** (1.)
Section => ==== (1.1)
Section => ---- (1.1.1)
Section => ~~~~ (1.1.1.1)
Section => ^^^^ (1.1.1.1.1)
During the conversion with pandoc, we used --shift-heading-level=-1 to
convert most of DocBook headings automatically. However with this
setting, the Chapter header was removed, so I added it back
manually. Without this setting all headings were off by one, which was
more difficult to manually fix.
At least with this change, we now have the same TOC with Sphinx and
DocBook.
(From yocto-docs rev: 3c73d64a476d4423ee4c6808c685fa94d88d7df8)
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/ref-manual/ref-classes.rst')
-rw-r--r-- | documentation/ref-manual/ref-classes.rst | 2881 |
1 files changed, 2881 insertions, 0 deletions
diff --git a/documentation/ref-manual/ref-classes.rst b/documentation/ref-manual/ref-classes.rst new file mode 100644 index 0000000000..3b6f450fab --- /dev/null +++ b/documentation/ref-manual/ref-classes.rst | |||
@@ -0,0 +1,2881 @@ | |||
1 | ******* | ||
2 | Classes | ||
3 | ******* | ||
4 | |||
5 | Class files are used to abstract common functionality and share it | ||
6 | amongst multiple recipe (``.bb``) files. To use a class file, you simply | ||
7 | make sure the recipe inherits the class. In most cases, when a recipe | ||
8 | inherits a class it is enough to enable its features. There are cases, | ||
9 | however, where in the recipe you might need to set variables or override | ||
10 | some default behavior. | ||
11 | |||
12 | Any `Metadata <#metadata>`__ usually found in a recipe can also be | ||
13 | placed in a class file. Class files are identified by the extension | ||
14 | ``.bbclass`` and are usually placed in a ``classes/`` directory beneath | ||
15 | the ``meta*/`` directory found in the `Source | ||
16 | Directory <#source-directory>`__. Class files can also be pointed to by | ||
17 | ```BUILDDIR`` <#var-BUILDDIR>`__ (e.g. ``build/``) in the same way as | ||
18 | ``.conf`` files in the ``conf`` directory. Class files are searched for | ||
19 | in ```BBPATH`` <#var-BBPATH>`__ using the same method by which ``.conf`` | ||
20 | files are searched. | ||
21 | |||
22 | This chapter discusses only the most useful and important classes. Other | ||
23 | classes do exist within the ``meta/classes`` directory in the Source | ||
24 | Directory. You can reference the ``.bbclass`` files directly for more | ||
25 | information. | ||
26 | |||
27 | .. _ref-classes-allarch: | ||
28 | |||
29 | ``allarch.bbclass`` | ||
30 | =================== | ||
31 | |||
32 | The ``allarch`` class is inherited by recipes that do not produce | ||
33 | architecture-specific output. The class disables functionality that is | ||
34 | normally needed for recipes that produce executable binaries (such as | ||
35 | building the cross-compiler and a C library as pre-requisites, and | ||
36 | splitting out of debug symbols during packaging). | ||
37 | |||
38 | .. note:: | ||
39 | |||
40 | Unlike some distro recipes (e.g. Debian), OpenEmbedded recipes that | ||
41 | produce packages that depend on tunings through use of the | ||
42 | ```RDEPENDS`` <#var-RDEPENDS>`__ and | ||
43 | ```TUNE_PKGARCH`` <#var-TUNE_PKGARCH>`__ variables, should never be | ||
44 | configured for all architectures using ``allarch``. This is the case | ||
45 | even if the recipes do not produce architecture-specific output. | ||
46 | |||
47 | Configuring such recipes for all architectures causes the | ||
48 | ```do_package_write_*`` <#ref-tasks-package_write_deb>`__ tasks to | ||
49 | have different signatures for the machines with different tunings. | ||
50 | Additionally, unnecessary rebuilds occur every time an image for a | ||
51 | different ``MACHINE`` is built even when the recipe never changes. | ||
52 | |||
53 | By default, all recipes inherit the ```base`` <#ref-classes-base>`__ and | ||
54 | ```package`` <#ref-classes-package>`__ classes, which enable | ||
55 | functionality needed for recipes that produce executable output. If your | ||
56 | recipe, for example, only produces packages that contain configuration | ||
57 | files, media files, or scripts (e.g. Python and Perl), then it should | ||
58 | inherit the ``allarch`` class. | ||
59 | |||
60 | .. _ref-classes-archiver: | ||
61 | |||
62 | ``archiver.bbclass`` | ||
63 | ==================== | ||
64 | |||
65 | The ``archiver`` class supports releasing source code and other | ||
66 | materials with the binaries. | ||
67 | |||
68 | For more details on the source archiver, see the "`Maintaining Open | ||
69 | Source License Compliance During Your Product's | ||
70 | Lifecycle <&YOCTO_DOCS_DEV_URL;#maintaining-open-source-license-compliance-during-your-products-lifecycle>`__" | ||
71 | section in the Yocto Project Development Tasks Manual. You can also see | ||
72 | the ```ARCHIVER_MODE`` <#var-ARCHIVER_MODE>`__ variable for information | ||
73 | about the variable flags (varflags) that help control archive creation. | ||
74 | |||
75 | .. _ref-classes-autotools: | ||
76 | |||
77 | ``autotools*.bbclass`` | ||
78 | ====================== | ||
79 | |||
80 | The ``autotools*`` classes support Autotooled packages. | ||
81 | |||
82 | The ``autoconf``, ``automake``, and ``libtool`` packages bring | ||
83 | standardization. This class defines a set of tasks (e.g. ``configure``, | ||
84 | ``compile`` and so forth) that work for all Autotooled packages. It | ||
85 | should usually be enough to define a few standard variables and then | ||
86 | simply ``inherit autotools``. These classes can also work with software | ||
87 | that emulates Autotools. For more information, see the "`Autotooled | ||
88 | Package <&YOCTO_DOCS_DEV_URL;#new-recipe-autotooled-package>`__" section | ||
89 | in the Yocto Project Development Tasks Manual. | ||
90 | |||
91 | By default, the ``autotools*`` classes use out-of-tree builds (i.e. | ||
92 | ``autotools.bbclass`` building with ``B != S``). | ||
93 | |||
94 | If the software being built by a recipe does not support using | ||
95 | out-of-tree builds, you should have the recipe inherit the | ||
96 | ``autotools-brokensep`` class. The ``autotools-brokensep`` class behaves | ||
97 | the same as the ``autotools`` class but builds with ```B`` <#var-B>`__ | ||
98 | == ```S`` <#var-S>`__. This method is useful when out-of-tree build | ||
99 | support is either not present or is broken. | ||
100 | |||
101 | .. note:: | ||
102 | |||
103 | It is recommended that out-of-tree support be fixed and used if at | ||
104 | all possible. | ||
105 | |||
106 | It's useful to have some idea of how the tasks defined by the | ||
107 | ``autotools*`` classes work and what they do behind the scenes. | ||
108 | |||
109 | - ```do_configure`` <#ref-tasks-configure>`__ - Regenerates the | ||
110 | configure script (using ``autoreconf``) and then launches it with a | ||
111 | standard set of arguments used during cross-compilation. You can pass | ||
112 | additional parameters to ``configure`` through the ``EXTRA_OECONF`` | ||
113 | or ```PACKAGECONFIG_CONFARGS`` <#var-PACKAGECONFIG_CONFARGS>`__ | ||
114 | variables. | ||
115 | |||
116 | - ```do_compile`` <#ref-tasks-compile>`__ - Runs ``make`` with | ||
117 | arguments that specify the compiler and linker. You can pass | ||
118 | additional arguments through the ``EXTRA_OEMAKE`` variable. | ||
119 | |||
120 | - ```do_install`` <#ref-tasks-install>`__ - Runs ``make install`` and | ||
121 | passes in ``${``\ ```D`` <#var-D>`__\ ``}`` as ``DESTDIR``. | ||
122 | |||
123 | .. _ref-classes-base: | ||
124 | |||
125 | ``base.bbclass`` | ||
126 | ================ | ||
127 | |||
128 | The ``base`` class is special in that every ``.bb`` file implicitly | ||
129 | inherits the class. This class contains definitions for standard basic | ||
130 | tasks such as fetching, unpacking, configuring (empty by default), | ||
131 | compiling (runs any ``Makefile`` present), installing (empty by default) | ||
132 | and packaging (empty by default). These classes are often overridden or | ||
133 | extended by other classes such as the | ||
134 | ```autotools`` <#ref-classes-autotools>`__ class or the | ||
135 | ```package`` <#ref-classes-package>`__ class. | ||
136 | |||
137 | The class also contains some commonly used functions such as | ||
138 | ``oe_runmake``, which runs ``make`` with the arguments specified in | ||
139 | ```EXTRA_OEMAKE`` <#var-EXTRA_OEMAKE>`__ variable as well as the | ||
140 | arguments passed directly to ``oe_runmake``. | ||
141 | |||
142 | .. _ref-classes-bash-completion: | ||
143 | |||
144 | ``bash-completion.bbclass`` | ||
145 | =========================== | ||
146 | |||
147 | Sets up packaging and dependencies appropriate for recipes that build | ||
148 | software that includes bash-completion data. | ||
149 | |||
150 | .. _ref-classes-bin-package: | ||
151 | |||
152 | ``bin_package.bbclass`` | ||
153 | ======================= | ||
154 | |||
155 | The ``bin_package`` class is a helper class for recipes that extract the | ||
156 | contents of a binary package (e.g. an RPM) and install those contents | ||
157 | rather than building the binary from source. The binary package is | ||
158 | extracted and new packages in the configured output package format are | ||
159 | created. Extraction and installation of proprietary binaries is a good | ||
160 | example use for this class. | ||
161 | |||
162 | .. note:: | ||
163 | |||
164 | For RPMs and other packages that do not contain a subdirectory, you | ||
165 | should specify an appropriate fetcher parameter to point to the | ||
166 | subdirectory. For example, if BitBake is using the Git fetcher ( | ||
167 | git:// | ||
168 | ), the "subpath" parameter limits the checkout to a specific subpath | ||
169 | of the tree. Here is an example where | ||
170 | ${BP} | ||
171 | is used so that the files are extracted into the subdirectory | ||
172 | expected by the default value of | ||
173 | S | ||
174 | : | ||
175 | :: | ||
176 | |||
177 | SRC_URI = "git://example.com/downloads/somepackage.rpm;subpath=${BP}" | ||
178 | |||
179 | |||
180 | See the " | ||
181 | Fetchers | ||
182 | " section in the BitBake User Manual for more information on | ||
183 | supported BitBake Fetchers. | ||
184 | |||
185 | .. _ref-classes-binconfig: | ||
186 | |||
187 | ``binconfig.bbclass`` | ||
188 | ===================== | ||
189 | |||
190 | The ``binconfig`` class helps to correct paths in shell scripts. | ||
191 | |||
192 | Before ``pkg-config`` had become widespread, libraries shipped shell | ||
193 | scripts to give information about the libraries and include paths needed | ||
194 | to build software (usually named ``LIBNAME-config``). This class assists | ||
195 | any recipe using such scripts. | ||
196 | |||
197 | During staging, the OpenEmbedded build system installs such scripts into | ||
198 | the ``sysroots/`` directory. Inheriting this class results in all paths | ||
199 | in these scripts being changed to point into the ``sysroots/`` directory | ||
200 | so that all builds that use the script use the correct directories for | ||
201 | the cross compiling layout. See the | ||
202 | ```BINCONFIG_GLOB`` <#var-BINCONFIG_GLOB>`__ variable for more | ||
203 | information. | ||
204 | |||
205 | .. _ref-classes-binconfig-disabled: | ||
206 | |||
207 | ``binconfig-disabled.bbclass`` | ||
208 | ============================== | ||
209 | |||
210 | An alternative version of the ```binconfig`` <#ref-classes-binconfig>`__ | ||
211 | class, which disables binary configuration scripts by making them return | ||
212 | an error in favor of using ``pkg-config`` to query the information. The | ||
213 | scripts to be disabled should be specified using the | ||
214 | ```BINCONFIG`` <#var-BINCONFIG>`__ variable within the recipe inheriting | ||
215 | the class. | ||
216 | |||
217 | .. _ref-classes-blacklist: | ||
218 | |||
219 | ``blacklist.bbclass`` | ||
220 | ===================== | ||
221 | |||
222 | The ``blacklist`` class prevents the OpenEmbedded build system from | ||
223 | building specific recipes (blacklists them). To use this class, inherit | ||
224 | the class globally and set ```PNBLACKLIST`` <#var-PNBLACKLIST>`__ for | ||
225 | each recipe you wish to blacklist. Specify the ```PN`` <#var-PN>`__ | ||
226 | value as a variable flag (varflag) and provide a reason, which is | ||
227 | reported, if the package is requested to be built as the value. For | ||
228 | example, if you want to blacklist a recipe called "exoticware", you add | ||
229 | the following to your ``local.conf`` or distribution configuration: | ||
230 | INHERIT += "blacklist" PNBLACKLIST[exoticware] = "Not supported by our | ||
231 | organization." | ||
232 | |||
233 | .. _ref-classes-buildhistory: | ||
234 | |||
235 | ``buildhistory.bbclass`` | ||
236 | ======================== | ||
237 | |||
238 | The ``buildhistory`` class records a history of build output metadata, | ||
239 | which can be used to detect possible regressions as well as used for | ||
240 | analysis of the build output. For more information on using Build | ||
241 | History, see the "`Maintaining Build Output | ||
242 | Quality <&YOCTO_DOCS_DEV_URL;#maintaining-build-output-quality>`__" | ||
243 | section in the Yocto Project Development Tasks Manual. | ||
244 | |||
245 | .. _ref-classes-buildstats: | ||
246 | |||
247 | ``buildstats.bbclass`` | ||
248 | ====================== | ||
249 | |||
250 | The ``buildstats`` class records performance statistics about each task | ||
251 | executed during the build (e.g. elapsed time, CPU usage, and I/O usage). | ||
252 | |||
253 | When you use this class, the output goes into the | ||
254 | ```BUILDSTATS_BASE`` <#var-BUILDSTATS_BASE>`__ directory, which defaults | ||
255 | to ``${TMPDIR}/buildstats/``. You can analyze the elapsed time using | ||
256 | ``scripts/pybootchartgui/pybootchartgui.py``, which produces a cascading | ||
257 | chart of the entire build process and can be useful for highlighting | ||
258 | bottlenecks. | ||
259 | |||
260 | Collecting build statistics is enabled by default through the | ||
261 | ```USER_CLASSES`` <#var-USER_CLASSES>`__ variable from your | ||
262 | ``local.conf`` file. Consequently, you do not have to do anything to | ||
263 | enable the class. However, if you want to disable the class, simply | ||
264 | remove "buildstats" from the ``USER_CLASSES`` list. | ||
265 | |||
266 | .. _ref-classes-buildstats-summary: | ||
267 | |||
268 | ``buildstats-summary.bbclass`` | ||
269 | ============================== | ||
270 | |||
271 | When inherited globally, prints statistics at the end of the build on | ||
272 | sstate re-use. In order to function, this class requires the | ||
273 | ```buildstats`` <#ref-classes-buildstats>`__ class be enabled. | ||
274 | |||
275 | .. _ref-classes-ccache: | ||
276 | |||
277 | ``ccache.bbclass`` | ||
278 | ================== | ||
279 | |||
280 | The ``ccache`` class enables the C/C++ Compiler Cache for the build. | ||
281 | This class is used to give a minor performance boost during the build. | ||
282 | However, using the class can lead to unexpected side-effects. Thus, it | ||
283 | is recommended that you do not use this class. See | ||
284 | ` <http://ccache.samba.org/>`__ for information on the C/C++ Compiler | ||
285 | Cache. | ||
286 | |||
287 | .. _ref-classes-chrpath: | ||
288 | |||
289 | ``chrpath.bbclass`` | ||
290 | =================== | ||
291 | |||
292 | The ``chrpath`` class is a wrapper around the "chrpath" utility, which | ||
293 | is used during the build process for ``nativesdk``, ``cross``, and | ||
294 | ``cross-canadian`` recipes to change ``RPATH`` records within binaries | ||
295 | in order to make them relocatable. | ||
296 | |||
297 | .. _ref-classes-clutter: | ||
298 | |||
299 | ``clutter.bbclass`` | ||
300 | =================== | ||
301 | |||
302 | The ``clutter`` class consolidates the major and minor version naming | ||
303 | and other common items used by Clutter and related recipes. | ||
304 | |||
305 | .. note:: | ||
306 | |||
307 | Unlike some other classes related to specific libraries, recipes | ||
308 | building other software that uses Clutter do not need to inherit this | ||
309 | class unless they use the same recipe versioning scheme that the | ||
310 | Clutter and related recipes do. | ||
311 | |||
312 | .. _ref-classes-cmake: | ||
313 | |||
314 | ``cmake.bbclass`` | ||
315 | ================= | ||
316 | |||
317 | The ``cmake`` class allows for recipes that need to build software using | ||
318 | the `CMake <https://cmake.org/overview/>`__ build system. You can use | ||
319 | the ```EXTRA_OECMAKE`` <#var-EXTRA_OECMAKE>`__ variable to specify | ||
320 | additional configuration options to be passed using the ``cmake`` | ||
321 | command line. | ||
322 | |||
323 | On the occasion that you would be installing custom CMake toolchain | ||
324 | files supplied by the application being built, you should install them | ||
325 | to the preferred CMake Module directory: ``${D}${datadir}/cmake/`` | ||
326 | Modules during | ||
327 | ```do_install`` <&YOCTO_DOCS_REF_URL;#ref-tasks-install>`__. | ||
328 | |||
329 | .. _ref-classes-cml1: | ||
330 | |||
331 | ``cml1.bbclass`` | ||
332 | ================ | ||
333 | |||
334 | The ``cml1`` class provides basic support for the Linux kernel style | ||
335 | build configuration system. | ||
336 | |||
337 | .. _ref-classes-compress_doc: | ||
338 | |||
339 | ``compress_doc.bbclass`` | ||
340 | ======================== | ||
341 | |||
342 | Enables compression for man pages and info pages. This class is intended | ||
343 | to be inherited globally. The default compression mechanism is gz (gzip) | ||
344 | but you can select an alternative mechanism by setting the | ||
345 | ```DOC_COMPRESS`` <#var-DOC_COMPRESS>`__ variable. | ||
346 | |||
347 | .. _ref-classes-copyleft_compliance: | ||
348 | |||
349 | ``copyleft_compliance.bbclass`` | ||
350 | =============================== | ||
351 | |||
352 | The ``copyleft_compliance`` class preserves source code for the purposes | ||
353 | of license compliance. This class is an alternative to the ``archiver`` | ||
354 | class and is still used by some users even though it has been deprecated | ||
355 | in favor of the ```archiver`` <#ref-classes-archiver>`__ class. | ||
356 | |||
357 | .. _ref-classes-copyleft_filter: | ||
358 | |||
359 | ``copyleft_filter.bbclass`` | ||
360 | =========================== | ||
361 | |||
362 | A class used by the ```archiver`` <#ref-classes-archiver>`__ and | ||
363 | ```copyleft_compliance`` <#ref-classes-copyleft_compliance>`__ classes | ||
364 | for filtering licenses. The ``copyleft_filter`` class is an internal | ||
365 | class and is not intended to be used directly. | ||
366 | |||
367 | .. _ref-classes-core-image: | ||
368 | |||
369 | ``core-image.bbclass`` | ||
370 | ====================== | ||
371 | |||
372 | The ``core-image`` class provides common definitions for the | ||
373 | ``core-image-*`` image recipes, such as support for additional | ||
374 | ```IMAGE_FEATURES`` <#var-IMAGE_FEATURES>`__. | ||
375 | |||
376 | .. _ref-classes-cpan: | ||
377 | |||
378 | ``cpan*.bbclass`` | ||
379 | ================= | ||
380 | |||
381 | The ``cpan*`` classes support Perl modules. | ||
382 | |||
383 | Recipes for Perl modules are simple. These recipes usually only need to | ||
384 | point to the source's archive and then inherit the proper class file. | ||
385 | Building is split into two methods depending on which method the module | ||
386 | authors used. | ||
387 | |||
388 | - Modules that use old ``Makefile.PL``-based build system require | ||
389 | ``cpan.bbclass`` in their recipes. | ||
390 | |||
391 | - Modules that use ``Build.PL``-based build system require using | ||
392 | ``cpan_build.bbclass`` in their recipes. | ||
393 | |||
394 | Both build methods inherit the ``cpan-base`` class for basic Perl | ||
395 | support. | ||
396 | |||
397 | .. _ref-classes-cross: | ||
398 | |||
399 | ``cross.bbclass`` | ||
400 | ================= | ||
401 | |||
402 | The ``cross`` class provides support for the recipes that build the | ||
403 | cross-compilation tools. | ||
404 | |||
405 | .. _ref-classes-cross-canadian: | ||
406 | |||
407 | ``cross-canadian.bbclass`` | ||
408 | ========================== | ||
409 | |||
410 | The ``cross-canadian`` class provides support for the recipes that build | ||
411 | the Canadian Cross-compilation tools for SDKs. See the | ||
412 | "`Cross-Development Toolchain | ||
413 | Generation <&YOCTO_DOCS_OM_URL;#cross-development-toolchain-generation>`__" | ||
414 | section in the Yocto Project Overview and Concepts Manual for more | ||
415 | discussion on these cross-compilation tools. | ||
416 | |||
417 | .. _ref-classes-crosssdk: | ||
418 | |||
419 | ``crosssdk.bbclass`` | ||
420 | ==================== | ||
421 | |||
422 | The ``crosssdk`` class provides support for the recipes that build the | ||
423 | cross-compilation tools used for building SDKs. See the | ||
424 | "`Cross-Development Toolchain | ||
425 | Generation <&YOCTO_DOCS_OM_URL;#cross-development-toolchain-generation>`__" | ||
426 | section in the Yocto Project Overview and Concepts Manual for more | ||
427 | discussion on these cross-compilation tools. | ||
428 | |||
429 | .. _ref-classes-debian: | ||
430 | |||
431 | ``debian.bbclass`` | ||
432 | ================== | ||
433 | |||
434 | The ``debian`` class renames output packages so that they follow the | ||
435 | Debian naming policy (i.e. ``glibc`` becomes ``libc6`` and | ||
436 | ``glibc-devel`` becomes ``libc6-dev``.) Renaming includes the library | ||
437 | name and version as part of the package name. | ||
438 | |||
439 | If a recipe creates packages for multiple libraries (shared object files | ||
440 | of ``.so`` type), use the ```LEAD_SONAME`` <#var-LEAD_SONAME>`__ | ||
441 | variable in the recipe to specify the library on which to apply the | ||
442 | naming scheme. | ||
443 | |||
444 | .. _ref-classes-deploy: | ||
445 | |||
446 | ``deploy.bbclass`` | ||
447 | ================== | ||
448 | |||
449 | The ``deploy`` class handles deploying files to the | ||
450 | ```DEPLOY_DIR_IMAGE`` <#var-DEPLOY_DIR_IMAGE>`__ directory. The main | ||
451 | function of this class is to allow the deploy step to be accelerated by | ||
452 | shared state. Recipes that inherit this class should define their own | ||
453 | ```do_deploy`` <#ref-tasks-deploy>`__ function to copy the files to be | ||
454 | deployed to ```DEPLOYDIR`` <#var-DEPLOYDIR>`__, and use ``addtask`` to | ||
455 | add the task at the appropriate place, which is usually after | ||
456 | ```do_compile`` <#ref-tasks-compile>`__ or | ||
457 | ```do_install`` <#ref-tasks-install>`__. The class then takes care of | ||
458 | staging the files from ``DEPLOYDIR`` to ``DEPLOY_DIR_IMAGE``. | ||
459 | |||
460 | .. _ref-classes-devshell: | ||
461 | |||
462 | ``devshell.bbclass`` | ||
463 | ==================== | ||
464 | |||
465 | The ``devshell`` class adds the ``do_devshell`` task. Distribution | ||
466 | policy dictates whether to include this class. See the "`Using a | ||
467 | Development Shell <&YOCTO_DOCS_DEV_URL;#platdev-appdev-devshell>`__" | ||
468 | section in the Yocto Project Development Tasks Manual for more | ||
469 | information about using ``devshell``. | ||
470 | |||
471 | .. _ref-classes-devupstream: | ||
472 | |||
473 | ``devupstream.bbclass`` | ||
474 | ======================= | ||
475 | |||
476 | The ``devupstream`` class uses | ||
477 | ```BBCLASSEXTEND`` <#var-BBCLASSEXTEND>`__ to add a variant of the | ||
478 | recipe that fetches from an alternative URI (e.g. Git) instead of a | ||
479 | tarball. Following is an example: BBCLASSEXTEND = "devupstream:target" | ||
480 | SRC_URI_class-devupstream = "git://git.example.com/example" | ||
481 | SRCREV_class-devupstream = "abcd1234" Adding the above statements to | ||
482 | your recipe creates a variant that has | ||
483 | ```DEFAULT_PREFERENCE`` <#var-DEFAULT_PREFERENCE>`__ set to "-1". | ||
484 | Consequently, you need to select the variant of the recipe to use it. | ||
485 | Any development-specific adjustments can be done by using the | ||
486 | ``class-devupstream`` override. Here is an example: | ||
487 | DEPENDS_append_class-devupstream = " gperf-native" | ||
488 | do_configure_prepend_class-devupstream() { touch ${S}/README } The class | ||
489 | currently only supports creating a development variant of the target | ||
490 | recipe, not ``native`` or ``nativesdk`` variants. | ||
491 | |||
492 | The ``BBCLASSEXTEND`` syntax (i.e. ``devupstream:target``) provides | ||
493 | support for ``native`` and ``nativesdk`` variants. Consequently, this | ||
494 | functionality can be added in a future release. | ||
495 | |||
496 | Support for other version control systems such as Subversion is limited | ||
497 | due to BitBake's automatic fetch dependencies (e.g. | ||
498 | ``subversion-native``). | ||
499 | |||
500 | .. _ref-classes-distro_features_check: | ||
501 | |||
502 | ``distro_features_check.bbclass`` | ||
503 | ================================= | ||
504 | |||
505 | The ``distro_features_check`` class allows individual recipes to check | ||
506 | for required and conflicting | ||
507 | ```DISTRO_FEATURES`` <#var-DISTRO_FEATURES>`__. | ||
508 | |||
509 | This class provides support for the | ||
510 | ```REQUIRED_DISTRO_FEATURES`` <#var-REQUIRED_DISTRO_FEATURES>`__ and | ||
511 | ```CONFLICT_DISTRO_FEATURES`` <#var-CONFLICT_DISTRO_FEATURES>`__ | ||
512 | variables. If any conditions specified in the recipe using the above | ||
513 | variables are not met, the recipe will be skipped. | ||
514 | |||
515 | .. _ref-classes-distutils: | ||
516 | |||
517 | ``distutils*.bbclass`` | ||
518 | ====================== | ||
519 | |||
520 | The ``distutils*`` classes support recipes for Python version 2.x | ||
521 | extensions, which are simple. These recipes usually only need to point | ||
522 | to the source's archive and then inherit the proper class. Building is | ||
523 | split into two methods depending on which method the module authors | ||
524 | used. | ||
525 | |||
526 | - Extensions that use an Autotools-based build system require Autotools | ||
527 | and the classes based on ``distutils`` in their recipes. | ||
528 | |||
529 | - Extensions that use build systems based on ``distutils`` require the | ||
530 | ``distutils`` class in their recipes. | ||
531 | |||
532 | - Extensions that use build systems based on ``setuptools`` require the | ||
533 | ```setuptools`` <#ref-classes-setuptools>`__ class in their recipes. | ||
534 | |||
535 | The ``distutils-common-base`` class is required by some of the | ||
536 | ``distutils*`` classes to provide common Python2 support. | ||
537 | |||
538 | .. _ref-classes-distutils3: | ||
539 | |||
540 | ``distutils3*.bbclass`` | ||
541 | ======================= | ||
542 | |||
543 | The ``distutils3*`` classes support recipes for Python version 3.x | ||
544 | extensions, which are simple. These recipes usually only need to point | ||
545 | to the source's archive and then inherit the proper class. Building is | ||
546 | split into three methods depending on which method the module authors | ||
547 | used. | ||
548 | |||
549 | - Extensions that use an Autotools-based build system require Autotools | ||
550 | and ``distutils``-based classes in their recipes. | ||
551 | |||
552 | - Extensions that use ``distutils``-based build systems require the | ||
553 | ``distutils`` class in their recipes. | ||
554 | |||
555 | - Extensions that use build systems based on ``setuptools3`` require | ||
556 | the ```setuptools3`` <#ref-classes-setuptools>`__ class in their | ||
557 | recipes. | ||
558 | |||
559 | The ``distutils3*`` classes either inherit their corresponding | ||
560 | ``distutils*`` class or replicate them using a Python3 version instead | ||
561 | (e.g. ``distutils3-base`` inherits ``distutils-common-base``, which is | ||
562 | the same as ``distutils-base`` but inherits ``python3native`` instead of | ||
563 | ``pythonnative``). | ||
564 | |||
565 | .. _ref-classes-externalsrc: | ||
566 | |||
567 | ``externalsrc.bbclass`` | ||
568 | ======================= | ||
569 | |||
570 | The ``externalsrc`` class supports building software from source code | ||
571 | that is external to the OpenEmbedded build system. Building software | ||
572 | from an external source tree means that the build system's normal fetch, | ||
573 | unpack, and patch process is not used. | ||
574 | |||
575 | By default, the OpenEmbedded build system uses the ```S`` <#var-S>`__ | ||
576 | and ```B`` <#var-B>`__ variables to locate unpacked recipe source code | ||
577 | and to build it, respectively. When your recipe inherits the | ||
578 | ``externalsrc`` class, you use the | ||
579 | ```EXTERNALSRC`` <#var-EXTERNALSRC>`__ and | ||
580 | ```EXTERNALSRC_BUILD`` <#var-EXTERNALSRC_BUILD>`__ variables to | ||
581 | ultimately define ``S`` and ``B``. | ||
582 | |||
583 | By default, this class expects the source code to support recipe builds | ||
584 | that use the ```B`` <#var-B>`__ variable to point to the directory in | ||
585 | which the OpenEmbedded build system places the generated objects built | ||
586 | from the recipes. By default, the ``B`` directory is set to the | ||
587 | following, which is separate from the source directory (``S``): | ||
588 | ${WORKDIR}/${BPN}/{PV}/ See these variables for more information: | ||
589 | ```WORKDIR`` <#var-WORKDIR>`__, ```BPN`` <#var-BPN>`__, and | ||
590 | ```PV`` <#var-PV>`__, | ||
591 | |||
592 | For more information on the ``externalsrc`` class, see the comments in | ||
593 | ``meta/classes/externalsrc.bbclass`` in the `Source | ||
594 | Directory <#source-directory>`__. For information on how to use the | ||
595 | ``externalsrc`` class, see the "`Building Software from an External | ||
596 | Source <&YOCTO_DOCS_DEV_URL;#building-software-from-an-external-source>`__" | ||
597 | section in the Yocto Project Development Tasks Manual. | ||
598 | |||
599 | .. _ref-classes-extrausers: | ||
600 | |||
601 | ``extrausers.bbclass`` | ||
602 | ====================== | ||
603 | |||
604 | The ``extrausers`` class allows additional user and group configuration | ||
605 | to be applied at the image level. Inheriting this class either globally | ||
606 | or from an image recipe allows additional user and group operations to | ||
607 | be performed using the | ||
608 | ```EXTRA_USERS_PARAMS`` <#var-EXTRA_USERS_PARAMS>`__ variable. | ||
609 | |||
610 | .. note:: | ||
611 | |||
612 | The user and group operations added using the | ||
613 | extrausers | ||
614 | class are not tied to a specific recipe outside of the recipe for the | ||
615 | image. Thus, the operations can be performed across the image as a | ||
616 | whole. Use the | ||
617 | useradd | ||
618 | class to add user and group configuration to a specific recipe. | ||
619 | |||
620 | Here is an example that uses this class in an image recipe: inherit | ||
621 | extrausers EXTRA_USERS_PARAMS = "\\ useradd -p '' tester; \\ groupadd | ||
622 | developers; \\ userdel nobody; \\ groupdel -g video; \\ groupmod -g 1020 | ||
623 | developers; \\ usermod -s /bin/sh tester; \\ " Here is an example that | ||
624 | adds two users named "tester-jim" and "tester-sue" and assigns | ||
625 | passwords: inherit extrausers EXTRA_USERS_PARAMS = "\\ useradd -P | ||
626 | tester01 tester-jim; \\ useradd -P tester01 tester-sue; \\ " Finally, | ||
627 | here is an example that sets the root password to "1876*18": inherit | ||
628 | extrausers EXTRA_USERS_PARAMS = "\\ usermod -P 1876*18 root; \\ " | ||
629 | |||
630 | .. _ref-classes-fontcache: | ||
631 | |||
632 | ``fontcache.bbclass`` | ||
633 | ===================== | ||
634 | |||
635 | The ``fontcache`` class generates the proper post-install and | ||
636 | post-remove (postinst and postrm) scriptlets for font packages. These | ||
637 | scriptlets call ``fc-cache`` (part of ``Fontconfig``) to add the fonts | ||
638 | to the font information cache. Since the cache files are | ||
639 | architecture-specific, ``fc-cache`` runs using QEMU if the postinst | ||
640 | scriptlets need to be run on the build host during image creation. | ||
641 | |||
642 | If the fonts being installed are in packages other than the main | ||
643 | package, set ```FONT_PACKAGES`` <#var-FONT_PACKAGES>`__ to specify the | ||
644 | packages containing the fonts. | ||
645 | |||
646 | .. _ref-classes-fs-uuid: | ||
647 | |||
648 | ``fs-uuid.bbclass`` | ||
649 | =================== | ||
650 | |||
651 | The ``fs-uuid`` class extracts UUID from | ||
652 | ``${``\ ```ROOTFS`` <#var-ROOTFS>`__\ ``}``, which must have been built | ||
653 | by the time that this function gets called. The ``fs-uuid`` class only | ||
654 | works on ``ext`` file systems and depends on ``tune2fs``. | ||
655 | |||
656 | .. _ref-classes-gconf: | ||
657 | |||
658 | ``gconf.bbclass`` | ||
659 | ================= | ||
660 | |||
661 | The ``gconf`` class provides common functionality for recipes that need | ||
662 | to install GConf schemas. The schemas will be put into a separate | ||
663 | package (``${``\ ```PN`` <#var-PN>`__\ ``}-gconf``) that is created | ||
664 | automatically when this class is inherited. This package uses the | ||
665 | appropriate post-install and post-remove (postinst/postrm) scriptlets to | ||
666 | register and unregister the schemas in the target image. | ||
667 | |||
668 | .. _ref-classes-gettext: | ||
669 | |||
670 | ``gettext.bbclass`` | ||
671 | =================== | ||
672 | |||
673 | The ``gettext`` class provides support for building software that uses | ||
674 | the GNU ``gettext`` internationalization and localization system. All | ||
675 | recipes building software that use ``gettext`` should inherit this | ||
676 | class. | ||
677 | |||
678 | .. _ref-classes-gnomebase: | ||
679 | |||
680 | ``gnomebase.bbclass`` | ||
681 | ===================== | ||
682 | |||
683 | The ``gnomebase`` class is the base class for recipes that build | ||
684 | software from the GNOME stack. This class sets | ||
685 | ```SRC_URI`` <#var-SRC_URI>`__ to download the source from the GNOME | ||
686 | mirrors as well as extending ```FILES`` <#var-FILES>`__ with the typical | ||
687 | GNOME installation paths. | ||
688 | |||
689 | .. _ref-classes-gobject-introspection: | ||
690 | |||
691 | ``gobject-introspection.bbclass`` | ||
692 | ================================= | ||
693 | |||
694 | Provides support for recipes building software that supports GObject | ||
695 | introspection. This functionality is only enabled if the | ||
696 | "gobject-introspection-data" feature is in | ||
697 | ```DISTRO_FEATURES`` <#var-DISTRO_FEATURES>`__ as well as | ||
698 | "qemu-usermode" being in | ||
699 | ```MACHINE_FEATURES`` <#var-MACHINE_FEATURES>`__. | ||
700 | |||
701 | .. note:: | ||
702 | |||
703 | This functionality is backfilled by default and, if not applicable, | ||
704 | should be disabled through | ||
705 | DISTRO_FEATURES_BACKFILL_CONSIDERED | ||
706 | or | ||
707 | MACHINE_FEATURES_BACKFILL_CONSIDERED | ||
708 | , respectively. | ||
709 | |||
710 | .. _ref-classes-grub-efi: | ||
711 | |||
712 | ``grub-efi.bbclass`` | ||
713 | ==================== | ||
714 | |||
715 | The ``grub-efi`` class provides ``grub-efi``-specific functions for | ||
716 | building bootable images. | ||
717 | |||
718 | This class supports several variables: | ||
719 | |||
720 | - ```INITRD`` <#var-INITRD>`__: Indicates list of filesystem images to | ||
721 | concatenate and use as an initial RAM disk (initrd) (optional). | ||
722 | |||
723 | - ```ROOTFS`` <#var-ROOTFS>`__: Indicates a filesystem image to include | ||
724 | as the root filesystem (optional). | ||
725 | |||
726 | - ```GRUB_GFXSERIAL`` <#var-GRUB_GFXSERIAL>`__: Set this to "1" to have | ||
727 | graphics and serial in the boot menu. | ||
728 | |||
729 | - ```LABELS`` <#var-LABELS>`__: A list of targets for the automatic | ||
730 | configuration. | ||
731 | |||
732 | - ```APPEND`` <#var-APPEND>`__: An override list of append strings for | ||
733 | each ``LABEL``. | ||
734 | |||
735 | - ```GRUB_OPTS`` <#var-GRUB_OPTS>`__: Additional options to add to the | ||
736 | configuration (optional). Options are delimited using semi-colon | ||
737 | characters (``;``). | ||
738 | |||
739 | - ```GRUB_TIMEOUT`` <#var-GRUB_TIMEOUT>`__: Timeout before executing | ||
740 | the default ``LABEL`` (optional). | ||
741 | |||
742 | .. _ref-classes-gsettings: | ||
743 | |||
744 | ``gsettings.bbclass`` | ||
745 | ===================== | ||
746 | |||
747 | The ``gsettings`` class provides common functionality for recipes that | ||
748 | need to install GSettings (glib) schemas. The schemas are assumed to be | ||
749 | part of the main package. Appropriate post-install and post-remove | ||
750 | (postinst/postrm) scriptlets are added to register and unregister the | ||
751 | schemas in the target image. | ||
752 | |||
753 | .. _ref-classes-gtk-doc: | ||
754 | |||
755 | ``gtk-doc.bbclass`` | ||
756 | =================== | ||
757 | |||
758 | The ``gtk-doc`` class is a helper class to pull in the appropriate | ||
759 | ``gtk-doc`` dependencies and disable ``gtk-doc``. | ||
760 | |||
761 | .. _ref-classes-gtk-icon-cache: | ||
762 | |||
763 | ``gtk-icon-cache.bbclass`` | ||
764 | ========================== | ||
765 | |||
766 | The ``gtk-icon-cache`` class generates the proper post-install and | ||
767 | post-remove (postinst/postrm) scriptlets for packages that use GTK+ and | ||
768 | install icons. These scriptlets call ``gtk-update-icon-cache`` to add | ||
769 | the fonts to GTK+'s icon cache. Since the cache files are | ||
770 | architecture-specific, ``gtk-update-icon-cache`` is run using QEMU if | ||
771 | the postinst scriptlets need to be run on the build host during image | ||
772 | creation. | ||
773 | |||
774 | .. _ref-classes-gtk-immodules-cache: | ||
775 | |||
776 | ``gtk-immodules-cache.bbclass`` | ||
777 | =============================== | ||
778 | |||
779 | The ``gtk-immodules-cache`` class generates the proper post-install and | ||
780 | post-remove (postinst/postrm) scriptlets for packages that install GTK+ | ||
781 | input method modules for virtual keyboards. These scriptlets call | ||
782 | ``gtk-update-icon-cache`` to add the input method modules to the cache. | ||
783 | Since the cache files are architecture-specific, | ||
784 | ``gtk-update-icon-cache`` is run using QEMU if the postinst scriptlets | ||
785 | need to be run on the build host during image creation. | ||
786 | |||
787 | If the input method modules being installed are in packages other than | ||
788 | the main package, set | ||
789 | ```GTKIMMODULES_PACKAGES`` <#var-GTKIMMODULES_PACKAGES>`__ to specify | ||
790 | the packages containing the modules. | ||
791 | |||
792 | .. _ref-classes-gzipnative: | ||
793 | |||
794 | ``gzipnative.bbclass`` | ||
795 | ====================== | ||
796 | |||
797 | The ``gzipnative`` class enables the use of different native versions of | ||
798 | ``gzip`` and ``pigz`` rather than the versions of these tools from the | ||
799 | build host. | ||
800 | |||
801 | .. _ref-classes-icecc: | ||
802 | |||
803 | ``icecc.bbclass`` | ||
804 | ================= | ||
805 | |||
806 | The ``icecc`` class supports | ||
807 | `Icecream <https://github.com/icecc/icecream>`__, which facilitates | ||
808 | taking compile jobs and distributing them among remote machines. | ||
809 | |||
810 | The class stages directories with symlinks from ``gcc`` and ``g++`` to | ||
811 | ``icecc``, for both native and cross compilers. Depending on each | ||
812 | configure or compile, the OpenEmbedded build system adds the directories | ||
813 | at the head of the ``PATH`` list and then sets the ``ICECC_CXX`` and | ||
814 | ``ICEC_CC`` variables, which are the paths to the ``g++`` and ``gcc`` | ||
815 | compilers, respectively. | ||
816 | |||
817 | For the cross compiler, the class creates a ``tar.gz`` file that | ||
818 | contains the Yocto Project toolchain and sets ``ICECC_VERSION``, which | ||
819 | is the version of the cross-compiler used in the cross-development | ||
820 | toolchain, accordingly. | ||
821 | |||
822 | The class handles all three different compile stages (i.e native | ||
823 | ,cross-kernel and target) and creates the necessary environment | ||
824 | ``tar.gz`` file to be used by the remote machines. The class also | ||
825 | supports SDK generation. | ||
826 | |||
827 | If ```ICECC_PATH`` <#var-ICECC_PATH>`__ is not set in your | ||
828 | ``local.conf`` file, then the class tries to locate the ``icecc`` binary | ||
829 | using ``which``. If ```ICECC_ENV_EXEC`` <#var-ICECC_ENV_EXEC>`__ is set | ||
830 | in your ``local.conf`` file, the variable should point to the | ||
831 | ``icecc-create-env`` script provided by the user. If you do not point to | ||
832 | a user-provided script, the build system uses the default script | ||
833 | provided by the recipe ``icecc-create-env-native.bb``. | ||
834 | |||
835 | .. note:: | ||
836 | |||
837 | This script is a modified version and not the one that comes with | ||
838 | icecc | ||
839 | . | ||
840 | |||
841 | If you do not want the Icecream distributed compile support to apply to | ||
842 | specific recipes or classes, you can effectively "blacklist" them by | ||
843 | listing the recipes and classes using the | ||
844 | ```ICECC_USER_PACKAGE_BL`` <#var-ICECC_USER_PACKAGE_BL>`__ and | ||
845 | ```ICECC_USER_CLASS_BL`` <#var-ICECC_USER_CLASS_BL>`__, variables, | ||
846 | respectively, in your ``local.conf`` file. Doing so causes the | ||
847 | OpenEmbedded build system to handle these compilations locally. | ||
848 | |||
849 | Additionally, you can list recipes using the | ||
850 | ```ICECC_USER_PACKAGE_WL`` <#var-ICECC_USER_PACKAGE_WL>`__ variable in | ||
851 | your ``local.conf`` file to force ``icecc`` to be enabled for recipes | ||
852 | using an empty ```PARALLEL_MAKE`` <#var-PARALLEL_MAKE>`__ variable. | ||
853 | |||
854 | Inheriting the ``icecc`` class changes all sstate signatures. | ||
855 | Consequently, if a development team has a dedicated build system that | ||
856 | populates ```STATE_MIRRORS`` <#var-SSTATE_MIRRORS>`__ and they want to | ||
857 | reuse sstate from ``STATE_MIRRORS``, then all developers and the build | ||
858 | system need to either inherit the ``icecc`` class or nobody should. | ||
859 | |||
860 | At the distribution level, you can inherit the ``icecc`` class to be | ||
861 | sure that all builders start with the same sstate signatures. After | ||
862 | inheriting the class, you can then disable the feature by setting the | ||
863 | ```ICECC_DISABLED`` <#var-ICECC_DISABLED>`__ variable to "1" as follows: | ||
864 | INHERIT_DISTRO_append = " icecc" ICECC_DISABLED ??= "1" This practice | ||
865 | makes sure everyone is using the same signatures but also requires | ||
866 | individuals that do want to use Icecream to enable the feature | ||
867 | individually as follows in your ``local.conf`` file: ICECC_DISABLED = "" | ||
868 | |||
869 | .. _ref-classes-image: | ||
870 | |||
871 | ``image.bbclass`` | ||
872 | ================= | ||
873 | |||
874 | The ``image`` class helps support creating images in different formats. | ||
875 | First, the root filesystem is created from packages using one of the | ||
876 | ``rootfs*.bbclass`` files (depending on the package format used) and | ||
877 | then one or more image files are created. | ||
878 | |||
879 | - The ``IMAGE_FSTYPES`` variable controls the types of images to | ||
880 | generate. | ||
881 | |||
882 | - The ``IMAGE_INSTALL`` variable controls the list of packages to | ||
883 | install into the image. | ||
884 | |||
885 | For information on customizing images, see the "`Customizing | ||
886 | Images <&YOCTO_DOCS_DEV_URL;#usingpoky-extend-customimage>`__" section | ||
887 | in the Yocto Project Development Tasks Manual. For information on how | ||
888 | images are created, see the | ||
889 | "`Images <&YOCTO_DOCS_OM_URL;#images-dev-environment>`__" section in the | ||
890 | Yocto Project Overview and Concpets Manual. | ||
891 | |||
892 | .. _ref-classes-image-buildinfo: | ||
893 | |||
894 | ``image-buildinfo.bbclass`` | ||
895 | =========================== | ||
896 | |||
897 | The ``image-buildinfo`` class writes information to the target | ||
898 | filesystem on ``/etc/build``. | ||
899 | |||
900 | .. _ref-classes-image_types: | ||
901 | |||
902 | ``image_types.bbclass`` | ||
903 | ======================= | ||
904 | |||
905 | The ``image_types`` class defines all of the standard image output types | ||
906 | that you can enable through the | ||
907 | ```IMAGE_FSTYPES`` <#var-IMAGE_FSTYPES>`__ variable. You can use this | ||
908 | class as a reference on how to add support for custom image output | ||
909 | types. | ||
910 | |||
911 | By default, the ```image`` <#ref-classes-image>`__ class automatically | ||
912 | enables the ``image_types`` class. The ``image`` class uses the | ||
913 | ``IMGCLASSES`` variable as follows: IMGCLASSES = | ||
914 | "rootfs_${IMAGE_PKGTYPE} image_types ${IMAGE_CLASSES}" IMGCLASSES += | ||
915 | "${@['populate_sdk_base', 'populate_sdk_ext']['linux' in | ||
916 | d.getVar("SDK_OS")]}" IMGCLASSES += | ||
917 | "${@bb.utils.contains_any('IMAGE_FSTYPES', 'live iso hddimg', | ||
918 | 'image-live', '', d)}" IMGCLASSES += | ||
919 | "${@bb.utils.contains('IMAGE_FSTYPES', 'container', 'image-container', | ||
920 | '', d)}" IMGCLASSES += "image_types_wic" IMGCLASSES += | ||
921 | "rootfs-postcommands" IMGCLASSES += "image-postinst-intercepts" inherit | ||
922 | ${IMGCLASSES} | ||
923 | |||
924 | The ``image_types`` class also handles conversion and compression of | ||
925 | images. | ||
926 | |||
927 | .. note:: | ||
928 | |||
929 | To build a VMware VMDK image, you need to add "wic.vmdk" to | ||
930 | IMAGE_FSTYPES | ||
931 | . This would also be similar for Virtual Box Virtual Disk Image | ||
932 | ("vdi") and QEMU Copy On Write Version 2 ("qcow2") images. | ||
933 | |||
934 | .. _ref-classes-image-live: | ||
935 | |||
936 | ``image-live.bbclass`` | ||
937 | ====================== | ||
938 | |||
939 | This class controls building "live" (i.e. HDDIMG and ISO) images. Live | ||
940 | images contain syslinux for legacy booting, as well as the bootloader | ||
941 | specified by ```EFI_PROVIDER`` <#var-EFI_PROVIDER>`__ if | ||
942 | ```MACHINE_FEATURES`` <#var-MACHINE_FEATURES>`__ contains "efi". | ||
943 | |||
944 | Normally, you do not use this class directly. Instead, you add "live" to | ||
945 | ```IMAGE_FSTYPES`` <#var-IMAGE_FSTYPES>`__. | ||
946 | |||
947 | .. _ref-classes-image-mklibs: | ||
948 | |||
949 | ``image-mklibs.bbclass`` | ||
950 | ======================== | ||
951 | |||
952 | The ``image-mklibs`` class enables the use of the ``mklibs`` utility | ||
953 | during the ```do_rootfs`` <#ref-tasks-rootfs>`__ task, which optimizes | ||
954 | the size of libraries contained in the image. | ||
955 | |||
956 | By default, the class is enabled in the ``local.conf.template`` using | ||
957 | the ```USER_CLASSES`` <#var-USER_CLASSES>`__ variable as follows: | ||
958 | USER_CLASSES ?= "buildstats image-mklibs image-prelink" | ||
959 | |||
960 | .. _ref-classes-image-prelink: | ||
961 | |||
962 | ``image-prelink.bbclass`` | ||
963 | ========================= | ||
964 | |||
965 | The ``image-prelink`` class enables the use of the ``prelink`` utility | ||
966 | during the ```do_rootfs`` <#ref-tasks-rootfs>`__ task, which optimizes | ||
967 | the dynamic linking of shared libraries to reduce executable startup | ||
968 | time. | ||
969 | |||
970 | By default, the class is enabled in the ``local.conf.template`` using | ||
971 | the ```USER_CLASSES`` <#var-USER_CLASSES>`__ variable as follows: | ||
972 | USER_CLASSES ?= "buildstats image-mklibs image-prelink" | ||
973 | |||
974 | .. _ref-classes-insane: | ||
975 | |||
976 | ``insane.bbclass`` | ||
977 | ================== | ||
978 | |||
979 | The ``insane`` class adds a step to the package generation process so | ||
980 | that output quality assurance checks are generated by the OpenEmbedded | ||
981 | build system. A range of checks are performed that check the build's | ||
982 | output for common problems that show up during runtime. Distribution | ||
983 | policy usually dictates whether to include this class. | ||
984 | |||
985 | You can configure the sanity checks so that specific test failures | ||
986 | either raise a warning or an error message. Typically, failures for new | ||
987 | tests generate a warning. Subsequent failures for the same test would | ||
988 | then generate an error message once the metadata is in a known and good | ||
989 | condition. See the "`QA Error and Warning Messages <#ref-qa-checks>`__" | ||
990 | Chapter for a list of all the warning and error messages you might | ||
991 | encounter using a default configuration. | ||
992 | |||
993 | Use the ```WARN_QA`` <#var-WARN_QA>`__ and | ||
994 | ```ERROR_QA`` <#var-ERROR_QA>`__ variables to control the behavior of | ||
995 | these checks at the global level (i.e. in your custom distro | ||
996 | configuration). However, to skip one or more checks in recipes, you | ||
997 | should use ```INSANE_SKIP`` <#var-INSANE_SKIP>`__. For example, to skip | ||
998 | the check for symbolic link ``.so`` files in the main package of a | ||
999 | recipe, add the following to the recipe. You need to realize that the | ||
1000 | package name override, in this example ``${PN}``, must be used: | ||
1001 | INSANE_SKIP_${PN} += "dev-so" Please keep in mind that the QA checks | ||
1002 | exist in order to detect real or potential problems in the packaged | ||
1003 | output. So exercise caution when disabling these checks. | ||
1004 | |||
1005 | The following list shows the tests you can list with the ``WARN_QA`` and | ||
1006 | ``ERROR_QA`` variables: | ||
1007 | |||
1008 | - *``already-stripped:``* Checks that produced binaries have not | ||
1009 | already been stripped prior to the build system extracting debug | ||
1010 | symbols. It is common for upstream software projects to default to | ||
1011 | stripping debug symbols for output binaries. In order for debugging | ||
1012 | to work on the target using ``-dbg`` packages, this stripping must be | ||
1013 | disabled. | ||
1014 | |||
1015 | - *``arch:``* Checks the Executable and Linkable Format (ELF) type, bit | ||
1016 | size, and endianness of any binaries to ensure they match the target | ||
1017 | architecture. This test fails if any binaries do not match the type | ||
1018 | since there would be an incompatibility. The test could indicate that | ||
1019 | the wrong compiler or compiler options have been used. Sometimes | ||
1020 | software, like bootloaders, might need to bypass this check. | ||
1021 | |||
1022 | - *``buildpaths:``* Checks for paths to locations on the build host | ||
1023 | inside the output files. Currently, this test triggers too many false | ||
1024 | positives and thus is not normally enabled. | ||
1025 | |||
1026 | - *``build-deps:``* Determines if a build-time dependency that is | ||
1027 | specified through ```DEPENDS`` <#var-DEPENDS>`__, explicit | ||
1028 | ```RDEPENDS`` <#var-RDEPENDS>`__, or task-level dependencies exists | ||
1029 | to match any runtime dependency. This determination is particularly | ||
1030 | useful to discover where runtime dependencies are detected and added | ||
1031 | during packaging. If no explicit dependency has been specified within | ||
1032 | the metadata, at the packaging stage it is too late to ensure that | ||
1033 | the dependency is built, and thus you can end up with an error when | ||
1034 | the package is installed into the image during the | ||
1035 | ```do_rootfs`` <#ref-tasks-rootfs>`__ task because the auto-detected | ||
1036 | dependency was not satisfied. An example of this would be where the | ||
1037 | ```update-rc.d`` <#ref-classes-update-rc.d>`__ class automatically | ||
1038 | adds a dependency on the ``initscripts-functions`` package to | ||
1039 | packages that install an initscript that refers to | ||
1040 | ``/etc/init.d/functions``. The recipe should really have an explicit | ||
1041 | ``RDEPENDS`` for the package in question on ``initscripts-functions`` | ||
1042 | so that the OpenEmbedded build system is able to ensure that the | ||
1043 | ``initscripts`` recipe is actually built and thus the | ||
1044 | ``initscripts-functions`` package is made available. | ||
1045 | |||
1046 | - *``compile-host-path:``* Checks the | ||
1047 | ```do_compile`` <#ref-tasks-compile>`__ log for indications that | ||
1048 | paths to locations on the build host were used. Using such paths | ||
1049 | might result in host contamination of the build output. | ||
1050 | |||
1051 | - *``debug-deps:``* Checks that all packages except ``-dbg`` packages | ||
1052 | do not depend on ``-dbg`` packages, which would cause a packaging | ||
1053 | bug. | ||
1054 | |||
1055 | - *``debug-files:``* Checks for ``.debug`` directories in anything but | ||
1056 | the ``-dbg`` package. The debug files should all be in the ``-dbg`` | ||
1057 | package. Thus, anything packaged elsewhere is incorrect packaging. | ||
1058 | |||
1059 | - *``dep-cmp:``* Checks for invalid version comparison statements in | ||
1060 | runtime dependency relationships between packages (i.e. in | ||
1061 | ```RDEPENDS`` <#var-RDEPENDS>`__, | ||
1062 | ```RRECOMMENDS`` <#var-RRECOMMENDS>`__, | ||
1063 | ```RSUGGESTS`` <#var-RSUGGESTS>`__, | ||
1064 | ```RPROVIDES`` <#var-RPROVIDES>`__, | ||
1065 | ```RREPLACES`` <#var-RREPLACES>`__, and | ||
1066 | ```RCONFLICTS`` <#var-RCONFLICTS>`__ variable values). Any invalid | ||
1067 | comparisons might trigger failures or undesirable behavior when | ||
1068 | passed to the package manager. | ||
1069 | |||
1070 | - *``desktop:``* Runs the ``desktop-file-validate`` program against any | ||
1071 | ``.desktop`` files to validate their contents against the | ||
1072 | specification for ``.desktop`` files. | ||
1073 | |||
1074 | - *``dev-deps:``* Checks that all packages except ``-dev`` or | ||
1075 | ``-staticdev`` packages do not depend on ``-dev`` packages, which | ||
1076 | would be a packaging bug. | ||
1077 | |||
1078 | - *``dev-so:``* Checks that the ``.so`` symbolic links are in the | ||
1079 | ``-dev`` package and not in any of the other packages. In general, | ||
1080 | these symlinks are only useful for development purposes. Thus, the | ||
1081 | ``-dev`` package is the correct location for them. Some very rare | ||
1082 | cases do exist for dynamically loaded modules where these symlinks | ||
1083 | are needed instead in the main package. | ||
1084 | |||
1085 | - *``file-rdeps:``* Checks that file-level dependencies identified by | ||
1086 | the OpenEmbedded build system at packaging time are satisfied. For | ||
1087 | example, a shell script might start with the line ``#!/bin/bash``. | ||
1088 | This line would translate to a file dependency on ``/bin/bash``. Of | ||
1089 | the three package managers that the OpenEmbedded build system | ||
1090 | supports, only RPM directly handles file-level dependencies, | ||
1091 | resolving them automatically to packages providing the files. | ||
1092 | However, the lack of that functionality in the other two package | ||
1093 | managers does not mean the dependencies do not still need resolving. | ||
1094 | This QA check attempts to ensure that explicitly declared | ||
1095 | ```RDEPENDS`` <#var-RDEPENDS>`__ exist to handle any file-level | ||
1096 | dependency detected in packaged files. | ||
1097 | |||
1098 | - *``files-invalid:``* Checks for ```FILES`` <#var-FILES>`__ variable | ||
1099 | values that contain "//", which is invalid. | ||
1100 | |||
1101 | - *``host-user-contaminated:``* Checks that no package produced by the | ||
1102 | recipe contains any files outside of ``/home`` with a user or group | ||
1103 | ID that matches the user running BitBake. A match usually indicates | ||
1104 | that the files are being installed with an incorrect UID/GID, since | ||
1105 | target IDs are independent from host IDs. For additional information, | ||
1106 | see the section describing the | ||
1107 | ```do_install`` <#ref-tasks-install>`__ task. | ||
1108 | |||
1109 | - *``incompatible-license:``* Report when packages are excluded from | ||
1110 | being created due to being marked with a license that is in | ||
1111 | ```INCOMPATIBLE_LICENSE`` <#var-INCOMPATIBLE_LICENSE>`__. | ||
1112 | |||
1113 | - *``install-host-path:``* Checks the | ||
1114 | ```do_install`` <#ref-tasks-install>`__ log for indications that | ||
1115 | paths to locations on the build host were used. Using such paths | ||
1116 | might result in host contamination of the build output. | ||
1117 | |||
1118 | - *``installed-vs-shipped:``* Reports when files have been installed | ||
1119 | within ``do_install`` but have not been included in any package by | ||
1120 | way of the ```FILES`` <#var-FILES>`__ variable. Files that do not | ||
1121 | appear in any package cannot be present in an image later on in the | ||
1122 | build process. Ideally, all installed files should be packaged or not | ||
1123 | installed at all. These files can be deleted at the end of | ||
1124 | ``do_install`` if the files are not needed in any package. | ||
1125 | |||
1126 | - *``invalid-chars:``* Checks that the recipe metadata variables | ||
1127 | ```DESCRIPTION`` <#var-DESCRIPTION>`__, | ||
1128 | ```SUMMARY`` <#var-SUMMARY>`__, ```LICENSE`` <#var-LICENSE>`__, and | ||
1129 | ```SECTION`` <#var-SECTION>`__ do not contain non-UTF-8 characters. | ||
1130 | Some package managers do not support such characters. | ||
1131 | |||
1132 | - *``invalid-packageconfig:``* Checks that no undefined features are | ||
1133 | being added to ```PACKAGECONFIG`` <#var-PACKAGECONFIG>`__. For | ||
1134 | example, any name "foo" for which the following form does not exist: | ||
1135 | PACKAGECONFIG[foo] = "..." | ||
1136 | |||
1137 | - *``la:``* Checks ``.la`` files for any ``TMPDIR`` paths. Any ``.la`` | ||
1138 | file containing these paths is incorrect since ``libtool`` adds the | ||
1139 | correct sysroot prefix when using the files automatically itself. | ||
1140 | |||
1141 | - *``ldflags:``* Ensures that the binaries were linked with the | ||
1142 | ```LDFLAGS`` <#var-LDFLAGS>`__ options provided by the build system. | ||
1143 | If this test fails, check that the ``LDFLAGS`` variable is being | ||
1144 | passed to the linker command. | ||
1145 | |||
1146 | - *``libdir:``* Checks for libraries being installed into incorrect | ||
1147 | (possibly hardcoded) installation paths. For example, this test will | ||
1148 | catch recipes that install ``/lib/bar.so`` when ``${base_libdir}`` is | ||
1149 | "lib32". Another example is when recipes install | ||
1150 | ``/usr/lib64/foo.so`` when ``${libdir}`` is "/usr/lib". | ||
1151 | |||
1152 | - *``libexec:``* Checks if a package contains files in | ||
1153 | ``/usr/libexec``. This check is not performed if the ``libexecdir`` | ||
1154 | variable has been set explicitly to ``/usr/libexec``. | ||
1155 | |||
1156 | - *``packages-list:``* Checks for the same package being listed | ||
1157 | multiple times through the ```PACKAGES`` <#var-PACKAGES>`__ variable | ||
1158 | value. Installing the package in this manner can cause errors during | ||
1159 | packaging. | ||
1160 | |||
1161 | - *``perm-config:``* Reports lines in ``fs-perms.txt`` that have an | ||
1162 | invalid format. | ||
1163 | |||
1164 | - *``perm-line:``* Reports lines in ``fs-perms.txt`` that have an | ||
1165 | invalid format. | ||
1166 | |||
1167 | - *``perm-link:``* Reports lines in ``fs-perms.txt`` that specify | ||
1168 | 'link' where the specified target already exists. | ||
1169 | |||
1170 | - *``perms:``* Currently, this check is unused but reserved. | ||
1171 | |||
1172 | - *``pkgconfig:``* Checks ``.pc`` files for any | ||
1173 | ```TMPDIR`` <#var-TMPDIR>`__/```WORKDIR`` <#var-WORKDIR>`__ paths. | ||
1174 | Any ``.pc`` file containing these paths is incorrect since | ||
1175 | ``pkg-config`` itself adds the correct sysroot prefix when the files | ||
1176 | are accessed. | ||
1177 | |||
1178 | - *``pkgname:``* Checks that all packages in | ||
1179 | ```PACKAGES`` <#var-PACKAGES>`__ have names that do not contain | ||
1180 | invalid characters (i.e. characters other than 0-9, a-z, ., +, and | ||
1181 | -). | ||
1182 | |||
1183 | - *``pkgv-undefined:``* Checks to see if the ``PKGV`` variable is | ||
1184 | undefined during ```do_package`` <#ref-tasks-package>`__. | ||
1185 | |||
1186 | - *``pkgvarcheck:``* Checks through the variables | ||
1187 | ```RDEPENDS`` <#var-RDEPENDS>`__, | ||
1188 | ```RRECOMMENDS`` <#var-RRECOMMENDS>`__, | ||
1189 | ```RSUGGESTS`` <#var-RSUGGESTS>`__, | ||
1190 | ```RCONFLICTS`` <#var-RCONFLICTS>`__, | ||
1191 | ```RPROVIDES`` <#var-RPROVIDES>`__, | ||
1192 | ```RREPLACES`` <#var-RREPLACES>`__, ```FILES`` <#var-FILES>`__, | ||
1193 | ```ALLOW_EMPTY`` <#var-ALLOW_EMPTY>`__, ``pkg_preinst``, | ||
1194 | ``pkg_postinst``, ``pkg_prerm`` and ``pkg_postrm``, and reports if | ||
1195 | there are variable sets that are not package-specific. Using these | ||
1196 | variables without a package suffix is bad practice, and might | ||
1197 | unnecessarily complicate dependencies of other packages within the | ||
1198 | same recipe or have other unintended consequences. | ||
1199 | |||
1200 | - *``pn-overrides:``* Checks that a recipe does not have a name | ||
1201 | (```PN`` <#var-PN>`__) value that appears in | ||
1202 | ```OVERRIDES`` <#var-OVERRIDES>`__. If a recipe is named such that | ||
1203 | its ``PN`` value matches something already in ``OVERRIDES`` (e.g. | ||
1204 | ``PN`` happens to be the same as ```MACHINE`` <#var-MACHINE>`__ or | ||
1205 | ```DISTRO`` <#var-DISTRO>`__), it can have unexpected consequences. | ||
1206 | For example, assignments such as ``FILES_${PN} = "xyz"`` effectively | ||
1207 | turn into ``FILES = "xyz"``. | ||
1208 | |||
1209 | - *``rpaths:``* Checks for rpaths in the binaries that contain build | ||
1210 | system paths such as ``TMPDIR``. If this test fails, bad ``-rpath`` | ||
1211 | options are being passed to the linker commands and your binaries | ||
1212 | have potential security issues. | ||
1213 | |||
1214 | - *``split-strip:``* Reports that splitting or stripping debug symbols | ||
1215 | from binaries has failed. | ||
1216 | |||
1217 | - *``staticdev:``* Checks for static library files (``*.a``) in | ||
1218 | non-``staticdev`` packages. | ||
1219 | |||
1220 | - *``symlink-to-sysroot:``* Checks for symlinks in packages that point | ||
1221 | into ```TMPDIR`` <#var-TMPDIR>`__ on the host. Such symlinks will | ||
1222 | work on the host, but are clearly invalid when running on the target. | ||
1223 | |||
1224 | - *``textrel:``* Checks for ELF binaries that contain relocations in | ||
1225 | their ``.text`` sections, which can result in a performance impact at | ||
1226 | runtime. See the explanation for the | ||
1227 | ```ELF binary`` <#qa-issue-textrel>`__ message for more information | ||
1228 | regarding runtime performance issues. | ||
1229 | |||
1230 | - *``unlisted-pkg-lics:``* Checks that all declared licenses applying | ||
1231 | for a package are also declared on the recipe level (i.e. any license | ||
1232 | in ``LICENSE_*`` should appear in ```LICENSE`` <#var-LICENSE>`__). | ||
1233 | |||
1234 | - *``useless-rpaths:``* Checks for dynamic library load paths (rpaths) | ||
1235 | in the binaries that by default on a standard system are searched by | ||
1236 | the linker (e.g. ``/lib`` and ``/usr/lib``). While these paths will | ||
1237 | not cause any breakage, they do waste space and are unnecessary. | ||
1238 | |||
1239 | - *``var-undefined:``* Reports when variables fundamental to packaging | ||
1240 | (i.e. ```WORKDIR`` <#var-WORKDIR>`__, | ||
1241 | ```DEPLOY_DIR`` <#var-DEPLOY_DIR>`__, ```D`` <#var-D>`__, | ||
1242 | ```PN`` <#var-PN>`__, and ```PKGD`` <#var-PKGD>`__) are undefined | ||
1243 | during ```do_package`` <#ref-tasks-package>`__. | ||
1244 | |||
1245 | - *``version-going-backwards:``* If Build History is enabled, reports | ||
1246 | when a package being written out has a lower version than the | ||
1247 | previously written package under the same name. If you are placing | ||
1248 | output packages into a feed and upgrading packages on a target system | ||
1249 | using that feed, the version of a package going backwards can result | ||
1250 | in the target system not correctly upgrading to the "new" version of | ||
1251 | the package. | ||
1252 | |||
1253 | .. note:: | ||
1254 | |||
1255 | If you are not using runtime package management on your target | ||
1256 | system, then you do not need to worry about this situation. | ||
1257 | |||
1258 | - *``xorg-driver-abi:``* Checks that all packages containing Xorg | ||
1259 | drivers have ABI dependencies. The ``xserver-xorg`` recipe provides | ||
1260 | driver ABI names. All drivers should depend on the ABI versions that | ||
1261 | they have been built against. Driver recipes that include | ||
1262 | ``xorg-driver-input.inc`` or ``xorg-driver-video.inc`` will | ||
1263 | automatically get these versions. Consequently, you should only need | ||
1264 | to explicitly add dependencies to binary driver recipes. | ||
1265 | |||
1266 | .. _ref-classes-insserv: | ||
1267 | |||
1268 | ``insserv.bbclass`` | ||
1269 | =================== | ||
1270 | |||
1271 | The ``insserv`` class uses the ``insserv`` utility to update the order | ||
1272 | of symbolic links in ``/etc/rc?.d/`` within an image based on | ||
1273 | dependencies specified by LSB headers in the ``init.d`` scripts | ||
1274 | themselves. | ||
1275 | |||
1276 | .. _ref-classes-kernel: | ||
1277 | |||
1278 | ``kernel.bbclass`` | ||
1279 | ================== | ||
1280 | |||
1281 | The ``kernel`` class handles building Linux kernels. The class contains | ||
1282 | code to build all kernel trees. All needed headers are staged into the | ||
1283 | ``STAGING_KERNEL_DIR`` directory to allow out-of-tree module builds | ||
1284 | using the ```module`` <#ref-classes-module>`__ class. | ||
1285 | |||
1286 | This means that each built kernel module is packaged separately and | ||
1287 | inter-module dependencies are created by parsing the ``modinfo`` output. | ||
1288 | If all modules are required, then installing the ``kernel-modules`` | ||
1289 | package installs all packages with modules and various other kernel | ||
1290 | packages such as ``kernel-vmlinux``. | ||
1291 | |||
1292 | The ``kernel`` class contains logic that allows you to embed an initial | ||
1293 | RAM filesystem (initramfs) image when you build the kernel image. For | ||
1294 | information on how to build an initramfs, see the "`Building an Initial | ||
1295 | RAM Filesystem (initramfs) | ||
1296 | Image <&YOCTO_DOCS_DEV_URL;#building-an-initramfs-image>`__" section in | ||
1297 | the Yocto Project Development Tasks Manual. | ||
1298 | |||
1299 | Various other classes are used by the ``kernel`` and ``module`` classes | ||
1300 | internally including the ```kernel-arch`` <#ref-classes-kernel-arch>`__, | ||
1301 | ```module-base`` <#ref-classes-module-base>`__, and | ||
1302 | ```linux-kernel-base`` <#ref-classes-linux-kernel-base>`__ classes. | ||
1303 | |||
1304 | .. _ref-classes-kernel-arch: | ||
1305 | |||
1306 | ``kernel-arch.bbclass`` | ||
1307 | ======================= | ||
1308 | |||
1309 | The ``kernel-arch`` class sets the ``ARCH`` environment variable for | ||
1310 | Linux kernel compilation (including modules). | ||
1311 | |||
1312 | .. _ref-classes-kernel-devicetree: | ||
1313 | |||
1314 | ``kernel-devicetree.bbclass`` | ||
1315 | ============================= | ||
1316 | |||
1317 | The ``kernel-devicetree`` class, which is inherited by the | ||
1318 | ```kernel`` <#ref-classes-kernel>`__ class, supports device tree | ||
1319 | generation. | ||
1320 | |||
1321 | .. _ref-classes-kernel-fitimage: | ||
1322 | |||
1323 | ``kernel-fitimage.bbclass`` | ||
1324 | =========================== | ||
1325 | |||
1326 | The ``kernel-fitimage`` class provides support to pack a kernel Image, | ||
1327 | device trees and a RAM disk into a single FIT image. In theory, a FIT | ||
1328 | image can support any number of kernels, RAM disks and device-trees. | ||
1329 | However, ``kernel-fitimage`` currently only supports | ||
1330 | limited usescases: just one kernel image, an optional RAM disk, and | ||
1331 | any number of device tree. | ||
1332 | |||
1333 | To create a FIT image, it is required that :term:`KERNEL_CLASSES` | ||
1334 | is set to "kernel-fitimage" and :term:`KERNEL_IMAGETYPE` | ||
1335 | is set to "fitImage". | ||
1336 | |||
1337 | The options for the device tree compiler passed to mkimage -D feature | ||
1338 | when creating the FIT image are specified using the | ||
1339 | :term:`UBOOT_MKIMAGE_DTCOPTS` variable. | ||
1340 | |||
1341 | Only a single kernel can be added to the FIT image created by | ||
1342 | ``kernel-fitimage`` and the kernel image in FIT is mandatory. The | ||
1343 | address where the kernel image is to be loaded by U-boot is | ||
1344 | specified by :term:`UBOOT_LOADADDRESS` and the entrypoint by | ||
1345 | :term:`UBOOT_ENTRYPOINT`. | ||
1346 | |||
1347 | Multiple device trees can be added to the FIT image created by | ||
1348 | ``kernel-fitimage`` and the device tree is optional. | ||
1349 | The address where the device tree is to be loaded by U-boot is | ||
1350 | specified by :term:`UBOOT_DTBO_LOADADDRESS` for device tree overlays | ||
1351 | and by `:term:`UBOOT_DTB_LOADADDRESS` for device tree binaries. | ||
1352 | |||
1353 | Only a single RAM disk can be added to the FIT image created by | ||
1354 | ``kernel-fitimage`` and the RAM disk in FIT is optional. | ||
1355 | The address where the RAM disk image is to be loaded by U-boot | ||
1356 | is specified by :term:`UBOOT_RD_LOADADDRESS` and the entrypoint by | ||
1357 | :term:`UBOOT_RD_ENTRYPOINT`. The ramdisk is added to FIT image when | ||
1358 | :term:`INITRAMFS_IMAGE` is specified. | ||
1359 | |||
1360 | The FIT image generated by ``kernel-fitimage`` class is signed when the | ||
1361 | variables :term:`UBOOT_SIGN_ENABLE`, :term:`UBOOT_MKIMAGE_DTCOPTS`, | ||
1362 | :term:`UBOOT_SIGN_KEYDIR` and :term:`UBOOT_SIGN_KEYNAME` are set | ||
1363 | appropriately. The default values used for :term:`FIT_HASH_ALG` and | ||
1364 | :term:`FIT_SIGN_ALG` in ``kernel-fitimage`` are "sha256" and | ||
1365 | "rsa2048" respectively. | ||
1366 | |||
1367 | |||
1368 | .. _ref-classes-kernel-grub: | ||
1369 | |||
1370 | ``kernel-grub.bbclass`` | ||
1371 | ======================= | ||
1372 | |||
1373 | The ``kernel-grub`` class updates the boot area and the boot menu with | ||
1374 | the kernel as the priority boot mechanism while installing a RPM to | ||
1375 | update the kernel on a deployed target. | ||
1376 | |||
1377 | .. _ref-classes-kernel-module-split: | ||
1378 | |||
1379 | ``kernel-module-split.bbclass`` | ||
1380 | =============================== | ||
1381 | |||
1382 | The ``kernel-module-split`` class provides common functionality for | ||
1383 | splitting Linux kernel modules into separate packages. | ||
1384 | |||
1385 | .. _ref-classes-kernel-uboot: | ||
1386 | |||
1387 | ``kernel-uboot.bbclass`` | ||
1388 | ======================== | ||
1389 | |||
1390 | The ``kernel-uboot`` class provides support for building from | ||
1391 | vmlinux-style kernel sources. | ||
1392 | |||
1393 | .. _ref-classes-kernel-uimage: | ||
1394 | |||
1395 | ``kernel-uimage.bbclass`` | ||
1396 | ========================= | ||
1397 | |||
1398 | The ``kernel-uimage`` class provides support to pack uImage. | ||
1399 | |||
1400 | .. _ref-classes-kernel-yocto: | ||
1401 | |||
1402 | ``kernel-yocto.bbclass`` | ||
1403 | ======================== | ||
1404 | |||
1405 | The ``kernel-yocto`` class provides common functionality for building | ||
1406 | from linux-yocto style kernel source repositories. | ||
1407 | |||
1408 | .. _ref-classes-kernelsrc: | ||
1409 | |||
1410 | ``kernelsrc.bbclass`` | ||
1411 | ===================== | ||
1412 | |||
1413 | The ``kernelsrc`` class sets the Linux kernel source and version. | ||
1414 | |||
1415 | .. _ref-classes-lib_package: | ||
1416 | |||
1417 | ``lib_package.bbclass`` | ||
1418 | ======================= | ||
1419 | |||
1420 | The ``lib_package`` class supports recipes that build libraries and | ||
1421 | produce executable binaries, where those binaries should not be | ||
1422 | installed by default along with the library. Instead, the binaries are | ||
1423 | added to a separate ``${``\ ```PN`` <#var-PN>`__\ ``}-bin`` package to | ||
1424 | make their installation optional. | ||
1425 | |||
1426 | .. _ref-classes-libc*: | ||
1427 | |||
1428 | ``libc*.bbclass`` | ||
1429 | ================= | ||
1430 | |||
1431 | The ``libc*`` classes support recipes that build packages with ``libc``: | ||
1432 | |||
1433 | - The ``libc-common`` class provides common support for building with | ||
1434 | ``libc``. | ||
1435 | |||
1436 | - The ``libc-package`` class supports packaging up ``glibc`` and | ||
1437 | ``eglibc``. | ||
1438 | |||
1439 | .. _ref-classes-license: | ||
1440 | |||
1441 | ``license.bbclass`` | ||
1442 | =================== | ||
1443 | |||
1444 | The ``license`` class provides license manifest creation and license | ||
1445 | exclusion. This class is enabled by default using the default value for | ||
1446 | the ```INHERIT_DISTRO`` <#var-INHERIT_DISTRO>`__ variable. | ||
1447 | |||
1448 | .. _ref-classes-linux-kernel-base: | ||
1449 | |||
1450 | ``linux-kernel-base.bbclass`` | ||
1451 | ============================= | ||
1452 | |||
1453 | The ``linux-kernel-base`` class provides common functionality for | ||
1454 | recipes that build out of the Linux kernel source tree. These builds | ||
1455 | goes beyond the kernel itself. For example, the Perf recipe also | ||
1456 | inherits this class. | ||
1457 | |||
1458 | .. _ref-classes-linuxloader: | ||
1459 | |||
1460 | ``linuxloader.bbclass`` | ||
1461 | ======================= | ||
1462 | |||
1463 | Provides the function ``linuxloader()``, which gives the value of the | ||
1464 | dynamic loader/linker provided on the platform. This value is used by a | ||
1465 | number of other classes. | ||
1466 | |||
1467 | .. _ref-classes-logging: | ||
1468 | |||
1469 | ``logging.bbclass`` | ||
1470 | =================== | ||
1471 | |||
1472 | The ``logging`` class provides the standard shell functions used to log | ||
1473 | messages for various BitBake severity levels (i.e. ``bbplain``, | ||
1474 | ``bbnote``, ``bbwarn``, ``bberror``, ``bbfatal``, and ``bbdebug``). | ||
1475 | |||
1476 | This class is enabled by default since it is inherited by the ``base`` | ||
1477 | class. | ||
1478 | |||
1479 | .. _ref-classes-meta: | ||
1480 | |||
1481 | ``meta.bbclass`` | ||
1482 | ================ | ||
1483 | |||
1484 | The ``meta`` class is inherited by recipes that do not build any output | ||
1485 | packages themselves, but act as a "meta" target for building other | ||
1486 | recipes. | ||
1487 | |||
1488 | .. _ref-classes-metadata_scm: | ||
1489 | |||
1490 | ``metadata_scm.bbclass`` | ||
1491 | ======================== | ||
1492 | |||
1493 | The ``metadata_scm`` class provides functionality for querying the | ||
1494 | branch and revision of a Source Code Manager (SCM) repository. | ||
1495 | |||
1496 | The ```base`` <#ref-classes-base>`__ class uses this class to print the | ||
1497 | revisions of each layer before starting every build. The | ||
1498 | ``metadata_scm`` class is enabled by default because it is inherited by | ||
1499 | the ``base`` class. | ||
1500 | |||
1501 | .. _ref-classes-migrate_localcount: | ||
1502 | |||
1503 | ``migrate_localcount.bbclass`` | ||
1504 | ============================== | ||
1505 | |||
1506 | The ``migrate_localcount`` class verifies a recipe's localcount data and | ||
1507 | increments it appropriately. | ||
1508 | |||
1509 | .. _ref-classes-mime: | ||
1510 | |||
1511 | ``mime.bbclass`` | ||
1512 | ================ | ||
1513 | |||
1514 | The ``mime`` class generates the proper post-install and post-remove | ||
1515 | (postinst/postrm) scriptlets for packages that install MIME type files. | ||
1516 | These scriptlets call ``update-mime-database`` to add the MIME types to | ||
1517 | the shared database. | ||
1518 | |||
1519 | .. _ref-classes-mirrors: | ||
1520 | |||
1521 | ``mirrors.bbclass`` | ||
1522 | =================== | ||
1523 | |||
1524 | The ``mirrors`` class sets up some standard | ||
1525 | ```MIRRORS`` <#var-MIRRORS>`__ entries for source code mirrors. These | ||
1526 | mirrors provide a fall-back path in case the upstream source specified | ||
1527 | in ```SRC_URI`` <#var-SRC_URI>`__ within recipes is unavailable. | ||
1528 | |||
1529 | This class is enabled by default since it is inherited by the | ||
1530 | ```base`` <#ref-classes-base>`__ class. | ||
1531 | |||
1532 | .. _ref-classes-module: | ||
1533 | |||
1534 | ``module.bbclass`` | ||
1535 | ================== | ||
1536 | |||
1537 | The ``module`` class provides support for building out-of-tree Linux | ||
1538 | kernel modules. The class inherits the | ||
1539 | ```module-base`` <#ref-classes-module-base>`__ and | ||
1540 | ```kernel-module-split`` <#ref-classes-kernel-module-split>`__ classes, | ||
1541 | and implements the ```do_compile`` <#ref-tasks-compile>`__ and | ||
1542 | ```do_install`` <#ref-tasks-install>`__ tasks. The class provides | ||
1543 | everything needed to build and package a kernel module. | ||
1544 | |||
1545 | For general information on out-of-tree Linux kernel modules, see the | ||
1546 | "`Incorporating Out-of-Tree | ||
1547 | Modules <&YOCTO_DOCS_KERNEL_DEV_URL;#incorporating-out-of-tree-modules>`__" | ||
1548 | section in the Yocto Project Linux Kernel Development Manual. | ||
1549 | |||
1550 | .. _ref-classes-module-base: | ||
1551 | |||
1552 | ``module-base.bbclass`` | ||
1553 | ======================= | ||
1554 | |||
1555 | The ``module-base`` class provides the base functionality for building | ||
1556 | Linux kernel modules. Typically, a recipe that builds software that | ||
1557 | includes one or more kernel modules and has its own means of building | ||
1558 | the module inherits this class as opposed to inheriting the | ||
1559 | ```module`` <#ref-classes-module>`__ class. | ||
1560 | |||
1561 | .. _ref-classes-multilib*: | ||
1562 | |||
1563 | ``multilib*.bbclass`` | ||
1564 | ===================== | ||
1565 | |||
1566 | The ``multilib*`` classes provide support for building libraries with | ||
1567 | different target optimizations or target architectures and installing | ||
1568 | them side-by-side in the same image. | ||
1569 | |||
1570 | For more information on using the Multilib feature, see the "`Combining | ||
1571 | Multiple Versions of Library Files into One | ||
1572 | Image <&YOCTO_DOCS_DEV_URL;#combining-multiple-versions-library-files-into-one-image>`__" | ||
1573 | section in the Yocto Project Development Tasks Manual. | ||
1574 | |||
1575 | .. _ref-classes-native: | ||
1576 | |||
1577 | ``native.bbclass`` | ||
1578 | ================== | ||
1579 | |||
1580 | The ``native`` class provides common functionality for recipes that | ||
1581 | build tools to run on the `build host <#hardware-build-system-term>`__ | ||
1582 | (i.e. tools that use the compiler or other tools from the build host). | ||
1583 | |||
1584 | You can create a recipe that builds tools that run natively on the host | ||
1585 | a couple different ways: | ||
1586 | |||
1587 | - Create a myrecipe\ ``-native.bb`` recipe that inherits the ``native`` | ||
1588 | class. If you use this method, you must order the inherit statement | ||
1589 | in the recipe after all other inherit statements so that the | ||
1590 | ``native`` class is inherited last. | ||
1591 | |||
1592 | .. note:: | ||
1593 | |||
1594 | When creating a recipe this way, the recipe name must follow this | ||
1595 | naming convention: | ||
1596 | :: | ||
1597 | |||
1598 | myrecipe-native.bb | ||
1599 | |||
1600 | |||
1601 | Not using this naming convention can lead to subtle problems | ||
1602 | caused by existing code that depends on that naming convention. | ||
1603 | |||
1604 | - Create or modify a target recipe that contains the following: | ||
1605 | ```BBCLASSEXTEND`` <#var-BBCLASSEXTEND>`__ = "native" Inside the | ||
1606 | recipe, use ``_class-native`` and ``_class-target`` overrides to | ||
1607 | specify any functionality specific to the respective native or target | ||
1608 | case. | ||
1609 | |||
1610 | Although applied differently, the ``native`` class is used with both | ||
1611 | methods. The advantage of the second method is that you do not need to | ||
1612 | have two separate recipes (assuming you need both) for native and | ||
1613 | target. All common parts of the recipe are automatically shared. | ||
1614 | |||
1615 | .. _ref-classes-nativesdk: | ||
1616 | |||
1617 | ``nativesdk.bbclass`` | ||
1618 | ===================== | ||
1619 | |||
1620 | The ``nativesdk`` class provides common functionality for recipes that | ||
1621 | wish to build tools to run as part of an SDK (i.e. tools that run on | ||
1622 | ```SDKMACHINE`` <#var-SDKMACHINE>`__). | ||
1623 | |||
1624 | You can create a recipe that builds tools that run on the SDK machine a | ||
1625 | couple different ways: | ||
1626 | |||
1627 | - Create a ``nativesdk-``\ myrecipe\ ``.bb`` recipe that inherits the | ||
1628 | ``nativesdk`` class. If you use this method, you must order the | ||
1629 | inherit statement in the recipe after all other inherit statements so | ||
1630 | that the ``nativesdk`` class is inherited last. | ||
1631 | |||
1632 | - Create a ``nativesdk`` variant of any recipe by adding the following: | ||
1633 | ```BBCLASSEXTEND`` <#var-BBCLASSEXTEND>`__ = "nativesdk" Inside the | ||
1634 | recipe, use ``_class-nativesdk`` and ``_class-target`` overrides to | ||
1635 | specify any functionality specific to the respective SDK machine or | ||
1636 | target case. | ||
1637 | |||
1638 | .. note:: | ||
1639 | |||
1640 | When creating a recipe, you must follow this naming convention: | ||
1641 | :: | ||
1642 | |||
1643 | nativesdk-myrecipe.bb | ||
1644 | |||
1645 | |||
1646 | Not doing so can lead to subtle problems because code exists that | ||
1647 | depends on the naming convention. | ||
1648 | |||
1649 | Although applied differently, the ``nativesdk`` class is used with both | ||
1650 | methods. The advantage of the second method is that you do not need to | ||
1651 | have two separate recipes (assuming you need both) for the SDK machine | ||
1652 | and the target. All common parts of the recipe are automatically shared. | ||
1653 | |||
1654 | .. _ref-classes-nopackages: | ||
1655 | |||
1656 | ``nopackages.bbclass`` | ||
1657 | ====================== | ||
1658 | |||
1659 | Disables packaging tasks for those recipes and classes where packaging | ||
1660 | is not needed. | ||
1661 | |||
1662 | .. _ref-classes-npm: | ||
1663 | |||
1664 | ``npm.bbclass`` | ||
1665 | =============== | ||
1666 | |||
1667 | Provides support for building Node.js software fetched using the `node | ||
1668 | package manager (NPM) <https://en.wikipedia.org/wiki/Npm_(software)>`__. | ||
1669 | |||
1670 | .. note:: | ||
1671 | |||
1672 | Currently, recipes inheriting this class must use the | ||
1673 | npm:// | ||
1674 | fetcher to have dependencies fetched and packaged automatically. | ||
1675 | |||
1676 | For information on how to create NPM packages, see the "`Creating Node | ||
1677 | Package Manager (NPM) | ||
1678 | Packages <&YOCTO_DOCS_DEV_URL;#creating-node-package-manager-npm-packages>`__" | ||
1679 | section in the Yocto Project Development Tasks Manual. | ||
1680 | |||
1681 | .. _ref-classes-oelint: | ||
1682 | |||
1683 | ``oelint.bbclass`` | ||
1684 | ================== | ||
1685 | |||
1686 | The ``oelint`` class is an obsolete lint checking tool that exists in | ||
1687 | ``meta/classes`` in the `Source Directory <#source-directory>`__. | ||
1688 | |||
1689 | A number of classes exist that could be generally useful in OE-Core but | ||
1690 | are never actually used within OE-Core itself. The ``oelint`` class is | ||
1691 | one such example. However, being aware of this class can reduce the | ||
1692 | proliferation of different versions of similar classes across multiple | ||
1693 | layers. | ||
1694 | |||
1695 | .. _ref-classes-own-mirrors: | ||
1696 | |||
1697 | ``own-mirrors.bbclass`` | ||
1698 | ======================= | ||
1699 | |||
1700 | The ``own-mirrors`` class makes it easier to set up your own | ||
1701 | ```PREMIRRORS`` <#var-PREMIRRORS>`__ from which to first fetch source | ||
1702 | before attempting to fetch it from the upstream specified in | ||
1703 | ```SRC_URI`` <#var-SRC_URI>`__ within each recipe. | ||
1704 | |||
1705 | To use this class, inherit it globally and specify | ||
1706 | ```SOURCE_MIRROR_URL`` <#var-SOURCE_MIRROR_URL>`__. Here is an example: | ||
1707 | INHERIT += "own-mirrors" SOURCE_MIRROR_URL = | ||
1708 | "http://example.com/my-source-mirror" You can specify only a single URL | ||
1709 | in ``SOURCE_MIRROR_URL``. | ||
1710 | |||
1711 | .. _ref-classes-package: | ||
1712 | |||
1713 | ``package.bbclass`` | ||
1714 | =================== | ||
1715 | |||
1716 | The ``package`` class supports generating packages from a build's | ||
1717 | output. The core generic functionality is in ``package.bbclass``. The | ||
1718 | code specific to particular package types resides in these | ||
1719 | package-specific classes: | ||
1720 | ```package_deb`` <#ref-classes-package_deb>`__, | ||
1721 | ```package_rpm`` <#ref-classes-package_rpm>`__, | ||
1722 | ```package_ipk`` <#ref-classes-package_ipk>`__, and | ||
1723 | ```package_tar`` <#ref-classes-package_tar>`__. | ||
1724 | |||
1725 | .. note:: | ||
1726 | |||
1727 | The | ||
1728 | package_tar | ||
1729 | class is broken and not supported. It is recommended that you do not | ||
1730 | use this class. | ||
1731 | |||
1732 | You can control the list of resulting package formats by using the | ||
1733 | ``PACKAGE_CLASSES`` variable defined in your ``conf/local.conf`` | ||
1734 | configuration file, which is located in the `Build | ||
1735 | Directory <#build-directory>`__. When defining the variable, you can | ||
1736 | specify one or more package types. Since images are generated from | ||
1737 | packages, a packaging class is needed to enable image generation. The | ||
1738 | first class listed in this variable is used for image generation. | ||
1739 | |||
1740 | If you take the optional step to set up a repository (package feed) on | ||
1741 | the development host that can be used by DNF, you can install packages | ||
1742 | from the feed while you are running the image on the target (i.e. | ||
1743 | runtime installation of packages). For more information, see the "`Using | ||
1744 | Runtime Package | ||
1745 | Management <&YOCTO_DOCS_DEV_URL;#using-runtime-package-management>`__" | ||
1746 | section in the Yocto Project Development Tasks Manual. | ||
1747 | |||
1748 | The package-specific class you choose can affect build-time performance | ||
1749 | and has space ramifications. In general, building a package with IPK | ||
1750 | takes about thirty percent less time as compared to using RPM to build | ||
1751 | the same or similar package. This comparison takes into account a | ||
1752 | complete build of the package with all dependencies previously built. | ||
1753 | The reason for this discrepancy is because the RPM package manager | ||
1754 | creates and processes more `Metadata <#metadata>`__ than the IPK package | ||
1755 | manager. Consequently, you might consider setting ``PACKAGE_CLASSES`` to | ||
1756 | "package_ipk" if you are building smaller systems. | ||
1757 | |||
1758 | Before making your package manager decision, however, you should | ||
1759 | consider some further things about using RPM: | ||
1760 | |||
1761 | - RPM starts to provide more abilities than IPK due to the fact that it | ||
1762 | processes more Metadata. For example, this information includes | ||
1763 | individual file types, file checksum generation and evaluation on | ||
1764 | install, sparse file support, conflict detection and resolution for | ||
1765 | Multilib systems, ACID style upgrade, and repackaging abilities for | ||
1766 | rollbacks. | ||
1767 | |||
1768 | - For smaller systems, the extra space used for the Berkeley Database | ||
1769 | and the amount of metadata when using RPM can affect your ability to | ||
1770 | perform on-device upgrades. | ||
1771 | |||
1772 | You can find additional information on the effects of the package class | ||
1773 | at these two Yocto Project mailing list links: | ||
1774 | |||
1775 | - `https://lists.yoctoproject.org/pipermail/poky/2011-May/006362.html <&YOCTO_LISTS_URL;/pipermail/poky/2011-May/006362.html>`__ | ||
1776 | |||
1777 | - `https://lists.yoctoproject.org/pipermail/poky/2011-May/006363.html <&YOCTO_LISTS_URL;/pipermail/poky/2011-May/006363.html>`__ | ||
1778 | |||
1779 | .. _ref-classes-package_deb: | ||
1780 | |||
1781 | ``package_deb.bbclass`` | ||
1782 | ======================= | ||
1783 | |||
1784 | The ``package_deb`` class provides support for creating packages that | ||
1785 | use the Debian (i.e. ``.deb``) file format. The class ensures the | ||
1786 | packages are written out in a ``.deb`` file format to the | ||
1787 | ``${``\ ```DEPLOY_DIR_DEB`` <#var-DEPLOY_DIR_DEB>`__\ ``}`` directory. | ||
1788 | |||
1789 | This class inherits the ```package`` <#ref-classes-package>`__ class and | ||
1790 | is enabled through the ```PACKAGE_CLASSES`` <#var-PACKAGE_CLASSES>`__ | ||
1791 | variable in the ``local.conf`` file. | ||
1792 | |||
1793 | .. _ref-classes-package_ipk: | ||
1794 | |||
1795 | ``package_ipk.bbclass`` | ||
1796 | ======================= | ||
1797 | |||
1798 | The ``package_ipk`` class provides support for creating packages that | ||
1799 | use the IPK (i.e. ``.ipk``) file format. The class ensures the packages | ||
1800 | are written out in a ``.ipk`` file format to the | ||
1801 | ``${``\ ```DEPLOY_DIR_IPK`` <#var-DEPLOY_DIR_IPK>`__\ ``}`` directory. | ||
1802 | |||
1803 | This class inherits the ```package`` <#ref-classes-package>`__ class and | ||
1804 | is enabled through the ```PACKAGE_CLASSES`` <#var-PACKAGE_CLASSES>`__ | ||
1805 | variable in the ``local.conf`` file. | ||
1806 | |||
1807 | .. _ref-classes-package_rpm: | ||
1808 | |||
1809 | ``package_rpm.bbclass`` | ||
1810 | ======================= | ||
1811 | |||
1812 | The ``package_rpm`` class provides support for creating packages that | ||
1813 | use the RPM (i.e. ``.rpm``) file format. The class ensures the packages | ||
1814 | are written out in a ``.rpm`` file format to the | ||
1815 | ``${``\ ```DEPLOY_DIR_RPM`` <#var-DEPLOY_DIR_RPM>`__\ ``}`` directory. | ||
1816 | |||
1817 | This class inherits the ```package`` <#ref-classes-package>`__ class and | ||
1818 | is enabled through the ```PACKAGE_CLASSES`` <#var-PACKAGE_CLASSES>`__ | ||
1819 | variable in the ``local.conf`` file. | ||
1820 | |||
1821 | .. _ref-classes-package_tar: | ||
1822 | |||
1823 | ``package_tar.bbclass`` | ||
1824 | ======================= | ||
1825 | |||
1826 | The ``package_tar`` class provides support for creating tarballs. The | ||
1827 | class ensures the packages are written out in a tarball format to the | ||
1828 | ``${``\ ```DEPLOY_DIR_TAR`` <#var-DEPLOY_DIR_TAR>`__\ ``}`` directory. | ||
1829 | |||
1830 | This class inherits the ```package`` <#ref-classes-package>`__ class and | ||
1831 | is enabled through the ```PACKAGE_CLASSES`` <#var-PACKAGE_CLASSES>`__ | ||
1832 | variable in the ``local.conf`` file. | ||
1833 | |||
1834 | .. note:: | ||
1835 | |||
1836 | You cannot specify the | ||
1837 | package_tar | ||
1838 | class first using the | ||
1839 | PACKAGE_CLASSES | ||
1840 | variable. You must use | ||
1841 | .deb | ||
1842 | , | ||
1843 | .ipk | ||
1844 | , or | ||
1845 | .rpm | ||
1846 | file formats for your image or SDK. | ||
1847 | |||
1848 | .. _ref-classes-packagedata: | ||
1849 | |||
1850 | ``packagedata.bbclass`` | ||
1851 | ======================= | ||
1852 | |||
1853 | The ``packagedata`` class provides common functionality for reading | ||
1854 | ``pkgdata`` files found in ```PKGDATA_DIR`` <#var-PKGDATA_DIR>`__. These | ||
1855 | files contain information about each output package produced by the | ||
1856 | OpenEmbedded build system. | ||
1857 | |||
1858 | This class is enabled by default because it is inherited by the | ||
1859 | ```package`` <#ref-classes-package>`__ class. | ||
1860 | |||
1861 | .. _ref-classes-packagegroup: | ||
1862 | |||
1863 | ``packagegroup.bbclass`` | ||
1864 | ======================== | ||
1865 | |||
1866 | The ``packagegroup`` class sets default values appropriate for package | ||
1867 | group recipes (e.g. ``PACKAGES``, ``PACKAGE_ARCH``, ``ALLOW_EMPTY``, and | ||
1868 | so forth). It is highly recommended that all package group recipes | ||
1869 | inherit this class. | ||
1870 | |||
1871 | For information on how to use this class, see the "`Customizing Images | ||
1872 | Using Custom Package | ||
1873 | Groups <&YOCTO_DOCS_DEV_URL;#usingpoky-extend-customimage-customtasks>`__" | ||
1874 | section in the Yocto Project Development Tasks Manual. | ||
1875 | |||
1876 | Previously, this class was called the ``task`` class. | ||
1877 | |||
1878 | .. _ref-classes-patch: | ||
1879 | |||
1880 | ``patch.bbclass`` | ||
1881 | ================= | ||
1882 | |||
1883 | The ``patch`` class provides all functionality for applying patches | ||
1884 | during the ```do_patch`` <#ref-tasks-patch>`__ task. | ||
1885 | |||
1886 | This class is enabled by default because it is inherited by the | ||
1887 | ```base`` <#ref-classes-base>`__ class. | ||
1888 | |||
1889 | .. _ref-classes-perlnative: | ||
1890 | |||
1891 | ``perlnative.bbclass`` | ||
1892 | ====================== | ||
1893 | |||
1894 | When inherited by a recipe, the ``perlnative`` class supports using the | ||
1895 | native version of Perl built by the build system rather than using the | ||
1896 | version provided by the build host. | ||
1897 | |||
1898 | .. _ref-classes-pixbufcache: | ||
1899 | |||
1900 | ``pixbufcache.bbclass`` | ||
1901 | ======================= | ||
1902 | |||
1903 | The ``pixbufcache`` class generates the proper post-install and | ||
1904 | post-remove (postinst/postrm) scriptlets for packages that install | ||
1905 | pixbuf loaders, which are used with ``gdk-pixbuf``. These scriptlets | ||
1906 | call ``update_pixbuf_cache`` to add the pixbuf loaders to the cache. | ||
1907 | Since the cache files are architecture-specific, ``update_pixbuf_cache`` | ||
1908 | is run using QEMU if the postinst scriptlets need to be run on the build | ||
1909 | host during image creation. | ||
1910 | |||
1911 | If the pixbuf loaders being installed are in packages other than the | ||
1912 | recipe's main package, set | ||
1913 | ```PIXBUF_PACKAGES`` <#var-PIXBUF_PACKAGES>`__ to specify the packages | ||
1914 | containing the loaders. | ||
1915 | |||
1916 | .. _ref-classes-pkgconfig: | ||
1917 | |||
1918 | ``pkgconfig.bbclass`` | ||
1919 | ===================== | ||
1920 | |||
1921 | The ``pkgconfig`` class provides a standard way to get header and | ||
1922 | library information by using ``pkg-config``. This class aims to smooth | ||
1923 | integration of ``pkg-config`` into libraries that use it. | ||
1924 | |||
1925 | During staging, BitBake installs ``pkg-config`` data into the | ||
1926 | ``sysroots/`` directory. By making use of sysroot functionality within | ||
1927 | ``pkg-config``, the ``pkgconfig`` class no longer has to manipulate the | ||
1928 | files. | ||
1929 | |||
1930 | .. _ref-classes-populate-sdk: | ||
1931 | |||
1932 | ``populate_sdk.bbclass`` | ||
1933 | ======================== | ||
1934 | |||
1935 | The ``populate_sdk`` class provides support for SDK-only recipes. For | ||
1936 | information on advantages gained when building a cross-development | ||
1937 | toolchain using the ```do_populate_sdk`` <#ref-tasks-populate_sdk>`__ | ||
1938 | task, see the "`Building an SDK | ||
1939 | Installer <&YOCTO_DOCS_SDK_URL;#sdk-building-an-sdk-installer>`__" | ||
1940 | section in the Yocto Project Application Development and the Extensible | ||
1941 | Software Development Kit (eSDK) manual. | ||
1942 | |||
1943 | .. _ref-classes-populate-sdk-*: | ||
1944 | |||
1945 | ``populate_sdk_*.bbclass`` | ||
1946 | ========================== | ||
1947 | |||
1948 | The ``populate_sdk_*`` classes support SDK creation and consist of the | ||
1949 | following classes: | ||
1950 | |||
1951 | - *``populate_sdk_base``:* The base class supporting SDK creation under | ||
1952 | all package managers (i.e. DEB, RPM, and opkg). | ||
1953 | |||
1954 | - *``populate_sdk_deb``:* Supports creation of the SDK given the Debian | ||
1955 | package manager. | ||
1956 | |||
1957 | - *``populate_sdk_rpm``:* Supports creation of the SDK given the RPM | ||
1958 | package manager. | ||
1959 | |||
1960 | - *``populate_sdk_ipk``:* Supports creation of the SDK given the opkg | ||
1961 | (IPK format) package manager. | ||
1962 | |||
1963 | - *``populate_sdk_ext``:* Supports extensible SDK creation under all | ||
1964 | package managers. | ||
1965 | |||
1966 | The ``populate_sdk_base`` class inherits the appropriate | ||
1967 | ``populate_sdk_*`` (i.e. ``deb``, ``rpm``, and ``ipk``) based on | ||
1968 | ```IMAGE_PKGTYPE`` <#var-IMAGE_PKGTYPE>`__. | ||
1969 | |||
1970 | The base class ensures all source and destination directories are | ||
1971 | established and then populates the SDK. After populating the SDK, the | ||
1972 | ``populate_sdk_base`` class constructs two sysroots: | ||
1973 | ``${``\ ```SDK_ARCH`` <#var-SDK_ARCH>`__\ ``}-nativesdk``, which | ||
1974 | contains the cross-compiler and associated tooling, and the target, | ||
1975 | which contains a target root filesystem that is configured for the SDK | ||
1976 | usage. These two images reside in ```SDK_OUTPUT`` <#var-SDK_OUTPUT>`__, | ||
1977 | which consists of the following: | ||
1978 | ${SDK_OUTPUT}/${SDK_ARCH}-nativesdk-pkgs | ||
1979 | ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/target-pkgs | ||
1980 | |||
1981 | Finally, the base populate SDK class creates the toolchain environment | ||
1982 | setup script, the tarball of the SDK, and the installer. | ||
1983 | |||
1984 | The respective ``populate_sdk_deb``, ``populate_sdk_rpm``, and | ||
1985 | ``populate_sdk_ipk`` classes each support the specific type of SDK. | ||
1986 | These classes are inherited by and used with the ``populate_sdk_base`` | ||
1987 | class. | ||
1988 | |||
1989 | For more information on the cross-development toolchain generation, see | ||
1990 | the "`Cross-Development Toolchain | ||
1991 | Generation <&YOCTO_DOCS_OM_URL;#cross-development-toolchain-generation>`__" | ||
1992 | section in the Yocto Project Overview and Concepts Manual. For | ||
1993 | information on advantages gained when building a cross-development | ||
1994 | toolchain using the ```do_populate_sdk`` <#ref-tasks-populate_sdk>`__ | ||
1995 | task, see the "`Building an SDK | ||
1996 | Installer <&YOCTO_DOCS_SDK_URL;#sdk-building-an-sdk-installer>`__" | ||
1997 | section in the Yocto Project Application Development and the Extensible | ||
1998 | Software Development Kit (eSDK) manual. | ||
1999 | |||
2000 | .. _ref-classes-prexport: | ||
2001 | |||
2002 | ``prexport.bbclass`` | ||
2003 | ==================== | ||
2004 | |||
2005 | The ``prexport`` class provides functionality for exporting | ||
2006 | ```PR`` <#var-PR>`__ values. | ||
2007 | |||
2008 | .. note:: | ||
2009 | |||
2010 | This class is not intended to be used directly. Rather, it is enabled | ||
2011 | when using " | ||
2012 | bitbake-prserv-tool export | ||
2013 | ". | ||
2014 | |||
2015 | .. _ref-classes-primport: | ||
2016 | |||
2017 | ``primport.bbclass`` | ||
2018 | ==================== | ||
2019 | |||
2020 | The ``primport`` class provides functionality for importing | ||
2021 | ```PR`` <#var-PR>`__ values. | ||
2022 | |||
2023 | .. note:: | ||
2024 | |||
2025 | This class is not intended to be used directly. Rather, it is enabled | ||
2026 | when using " | ||
2027 | bitbake-prserv-tool import | ||
2028 | ". | ||
2029 | |||
2030 | .. _ref-classes-prserv: | ||
2031 | |||
2032 | ``prserv.bbclass`` | ||
2033 | ================== | ||
2034 | |||
2035 | The ``prserv`` class provides functionality for using a `PR | ||
2036 | service <&YOCTO_DOCS_DEV_URL;#working-with-a-pr-service>`__ in order to | ||
2037 | automatically manage the incrementing of the ```PR`` <#var-PR>`__ | ||
2038 | variable for each recipe. | ||
2039 | |||
2040 | This class is enabled by default because it is inherited by the | ||
2041 | ```package`` <#ref-classes-package>`__ class. However, the OpenEmbedded | ||
2042 | build system will not enable the functionality of this class unless | ||
2043 | ```PRSERV_HOST`` <#var-PRSERV_HOST>`__ has been set. | ||
2044 | |||
2045 | .. _ref-classes-ptest: | ||
2046 | |||
2047 | ``ptest.bbclass`` | ||
2048 | ================= | ||
2049 | |||
2050 | The ``ptest`` class provides functionality for packaging and installing | ||
2051 | runtime tests for recipes that build software that provides these tests. | ||
2052 | |||
2053 | This class is intended to be inherited by individual recipes. However, | ||
2054 | the class' functionality is largely disabled unless "ptest" appears in | ||
2055 | ```DISTRO_FEATURES`` <#var-DISTRO_FEATURES>`__. See the "`Testing | ||
2056 | Packages With | ||
2057 | ptest <&YOCTO_DOCS_DEV_URL;#testing-packages-with-ptest>`__" section in | ||
2058 | the Yocto Project Development Tasks Manual for more information on | ||
2059 | ptest. | ||
2060 | |||
2061 | .. _ref-classes-ptest-gnome: | ||
2062 | |||
2063 | ``ptest-gnome.bbclass`` | ||
2064 | ======================= | ||
2065 | |||
2066 | Enables package tests (ptests) specifically for GNOME packages, which | ||
2067 | have tests intended to be executed with ``gnome-desktop-testing``. | ||
2068 | |||
2069 | For information on setting up and running ptests, see the "`Testing | ||
2070 | Packages With | ||
2071 | ptest <&YOCTO_DOCS_DEV_URL;#testing-packages-with-ptest>`__" section in | ||
2072 | the Yocto Project Development Tasks Manual. | ||
2073 | |||
2074 | .. _ref-classes-python-dir: | ||
2075 | |||
2076 | ``python-dir.bbclass`` | ||
2077 | ====================== | ||
2078 | |||
2079 | The ``python-dir`` class provides the base version, location, and site | ||
2080 | package location for Python. | ||
2081 | |||
2082 | .. _ref-classes-python3native: | ||
2083 | |||
2084 | ``python3native.bbclass`` | ||
2085 | ========================= | ||
2086 | |||
2087 | The ``python3native`` class supports using the native version of Python | ||
2088 | 3 built by the build system rather than support of the version provided | ||
2089 | by the build host. | ||
2090 | |||
2091 | .. _ref-classes-pythonnative: | ||
2092 | |||
2093 | ``pythonnative.bbclass`` | ||
2094 | ======================== | ||
2095 | |||
2096 | When inherited by a recipe, the ``pythonnative`` class supports using | ||
2097 | the native version of Python built by the build system rather than using | ||
2098 | the version provided by the build host. | ||
2099 | |||
2100 | .. _ref-classes-qemu: | ||
2101 | |||
2102 | ``qemu.bbclass`` | ||
2103 | ================ | ||
2104 | |||
2105 | The ``qemu`` class provides functionality for recipes that either need | ||
2106 | QEMU or test for the existence of QEMU. Typically, this class is used to | ||
2107 | run programs for a target system on the build host using QEMU's | ||
2108 | application emulation mode. | ||
2109 | |||
2110 | .. _ref-classes-recipe_sanity: | ||
2111 | |||
2112 | ``recipe_sanity.bbclass`` | ||
2113 | ========================= | ||
2114 | |||
2115 | The ``recipe_sanity`` class checks for the presence of any host system | ||
2116 | recipe prerequisites that might affect the build (e.g. variables that | ||
2117 | are set or software that is present). | ||
2118 | |||
2119 | .. _ref-classes-relocatable: | ||
2120 | |||
2121 | ``relocatable.bbclass`` | ||
2122 | ======================= | ||
2123 | |||
2124 | The ``relocatable`` class enables relocation of binaries when they are | ||
2125 | installed into the sysroot. | ||
2126 | |||
2127 | This class makes use of the ```chrpath`` <#ref-classes-chrpath>`__ class | ||
2128 | and is used by both the ```cross`` <#ref-classes-cross>`__ and | ||
2129 | ```native`` <#ref-classes-native>`__ classes. | ||
2130 | |||
2131 | .. _ref-classes-remove-libtool: | ||
2132 | |||
2133 | ``remove-libtool.bbclass`` | ||
2134 | ========================== | ||
2135 | |||
2136 | The ``remove-libtool`` class adds a post function to the | ||
2137 | ```do_install`` <#ref-tasks-install>`__ task to remove all ``.la`` files | ||
2138 | installed by ``libtool``. Removing these files results in them being | ||
2139 | absent from both the sysroot and target packages. | ||
2140 | |||
2141 | If a recipe needs the ``.la`` files to be installed, then the recipe can | ||
2142 | override the removal by setting ``REMOVE_LIBTOOL_LA`` to "0" as follows: | ||
2143 | REMOVE_LIBTOOL_LA = "0" | ||
2144 | |||
2145 | .. note:: | ||
2146 | |||
2147 | The | ||
2148 | remove-libtool | ||
2149 | class is not enabled by default. | ||
2150 | |||
2151 | .. _ref-classes-report-error: | ||
2152 | |||
2153 | ``report-error.bbclass`` | ||
2154 | ======================== | ||
2155 | |||
2156 | The ``report-error`` class supports enabling the `error reporting | ||
2157 | tool <&YOCTO_DOCS_DEV_URL;#using-the-error-reporting-tool>`__, which | ||
2158 | allows you to submit build error information to a central database. | ||
2159 | |||
2160 | The class collects debug information for recipe, recipe version, task, | ||
2161 | machine, distro, build system, target system, host distro, branch, | ||
2162 | commit, and log. From the information, report files using a JSON format | ||
2163 | are created and stored in | ||
2164 | ``${``\ ```LOG_DIR`` <#var-LOG_DIR>`__\ ``}/error-report``. | ||
2165 | |||
2166 | .. _ref-classes-rm-work: | ||
2167 | |||
2168 | ``rm_work.bbclass`` | ||
2169 | =================== | ||
2170 | |||
2171 | The ``rm_work`` class supports deletion of temporary workspace, which | ||
2172 | can ease your hard drive demands during builds. | ||
2173 | |||
2174 | The OpenEmbedded build system can use a substantial amount of disk space | ||
2175 | during the build process. A portion of this space is the work files | ||
2176 | under the ``${TMPDIR}/work`` directory for each recipe. Once the build | ||
2177 | system generates the packages for a recipe, the work files for that | ||
2178 | recipe are no longer needed. However, by default, the build system | ||
2179 | preserves these files for inspection and possible debugging purposes. If | ||
2180 | you would rather have these files deleted to save disk space as the | ||
2181 | build progresses, you can enable ``rm_work`` by adding the following to | ||
2182 | your ``local.conf`` file, which is found in the `Build | ||
2183 | Directory <#build-directory>`__. INHERIT += "rm_work" If you are | ||
2184 | modifying and building source code out of the work directory for a | ||
2185 | recipe, enabling ``rm_work`` will potentially result in your changes to | ||
2186 | the source being lost. To exclude some recipes from having their work | ||
2187 | directories deleted by ``rm_work``, you can add the names of the recipe | ||
2188 | or recipes you are working on to the ``RM_WORK_EXCLUDE`` variable, which | ||
2189 | can also be set in your ``local.conf`` file. Here is an example: | ||
2190 | RM_WORK_EXCLUDE += "busybox glibc" | ||
2191 | |||
2192 | .. _ref-classes-rootfs*: | ||
2193 | |||
2194 | ``rootfs*.bbclass`` | ||
2195 | =================== | ||
2196 | |||
2197 | The ``rootfs*`` classes support creating the root filesystem for an | ||
2198 | image and consist of the following classes: | ||
2199 | |||
2200 | - The ``rootfs-postcommands`` class, which defines filesystem | ||
2201 | post-processing functions for image recipes. | ||
2202 | |||
2203 | - The ``rootfs_deb`` class, which supports creation of root filesystems | ||
2204 | for images built using ``.deb`` packages. | ||
2205 | |||
2206 | - The ``rootfs_rpm`` class, which supports creation of root filesystems | ||
2207 | for images built using ``.rpm`` packages. | ||
2208 | |||
2209 | - The ``rootfs_ipk`` class, which supports creation of root filesystems | ||
2210 | for images built using ``.ipk`` packages. | ||
2211 | |||
2212 | - The ``rootfsdebugfiles`` class, which installs additional files found | ||
2213 | on the build host directly into the root filesystem. | ||
2214 | |||
2215 | The root filesystem is created from packages using one of the | ||
2216 | ``rootfs*.bbclass`` files as determined by the | ||
2217 | ```PACKAGE_CLASSES`` <#var-PACKAGE_CLASSES>`__ variable. | ||
2218 | |||
2219 | For information on how root filesystem images are created, see the | ||
2220 | "`Image | ||
2221 | Generation <&YOCTO_DOCS_OM_URL;#image-generation-dev-environment>`__" | ||
2222 | section in the Yocto Project Overview and Concepts Manual. | ||
2223 | |||
2224 | .. _ref-classes-sanity: | ||
2225 | |||
2226 | ``sanity.bbclass`` | ||
2227 | ================== | ||
2228 | |||
2229 | The ``sanity`` class checks to see if prerequisite software is present | ||
2230 | on the host system so that users can be notified of potential problems | ||
2231 | that might affect their build. The class also performs basic user | ||
2232 | configuration checks from the ``local.conf`` configuration file to | ||
2233 | prevent common mistakes that cause build failures. Distribution policy | ||
2234 | usually determines whether to include this class. | ||
2235 | |||
2236 | .. _ref-classes-scons: | ||
2237 | |||
2238 | ``scons.bbclass`` | ||
2239 | ================= | ||
2240 | |||
2241 | The ``scons`` class supports recipes that need to build software that | ||
2242 | uses the SCons build system. You can use the | ||
2243 | ```EXTRA_OESCONS`` <#var-EXTRA_OESCONS>`__ variable to specify | ||
2244 | additional configuration options you want to pass SCons command line. | ||
2245 | |||
2246 | .. _ref-classes-sdl: | ||
2247 | |||
2248 | ``sdl.bbclass`` | ||
2249 | =============== | ||
2250 | |||
2251 | The ``sdl`` class supports recipes that need to build software that uses | ||
2252 | the Simple DirectMedia Layer (SDL) library. | ||
2253 | |||
2254 | .. _ref-classes-setuptools: | ||
2255 | |||
2256 | ``setuptools.bbclass`` | ||
2257 | ====================== | ||
2258 | |||
2259 | The ``setuptools`` class supports Python version 2.x extensions that use | ||
2260 | build systems based on ``setuptools``. If your recipe uses these build | ||
2261 | systems, the recipe needs to inherit the ``setuptools`` class. | ||
2262 | |||
2263 | .. _ref-classes-setuptools3: | ||
2264 | |||
2265 | ``setuptools3.bbclass`` | ||
2266 | ======================= | ||
2267 | |||
2268 | The ``setuptools3`` class supports Python version 3.x extensions that | ||
2269 | use build systems based on ``setuptools3``. If your recipe uses these | ||
2270 | build systems, the recipe needs to inherit the ``setuptools3`` class. | ||
2271 | |||
2272 | .. _ref-classes-sign_rpm: | ||
2273 | |||
2274 | ``sign_rpm.bbclass`` | ||
2275 | ==================== | ||
2276 | |||
2277 | The ``sign_rpm`` class supports generating signed RPM packages. | ||
2278 | |||
2279 | .. _ref-classes-sip: | ||
2280 | |||
2281 | ``sip.bbclass`` | ||
2282 | =============== | ||
2283 | |||
2284 | The ``sip`` class supports recipes that build or package SIP-based | ||
2285 | Python bindings. | ||
2286 | |||
2287 | .. _ref-classes-siteconfig: | ||
2288 | |||
2289 | ``siteconfig.bbclass`` | ||
2290 | ====================== | ||
2291 | |||
2292 | The ``siteconfig`` class provides functionality for handling site | ||
2293 | configuration. The class is used by the | ||
2294 | ```autotools`` <#ref-classes-autotools>`__ class to accelerate the | ||
2295 | ```do_configure`` <#ref-tasks-configure>`__ task. | ||
2296 | |||
2297 | .. _ref-classes-siteinfo: | ||
2298 | |||
2299 | ``siteinfo.bbclass`` | ||
2300 | ==================== | ||
2301 | |||
2302 | The ``siteinfo`` class provides information about the targets that might | ||
2303 | be needed by other classes or recipes. | ||
2304 | |||
2305 | As an example, consider Autotools, which can require tests that must | ||
2306 | execute on the target hardware. Since this is not possible in general | ||
2307 | when cross compiling, site information is used to provide cached test | ||
2308 | results so these tests can be skipped over but still make the correct | ||
2309 | values available. The ``meta/site directory`` contains test results | ||
2310 | sorted into different categories such as architecture, endianness, and | ||
2311 | the ``libc`` used. Site information provides a list of files containing | ||
2312 | data relevant to the current build in the ``CONFIG_SITE`` variable that | ||
2313 | Autotools automatically picks up. | ||
2314 | |||
2315 | The class also provides variables like ``SITEINFO_ENDIANNESS`` and | ||
2316 | ``SITEINFO_BITS`` that can be used elsewhere in the metadata. | ||
2317 | |||
2318 | .. _ref-classes-spdx: | ||
2319 | |||
2320 | ``spdx.bbclass`` | ||
2321 | ================ | ||
2322 | |||
2323 | The ``spdx`` class integrates real-time license scanning, generation of | ||
2324 | SPDX standard output, and verification of license information during the | ||
2325 | build. | ||
2326 | |||
2327 | .. note:: | ||
2328 | |||
2329 | This class is currently at the prototype stage in the 1.6 release. | ||
2330 | |||
2331 | .. _ref-classes-sstate: | ||
2332 | |||
2333 | ``sstate.bbclass`` | ||
2334 | ================== | ||
2335 | |||
2336 | The ``sstate`` class provides support for Shared State (sstate). By | ||
2337 | default, the class is enabled through the | ||
2338 | ```INHERIT_DISTRO`` <#var-INHERIT_DISTRO>`__ variable's default value. | ||
2339 | |||
2340 | For more information on sstate, see the "`Shared State | ||
2341 | Cache <&YOCTO_DOCS_OM_URL;#shared-state-cache>`__" section in the Yocto | ||
2342 | Project Overview and Concepts Manual. | ||
2343 | |||
2344 | .. _ref-classes-staging: | ||
2345 | |||
2346 | ``staging.bbclass`` | ||
2347 | =================== | ||
2348 | |||
2349 | The ``staging`` class installs files into individual recipe work | ||
2350 | directories for sysroots. The class contains the following key tasks: | ||
2351 | |||
2352 | - The ```do_populate_sysroot`` <#ref-tasks-populate_sysroot>`__ task, | ||
2353 | which is responsible for handing the files that end up in the recipe | ||
2354 | sysroots. | ||
2355 | |||
2356 | - The | ||
2357 | ```do_prepare_recipe_sysroot`` <#ref-tasks-prepare_recipe_sysroot>`__ | ||
2358 | task (a "partner" task to the ``populate_sysroot`` task), which | ||
2359 | installs the files into the individual recipe work directories (i.e. | ||
2360 | ```WORKDIR`` <#var-WORKDIR>`__). | ||
2361 | |||
2362 | The code in the ``staging`` class is complex and basically works in two | ||
2363 | stages: | ||
2364 | |||
2365 | - *Stage One:* The first stage addresses recipes that have files they | ||
2366 | want to share with other recipes that have dependencies on the | ||
2367 | originating recipe. Normally these dependencies are installed through | ||
2368 | the ```do_install`` <#ref-tasks-install>`__ task into | ||
2369 | ``${``\ ```D`` <#var-D>`__\ ``}``. The ``do_populate_sysroot`` task | ||
2370 | copies a subset of these files into ``${SYSROOT_DESTDIR}``. This | ||
2371 | subset of files is controlled by the | ||
2372 | ```SYSROOT_DIRS`` <#var-SYSROOT_DIRS>`__, | ||
2373 | ```SYSROOT_DIRS_NATIVE`` <#var-SYSROOT_DIRS_NATIVE>`__, and | ||
2374 | ```SYSROOT_DIRS_BLACKLIST`` <#var-SYSROOT_DIRS_BLACKLIST>`__ | ||
2375 | variables. | ||
2376 | |||
2377 | .. note:: | ||
2378 | |||
2379 | Additionally, a recipe can customize the files further by | ||
2380 | declaring a processing function in the | ||
2381 | SYSROOT_PREPROCESS_FUNCS | ||
2382 | variable. | ||
2383 | |||
2384 | A shared state (sstate) object is built from these files and the | ||
2385 | files are placed into a subdirectory of | ||
2386 | ```tmp/sysroots-components/`` <#structure-build-tmp-sysroots-components>`__. | ||
2387 | The files are scanned for hardcoded paths to the original | ||
2388 | installation location. If the location is found in text files, the | ||
2389 | hardcoded locations are replaced by tokens and a list of the files | ||
2390 | needing such replacements is created. These adjustments are referred | ||
2391 | to as "FIXMEs". The list of files that are scanned for paths is | ||
2392 | controlled by the ```SSTATE_SCAN_FILES`` <#var-SSTATE_SCAN_FILES>`__ | ||
2393 | variable. | ||
2394 | |||
2395 | - *Stage Two:* The second stage addresses recipes that want to use | ||
2396 | something from another recipe and declare a dependency on that recipe | ||
2397 | through the ```DEPENDS`` <#var-DEPENDS>`__ variable. The recipe will | ||
2398 | have a | ||
2399 | ```do_prepare_recipe_sysroot`` <#ref-tasks-prepare_recipe_sysroot>`__ | ||
2400 | task and when this task executes, it creates the ``recipe-sysroot`` | ||
2401 | and ``recipe-sysroot-native`` in the recipe work directory (i.e. | ||
2402 | ```WORKDIR`` <#var-WORKDIR>`__). The OpenEmbedded build system | ||
2403 | creates hard links to copies of the relevant files from | ||
2404 | ``sysroots-components`` into the recipe work directory. | ||
2405 | |||
2406 | .. note:: | ||
2407 | |||
2408 | If hard links are not possible, the build system uses actual | ||
2409 | copies. | ||
2410 | |||
2411 | The build system then addresses any "FIXMEs" to paths as defined from | ||
2412 | the list created in the first stage. | ||
2413 | |||
2414 | Finally, any files in ``${bindir}`` within the sysroot that have the | ||
2415 | prefix "``postinst-``" are executed. | ||
2416 | |||
2417 | .. note:: | ||
2418 | |||
2419 | Although such sysroot post installation scripts are not | ||
2420 | recommended for general use, the files do allow some issues such | ||
2421 | as user creation and module indexes to be addressed. | ||
2422 | |||
2423 | Because recipes can have other dependencies outside of ``DEPENDS`` | ||
2424 | (e.g. ``do_unpack[depends] += "tar-native:do_populate_sysroot"``), | ||
2425 | the sysroot creation function ``extend_recipe_sysroot`` is also added | ||
2426 | as a pre-function for those tasks whose dependencies are not through | ||
2427 | ``DEPENDS`` but operate similarly. | ||
2428 | |||
2429 | When installing dependencies into the sysroot, the code traverses the | ||
2430 | dependency graph and processes dependencies in exactly the same way | ||
2431 | as the dependencies would or would not be when installed from sstate. | ||
2432 | This processing means, for example, a native tool would have its | ||
2433 | native dependencies added but a target library would not have its | ||
2434 | dependencies traversed or installed. The same sstate dependency code | ||
2435 | is used so that builds should be identical regardless of whether | ||
2436 | sstate was used or not. For a closer look, see the | ||
2437 | ``setscene_depvalid()`` function in the | ||
2438 | ```sstate`` <#ref-classes-sstate>`__ class. | ||
2439 | |||
2440 | The build system is careful to maintain manifests of the files it | ||
2441 | installs so that any given dependency can be installed as needed. The | ||
2442 | sstate hash of the installed item is also stored so that if it | ||
2443 | changes, the build system can reinstall it. | ||
2444 | |||
2445 | .. _ref-classes-syslinux: | ||
2446 | |||
2447 | ``syslinux.bbclass`` | ||
2448 | ==================== | ||
2449 | |||
2450 | The ``syslinux`` class provides syslinux-specific functions for building | ||
2451 | bootable images. | ||
2452 | |||
2453 | The class supports the following variables: | ||
2454 | |||
2455 | - ```INITRD`` <#var-INITRD>`__: Indicates list of filesystem images to | ||
2456 | concatenate and use as an initial RAM disk (initrd). This variable is | ||
2457 | optional. | ||
2458 | |||
2459 | - ```ROOTFS`` <#var-ROOTFS>`__: Indicates a filesystem image to include | ||
2460 | as the root filesystem. This variable is optional. | ||
2461 | |||
2462 | - ```AUTO_SYSLINUXMENU`` <#var-AUTO_SYSLINUXMENU>`__: Enables creating | ||
2463 | an automatic menu when set to "1". | ||
2464 | |||
2465 | - ```LABELS`` <#var-LABELS>`__: Lists targets for automatic | ||
2466 | configuration. | ||
2467 | |||
2468 | - ```APPEND`` <#var-APPEND>`__: Lists append string overrides for each | ||
2469 | label. | ||
2470 | |||
2471 | - ```SYSLINUX_OPTS`` <#var-SYSLINUX_OPTS>`__: Lists additional options | ||
2472 | to add to the syslinux file. Semicolon characters separate multiple | ||
2473 | options. | ||
2474 | |||
2475 | - ```SYSLINUX_SPLASH`` <#var-SYSLINUX_SPLASH>`__: Lists a background | ||
2476 | for the VGA boot menu when you are using the boot menu. | ||
2477 | |||
2478 | - ```SYSLINUX_DEFAULT_CONSOLE`` <#var-SYSLINUX_DEFAULT_CONSOLE>`__: Set | ||
2479 | to "console=ttyX" to change kernel boot default console. | ||
2480 | |||
2481 | - ```SYSLINUX_SERIAL`` <#var-SYSLINUX_SERIAL>`__: Sets an alternate | ||
2482 | serial port. Or, turns off serial when the variable is set with an | ||
2483 | empty string. | ||
2484 | |||
2485 | - ```SYSLINUX_SERIAL_TTY`` <#var-SYSLINUX_SERIAL_TTY>`__: Sets an | ||
2486 | alternate "console=tty..." kernel boot argument. | ||
2487 | |||
2488 | .. _ref-classes-systemd: | ||
2489 | |||
2490 | ``systemd.bbclass`` | ||
2491 | =================== | ||
2492 | |||
2493 | The ``systemd`` class provides support for recipes that install systemd | ||
2494 | unit files. | ||
2495 | |||
2496 | The functionality for this class is disabled unless you have "systemd" | ||
2497 | in ```DISTRO_FEATURES`` <#var-DISTRO_FEATURES>`__. | ||
2498 | |||
2499 | Under this class, the recipe or Makefile (i.e. whatever the recipe is | ||
2500 | calling during the ```do_install`` <#ref-tasks-install>`__ task) | ||
2501 | installs unit files into | ||
2502 | ``${``\ ```D`` <#var-D>`__\ ``}${systemd_unitdir}/system``. If the unit | ||
2503 | files being installed go into packages other than the main package, you | ||
2504 | need to set ```SYSTEMD_PACKAGES`` <#var-SYSTEMD_PACKAGES>`__ in your | ||
2505 | recipe to identify the packages in which the files will be installed. | ||
2506 | |||
2507 | You should set ```SYSTEMD_SERVICE`` <#var-SYSTEMD_SERVICE>`__ to the | ||
2508 | name of the service file. You should also use a package name override to | ||
2509 | indicate the package to which the value applies. If the value applies to | ||
2510 | the recipe's main package, use ``${``\ ```PN`` <#var-PN>`__\ ``}``. Here | ||
2511 | is an example from the connman recipe: SYSTEMD_SERVICE_${PN} = | ||
2512 | "connman.service" Services are set up to start on boot automatically | ||
2513 | unless you have set | ||
2514 | ```SYSTEMD_AUTO_ENABLE`` <#var-SYSTEMD_AUTO_ENABLE>`__ to "disable". | ||
2515 | |||
2516 | For more information on ``systemd``, see the "`Selecting an | ||
2517 | Initialization | ||
2518 | Manager <&YOCTO_DOCS_DEV_URL;#selecting-an-initialization-manager>`__" | ||
2519 | section in the Yocto Project Development Tasks Manual. | ||
2520 | |||
2521 | .. _ref-classes-systemd-boot: | ||
2522 | |||
2523 | ``systemd-boot.bbclass`` | ||
2524 | ======================== | ||
2525 | |||
2526 | The ``systemd-boot`` class provides functions specific to the | ||
2527 | systemd-boot bootloader for building bootable images. This is an | ||
2528 | internal class and is not intended to be used directly. | ||
2529 | |||
2530 | .. note:: | ||
2531 | |||
2532 | The | ||
2533 | systemd-boot | ||
2534 | class is a result from merging the | ||
2535 | gummiboot | ||
2536 | class used in previous Yocto Project releases with the | ||
2537 | systemd | ||
2538 | project. | ||
2539 | |||
2540 | Set the ```EFI_PROVIDER`` <#var-EFI_PROVIDER>`__ variable to | ||
2541 | "systemd-boot" to use this class. Doing so creates a standalone EFI | ||
2542 | bootloader that is not dependent on systemd. | ||
2543 | |||
2544 | For information on more variables used and supported in this class, see | ||
2545 | the ```SYSTEMD_BOOT_CFG`` <#var-SYSTEMD_BOOT_CFG>`__, | ||
2546 | ```SYSTEMD_BOOT_ENTRIES`` <#var-SYSTEMD_BOOT_ENTRIES>`__, and | ||
2547 | ```SYSTEMD_BOOT_TIMEOUT`` <#var-SYSTEMD_BOOT_TIMEOUT>`__ variables. | ||
2548 | |||
2549 | You can also see the `Systemd-boot | ||
2550 | documentation <http://www.freedesktop.org/wiki/Software/systemd/systemd-boot/>`__ | ||
2551 | for more information. | ||
2552 | |||
2553 | .. _ref-classes-terminal: | ||
2554 | |||
2555 | ``terminal.bbclass`` | ||
2556 | ==================== | ||
2557 | |||
2558 | The ``terminal`` class provides support for starting a terminal session. | ||
2559 | The ```OE_TERMINAL`` <#var-OE_TERMINAL>`__ variable controls which | ||
2560 | terminal emulator is used for the session. | ||
2561 | |||
2562 | Other classes use the ``terminal`` class anywhere a separate terminal | ||
2563 | session needs to be started. For example, the | ||
2564 | ```patch`` <#ref-classes-patch>`__ class assuming | ||
2565 | ```PATCHRESOLVE`` <#var-PATCHRESOLVE>`__ is set to "user", the | ||
2566 | ```cml1`` <#ref-classes-cml1>`__ class, and the | ||
2567 | ```devshell`` <#ref-classes-devshell>`__ class all use the ``terminal`` | ||
2568 | class. | ||
2569 | |||
2570 | .. _ref-classes-testimage*: | ||
2571 | |||
2572 | ``testimage*.bbclass`` | ||
2573 | ====================== | ||
2574 | |||
2575 | The ``testimage*`` classes support running automated tests against | ||
2576 | images using QEMU and on actual hardware. The classes handle loading the | ||
2577 | tests and starting the image. To use the classes, you need to perform | ||
2578 | steps to set up the environment. | ||
2579 | |||
2580 | .. note:: | ||
2581 | |||
2582 | Best practices include using | ||
2583 | IMAGE_CLASSES | ||
2584 | rather than | ||
2585 | INHERIT | ||
2586 | to inherit the | ||
2587 | testimage | ||
2588 | class for automated image testing. | ||
2589 | |||
2590 | The tests are commands that run on the target system over ``ssh``. Each | ||
2591 | test is written in Python and makes use of the ``unittest`` module. | ||
2592 | |||
2593 | The ``testimage.bbclass`` runs tests on an image when called using the | ||
2594 | following: $ bitbake -c testimage image The ``testimage-auto`` class | ||
2595 | runs tests on an image after the image is constructed (i.e. | ||
2596 | ```TESTIMAGE_AUTO`` <#var-TESTIMAGE_AUTO>`__ must be set to "1"). | ||
2597 | |||
2598 | For information on how to enable, run, and create new tests, see the | ||
2599 | "`Performing Automated Runtime | ||
2600 | Testing <&YOCTO_DOCS_DEV_URL;#performing-automated-runtime-testing>`__" | ||
2601 | section in the Yocto Project Development Tasks Manual. | ||
2602 | |||
2603 | .. _ref-classes-testsdk: | ||
2604 | |||
2605 | ``testsdk.bbclass`` | ||
2606 | =================== | ||
2607 | |||
2608 | This class supports running automated tests against software development | ||
2609 | kits (SDKs). The ``testsdk`` class runs tests on an SDK when called | ||
2610 | using the following: $ bitbake -c testsdk image | ||
2611 | |||
2612 | .. note:: | ||
2613 | |||
2614 | Best practices include using | ||
2615 | IMAGE_CLASSES | ||
2616 | rather than | ||
2617 | INHERIT | ||
2618 | to inherit the | ||
2619 | testsdk | ||
2620 | class for automated SDK testing. | ||
2621 | |||
2622 | .. _ref-classes-texinfo: | ||
2623 | |||
2624 | ``texinfo.bbclass`` | ||
2625 | =================== | ||
2626 | |||
2627 | This class should be inherited by recipes whose upstream packages invoke | ||
2628 | the ``texinfo`` utilities at build-time. Native and cross recipes are | ||
2629 | made to use the dummy scripts provided by ``texinfo-dummy-native``, for | ||
2630 | improved performance. Target architecture recipes use the genuine | ||
2631 | Texinfo utilities. By default, they use the Texinfo utilities on the | ||
2632 | host system. | ||
2633 | |||
2634 | .. note:: | ||
2635 | |||
2636 | If you want to use the Texinfo recipe shipped with the build system, | ||
2637 | you can remove "texinfo-native" from | ||
2638 | ASSUME_PROVIDED | ||
2639 | and makeinfo from | ||
2640 | SANITY_REQUIRED_UTILITIES | ||
2641 | . | ||
2642 | |||
2643 | .. _ref-classes-tinderclient: | ||
2644 | |||
2645 | ``tinderclient.bbclass`` | ||
2646 | ======================== | ||
2647 | |||
2648 | The ``tinderclient`` class submits build results to an external | ||
2649 | Tinderbox instance. | ||
2650 | |||
2651 | .. note:: | ||
2652 | |||
2653 | This class is currently unmaintained. | ||
2654 | |||
2655 | .. _ref-classes-toaster: | ||
2656 | |||
2657 | ``toaster.bbclass`` | ||
2658 | =================== | ||
2659 | |||
2660 | The ``toaster`` class collects information about packages and images and | ||
2661 | sends them as events that the BitBake user interface can receive. The | ||
2662 | class is enabled when the Toaster user interface is running. | ||
2663 | |||
2664 | This class is not intended to be used directly. | ||
2665 | |||
2666 | .. _ref-classes-toolchain-scripts: | ||
2667 | |||
2668 | ``toolchain-scripts.bbclass`` | ||
2669 | ============================= | ||
2670 | |||
2671 | The ``toolchain-scripts`` class provides the scripts used for setting up | ||
2672 | the environment for installed SDKs. | ||
2673 | |||
2674 | .. _ref-classes-typecheck: | ||
2675 | |||
2676 | ``typecheck.bbclass`` | ||
2677 | ===================== | ||
2678 | |||
2679 | The ``typecheck`` class provides support for validating the values of | ||
2680 | variables set at the configuration level against their defined types. | ||
2681 | The OpenEmbedded build system allows you to define the type of a | ||
2682 | variable using the "type" varflag. Here is an example: | ||
2683 | IMAGE_FEATURES[type] = "list" | ||
2684 | |||
2685 | .. _ref-classes-uboot-config: | ||
2686 | |||
2687 | ``uboot-config.bbclass`` | ||
2688 | ======================== | ||
2689 | |||
2690 | The ``uboot-config`` class provides support for U-Boot configuration for | ||
2691 | a machine. Specify the machine in your recipe as follows: UBOOT_CONFIG | ||
2692 | ??= <default> UBOOT_CONFIG[foo] = "config,images" You can also specify | ||
2693 | the machine using this method: UBOOT_MACHINE = "config" See the | ||
2694 | ```UBOOT_CONFIG`` <#var-UBOOT_CONFIG>`__ and | ||
2695 | ```UBOOT_MACHINE`` <#var-UBOOT_MACHINE>`__ variables for additional | ||
2696 | information. | ||
2697 | |||
2698 | .. _ref-classes-uninative: | ||
2699 | |||
2700 | ``uninative.bbclass`` | ||
2701 | ===================== | ||
2702 | |||
2703 | Attempts to isolate the build system from the host distribution's C | ||
2704 | library in order to make re-use of native shared state artifacts across | ||
2705 | different host distributions practical. With this class enabled, a | ||
2706 | tarball containing a pre-built C library is downloaded at the start of | ||
2707 | the build. In the Poky reference distribution this is enabled by default | ||
2708 | through ``meta/conf/distro/include/yocto-uninative.inc``. Other | ||
2709 | distributions that do not derive from poky can also | ||
2710 | "``require conf/distro/include/yocto-uninative.inc``" to use this. | ||
2711 | Alternatively if you prefer, you can build the uninative-tarball recipe | ||
2712 | yourself, publish the resulting tarball (e.g. via HTTP) and set | ||
2713 | ``UNINATIVE_URL`` and ``UNINATIVE_CHECKSUM`` appropriately. For an | ||
2714 | example, see the ``meta/conf/distro/include/yocto-uninative.inc``. | ||
2715 | |||
2716 | The ``uninative`` class is also used unconditionally by the extensible | ||
2717 | SDK. When building the extensible SDK, ``uninative-tarball`` is built | ||
2718 | and the resulting tarball is included within the SDK. | ||
2719 | |||
2720 | .. _ref-classes-update-alternatives: | ||
2721 | |||
2722 | ``update-alternatives.bbclass`` | ||
2723 | =============================== | ||
2724 | |||
2725 | The ``update-alternatives`` class helps the alternatives system when | ||
2726 | multiple sources provide the same command. This situation occurs when | ||
2727 | several programs that have the same or similar function are installed | ||
2728 | with the same name. For example, the ``ar`` command is available from | ||
2729 | the ``busybox``, ``binutils`` and ``elfutils`` packages. The | ||
2730 | ``update-alternatives`` class handles renaming the binaries so that | ||
2731 | multiple packages can be installed without conflicts. The ``ar`` command | ||
2732 | still works regardless of which packages are installed or subsequently | ||
2733 | removed. The class renames the conflicting binary in each package and | ||
2734 | symlinks the highest priority binary during installation or removal of | ||
2735 | packages. | ||
2736 | |||
2737 | To use this class, you need to define a number of variables: | ||
2738 | |||
2739 | - ```ALTERNATIVE`` <#var-ALTERNATIVE>`__ | ||
2740 | |||
2741 | - ```ALTERNATIVE_LINK_NAME`` <#var-ALTERNATIVE_LINK_NAME>`__ | ||
2742 | |||
2743 | - ```ALTERNATIVE_TARGET`` <#var-ALTERNATIVE_TARGET>`__ | ||
2744 | |||
2745 | - ```ALTERNATIVE_PRIORITY`` <#var-ALTERNATIVE_PRIORITY>`__ | ||
2746 | |||
2747 | These variables list alternative commands needed by a package, provide | ||
2748 | pathnames for links, default links for targets, and so forth. For | ||
2749 | details on how to use this class, see the comments in the | ||
2750 | ```update-alternatives.bbclass`` <&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/meta/classes/update-alternatives.bbclass>`__ | ||
2751 | file. | ||
2752 | |||
2753 | .. note:: | ||
2754 | |||
2755 | You can use the | ||
2756 | update-alternatives | ||
2757 | command directly in your recipes. However, this class simplifies | ||
2758 | things in most cases. | ||
2759 | |||
2760 | .. _ref-classes-update-rc.d: | ||
2761 | |||
2762 | ``update-rc.d.bbclass`` | ||
2763 | ======================= | ||
2764 | |||
2765 | The ``update-rc.d`` class uses ``update-rc.d`` to safely install an | ||
2766 | initialization script on behalf of the package. The OpenEmbedded build | ||
2767 | system takes care of details such as making sure the script is stopped | ||
2768 | before a package is removed and started when the package is installed. | ||
2769 | |||
2770 | Three variables control this class: ``INITSCRIPT_PACKAGES``, | ||
2771 | ``INITSCRIPT_NAME`` and ``INITSCRIPT_PARAMS``. See the variable links | ||
2772 | for details. | ||
2773 | |||
2774 | .. _ref-classes-useradd: | ||
2775 | |||
2776 | ``useradd*.bbclass`` | ||
2777 | ==================== | ||
2778 | |||
2779 | The ``useradd*`` classes support the addition of users or groups for | ||
2780 | usage by the package on the target. For example, if you have packages | ||
2781 | that contain system services that should be run under their own user or | ||
2782 | group, you can use these classes to enable creation of the user or | ||
2783 | group. The ``meta-skeleton/recipes-skeleton/useradd/useradd-example.bb`` | ||
2784 | recipe in the `Source Directory <#source-directory>`__ provides a simple | ||
2785 | example that shows how to add three users and groups to two packages. | ||
2786 | See the ``useradd-example.bb`` recipe for more information on how to use | ||
2787 | these classes. | ||
2788 | |||
2789 | The ``useradd_base`` class provides basic functionality for user or | ||
2790 | groups settings. | ||
2791 | |||
2792 | The ``useradd*`` classes support the | ||
2793 | ```USERADD_PACKAGES`` <#var-USERADD_PACKAGES>`__, | ||
2794 | ```USERADD_PARAM`` <#var-USERADD_PARAM>`__, | ||
2795 | ```GROUPADD_PARAM`` <#var-GROUPADD_PARAM>`__, and | ||
2796 | ```GROUPMEMS_PARAM`` <#var-GROUPMEMS_PARAM>`__ variables. | ||
2797 | |||
2798 | The ``useradd-staticids`` class supports the addition of users or groups | ||
2799 | that have static user identification (``uid``) and group identification | ||
2800 | (``gid``) values. | ||
2801 | |||
2802 | The default behavior of the OpenEmbedded build system for assigning | ||
2803 | ``uid`` and ``gid`` values when packages add users and groups during | ||
2804 | package install time is to add them dynamically. This works fine for | ||
2805 | programs that do not care what the values of the resulting users and | ||
2806 | groups become. In these cases, the order of the installation determines | ||
2807 | the final ``uid`` and ``gid`` values. However, if non-deterministic | ||
2808 | ``uid`` and ``gid`` values are a problem, you can override the default, | ||
2809 | dynamic application of these values by setting static values. When you | ||
2810 | set static values, the OpenEmbedded build system looks in | ||
2811 | ```BBPATH`` <#var-BBPATH>`__ for ``files/passwd`` and ``files/group`` | ||
2812 | files for the values. | ||
2813 | |||
2814 | To use static ``uid`` and ``gid`` values, you need to set some | ||
2815 | variables. See the ```USERADDEXTENSION`` <#var-USERADDEXTENSION>`__, | ||
2816 | ```USERADD_UID_TABLES`` <#var-USERADD_UID_TABLES>`__, | ||
2817 | ```USERADD_GID_TABLES`` <#var-USERADD_GID_TABLES>`__, and | ||
2818 | ```USERADD_ERROR_DYNAMIC`` <#var-USERADD_ERROR_DYNAMIC>`__ variables. | ||
2819 | You can also see the ```useradd`` <#ref-classes-useradd>`__ class for | ||
2820 | additional information. | ||
2821 | |||
2822 | .. note:: | ||
2823 | |||
2824 | You do not use the | ||
2825 | useradd-staticids | ||
2826 | class directly. You either enable or disable the class by setting the | ||
2827 | USERADDEXTENSION | ||
2828 | variable. If you enable or disable the class in a configured system, | ||
2829 | TMPDIR | ||
2830 | might contain incorrect | ||
2831 | uid | ||
2832 | and | ||
2833 | gid | ||
2834 | values. Deleting the | ||
2835 | TMPDIR | ||
2836 | directory will correct this condition. | ||
2837 | |||
2838 | .. _ref-classes-utility-tasks: | ||
2839 | |||
2840 | ``utility-tasks.bbclass`` | ||
2841 | ========================= | ||
2842 | |||
2843 | The ``utility-tasks`` class provides support for various "utility" type | ||
2844 | tasks that are applicable to all recipes, such as | ||
2845 | ```do_clean`` <#ref-tasks-clean>`__ and | ||
2846 | ```do_listtasks`` <#ref-tasks-listtasks>`__. | ||
2847 | |||
2848 | This class is enabled by default because it is inherited by the | ||
2849 | ```base`` <#ref-classes-base>`__ class. | ||
2850 | |||
2851 | .. _ref-classes-utils: | ||
2852 | |||
2853 | ``utils.bbclass`` | ||
2854 | ================= | ||
2855 | |||
2856 | The ``utils`` class provides some useful Python functions that are | ||
2857 | typically used in inline Python expressions (e.g. ``${@...}``). One | ||
2858 | example use is for ``bb.utils.contains()``. | ||
2859 | |||
2860 | This class is enabled by default because it is inherited by the | ||
2861 | ```base`` <#ref-classes-base>`__ class. | ||
2862 | |||
2863 | .. _ref-classes-vala: | ||
2864 | |||
2865 | ``vala.bbclass`` | ||
2866 | ================ | ||
2867 | |||
2868 | The ``vala`` class supports recipes that need to build software written | ||
2869 | using the Vala programming language. | ||
2870 | |||
2871 | .. _ref-classes-waf: | ||
2872 | |||
2873 | ``waf.bbclass`` | ||
2874 | =============== | ||
2875 | |||
2876 | The ``waf`` class supports recipes that need to build software that uses | ||
2877 | the Waf build system. You can use the | ||
2878 | ```EXTRA_OECONF`` <#var-EXTRA_OECONF>`__ or | ||
2879 | ```PACKAGECONFIG_CONFARGS`` <#var-PACKAGECONFIG_CONFARGS>`__ variables | ||
2880 | to specify additional configuration options to be passed on the Waf | ||
2881 | command line. | ||