summaryrefslogtreecommitdiffstats
path: root/documentation/ref-manual/ref-classes.rst
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/ref-manual/ref-classes.rst')
-rw-r--r--documentation/ref-manual/ref-classes.rst2881
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*******
2Classes
3*******
4
5Class files are used to abstract common functionality and share it
6amongst multiple recipe (``.bb``) files. To use a class file, you simply
7make sure the recipe inherits the class. In most cases, when a recipe
8inherits a class it is enough to enable its features. There are cases,
9however, where in the recipe you might need to set variables or override
10some default behavior.
11
12Any `Metadata <#metadata>`__ usually found in a recipe can also be
13placed in a class file. Class files are identified by the extension
14``.bbclass`` and are usually placed in a ``classes/`` directory beneath
15the ``meta*/`` directory found in the `Source
16Directory <#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
19in ```BBPATH`` <#var-BBPATH>`__ using the same method by which ``.conf``
20files are searched.
21
22This chapter discusses only the most useful and important classes. Other
23classes do exist within the ``meta/classes`` directory in the Source
24Directory. You can reference the ``.bbclass`` files directly for more
25information.
26
27.. _ref-classes-allarch:
28
29``allarch.bbclass``
30===================
31
32The ``allarch`` class is inherited by recipes that do not produce
33architecture-specific output. The class disables functionality that is
34normally needed for recipes that produce executable binaries (such as
35building the cross-compiler and a C library as pre-requisites, and
36splitting 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
53By default, all recipes inherit the ```base`` <#ref-classes-base>`__ and
54```package`` <#ref-classes-package>`__ classes, which enable
55functionality needed for recipes that produce executable output. If your
56recipe, for example, only produces packages that contain configuration
57files, media files, or scripts (e.g. Python and Perl), then it should
58inherit the ``allarch`` class.
59
60.. _ref-classes-archiver:
61
62``archiver.bbclass``
63====================
64
65The ``archiver`` class supports releasing source code and other
66materials with the binaries.
67
68For more details on the source archiver, see the "`Maintaining Open
69Source License Compliance During Your Product's
70Lifecycle <&YOCTO_DOCS_DEV_URL;#maintaining-open-source-license-compliance-during-your-products-lifecycle>`__"
71section in the Yocto Project Development Tasks Manual. You can also see
72the ```ARCHIVER_MODE`` <#var-ARCHIVER_MODE>`__ variable for information
73about the variable flags (varflags) that help control archive creation.
74
75.. _ref-classes-autotools:
76
77``autotools*.bbclass``
78======================
79
80The ``autotools*`` classes support Autotooled packages.
81
82The ``autoconf``, ``automake``, and ``libtool`` packages bring
83standardization. This class defines a set of tasks (e.g. ``configure``,
84``compile`` and so forth) that work for all Autotooled packages. It
85should usually be enough to define a few standard variables and then
86simply ``inherit autotools``. These classes can also work with software
87that emulates Autotools. For more information, see the "`Autotooled
88Package <&YOCTO_DOCS_DEV_URL;#new-recipe-autotooled-package>`__" section
89in the Yocto Project Development Tasks Manual.
90
91By default, the ``autotools*`` classes use out-of-tree builds (i.e.
92``autotools.bbclass`` building with ``B != S``).
93
94If the software being built by a recipe does not support using
95out-of-tree builds, you should have the recipe inherit the
96``autotools-brokensep`` class. The ``autotools-brokensep`` class behaves
97the same as the ``autotools`` class but builds with ```B`` <#var-B>`__
98== ```S`` <#var-S>`__. This method is useful when out-of-tree build
99support 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
106It'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
128The ``base`` class is special in that every ``.bb`` file implicitly
129inherits the class. This class contains definitions for standard basic
130tasks such as fetching, unpacking, configuring (empty by default),
131compiling (runs any ``Makefile`` present), installing (empty by default)
132and packaging (empty by default). These classes are often overridden or
133extended by other classes such as the
134```autotools`` <#ref-classes-autotools>`__ class or the
135```package`` <#ref-classes-package>`__ class.
136
137The 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
140arguments passed directly to ``oe_runmake``.
141
142.. _ref-classes-bash-completion:
143
144``bash-completion.bbclass``
145===========================
146
147Sets up packaging and dependencies appropriate for recipes that build
148software that includes bash-completion data.
149
150.. _ref-classes-bin-package:
151
152``bin_package.bbclass``
153=======================
154
155The ``bin_package`` class is a helper class for recipes that extract the
156contents of a binary package (e.g. an RPM) and install those contents
157rather than building the binary from source. The binary package is
158extracted and new packages in the configured output package format are
159created. Extraction and installation of proprietary binaries is a good
160example 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
190The ``binconfig`` class helps to correct paths in shell scripts.
191
192Before ``pkg-config`` had become widespread, libraries shipped shell
193scripts to give information about the libraries and include paths needed
194to build software (usually named ``LIBNAME-config``). This class assists
195any recipe using such scripts.
196
197During staging, the OpenEmbedded build system installs such scripts into
198the ``sysroots/`` directory. Inheriting this class results in all paths
199in these scripts being changed to point into the ``sysroots/`` directory
200so that all builds that use the script use the correct directories for
201the cross compiling layout. See the
202```BINCONFIG_GLOB`` <#var-BINCONFIG_GLOB>`__ variable for more
203information.
204
205.. _ref-classes-binconfig-disabled:
206
207``binconfig-disabled.bbclass``
208==============================
209
210An alternative version of the ```binconfig`` <#ref-classes-binconfig>`__
211class, which disables binary configuration scripts by making them return
212an error in favor of using ``pkg-config`` to query the information. The
213scripts to be disabled should be specified using the
214```BINCONFIG`` <#var-BINCONFIG>`__ variable within the recipe inheriting
215the class.
216
217.. _ref-classes-blacklist:
218
219``blacklist.bbclass``
220=====================
221
222The ``blacklist`` class prevents the OpenEmbedded build system from
223building specific recipes (blacklists them). To use this class, inherit
224the class globally and set ```PNBLACKLIST`` <#var-PNBLACKLIST>`__ for
225each recipe you wish to blacklist. Specify the ```PN`` <#var-PN>`__
226value as a variable flag (varflag) and provide a reason, which is
227reported, if the package is requested to be built as the value. For
228example, if you want to blacklist a recipe called "exoticware", you add
229the following to your ``local.conf`` or distribution configuration:
230INHERIT += "blacklist" PNBLACKLIST[exoticware] = "Not supported by our
231organization."
232
233.. _ref-classes-buildhistory:
234
235``buildhistory.bbclass``
236========================
237
238The ``buildhistory`` class records a history of build output metadata,
239which can be used to detect possible regressions as well as used for
240analysis of the build output. For more information on using Build
241History, see the "`Maintaining Build Output
242Quality <&YOCTO_DOCS_DEV_URL;#maintaining-build-output-quality>`__"
243section in the Yocto Project Development Tasks Manual.
244
245.. _ref-classes-buildstats:
246
247``buildstats.bbclass``
248======================
249
250The ``buildstats`` class records performance statistics about each task
251executed during the build (e.g. elapsed time, CPU usage, and I/O usage).
252
253When you use this class, the output goes into the
254```BUILDSTATS_BASE`` <#var-BUILDSTATS_BASE>`__ directory, which defaults
255to ``${TMPDIR}/buildstats/``. You can analyze the elapsed time using
256``scripts/pybootchartgui/pybootchartgui.py``, which produces a cascading
257chart of the entire build process and can be useful for highlighting
258bottlenecks.
259
260Collecting 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
263enable the class. However, if you want to disable the class, simply
264remove "buildstats" from the ``USER_CLASSES`` list.
265
266.. _ref-classes-buildstats-summary:
267
268``buildstats-summary.bbclass``
269==============================
270
271When inherited globally, prints statistics at the end of the build on
272sstate 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
280The ``ccache`` class enables the C/C++ Compiler Cache for the build.
281This class is used to give a minor performance boost during the build.
282However, using the class can lead to unexpected side-effects. Thus, it
283is recommended that you do not use this class. See
284` <http://ccache.samba.org/>`__ for information on the C/C++ Compiler
285Cache.
286
287.. _ref-classes-chrpath:
288
289``chrpath.bbclass``
290===================
291
292The ``chrpath`` class is a wrapper around the "chrpath" utility, which
293is used during the build process for ``nativesdk``, ``cross``, and
294``cross-canadian`` recipes to change ``RPATH`` records within binaries
295in order to make them relocatable.
296
297.. _ref-classes-clutter:
298
299``clutter.bbclass``
300===================
301
302The ``clutter`` class consolidates the major and minor version naming
303and 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
317The ``cmake`` class allows for recipes that need to build software using
318the `CMake <https://cmake.org/overview/>`__ build system. You can use
319the ```EXTRA_OECMAKE`` <#var-EXTRA_OECMAKE>`__ variable to specify
320additional configuration options to be passed using the ``cmake``
321command line.
322
323On the occasion that you would be installing custom CMake toolchain
324files supplied by the application being built, you should install them
325to the preferred CMake Module directory: ``${D}${datadir}/cmake/``
326Modules during
327```do_install`` <&YOCTO_DOCS_REF_URL;#ref-tasks-install>`__.
328
329.. _ref-classes-cml1:
330
331``cml1.bbclass``
332================
333
334The ``cml1`` class provides basic support for the Linux kernel style
335build configuration system.
336
337.. _ref-classes-compress_doc:
338
339``compress_doc.bbclass``
340========================
341
342Enables compression for man pages and info pages. This class is intended
343to be inherited globally. The default compression mechanism is gz (gzip)
344but 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
352The ``copyleft_compliance`` class preserves source code for the purposes
353of license compliance. This class is an alternative to the ``archiver``
354class and is still used by some users even though it has been deprecated
355in favor of the ```archiver`` <#ref-classes-archiver>`__ class.
356
357.. _ref-classes-copyleft_filter:
358
359``copyleft_filter.bbclass``
360===========================
361
362A class used by the ```archiver`` <#ref-classes-archiver>`__ and
363```copyleft_compliance`` <#ref-classes-copyleft_compliance>`__ classes
364for filtering licenses. The ``copyleft_filter`` class is an internal
365class and is not intended to be used directly.
366
367.. _ref-classes-core-image:
368
369``core-image.bbclass``
370======================
371
372The ``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
381The ``cpan*`` classes support Perl modules.
382
383Recipes for Perl modules are simple. These recipes usually only need to
384point to the source's archive and then inherit the proper class file.
385Building is split into two methods depending on which method the module
386authors 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
394Both build methods inherit the ``cpan-base`` class for basic Perl
395support.
396
397.. _ref-classes-cross:
398
399``cross.bbclass``
400=================
401
402The ``cross`` class provides support for the recipes that build the
403cross-compilation tools.
404
405.. _ref-classes-cross-canadian:
406
407``cross-canadian.bbclass``
408==========================
409
410The ``cross-canadian`` class provides support for the recipes that build
411the Canadian Cross-compilation tools for SDKs. See the
412"`Cross-Development Toolchain
413Generation <&YOCTO_DOCS_OM_URL;#cross-development-toolchain-generation>`__"
414section in the Yocto Project Overview and Concepts Manual for more
415discussion on these cross-compilation tools.
416
417.. _ref-classes-crosssdk:
418
419``crosssdk.bbclass``
420====================
421
422The ``crosssdk`` class provides support for the recipes that build the
423cross-compilation tools used for building SDKs. See the
424"`Cross-Development Toolchain
425Generation <&YOCTO_DOCS_OM_URL;#cross-development-toolchain-generation>`__"
426section in the Yocto Project Overview and Concepts Manual for more
427discussion on these cross-compilation tools.
428
429.. _ref-classes-debian:
430
431``debian.bbclass``
432==================
433
434The ``debian`` class renames output packages so that they follow the
435Debian naming policy (i.e. ``glibc`` becomes ``libc6`` and
436``glibc-devel`` becomes ``libc6-dev``.) Renaming includes the library
437name and version as part of the package name.
438
439If a recipe creates packages for multiple libraries (shared object files
440of ``.so`` type), use the ```LEAD_SONAME`` <#var-LEAD_SONAME>`__
441variable in the recipe to specify the library on which to apply the
442naming scheme.
443
444.. _ref-classes-deploy:
445
446``deploy.bbclass``
447==================
448
449The ``deploy`` class handles deploying files to the
450```DEPLOY_DIR_IMAGE`` <#var-DEPLOY_DIR_IMAGE>`__ directory. The main
451function of this class is to allow the deploy step to be accelerated by
452shared state. Recipes that inherit this class should define their own
453```do_deploy`` <#ref-tasks-deploy>`__ function to copy the files to be
454deployed to ```DEPLOYDIR`` <#var-DEPLOYDIR>`__, and use ``addtask`` to
455add 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
458staging the files from ``DEPLOYDIR`` to ``DEPLOY_DIR_IMAGE``.
459
460.. _ref-classes-devshell:
461
462``devshell.bbclass``
463====================
464
465The ``devshell`` class adds the ``do_devshell`` task. Distribution
466policy dictates whether to include this class. See the "`Using a
467Development Shell <&YOCTO_DOCS_DEV_URL;#platdev-appdev-devshell>`__"
468section in the Yocto Project Development Tasks Manual for more
469information about using ``devshell``.
470
471.. _ref-classes-devupstream:
472
473``devupstream.bbclass``
474=======================
475
476The ``devupstream`` class uses
477```BBCLASSEXTEND`` <#var-BBCLASSEXTEND>`__ to add a variant of the
478recipe that fetches from an alternative URI (e.g. Git) instead of a
479tarball. Following is an example: BBCLASSEXTEND = "devupstream:target"
480SRC_URI_class-devupstream = "git://git.example.com/example"
481SRCREV_class-devupstream = "abcd1234" Adding the above statements to
482your recipe creates a variant that has
483```DEFAULT_PREFERENCE`` <#var-DEFAULT_PREFERENCE>`__ set to "-1".
484Consequently, you need to select the variant of the recipe to use it.
485Any development-specific adjustments can be done by using the
486``class-devupstream`` override. Here is an example:
487DEPENDS_append_class-devupstream = " gperf-native"
488do_configure_prepend_class-devupstream() { touch ${S}/README } The class
489currently only supports creating a development variant of the target
490recipe, not ``native`` or ``nativesdk`` variants.
491
492The ``BBCLASSEXTEND`` syntax (i.e. ``devupstream:target``) provides
493support for ``native`` and ``nativesdk`` variants. Consequently, this
494functionality can be added in a future release.
495
496Support for other version control systems such as Subversion is limited
497due 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
505The ``distro_features_check`` class allows individual recipes to check
506for required and conflicting
507```DISTRO_FEATURES`` <#var-DISTRO_FEATURES>`__.
508
509This class provides support for the
510```REQUIRED_DISTRO_FEATURES`` <#var-REQUIRED_DISTRO_FEATURES>`__ and
511```CONFLICT_DISTRO_FEATURES`` <#var-CONFLICT_DISTRO_FEATURES>`__
512variables. If any conditions specified in the recipe using the above
513variables are not met, the recipe will be skipped.
514
515.. _ref-classes-distutils:
516
517``distutils*.bbclass``
518======================
519
520The ``distutils*`` classes support recipes for Python version 2.x
521extensions, which are simple. These recipes usually only need to point
522to the source's archive and then inherit the proper class. Building is
523split into two methods depending on which method the module authors
524used.
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
535The ``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
543The ``distutils3*`` classes support recipes for Python version 3.x
544extensions, which are simple. These recipes usually only need to point
545to the source's archive and then inherit the proper class. Building is
546split into three methods depending on which method the module authors
547used.
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
559The ``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
562the same as ``distutils-base`` but inherits ``python3native`` instead of
563``pythonnative``).
564
565.. _ref-classes-externalsrc:
566
567``externalsrc.bbclass``
568=======================
569
570The ``externalsrc`` class supports building software from source code
571that is external to the OpenEmbedded build system. Building software
572from an external source tree means that the build system's normal fetch,
573unpack, and patch process is not used.
574
575By default, the OpenEmbedded build system uses the ```S`` <#var-S>`__
576and ```B`` <#var-B>`__ variables to locate unpacked recipe source code
577and 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
581ultimately define ``S`` and ``B``.
582
583By default, this class expects the source code to support recipe builds
584that use the ```B`` <#var-B>`__ variable to point to the directory in
585which the OpenEmbedded build system places the generated objects built
586from the recipes. By default, the ``B`` directory is set to the
587following, 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
592For more information on the ``externalsrc`` class, see the comments in
593``meta/classes/externalsrc.bbclass`` in the `Source
594Directory <#source-directory>`__. For information on how to use the
595``externalsrc`` class, see the "`Building Software from an External
596Source <&YOCTO_DOCS_DEV_URL;#building-software-from-an-external-source>`__"
597section in the Yocto Project Development Tasks Manual.
598
599.. _ref-classes-extrausers:
600
601``extrausers.bbclass``
602======================
603
604The ``extrausers`` class allows additional user and group configuration
605to be applied at the image level. Inheriting this class either globally
606or from an image recipe allows additional user and group operations to
607be 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
620Here is an example that uses this class in an image recipe: inherit
621extrausers EXTRA_USERS_PARAMS = "\\ useradd -p '' tester; \\ groupadd
622developers; \\ userdel nobody; \\ groupdel -g video; \\ groupmod -g 1020
623developers; \\ usermod -s /bin/sh tester; \\ " Here is an example that
624adds two users named "tester-jim" and "tester-sue" and assigns
625passwords: inherit extrausers EXTRA_USERS_PARAMS = "\\ useradd -P
626tester01 tester-jim; \\ useradd -P tester01 tester-sue; \\ " Finally,
627here is an example that sets the root password to "1876*18": inherit
628extrausers EXTRA_USERS_PARAMS = "\\ usermod -P 1876*18 root; \\ "
629
630.. _ref-classes-fontcache:
631
632``fontcache.bbclass``
633=====================
634
635The ``fontcache`` class generates the proper post-install and
636post-remove (postinst and postrm) scriptlets for font packages. These
637scriptlets call ``fc-cache`` (part of ``Fontconfig``) to add the fonts
638to the font information cache. Since the cache files are
639architecture-specific, ``fc-cache`` runs using QEMU if the postinst
640scriptlets need to be run on the build host during image creation.
641
642If the fonts being installed are in packages other than the main
643package, set ```FONT_PACKAGES`` <#var-FONT_PACKAGES>`__ to specify the
644packages containing the fonts.
645
646.. _ref-classes-fs-uuid:
647
648``fs-uuid.bbclass``
649===================
650
651The ``fs-uuid`` class extracts UUID from
652``${``\ ```ROOTFS`` <#var-ROOTFS>`__\ ``}``, which must have been built
653by the time that this function gets called. The ``fs-uuid`` class only
654works on ``ext`` file systems and depends on ``tune2fs``.
655
656.. _ref-classes-gconf:
657
658``gconf.bbclass``
659=================
660
661The ``gconf`` class provides common functionality for recipes that need
662to install GConf schemas. The schemas will be put into a separate
663package (``${``\ ```PN`` <#var-PN>`__\ ``}-gconf``) that is created
664automatically when this class is inherited. This package uses the
665appropriate post-install and post-remove (postinst/postrm) scriptlets to
666register and unregister the schemas in the target image.
667
668.. _ref-classes-gettext:
669
670``gettext.bbclass``
671===================
672
673The ``gettext`` class provides support for building software that uses
674the GNU ``gettext`` internationalization and localization system. All
675recipes building software that use ``gettext`` should inherit this
676class.
677
678.. _ref-classes-gnomebase:
679
680``gnomebase.bbclass``
681=====================
682
683The ``gnomebase`` class is the base class for recipes that build
684software from the GNOME stack. This class sets
685```SRC_URI`` <#var-SRC_URI>`__ to download the source from the GNOME
686mirrors as well as extending ```FILES`` <#var-FILES>`__ with the typical
687GNOME installation paths.
688
689.. _ref-classes-gobject-introspection:
690
691``gobject-introspection.bbclass``
692=================================
693
694Provides support for recipes building software that supports GObject
695introspection. 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
715The ``grub-efi`` class provides ``grub-efi``-specific functions for
716building bootable images.
717
718This 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
747The ``gsettings`` class provides common functionality for recipes that
748need to install GSettings (glib) schemas. The schemas are assumed to be
749part of the main package. Appropriate post-install and post-remove
750(postinst/postrm) scriptlets are added to register and unregister the
751schemas in the target image.
752
753.. _ref-classes-gtk-doc:
754
755``gtk-doc.bbclass``
756===================
757
758The ``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
766The ``gtk-icon-cache`` class generates the proper post-install and
767post-remove (postinst/postrm) scriptlets for packages that use GTK+ and
768install icons. These scriptlets call ``gtk-update-icon-cache`` to add
769the fonts to GTK+'s icon cache. Since the cache files are
770architecture-specific, ``gtk-update-icon-cache`` is run using QEMU if
771the postinst scriptlets need to be run on the build host during image
772creation.
773
774.. _ref-classes-gtk-immodules-cache:
775
776``gtk-immodules-cache.bbclass``
777===============================
778
779The ``gtk-immodules-cache`` class generates the proper post-install and
780post-remove (postinst/postrm) scriptlets for packages that install GTK+
781input method modules for virtual keyboards. These scriptlets call
782``gtk-update-icon-cache`` to add the input method modules to the cache.
783Since the cache files are architecture-specific,
784``gtk-update-icon-cache`` is run using QEMU if the postinst scriptlets
785need to be run on the build host during image creation.
786
787If the input method modules being installed are in packages other than
788the main package, set
789```GTKIMMODULES_PACKAGES`` <#var-GTKIMMODULES_PACKAGES>`__ to specify
790the packages containing the modules.
791
792.. _ref-classes-gzipnative:
793
794``gzipnative.bbclass``
795======================
796
797The ``gzipnative`` class enables the use of different native versions of
798``gzip`` and ``pigz`` rather than the versions of these tools from the
799build host.
800
801.. _ref-classes-icecc:
802
803``icecc.bbclass``
804=================
805
806The ``icecc`` class supports
807`Icecream <https://github.com/icecc/icecream>`__, which facilitates
808taking compile jobs and distributing them among remote machines.
809
810The class stages directories with symlinks from ``gcc`` and ``g++`` to
811``icecc``, for both native and cross compilers. Depending on each
812configure or compile, the OpenEmbedded build system adds the directories
813at 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``
815compilers, respectively.
816
817For the cross compiler, the class creates a ``tar.gz`` file that
818contains the Yocto Project toolchain and sets ``ICECC_VERSION``, which
819is the version of the cross-compiler used in the cross-development
820toolchain, accordingly.
821
822The 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
825supports SDK generation.
826
827If ```ICECC_PATH`` <#var-ICECC_PATH>`__ is not set in your
828``local.conf`` file, then the class tries to locate the ``icecc`` binary
829using ``which``. If ```ICECC_ENV_EXEC`` <#var-ICECC_ENV_EXEC>`__ is set
830in 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
832a user-provided script, the build system uses the default script
833provided 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
841If you do not want the Icecream distributed compile support to apply to
842specific recipes or classes, you can effectively "blacklist" them by
843listing 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,
846respectively, in your ``local.conf`` file. Doing so causes the
847OpenEmbedded build system to handle these compilations locally.
848
849Additionally, you can list recipes using the
850```ICECC_USER_PACKAGE_WL`` <#var-ICECC_USER_PACKAGE_WL>`__ variable in
851your ``local.conf`` file to force ``icecc`` to be enabled for recipes
852using an empty ```PARALLEL_MAKE`` <#var-PARALLEL_MAKE>`__ variable.
853
854Inheriting the ``icecc`` class changes all sstate signatures.
855Consequently, if a development team has a dedicated build system that
856populates ```STATE_MIRRORS`` <#var-SSTATE_MIRRORS>`__ and they want to
857reuse sstate from ``STATE_MIRRORS``, then all developers and the build
858system need to either inherit the ``icecc`` class or nobody should.
859
860At the distribution level, you can inherit the ``icecc`` class to be
861sure that all builders start with the same sstate signatures. After
862inheriting the class, you can then disable the feature by setting the
863```ICECC_DISABLED`` <#var-ICECC_DISABLED>`__ variable to "1" as follows:
864INHERIT_DISTRO_append = " icecc" ICECC_DISABLED ??= "1" This practice
865makes sure everyone is using the same signatures but also requires
866individuals that do want to use Icecream to enable the feature
867individually as follows in your ``local.conf`` file: ICECC_DISABLED = ""
868
869.. _ref-classes-image:
870
871``image.bbclass``
872=================
873
874The ``image`` class helps support creating images in different formats.
875First, the root filesystem is created from packages using one of the
876``rootfs*.bbclass`` files (depending on the package format used) and
877then 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
885For information on customizing images, see the "`Customizing
886Images <&YOCTO_DOCS_DEV_URL;#usingpoky-extend-customimage>`__" section
887in the Yocto Project Development Tasks Manual. For information on how
888images are created, see the
889"`Images <&YOCTO_DOCS_OM_URL;#images-dev-environment>`__" section in the
890Yocto Project Overview and Concpets Manual.
891
892.. _ref-classes-image-buildinfo:
893
894``image-buildinfo.bbclass``
895===========================
896
897The ``image-buildinfo`` class writes information to the target
898filesystem on ``/etc/build``.
899
900.. _ref-classes-image_types:
901
902``image_types.bbclass``
903=======================
904
905The ``image_types`` class defines all of the standard image output types
906that you can enable through the
907```IMAGE_FSTYPES`` <#var-IMAGE_FSTYPES>`__ variable. You can use this
908class as a reference on how to add support for custom image output
909types.
910
911By default, the ```image`` <#ref-classes-image>`__ class automatically
912enables 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
916d.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
924The ``image_types`` class also handles conversion and compression of
925images.
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
939This class controls building "live" (i.e. HDDIMG and ISO) images. Live
940images contain syslinux for legacy booting, as well as the bootloader
941specified by ```EFI_PROVIDER`` <#var-EFI_PROVIDER>`__ if
942```MACHINE_FEATURES`` <#var-MACHINE_FEATURES>`__ contains "efi".
943
944Normally, 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
952The ``image-mklibs`` class enables the use of the ``mklibs`` utility
953during the ```do_rootfs`` <#ref-tasks-rootfs>`__ task, which optimizes
954the size of libraries contained in the image.
955
956By default, the class is enabled in the ``local.conf.template`` using
957the ```USER_CLASSES`` <#var-USER_CLASSES>`__ variable as follows:
958USER_CLASSES ?= "buildstats image-mklibs image-prelink"
959
960.. _ref-classes-image-prelink:
961
962``image-prelink.bbclass``
963=========================
964
965The ``image-prelink`` class enables the use of the ``prelink`` utility
966during the ```do_rootfs`` <#ref-tasks-rootfs>`__ task, which optimizes
967the dynamic linking of shared libraries to reduce executable startup
968time.
969
970By default, the class is enabled in the ``local.conf.template`` using
971the ```USER_CLASSES`` <#var-USER_CLASSES>`__ variable as follows:
972USER_CLASSES ?= "buildstats image-mklibs image-prelink"
973
974.. _ref-classes-insane:
975
976``insane.bbclass``
977==================
978
979The ``insane`` class adds a step to the package generation process so
980that output quality assurance checks are generated by the OpenEmbedded
981build system. A range of checks are performed that check the build's
982output for common problems that show up during runtime. Distribution
983policy usually dictates whether to include this class.
984
985You can configure the sanity checks so that specific test failures
986either raise a warning or an error message. Typically, failures for new
987tests generate a warning. Subsequent failures for the same test would
988then generate an error message once the metadata is in a known and good
989condition. See the "`QA Error and Warning Messages <#ref-qa-checks>`__"
990Chapter for a list of all the warning and error messages you might
991encounter using a default configuration.
992
993Use the ```WARN_QA`` <#var-WARN_QA>`__ and
994```ERROR_QA`` <#var-ERROR_QA>`__ variables to control the behavior of
995these checks at the global level (i.e. in your custom distro
996configuration). However, to skip one or more checks in recipes, you
997should use ```INSANE_SKIP`` <#var-INSANE_SKIP>`__. For example, to skip
998the check for symbolic link ``.so`` files in the main package of a
999recipe, add the following to the recipe. You need to realize that the
1000package name override, in this example ``${PN}``, must be used:
1001INSANE_SKIP_${PN} += "dev-so" Please keep in mind that the QA checks
1002exist in order to detect real or potential problems in the packaged
1003output. So exercise caution when disabling these checks.
1004
1005The 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
1271The ``insserv`` class uses the ``insserv`` utility to update the order
1272of symbolic links in ``/etc/rc?.d/`` within an image based on
1273dependencies specified by LSB headers in the ``init.d`` scripts
1274themselves.
1275
1276.. _ref-classes-kernel:
1277
1278``kernel.bbclass``
1279==================
1280
1281The ``kernel`` class handles building Linux kernels. The class contains
1282code to build all kernel trees. All needed headers are staged into the
1283``STAGING_KERNEL_DIR`` directory to allow out-of-tree module builds
1284using the ```module`` <#ref-classes-module>`__ class.
1285
1286This means that each built kernel module is packaged separately and
1287inter-module dependencies are created by parsing the ``modinfo`` output.
1288If all modules are required, then installing the ``kernel-modules``
1289package installs all packages with modules and various other kernel
1290packages such as ``kernel-vmlinux``.
1291
1292The ``kernel`` class contains logic that allows you to embed an initial
1293RAM filesystem (initramfs) image when you build the kernel image. For
1294information on how to build an initramfs, see the "`Building an Initial
1295RAM Filesystem (initramfs)
1296Image <&YOCTO_DOCS_DEV_URL;#building-an-initramfs-image>`__" section in
1297the Yocto Project Development Tasks Manual.
1298
1299Various other classes are used by the ``kernel`` and ``module`` classes
1300internally 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
1309The ``kernel-arch`` class sets the ``ARCH`` environment variable for
1310Linux kernel compilation (including modules).
1311
1312.. _ref-classes-kernel-devicetree:
1313
1314``kernel-devicetree.bbclass``
1315=============================
1316
1317The ``kernel-devicetree`` class, which is inherited by the
1318```kernel`` <#ref-classes-kernel>`__ class, supports device tree
1319generation.
1320
1321.. _ref-classes-kernel-fitimage:
1322
1323``kernel-fitimage.bbclass``
1324===========================
1325
1326The ``kernel-fitimage`` class provides support to pack a kernel Image,
1327device trees and a RAM disk into a single FIT image. In theory, a FIT
1328image can support any number of kernels, RAM disks and device-trees.
1329However, ``kernel-fitimage`` currently only supports
1330limited usescases: just one kernel image, an optional RAM disk, and
1331any number of device tree.
1332
1333To create a FIT image, it is required that :term:`KERNEL_CLASSES`
1334is set to "kernel-fitimage" and :term:`KERNEL_IMAGETYPE`
1335is set to "fitImage".
1336
1337The options for the device tree compiler passed to mkimage -D feature
1338when creating the FIT image are specified using the
1339:term:`UBOOT_MKIMAGE_DTCOPTS` variable.
1340
1341Only a single kernel can be added to the FIT image created by
1342``kernel-fitimage`` and the kernel image in FIT is mandatory. The
1343address where the kernel image is to be loaded by U-boot is
1344specified by :term:`UBOOT_LOADADDRESS` and the entrypoint by
1345:term:`UBOOT_ENTRYPOINT`.
1346
1347Multiple device trees can be added to the FIT image created by
1348``kernel-fitimage`` and the device tree is optional.
1349The address where the device tree is to be loaded by U-boot is
1350specified by :term:`UBOOT_DTBO_LOADADDRESS` for device tree overlays
1351and by `:term:`UBOOT_DTB_LOADADDRESS` for device tree binaries.
1352
1353Only a single RAM disk can be added to the FIT image created by
1354``kernel-fitimage`` and the RAM disk in FIT is optional.
1355The address where the RAM disk image is to be loaded by U-boot
1356is 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
1360The FIT image generated by ``kernel-fitimage`` class is signed when the
1361variables :term:`UBOOT_SIGN_ENABLE`, :term:`UBOOT_MKIMAGE_DTCOPTS`,
1362:term:`UBOOT_SIGN_KEYDIR` and :term:`UBOOT_SIGN_KEYNAME` are set
1363appropriately. 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
1373The ``kernel-grub`` class updates the boot area and the boot menu with
1374the kernel as the priority boot mechanism while installing a RPM to
1375update the kernel on a deployed target.
1376
1377.. _ref-classes-kernel-module-split:
1378
1379``kernel-module-split.bbclass``
1380===============================
1381
1382The ``kernel-module-split`` class provides common functionality for
1383splitting Linux kernel modules into separate packages.
1384
1385.. _ref-classes-kernel-uboot:
1386
1387``kernel-uboot.bbclass``
1388========================
1389
1390The ``kernel-uboot`` class provides support for building from
1391vmlinux-style kernel sources.
1392
1393.. _ref-classes-kernel-uimage:
1394
1395``kernel-uimage.bbclass``
1396=========================
1397
1398The ``kernel-uimage`` class provides support to pack uImage.
1399
1400.. _ref-classes-kernel-yocto:
1401
1402``kernel-yocto.bbclass``
1403========================
1404
1405The ``kernel-yocto`` class provides common functionality for building
1406from linux-yocto style kernel source repositories.
1407
1408.. _ref-classes-kernelsrc:
1409
1410``kernelsrc.bbclass``
1411=====================
1412
1413The ``kernelsrc`` class sets the Linux kernel source and version.
1414
1415.. _ref-classes-lib_package:
1416
1417``lib_package.bbclass``
1418=======================
1419
1420The ``lib_package`` class supports recipes that build libraries and
1421produce executable binaries, where those binaries should not be
1422installed by default along with the library. Instead, the binaries are
1423added to a separate ``${``\ ```PN`` <#var-PN>`__\ ``}-bin`` package to
1424make their installation optional.
1425
1426.. _ref-classes-libc*:
1427
1428``libc*.bbclass``
1429=================
1430
1431The ``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
1444The ``license`` class provides license manifest creation and license
1445exclusion. This class is enabled by default using the default value for
1446the ```INHERIT_DISTRO`` <#var-INHERIT_DISTRO>`__ variable.
1447
1448.. _ref-classes-linux-kernel-base:
1449
1450``linux-kernel-base.bbclass``
1451=============================
1452
1453The ``linux-kernel-base`` class provides common functionality for
1454recipes that build out of the Linux kernel source tree. These builds
1455goes beyond the kernel itself. For example, the Perf recipe also
1456inherits this class.
1457
1458.. _ref-classes-linuxloader:
1459
1460``linuxloader.bbclass``
1461=======================
1462
1463Provides the function ``linuxloader()``, which gives the value of the
1464dynamic loader/linker provided on the platform. This value is used by a
1465number of other classes.
1466
1467.. _ref-classes-logging:
1468
1469``logging.bbclass``
1470===================
1471
1472The ``logging`` class provides the standard shell functions used to log
1473messages for various BitBake severity levels (i.e. ``bbplain``,
1474``bbnote``, ``bbwarn``, ``bberror``, ``bbfatal``, and ``bbdebug``).
1475
1476This class is enabled by default since it is inherited by the ``base``
1477class.
1478
1479.. _ref-classes-meta:
1480
1481``meta.bbclass``
1482================
1483
1484The ``meta`` class is inherited by recipes that do not build any output
1485packages themselves, but act as a "meta" target for building other
1486recipes.
1487
1488.. _ref-classes-metadata_scm:
1489
1490``metadata_scm.bbclass``
1491========================
1492
1493The ``metadata_scm`` class provides functionality for querying the
1494branch and revision of a Source Code Manager (SCM) repository.
1495
1496The ```base`` <#ref-classes-base>`__ class uses this class to print the
1497revisions of each layer before starting every build. The
1498``metadata_scm`` class is enabled by default because it is inherited by
1499the ``base`` class.
1500
1501.. _ref-classes-migrate_localcount:
1502
1503``migrate_localcount.bbclass``
1504==============================
1505
1506The ``migrate_localcount`` class verifies a recipe's localcount data and
1507increments it appropriately.
1508
1509.. _ref-classes-mime:
1510
1511``mime.bbclass``
1512================
1513
1514The ``mime`` class generates the proper post-install and post-remove
1515(postinst/postrm) scriptlets for packages that install MIME type files.
1516These scriptlets call ``update-mime-database`` to add the MIME types to
1517the shared database.
1518
1519.. _ref-classes-mirrors:
1520
1521``mirrors.bbclass``
1522===================
1523
1524The ``mirrors`` class sets up some standard
1525```MIRRORS`` <#var-MIRRORS>`__ entries for source code mirrors. These
1526mirrors provide a fall-back path in case the upstream source specified
1527in ```SRC_URI`` <#var-SRC_URI>`__ within recipes is unavailable.
1528
1529This 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
1537The ``module`` class provides support for building out-of-tree Linux
1538kernel modules. The class inherits the
1539```module-base`` <#ref-classes-module-base>`__ and
1540```kernel-module-split`` <#ref-classes-kernel-module-split>`__ classes,
1541and implements the ```do_compile`` <#ref-tasks-compile>`__ and
1542```do_install`` <#ref-tasks-install>`__ tasks. The class provides
1543everything needed to build and package a kernel module.
1544
1545For general information on out-of-tree Linux kernel modules, see the
1546"`Incorporating Out-of-Tree
1547Modules <&YOCTO_DOCS_KERNEL_DEV_URL;#incorporating-out-of-tree-modules>`__"
1548section in the Yocto Project Linux Kernel Development Manual.
1549
1550.. _ref-classes-module-base:
1551
1552``module-base.bbclass``
1553=======================
1554
1555The ``module-base`` class provides the base functionality for building
1556Linux kernel modules. Typically, a recipe that builds software that
1557includes one or more kernel modules and has its own means of building
1558the 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
1566The ``multilib*`` classes provide support for building libraries with
1567different target optimizations or target architectures and installing
1568them side-by-side in the same image.
1569
1570For more information on using the Multilib feature, see the "`Combining
1571Multiple Versions of Library Files into One
1572Image <&YOCTO_DOCS_DEV_URL;#combining-multiple-versions-library-files-into-one-image>`__"
1573section in the Yocto Project Development Tasks Manual.
1574
1575.. _ref-classes-native:
1576
1577``native.bbclass``
1578==================
1579
1580The ``native`` class provides common functionality for recipes that
1581build 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
1584You can create a recipe that builds tools that run natively on the host
1585a 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
1610Although applied differently, the ``native`` class is used with both
1611methods. The advantage of the second method is that you do not need to
1612have two separate recipes (assuming you need both) for native and
1613target. All common parts of the recipe are automatically shared.
1614
1615.. _ref-classes-nativesdk:
1616
1617``nativesdk.bbclass``
1618=====================
1619
1620The ``nativesdk`` class provides common functionality for recipes that
1621wish to build tools to run as part of an SDK (i.e. tools that run on
1622```SDKMACHINE`` <#var-SDKMACHINE>`__).
1623
1624You can create a recipe that builds tools that run on the SDK machine a
1625couple 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
1649Although applied differently, the ``nativesdk`` class is used with both
1650methods. The advantage of the second method is that you do not need to
1651have two separate recipes (assuming you need both) for the SDK machine
1652and the target. All common parts of the recipe are automatically shared.
1653
1654.. _ref-classes-nopackages:
1655
1656``nopackages.bbclass``
1657======================
1658
1659Disables packaging tasks for those recipes and classes where packaging
1660is not needed.
1661
1662.. _ref-classes-npm:
1663
1664``npm.bbclass``
1665===============
1666
1667Provides support for building Node.js software fetched using the `node
1668package 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
1676For information on how to create NPM packages, see the "`Creating Node
1677Package Manager (NPM)
1678Packages <&YOCTO_DOCS_DEV_URL;#creating-node-package-manager-npm-packages>`__"
1679section in the Yocto Project Development Tasks Manual.
1680
1681.. _ref-classes-oelint:
1682
1683``oelint.bbclass``
1684==================
1685
1686The ``oelint`` class is an obsolete lint checking tool that exists in
1687``meta/classes`` in the `Source Directory <#source-directory>`__.
1688
1689A number of classes exist that could be generally useful in OE-Core but
1690are never actually used within OE-Core itself. The ``oelint`` class is
1691one such example. However, being aware of this class can reduce the
1692proliferation of different versions of similar classes across multiple
1693layers.
1694
1695.. _ref-classes-own-mirrors:
1696
1697``own-mirrors.bbclass``
1698=======================
1699
1700The ``own-mirrors`` class makes it easier to set up your own
1701```PREMIRRORS`` <#var-PREMIRRORS>`__ from which to first fetch source
1702before attempting to fetch it from the upstream specified in
1703```SRC_URI`` <#var-SRC_URI>`__ within each recipe.
1704
1705To use this class, inherit it globally and specify
1706```SOURCE_MIRROR_URL`` <#var-SOURCE_MIRROR_URL>`__. Here is an example:
1707INHERIT += "own-mirrors" SOURCE_MIRROR_URL =
1708"http://example.com/my-source-mirror" You can specify only a single URL
1709in ``SOURCE_MIRROR_URL``.
1710
1711.. _ref-classes-package:
1712
1713``package.bbclass``
1714===================
1715
1716The ``package`` class supports generating packages from a build's
1717output. The core generic functionality is in ``package.bbclass``. The
1718code specific to particular package types resides in these
1719package-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
1732You can control the list of resulting package formats by using the
1733``PACKAGE_CLASSES`` variable defined in your ``conf/local.conf``
1734configuration file, which is located in the `Build
1735Directory <#build-directory>`__. When defining the variable, you can
1736specify one or more package types. Since images are generated from
1737packages, a packaging class is needed to enable image generation. The
1738first class listed in this variable is used for image generation.
1739
1740If you take the optional step to set up a repository (package feed) on
1741the development host that can be used by DNF, you can install packages
1742from the feed while you are running the image on the target (i.e.
1743runtime installation of packages). For more information, see the "`Using
1744Runtime Package
1745Management <&YOCTO_DOCS_DEV_URL;#using-runtime-package-management>`__"
1746section in the Yocto Project Development Tasks Manual.
1747
1748The package-specific class you choose can affect build-time performance
1749and has space ramifications. In general, building a package with IPK
1750takes about thirty percent less time as compared to using RPM to build
1751the same or similar package. This comparison takes into account a
1752complete build of the package with all dependencies previously built.
1753The reason for this discrepancy is because the RPM package manager
1754creates and processes more `Metadata <#metadata>`__ than the IPK package
1755manager. Consequently, you might consider setting ``PACKAGE_CLASSES`` to
1756"package_ipk" if you are building smaller systems.
1757
1758Before making your package manager decision, however, you should
1759consider 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
1772You can find additional information on the effects of the package class
1773at 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
1784The ``package_deb`` class provides support for creating packages that
1785use the Debian (i.e. ``.deb``) file format. The class ensures the
1786packages are written out in a ``.deb`` file format to the
1787``${``\ ```DEPLOY_DIR_DEB`` <#var-DEPLOY_DIR_DEB>`__\ ``}`` directory.
1788
1789This class inherits the ```package`` <#ref-classes-package>`__ class and
1790is enabled through the ```PACKAGE_CLASSES`` <#var-PACKAGE_CLASSES>`__
1791variable in the ``local.conf`` file.
1792
1793.. _ref-classes-package_ipk:
1794
1795``package_ipk.bbclass``
1796=======================
1797
1798The ``package_ipk`` class provides support for creating packages that
1799use the IPK (i.e. ``.ipk``) file format. The class ensures the packages
1800are written out in a ``.ipk`` file format to the
1801``${``\ ```DEPLOY_DIR_IPK`` <#var-DEPLOY_DIR_IPK>`__\ ``}`` directory.
1802
1803This class inherits the ```package`` <#ref-classes-package>`__ class and
1804is enabled through the ```PACKAGE_CLASSES`` <#var-PACKAGE_CLASSES>`__
1805variable in the ``local.conf`` file.
1806
1807.. _ref-classes-package_rpm:
1808
1809``package_rpm.bbclass``
1810=======================
1811
1812The ``package_rpm`` class provides support for creating packages that
1813use the RPM (i.e. ``.rpm``) file format. The class ensures the packages
1814are written out in a ``.rpm`` file format to the
1815``${``\ ```DEPLOY_DIR_RPM`` <#var-DEPLOY_DIR_RPM>`__\ ``}`` directory.
1816
1817This class inherits the ```package`` <#ref-classes-package>`__ class and
1818is enabled through the ```PACKAGE_CLASSES`` <#var-PACKAGE_CLASSES>`__
1819variable in the ``local.conf`` file.
1820
1821.. _ref-classes-package_tar:
1822
1823``package_tar.bbclass``
1824=======================
1825
1826The ``package_tar`` class provides support for creating tarballs. The
1827class ensures the packages are written out in a tarball format to the
1828``${``\ ```DEPLOY_DIR_TAR`` <#var-DEPLOY_DIR_TAR>`__\ ``}`` directory.
1829
1830This class inherits the ```package`` <#ref-classes-package>`__ class and
1831is enabled through the ```PACKAGE_CLASSES`` <#var-PACKAGE_CLASSES>`__
1832variable 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
1853The ``packagedata`` class provides common functionality for reading
1854``pkgdata`` files found in ```PKGDATA_DIR`` <#var-PKGDATA_DIR>`__. These
1855files contain information about each output package produced by the
1856OpenEmbedded build system.
1857
1858This 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
1866The ``packagegroup`` class sets default values appropriate for package
1867group recipes (e.g. ``PACKAGES``, ``PACKAGE_ARCH``, ``ALLOW_EMPTY``, and
1868so forth). It is highly recommended that all package group recipes
1869inherit this class.
1870
1871For information on how to use this class, see the "`Customizing Images
1872Using Custom Package
1873Groups <&YOCTO_DOCS_DEV_URL;#usingpoky-extend-customimage-customtasks>`__"
1874section in the Yocto Project Development Tasks Manual.
1875
1876Previously, this class was called the ``task`` class.
1877
1878.. _ref-classes-patch:
1879
1880``patch.bbclass``
1881=================
1882
1883The ``patch`` class provides all functionality for applying patches
1884during the ```do_patch`` <#ref-tasks-patch>`__ task.
1885
1886This 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
1894When inherited by a recipe, the ``perlnative`` class supports using the
1895native version of Perl built by the build system rather than using the
1896version provided by the build host.
1897
1898.. _ref-classes-pixbufcache:
1899
1900``pixbufcache.bbclass``
1901=======================
1902
1903The ``pixbufcache`` class generates the proper post-install and
1904post-remove (postinst/postrm) scriptlets for packages that install
1905pixbuf loaders, which are used with ``gdk-pixbuf``. These scriptlets
1906call ``update_pixbuf_cache`` to add the pixbuf loaders to the cache.
1907Since the cache files are architecture-specific, ``update_pixbuf_cache``
1908is run using QEMU if the postinst scriptlets need to be run on the build
1909host during image creation.
1910
1911If the pixbuf loaders being installed are in packages other than the
1912recipe's main package, set
1913```PIXBUF_PACKAGES`` <#var-PIXBUF_PACKAGES>`__ to specify the packages
1914containing the loaders.
1915
1916.. _ref-classes-pkgconfig:
1917
1918``pkgconfig.bbclass``
1919=====================
1920
1921The ``pkgconfig`` class provides a standard way to get header and
1922library information by using ``pkg-config``. This class aims to smooth
1923integration of ``pkg-config`` into libraries that use it.
1924
1925During 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
1928files.
1929
1930.. _ref-classes-populate-sdk:
1931
1932``populate_sdk.bbclass``
1933========================
1934
1935The ``populate_sdk`` class provides support for SDK-only recipes. For
1936information on advantages gained when building a cross-development
1937toolchain using the ```do_populate_sdk`` <#ref-tasks-populate_sdk>`__
1938task, see the "`Building an SDK
1939Installer <&YOCTO_DOCS_SDK_URL;#sdk-building-an-sdk-installer>`__"
1940section in the Yocto Project Application Development and the Extensible
1941Software Development Kit (eSDK) manual.
1942
1943.. _ref-classes-populate-sdk-*:
1944
1945``populate_sdk_*.bbclass``
1946==========================
1947
1948The ``populate_sdk_*`` classes support SDK creation and consist of the
1949following 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
1966The ``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
1970The base class ensures all source and destination directories are
1971established 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
1974contains the cross-compiler and associated tooling, and the target,
1975which contains a target root filesystem that is configured for the SDK
1976usage. These two images reside in ```SDK_OUTPUT`` <#var-SDK_OUTPUT>`__,
1977which consists of the following:
1978${SDK_OUTPUT}/${SDK_ARCH}-nativesdk-pkgs
1979${SDK_OUTPUT}/${SDKTARGETSYSROOT}/target-pkgs
1980
1981Finally, the base populate SDK class creates the toolchain environment
1982setup script, the tarball of the SDK, and the installer.
1983
1984The respective ``populate_sdk_deb``, ``populate_sdk_rpm``, and
1985``populate_sdk_ipk`` classes each support the specific type of SDK.
1986These classes are inherited by and used with the ``populate_sdk_base``
1987class.
1988
1989For more information on the cross-development toolchain generation, see
1990the "`Cross-Development Toolchain
1991Generation <&YOCTO_DOCS_OM_URL;#cross-development-toolchain-generation>`__"
1992section in the Yocto Project Overview and Concepts Manual. For
1993information on advantages gained when building a cross-development
1994toolchain using the ```do_populate_sdk`` <#ref-tasks-populate_sdk>`__
1995task, see the "`Building an SDK
1996Installer <&YOCTO_DOCS_SDK_URL;#sdk-building-an-sdk-installer>`__"
1997section in the Yocto Project Application Development and the Extensible
1998Software Development Kit (eSDK) manual.
1999
2000.. _ref-classes-prexport:
2001
2002``prexport.bbclass``
2003====================
2004
2005The ``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
2020The ``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
2035The ``prserv`` class provides functionality for using a `PR
2036service <&YOCTO_DOCS_DEV_URL;#working-with-a-pr-service>`__ in order to
2037automatically manage the incrementing of the ```PR`` <#var-PR>`__
2038variable for each recipe.
2039
2040This class is enabled by default because it is inherited by the
2041```package`` <#ref-classes-package>`__ class. However, the OpenEmbedded
2042build 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
2050The ``ptest`` class provides functionality for packaging and installing
2051runtime tests for recipes that build software that provides these tests.
2052
2053This class is intended to be inherited by individual recipes. However,
2054the class' functionality is largely disabled unless "ptest" appears in
2055```DISTRO_FEATURES`` <#var-DISTRO_FEATURES>`__. See the "`Testing
2056Packages With
2057ptest <&YOCTO_DOCS_DEV_URL;#testing-packages-with-ptest>`__" section in
2058the Yocto Project Development Tasks Manual for more information on
2059ptest.
2060
2061.. _ref-classes-ptest-gnome:
2062
2063``ptest-gnome.bbclass``
2064=======================
2065
2066Enables package tests (ptests) specifically for GNOME packages, which
2067have tests intended to be executed with ``gnome-desktop-testing``.
2068
2069For information on setting up and running ptests, see the "`Testing
2070Packages With
2071ptest <&YOCTO_DOCS_DEV_URL;#testing-packages-with-ptest>`__" section in
2072the Yocto Project Development Tasks Manual.
2073
2074.. _ref-classes-python-dir:
2075
2076``python-dir.bbclass``
2077======================
2078
2079The ``python-dir`` class provides the base version, location, and site
2080package location for Python.
2081
2082.. _ref-classes-python3native:
2083
2084``python3native.bbclass``
2085=========================
2086
2087The ``python3native`` class supports using the native version of Python
20883 built by the build system rather than support of the version provided
2089by the build host.
2090
2091.. _ref-classes-pythonnative:
2092
2093``pythonnative.bbclass``
2094========================
2095
2096When inherited by a recipe, the ``pythonnative`` class supports using
2097the native version of Python built by the build system rather than using
2098the version provided by the build host.
2099
2100.. _ref-classes-qemu:
2101
2102``qemu.bbclass``
2103================
2104
2105The ``qemu`` class provides functionality for recipes that either need
2106QEMU or test for the existence of QEMU. Typically, this class is used to
2107run programs for a target system on the build host using QEMU's
2108application emulation mode.
2109
2110.. _ref-classes-recipe_sanity:
2111
2112``recipe_sanity.bbclass``
2113=========================
2114
2115The ``recipe_sanity`` class checks for the presence of any host system
2116recipe prerequisites that might affect the build (e.g. variables that
2117are set or software that is present).
2118
2119.. _ref-classes-relocatable:
2120
2121``relocatable.bbclass``
2122=======================
2123
2124The ``relocatable`` class enables relocation of binaries when they are
2125installed into the sysroot.
2126
2127This class makes use of the ```chrpath`` <#ref-classes-chrpath>`__ class
2128and 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
2136The ``remove-libtool`` class adds a post function to the
2137```do_install`` <#ref-tasks-install>`__ task to remove all ``.la`` files
2138installed by ``libtool``. Removing these files results in them being
2139absent from both the sysroot and target packages.
2140
2141If a recipe needs the ``.la`` files to be installed, then the recipe can
2142override the removal by setting ``REMOVE_LIBTOOL_LA`` to "0" as follows:
2143REMOVE_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
2156The ``report-error`` class supports enabling the `error reporting
2157tool <&YOCTO_DOCS_DEV_URL;#using-the-error-reporting-tool>`__, which
2158allows you to submit build error information to a central database.
2159
2160The class collects debug information for recipe, recipe version, task,
2161machine, distro, build system, target system, host distro, branch,
2162commit, and log. From the information, report files using a JSON format
2163are 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
2171The ``rm_work`` class supports deletion of temporary workspace, which
2172can ease your hard drive demands during builds.
2173
2174The OpenEmbedded build system can use a substantial amount of disk space
2175during the build process. A portion of this space is the work files
2176under the ``${TMPDIR}/work`` directory for each recipe. Once the build
2177system generates the packages for a recipe, the work files for that
2178recipe are no longer needed. However, by default, the build system
2179preserves these files for inspection and possible debugging purposes. If
2180you would rather have these files deleted to save disk space as the
2181build progresses, you can enable ``rm_work`` by adding the following to
2182your ``local.conf`` file, which is found in the `Build
2183Directory <#build-directory>`__. INHERIT += "rm_work" If you are
2184modifying and building source code out of the work directory for a
2185recipe, enabling ``rm_work`` will potentially result in your changes to
2186the source being lost. To exclude some recipes from having their work
2187directories deleted by ``rm_work``, you can add the names of the recipe
2188or recipes you are working on to the ``RM_WORK_EXCLUDE`` variable, which
2189can also be set in your ``local.conf`` file. Here is an example:
2190RM_WORK_EXCLUDE += "busybox glibc"
2191
2192.. _ref-classes-rootfs*:
2193
2194``rootfs*.bbclass``
2195===================
2196
2197The ``rootfs*`` classes support creating the root filesystem for an
2198image 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
2215The 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
2219For information on how root filesystem images are created, see the
2220"`Image
2221Generation <&YOCTO_DOCS_OM_URL;#image-generation-dev-environment>`__"
2222section in the Yocto Project Overview and Concepts Manual.
2223
2224.. _ref-classes-sanity:
2225
2226``sanity.bbclass``
2227==================
2228
2229The ``sanity`` class checks to see if prerequisite software is present
2230on the host system so that users can be notified of potential problems
2231that might affect their build. The class also performs basic user
2232configuration checks from the ``local.conf`` configuration file to
2233prevent common mistakes that cause build failures. Distribution policy
2234usually determines whether to include this class.
2235
2236.. _ref-classes-scons:
2237
2238``scons.bbclass``
2239=================
2240
2241The ``scons`` class supports recipes that need to build software that
2242uses the SCons build system. You can use the
2243```EXTRA_OESCONS`` <#var-EXTRA_OESCONS>`__ variable to specify
2244additional configuration options you want to pass SCons command line.
2245
2246.. _ref-classes-sdl:
2247
2248``sdl.bbclass``
2249===============
2250
2251The ``sdl`` class supports recipes that need to build software that uses
2252the Simple DirectMedia Layer (SDL) library.
2253
2254.. _ref-classes-setuptools:
2255
2256``setuptools.bbclass``
2257======================
2258
2259The ``setuptools`` class supports Python version 2.x extensions that use
2260build systems based on ``setuptools``. If your recipe uses these build
2261systems, the recipe needs to inherit the ``setuptools`` class.
2262
2263.. _ref-classes-setuptools3:
2264
2265``setuptools3.bbclass``
2266=======================
2267
2268The ``setuptools3`` class supports Python version 3.x extensions that
2269use build systems based on ``setuptools3``. If your recipe uses these
2270build systems, the recipe needs to inherit the ``setuptools3`` class.
2271
2272.. _ref-classes-sign_rpm:
2273
2274``sign_rpm.bbclass``
2275====================
2276
2277The ``sign_rpm`` class supports generating signed RPM packages.
2278
2279.. _ref-classes-sip:
2280
2281``sip.bbclass``
2282===============
2283
2284The ``sip`` class supports recipes that build or package SIP-based
2285Python bindings.
2286
2287.. _ref-classes-siteconfig:
2288
2289``siteconfig.bbclass``
2290======================
2291
2292The ``siteconfig`` class provides functionality for handling site
2293configuration. 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
2302The ``siteinfo`` class provides information about the targets that might
2303be needed by other classes or recipes.
2304
2305As an example, consider Autotools, which can require tests that must
2306execute on the target hardware. Since this is not possible in general
2307when cross compiling, site information is used to provide cached test
2308results so these tests can be skipped over but still make the correct
2309values available. The ``meta/site directory`` contains test results
2310sorted into different categories such as architecture, endianness, and
2311the ``libc`` used. Site information provides a list of files containing
2312data relevant to the current build in the ``CONFIG_SITE`` variable that
2313Autotools automatically picks up.
2314
2315The 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
2323The ``spdx`` class integrates real-time license scanning, generation of
2324SPDX standard output, and verification of license information during the
2325build.
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
2336The ``sstate`` class provides support for Shared State (sstate). By
2337default, the class is enabled through the
2338```INHERIT_DISTRO`` <#var-INHERIT_DISTRO>`__ variable's default value.
2339
2340For more information on sstate, see the "`Shared State
2341Cache <&YOCTO_DOCS_OM_URL;#shared-state-cache>`__" section in the Yocto
2342Project Overview and Concepts Manual.
2343
2344.. _ref-classes-staging:
2345
2346``staging.bbclass``
2347===================
2348
2349The ``staging`` class installs files into individual recipe work
2350directories 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
2362The code in the ``staging`` class is complex and basically works in two
2363stages:
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
2450The ``syslinux`` class provides syslinux-specific functions for building
2451bootable images.
2452
2453The 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
2493The ``systemd`` class provides support for recipes that install systemd
2494unit files.
2495
2496The functionality for this class is disabled unless you have "systemd"
2497in ```DISTRO_FEATURES`` <#var-DISTRO_FEATURES>`__.
2498
2499Under this class, the recipe or Makefile (i.e. whatever the recipe is
2500calling during the ```do_install`` <#ref-tasks-install>`__ task)
2501installs unit files into
2502``${``\ ```D`` <#var-D>`__\ ``}${systemd_unitdir}/system``. If the unit
2503files being installed go into packages other than the main package, you
2504need to set ```SYSTEMD_PACKAGES`` <#var-SYSTEMD_PACKAGES>`__ in your
2505recipe to identify the packages in which the files will be installed.
2506
2507You should set ```SYSTEMD_SERVICE`` <#var-SYSTEMD_SERVICE>`__ to the
2508name of the service file. You should also use a package name override to
2509indicate the package to which the value applies. If the value applies to
2510the recipe's main package, use ``${``\ ```PN`` <#var-PN>`__\ ``}``. Here
2511is an example from the connman recipe: SYSTEMD_SERVICE_${PN} =
2512"connman.service" Services are set up to start on boot automatically
2513unless you have set
2514```SYSTEMD_AUTO_ENABLE`` <#var-SYSTEMD_AUTO_ENABLE>`__ to "disable".
2515
2516For more information on ``systemd``, see the "`Selecting an
2517Initialization
2518Manager <&YOCTO_DOCS_DEV_URL;#selecting-an-initialization-manager>`__"
2519section in the Yocto Project Development Tasks Manual.
2520
2521.. _ref-classes-systemd-boot:
2522
2523``systemd-boot.bbclass``
2524========================
2525
2526The ``systemd-boot`` class provides functions specific to the
2527systemd-boot bootloader for building bootable images. This is an
2528internal 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
2540Set the ```EFI_PROVIDER`` <#var-EFI_PROVIDER>`__ variable to
2541"systemd-boot" to use this class. Doing so creates a standalone EFI
2542bootloader that is not dependent on systemd.
2543
2544For information on more variables used and supported in this class, see
2545the ```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
2549You can also see the `Systemd-boot
2550documentation <http://www.freedesktop.org/wiki/Software/systemd/systemd-boot/>`__
2551for more information.
2552
2553.. _ref-classes-terminal:
2554
2555``terminal.bbclass``
2556====================
2557
2558The ``terminal`` class provides support for starting a terminal session.
2559The ```OE_TERMINAL`` <#var-OE_TERMINAL>`__ variable controls which
2560terminal emulator is used for the session.
2561
2562Other classes use the ``terminal`` class anywhere a separate terminal
2563session 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``
2568class.
2569
2570.. _ref-classes-testimage*:
2571
2572``testimage*.bbclass``
2573======================
2574
2575The ``testimage*`` classes support running automated tests against
2576images using QEMU and on actual hardware. The classes handle loading the
2577tests and starting the image. To use the classes, you need to perform
2578steps 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
2590The tests are commands that run on the target system over ``ssh``. Each
2591test is written in Python and makes use of the ``unittest`` module.
2592
2593The ``testimage.bbclass`` runs tests on an image when called using the
2594following: $ bitbake -c testimage image The ``testimage-auto`` class
2595runs tests on an image after the image is constructed (i.e.
2596```TESTIMAGE_AUTO`` <#var-TESTIMAGE_AUTO>`__ must be set to "1").
2597
2598For information on how to enable, run, and create new tests, see the
2599"`Performing Automated Runtime
2600Testing <&YOCTO_DOCS_DEV_URL;#performing-automated-runtime-testing>`__"
2601section in the Yocto Project Development Tasks Manual.
2602
2603.. _ref-classes-testsdk:
2604
2605``testsdk.bbclass``
2606===================
2607
2608This class supports running automated tests against software development
2609kits (SDKs). The ``testsdk`` class runs tests on an SDK when called
2610using 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
2627This class should be inherited by recipes whose upstream packages invoke
2628the ``texinfo`` utilities at build-time. Native and cross recipes are
2629made to use the dummy scripts provided by ``texinfo-dummy-native``, for
2630improved performance. Target architecture recipes use the genuine
2631Texinfo utilities. By default, they use the Texinfo utilities on the
2632host 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
2648The ``tinderclient`` class submits build results to an external
2649Tinderbox instance.
2650
2651.. note::
2652
2653 This class is currently unmaintained.
2654
2655.. _ref-classes-toaster:
2656
2657``toaster.bbclass``
2658===================
2659
2660The ``toaster`` class collects information about packages and images and
2661sends them as events that the BitBake user interface can receive. The
2662class is enabled when the Toaster user interface is running.
2663
2664This class is not intended to be used directly.
2665
2666.. _ref-classes-toolchain-scripts:
2667
2668``toolchain-scripts.bbclass``
2669=============================
2670
2671The ``toolchain-scripts`` class provides the scripts used for setting up
2672the environment for installed SDKs.
2673
2674.. _ref-classes-typecheck:
2675
2676``typecheck.bbclass``
2677=====================
2678
2679The ``typecheck`` class provides support for validating the values of
2680variables set at the configuration level against their defined types.
2681The OpenEmbedded build system allows you to define the type of a
2682variable using the "type" varflag. Here is an example:
2683IMAGE_FEATURES[type] = "list"
2684
2685.. _ref-classes-uboot-config:
2686
2687``uboot-config.bbclass``
2688========================
2689
2690The ``uboot-config`` class provides support for U-Boot configuration for
2691a machine. Specify the machine in your recipe as follows: UBOOT_CONFIG
2692??= <default> UBOOT_CONFIG[foo] = "config,images" You can also specify
2693the 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
2696information.
2697
2698.. _ref-classes-uninative:
2699
2700``uninative.bbclass``
2701=====================
2702
2703Attempts to isolate the build system from the host distribution's C
2704library in order to make re-use of native shared state artifacts across
2705different host distributions practical. With this class enabled, a
2706tarball containing a pre-built C library is downloaded at the start of
2707the build. In the Poky reference distribution this is enabled by default
2708through ``meta/conf/distro/include/yocto-uninative.inc``. Other
2709distributions that do not derive from poky can also
2710"``require conf/distro/include/yocto-uninative.inc``" to use this.
2711Alternatively if you prefer, you can build the uninative-tarball recipe
2712yourself, publish the resulting tarball (e.g. via HTTP) and set
2713``UNINATIVE_URL`` and ``UNINATIVE_CHECKSUM`` appropriately. For an
2714example, see the ``meta/conf/distro/include/yocto-uninative.inc``.
2715
2716The ``uninative`` class is also used unconditionally by the extensible
2717SDK. When building the extensible SDK, ``uninative-tarball`` is built
2718and the resulting tarball is included within the SDK.
2719
2720.. _ref-classes-update-alternatives:
2721
2722``update-alternatives.bbclass``
2723===============================
2724
2725The ``update-alternatives`` class helps the alternatives system when
2726multiple sources provide the same command. This situation occurs when
2727several programs that have the same or similar function are installed
2728with the same name. For example, the ``ar`` command is available from
2729the ``busybox``, ``binutils`` and ``elfutils`` packages. The
2730``update-alternatives`` class handles renaming the binaries so that
2731multiple packages can be installed without conflicts. The ``ar`` command
2732still works regardless of which packages are installed or subsequently
2733removed. The class renames the conflicting binary in each package and
2734symlinks the highest priority binary during installation or removal of
2735packages.
2736
2737To 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
2747These variables list alternative commands needed by a package, provide
2748pathnames for links, default links for targets, and so forth. For
2749details 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>`__
2751file.
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
2765The ``update-rc.d`` class uses ``update-rc.d`` to safely install an
2766initialization script on behalf of the package. The OpenEmbedded build
2767system takes care of details such as making sure the script is stopped
2768before a package is removed and started when the package is installed.
2769
2770Three variables control this class: ``INITSCRIPT_PACKAGES``,
2771``INITSCRIPT_NAME`` and ``INITSCRIPT_PARAMS``. See the variable links
2772for details.
2773
2774.. _ref-classes-useradd:
2775
2776``useradd*.bbclass``
2777====================
2778
2779The ``useradd*`` classes support the addition of users or groups for
2780usage by the package on the target. For example, if you have packages
2781that contain system services that should be run under their own user or
2782group, you can use these classes to enable creation of the user or
2783group. The ``meta-skeleton/recipes-skeleton/useradd/useradd-example.bb``
2784recipe in the `Source Directory <#source-directory>`__ provides a simple
2785example that shows how to add three users and groups to two packages.
2786See the ``useradd-example.bb`` recipe for more information on how to use
2787these classes.
2788
2789The ``useradd_base`` class provides basic functionality for user or
2790groups settings.
2791
2792The ``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
2798The ``useradd-staticids`` class supports the addition of users or groups
2799that have static user identification (``uid``) and group identification
2800(``gid``) values.
2801
2802The default behavior of the OpenEmbedded build system for assigning
2803``uid`` and ``gid`` values when packages add users and groups during
2804package install time is to add them dynamically. This works fine for
2805programs that do not care what the values of the resulting users and
2806groups become. In these cases, the order of the installation determines
2807the final ``uid`` and ``gid`` values. However, if non-deterministic
2808``uid`` and ``gid`` values are a problem, you can override the default,
2809dynamic application of these values by setting static values. When you
2810set static values, the OpenEmbedded build system looks in
2811```BBPATH`` <#var-BBPATH>`__ for ``files/passwd`` and ``files/group``
2812files for the values.
2813
2814To use static ``uid`` and ``gid`` values, you need to set some
2815variables. 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.
2819You can also see the ```useradd`` <#ref-classes-useradd>`__ class for
2820additional 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
2843The ``utility-tasks`` class provides support for various "utility" type
2844tasks that are applicable to all recipes, such as
2845```do_clean`` <#ref-tasks-clean>`__ and
2846```do_listtasks`` <#ref-tasks-listtasks>`__.
2847
2848This 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
2856The ``utils`` class provides some useful Python functions that are
2857typically used in inline Python expressions (e.g. ``${@...}``). One
2858example use is for ``bb.utils.contains()``.
2859
2860This 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
2868The ``vala`` class supports recipes that need to build software written
2869using the Vala programming language.
2870
2871.. _ref-classes-waf:
2872
2873``waf.bbclass``
2874===============
2875
2876The ``waf`` class supports recipes that need to build software that uses
2877the Waf build system. You can use the
2878```EXTRA_OECONF`` <#var-EXTRA_OECONF>`__ or
2879```PACKAGECONFIG_CONFARGS`` <#var-PACKAGECONFIG_CONFARGS>`__ variables
2880to specify additional configuration options to be passed on the Waf
2881command line.