123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147 |
- .. SPDX-License-Identifier: CC-BY-SA-2.0-UK
- *******
- Classes
- *******
- Class files are used to abstract common functionality and share it
- amongst multiple recipe (``.bb``) files. To use a class file, you simply
- make sure the recipe inherits the class. In most cases, when a recipe
- inherits a class it is enough to enable its features. There are cases,
- however, where in the recipe you might need to set variables or override
- some default behavior.
- Any :term:`Metadata` usually found in a recipe can also be
- placed in a class file. Class files are identified by the extension
- ``.bbclass`` and are usually placed in one of a set of subdirectories
- beneath the ``meta*/`` directory found in the :term:`Source Directory`:
- - ``classes-recipe/`` - classes intended to be inherited by recipes
- individually
- - ``classes-global/`` - classes intended to be inherited globally
- - ``classes/`` - classes whose usage context is not clearly defined
- Class files can also be pointed to by
- :term:`BUILDDIR` (e.g. ``build/``) in the same way as
- ``.conf`` files in the ``conf`` directory. Class files are searched for
- in :term:`BBPATH` using the same method by which ``.conf``
- files are searched.
- This chapter discusses only the most useful and important classes. Other
- classes do exist within the ``meta/classes*`` directories in the Source
- Directory. You can reference the ``.bbclass`` files directly for more
- information.
- .. _ref-classes-allarch:
- ``allarch.bbclass``
- ===================
- The :ref:`allarch <ref-classes-allarch>` class is inherited by recipes that do not produce
- architecture-specific output. The class disables functionality that is
- normally needed for recipes that produce executable binaries (such as
- building the cross-compiler and a C library as pre-requisites, and
- splitting out of debug symbols during packaging).
- .. note::
- Unlike some distro recipes (e.g. Debian), OpenEmbedded recipes that
- produce packages that depend on tunings through use of the
- :term:`RDEPENDS` and
- :term:`TUNE_PKGARCH` variables, should never be
- configured for all architectures using :ref:`allarch <ref-classes-allarch>`. This is the case
- even if the recipes do not produce architecture-specific output.
- Configuring such recipes for all architectures causes the
- :ref:`do_package_write_* <ref-tasks-package_write_deb>` tasks to
- have different signatures for the machines with different tunings.
- Additionally, unnecessary rebuilds occur every time an image for a
- different :term:`MACHINE` is built even when the recipe never changes.
- By default, all recipes inherit the :ref:`base <ref-classes-base>` and
- :ref:`package <ref-classes-package>` classes, which enable
- functionality needed for recipes that produce executable output. If your
- recipe, for example, only produces packages that contain configuration
- files, media files, or scripts (e.g. Python and Perl), then it should
- inherit the :ref:`allarch <ref-classes-allarch>` class.
- .. _ref-classes-archiver:
- ``archiver.bbclass``
- ====================
- The :ref:`archiver <ref-classes-archiver>` class supports releasing source code and other
- materials with the binaries.
- For more details on the source :ref:`archiver <ref-classes-archiver>`, see the
- ":ref:`dev-manual/licenses:maintaining open source license compliance during your product's lifecycle`"
- section in the Yocto Project Development Tasks Manual. You can also see
- the :term:`ARCHIVER_MODE` variable for information
- about the variable flags (varflags) that help control archive creation.
- .. _ref-classes-autotools:
- ``autotools*.bbclass``
- ======================
- The :ref:`autotools* <ref-classes-autotools>` classes support packages built with the
- :wikipedia:`GNU Autotools <GNU_Autotools>`.
- The ``autoconf``, ``automake``, and ``libtool`` packages bring
- standardization. This class defines a set of tasks (e.g. ``configure``,
- ``compile`` and so forth) that work for all Autotooled packages. It
- should usually be enough to define a few standard variables and then
- simply ``inherit autotools``. These classes can also work with software
- that emulates Autotools. For more information, see the
- ":ref:`dev-manual/new-recipe:autotooled package`" section
- in the Yocto Project Development Tasks Manual.
- By default, the :ref:`autotools* <ref-classes-autotools>` classes use out-of-tree builds (i.e.
- ``autotools.bbclass`` building with ``B != S``).
- If the software being built by a recipe does not support using
- out-of-tree builds, you should have the recipe inherit the
- :ref:`autotools-brokensep <ref-classes-autotools>` class. The :ref:`autotools-brokensep <ref-classes-autotools>` class behaves
- the same as the :ref:`autotools <ref-classes-autotools>` class but builds with :term:`B`
- == :term:`S`. This method is useful when out-of-tree build
- support is either not present or is broken.
- .. note::
- It is recommended that out-of-tree support be fixed and used if at
- all possible.
- It's useful to have some idea of how the tasks defined by the
- :ref:`autotools* <ref-classes-autotools>` classes work and what they do behind the scenes.
- - :ref:`ref-tasks-configure` --- regenerates the
- configure script (using ``autoreconf``) and then launches it with a
- standard set of arguments used during cross-compilation. You can pass
- additional parameters to ``configure`` through the :term:`EXTRA_OECONF`
- or :term:`PACKAGECONFIG_CONFARGS`
- variables.
- - :ref:`ref-tasks-compile` --- runs ``make`` with
- arguments that specify the compiler and linker. You can pass
- additional arguments through the :term:`EXTRA_OEMAKE` variable.
- - :ref:`ref-tasks-install` --- runs ``make install`` and
- passes in ``${``\ :term:`D`\ ``}`` as ``DESTDIR``.
- .. _ref-classes-base:
- ``base.bbclass``
- ================
- The :ref:`base <ref-classes-base>` class is special in that every ``.bb`` file implicitly
- inherits the class. This class contains definitions for standard basic
- tasks such as fetching, unpacking, configuring (empty by default),
- compiling (runs any ``Makefile`` present), installing (empty by default)
- and packaging (empty by default). These classes are often overridden or
- extended by other classes such as the
- :ref:`autotools <ref-classes-autotools>` class or the
- :ref:`package <ref-classes-package>` class.
- The class also contains some commonly used functions such as
- ``oe_runmake``, which runs ``make`` with the arguments specified in
- :term:`EXTRA_OEMAKE` variable as well as the
- arguments passed directly to ``oe_runmake``.
- .. _ref-classes-bash-completion:
- ``bash-completion.bbclass``
- ===========================
- Sets up packaging and dependencies appropriate for recipes that build
- software that includes bash-completion data.
- .. _ref-classes-bin-package:
- ``bin_package.bbclass``
- =======================
- The :ref:`bin_package <ref-classes-bin-package>` class is a helper class for recipes that extract the
- contents of a binary package (e.g. an RPM) and install those contents
- rather than building the binary from source. The binary package is
- extracted and new packages in the configured output package format are
- created. Extraction and installation of proprietary binaries is a good
- example use for this class.
- .. note::
- For RPMs and other packages that do not contain a subdirectory, you
- should specify an appropriate fetcher parameter to point to the
- subdirectory. For example, if BitBake is using the Git fetcher (``git://``),
- the "subpath" parameter limits the checkout to a specific subpath
- of the tree. Here is an example where ``${BP}`` is used so that the files
- are extracted into the subdirectory expected by the default value of
- :term:`S`::
- SRC_URI = "git://example.com/downloads/somepackage.rpm;branch=main;subpath=${BP}"
- See the ":ref:`bitbake-user-manual/bitbake-user-manual-fetching:fetchers`" section in the BitBake User Manual for
- more information on supported BitBake Fetchers.
- .. _ref-classes-binconfig:
- ``binconfig.bbclass``
- =====================
- The :ref:`binconfig <ref-classes-binconfig>` class helps to correct paths in shell scripts.
- Before ``pkg-config`` had become widespread, libraries shipped shell
- scripts to give information about the libraries and include paths needed
- to build software (usually named ``LIBNAME-config``). This class assists
- any recipe using such scripts.
- During staging, the OpenEmbedded build system installs such scripts into
- the ``sysroots/`` directory. Inheriting this class results in all paths
- in these scripts being changed to point into the ``sysroots/`` directory
- so that all builds that use the script use the correct directories for
- the cross compiling layout. See the
- :term:`BINCONFIG_GLOB` variable for more
- information.
- .. _ref-classes-binconfig-disabled:
- ``binconfig-disabled.bbclass``
- ==============================
- An alternative version of the :ref:`binconfig <ref-classes-binconfig>`
- class, which disables binary configuration scripts by making them return
- an error in favor of using ``pkg-config`` to query the information. The
- scripts to be disabled should be specified using the :term:`BINCONFIG`
- variable within the recipe inheriting the class.
- .. _ref-classes-buildhistory:
- ``buildhistory.bbclass``
- ========================
- The :ref:`buildhistory <ref-classes-buildhistory>` class records a history of build output metadata,
- which can be used to detect possible regressions as well as used for
- analysis of the build output. For more information on using Build
- History, see the
- ":ref:`dev-manual/build-quality:maintaining build output quality`"
- section in the Yocto Project Development Tasks Manual.
- .. _ref-classes-buildstats:
- ``buildstats.bbclass``
- ======================
- The :ref:`buildstats <ref-classes-buildstats>` class records performance statistics about each task
- executed during the build (e.g. elapsed time, CPU usage, and I/O usage).
- When you use this class, the output goes into the
- :term:`BUILDSTATS_BASE` directory, which defaults
- to ``${TMPDIR}/buildstats/``. You can analyze the elapsed time using
- ``scripts/pybootchartgui/pybootchartgui.py``, which produces a cascading
- chart of the entire build process and can be useful for highlighting
- bottlenecks.
- Collecting build statistics is enabled by default through the
- :term:`USER_CLASSES` variable from your
- ``local.conf`` file. Consequently, you do not have to do anything to
- enable the class. However, if you want to disable the class, simply
- remove ":ref:`buildstats <ref-classes-buildstats>`" from the :term:`USER_CLASSES` list.
- .. _ref-classes-buildstats-summary:
- ``buildstats-summary.bbclass``
- ==============================
- When inherited globally, prints statistics at the end of the build on
- sstate re-use. In order to function, this class requires the
- :ref:`buildstats <ref-classes-buildstats>` class be enabled.
- .. _ref-classes-ccache:
- ``ccache.bbclass``
- ==================
- The :ref:`ccache <ref-classes-ccache>` class enables the C/C++ Compiler Cache for the build.
- This class is used to give a minor performance boost during the build.
- See https://ccache.samba.org/ for information on the C/C++ Compiler
- Cache, and the :oe_git:`ccache.bbclass </openembedded-core/tree/meta/classes/ccache.bbclass>`
- file for details about how to enable this mechanism in your configuration
- file, how to disable it for specific recipes, and how to share ``ccache``
- files between builds.
- However, using the class can lead to unexpected side-effects. Thus, using
- this class is not recommended.
- .. _ref-classes-chrpath:
- ``chrpath.bbclass``
- ===================
- The :ref:`chrpath <ref-classes-chrpath>` class is a wrapper around the "chrpath" utility, which
- is used during the build process for :ref:`nativesdk <ref-classes-nativesdk>`, :ref:`cross <ref-classes-cross>`, and
- :ref:`cross-canadian <ref-classes-cross-canadian>` recipes to change ``RPATH`` records within binaries
- in order to make them relocatable.
- .. _ref-classes-cmake:
- ``cmake.bbclass``
- =================
- The ref:`cmake <ref-classes-cmake>` class allows for recipes that need to build software using
- the `CMake <https://cmake.org/overview/>`__ build system. You can use
- the :term:`EXTRA_OECMAKE` variable to specify
- additional configuration options to be passed using the ``cmake``
- command line.
- On the occasion that you would be installing custom CMake toolchain
- files supplied by the application being built, you should install them
- to the preferred CMake Module directory: ``${D}${datadir}/cmake/``
- Modules during
- :ref:`ref-tasks-install`.
- .. _ref-classes-cml1:
- ``cml1.bbclass``
- ================
- The :ref:`cml1 <ref-classes-cml1>` class provides basic support for the Linux kernel style
- build configuration system.
- .. _ref-classes-compress_doc:
- ``compress_doc.bbclass``
- ========================
- Enables compression for man pages and info pages. This class is intended
- to be inherited globally. The default compression mechanism is gz (gzip)
- but you can select an alternative mechanism by setting the
- :term:`DOC_COMPRESS` variable.
- .. _ref-classes-copyleft_compliance:
- ``copyleft_compliance.bbclass``
- ===============================
- The :ref:`copyleft_compliance <ref-classes-copyleft_compliance>` class preserves source code for the purposes
- of license compliance. This class is an alternative to the :ref:`archiver <ref-classes-archiver>`
- class and is still used by some users even though it has been deprecated
- in favor of the :ref:`archiver <ref-classes-archiver>` class.
- .. _ref-classes-copyleft_filter:
- ``copyleft_filter.bbclass``
- ===========================
- A class used by the :ref:`archiver <ref-classes-archiver>` and
- :ref:`copyleft_compliance <ref-classes-copyleft_compliance>` classes
- for filtering licenses. The ``copyleft_filter`` class is an internal
- class and is not intended to be used directly.
- .. _ref-classes-core-image:
- ``core-image.bbclass``
- ======================
- The :ref:`core-image <ref-classes-core-image>` class provides common definitions for the
- ``core-image-*`` image recipes, such as support for additional
- :term:`IMAGE_FEATURES`.
- .. _ref-classes-cpan:
- ``cpan*.bbclass``
- =================
- The :ref:`cpan* <ref-classes-cpan>` classes support Perl modules.
- Recipes for Perl modules are simple. These recipes usually only need to
- point to the source's archive and then inherit the proper class file.
- Building is split into two methods depending on which method the module
- authors used.
- - Modules that use old ``Makefile.PL``-based build system require
- ``cpan.bbclass`` in their recipes.
- - Modules that use ``Build.PL``-based build system require using
- ``cpan_build.bbclass`` in their recipes.
- Both build methods inherit the :ref:`cpan-base <ref-classes-cpan>` class for basic Perl
- support.
- .. _ref-classes-create-spdx:
- ``create-spdx.bbclass``
- =======================
- The :ref:`create-spdx <ref-classes-create-spdx>` class provides support for
- automatically creating :term:`SPDX` :term:`SBOM` documents based upon image
- and SDK contents.
- This class is meant to be inherited globally from a configuration file::
- INHERIT += "create-spdx"
- The toplevel :term:`SPDX` output file is generated in JSON format as a
- ``IMAGE-MACHINE.spdx.json`` file in ``tmp/deploy/images/MACHINE/`` inside the
- :term:`Build Directory`. There are other related files in the same directory,
- as well as in ``tmp/deploy/spdx``.
- The exact behaviour of this class, and the amount of output can be controlled
- by the :term:`SPDX_PRETTY`, :term:`SPDX_ARCHIVE_PACKAGED`,
- :term:`SPDX_ARCHIVE_SOURCES` and :term:`SPDX_INCLUDE_SOURCES` variables.
- See the description of these variables and the
- ":ref:`dev-manual/sbom:creating a software bill of materials`"
- section in the Yocto Project Development Manual for more details.
- .. _ref-classes-cross:
- ``cross.bbclass``
- =================
- The :ref:`cross <ref-classes-cross>` class provides support for the recipes that build the
- cross-compilation tools.
- .. _ref-classes-cross-canadian:
- ``cross-canadian.bbclass``
- ==========================
- The :ref:`cross-canadian <ref-classes-cross-canadian>` class provides support for the recipes that build
- the Canadian Cross-compilation tools for SDKs. See the
- ":ref:`overview-manual/concepts:cross-development toolchain generation`"
- section in the Yocto Project Overview and Concepts Manual for more
- discussion on these cross-compilation tools.
- .. _ref-classes-crosssdk:
- ``crosssdk.bbclass``
- ====================
- The :ref:`crosssdk <ref-classes-crosssdk>` class provides support for the recipes that build the
- cross-compilation tools used for building SDKs. See the
- ":ref:`overview-manual/concepts:cross-development toolchain generation`"
- section in the Yocto Project Overview and Concepts Manual for more
- discussion on these cross-compilation tools.
- .. _ref-classes-cve-check:
- ``cve-check.bbclass``
- =====================
- The :ref:`cve-check <ref-classes-cve-check>` class looks for known CVEs (Common Vulnerabilities
- and Exposures) while building with BitBake. This class is meant to be
- inherited globally from a configuration file::
- INHERIT += "cve-check"
- To filter out obsolete CVE database entries which are known not to impact software from Poky and OE-Core,
- add following line to the build configuration file::
- include cve-extra-exclusions.inc
- You can also look for vulnerabilities in specific packages by passing
- ``-c cve_check`` to BitBake.
- After building the software with Bitbake, CVE check output reports are available in ``tmp/deploy/cve``
- and image specific summaries in ``tmp/deploy/images/*.cve`` or ``tmp/deploy/images/*.json`` files.
- When building, the CVE checker will emit build time warnings for any detected
- issues which are in the state ``Unpatched``, meaning that CVE issue seems to affect the software component
- and version being compiled and no patches to address the issue are applied. Other states
- for detected CVE issues are: ``Patched`` meaning that a patch to address the issue is already
- applied, and ``Ignored`` meaning that the issue can be ignored.
- The ``Patched`` state of a CVE issue is detected from patch files with the format
- ``CVE-ID.patch``, e.g. ``CVE-2019-20633.patch``, in the :term:`SRC_URI` and using
- CVE metadata of format ``CVE: CVE-ID`` in the commit message of the patch file.
- If the recipe lists the ``CVE-ID`` in :term:`CVE_CHECK_IGNORE` variable, then the CVE state is reported
- as ``Ignored``. Multiple CVEs can be listed separated by spaces. Example::
- CVE_CHECK_IGNORE += "CVE-2020-29509 CVE-2020-29511"
- If CVE check reports that a recipe contains false positives or false negatives, these may be
- fixed in recipes by adjusting the CVE product name using :term:`CVE_PRODUCT` and :term:`CVE_VERSION` variables.
- :term:`CVE_PRODUCT` defaults to the plain recipe name :term:`BPN` which can be adjusted to one or more CVE
- database vendor and product pairs using the syntax::
- CVE_PRODUCT = "flex_project:flex"
- where ``flex_project`` is the CVE database vendor name and ``flex`` is the product name. Similarly
- if the default recipe version :term:`PV` does not match the version numbers of the software component
- in upstream releases or the CVE database, then the :term:`CVE_VERSION` variable can be used to set the
- CVE database compatible version number, for example::
- CVE_VERSION = "2.39"
- Any bugs or missing or incomplete information in the CVE database entries should be fixed in the CVE database
- via the `NVD feedback form <https://nvd.nist.gov/info/contact-form>`__.
- Users should note that security is a process, not a product, and thus also CVE checking, analyzing results,
- patching and updating the software should be done as a regular process. The data and assumptions
- required for CVE checker to reliably detect issues are frequently broken in various ways.
- These can only be detected by reviewing the details of the issues and iterating over the generated reports,
- and following what happens in other Linux distributions and in the greater open source community.
- You will find some more details in the
- ":ref:`dev-manual/vulnerabilities:checking for vulnerabilities`"
- section in the Development Tasks Manual.
- .. _ref-classes-debian:
- ``debian.bbclass``
- ==================
- The :ref:`debian <ref-classes-debian>` class renames output packages so that they follow the
- Debian naming policy (i.e. ``glibc`` becomes ``libc6`` and
- ``glibc-devel`` becomes ``libc6-dev``.) Renaming includes the library
- name and version as part of the package name.
- If a recipe creates packages for multiple libraries (shared object files
- of ``.so`` type), use the :term:`LEAD_SONAME`
- variable in the recipe to specify the library on which to apply the
- naming scheme.
- .. _ref-classes-deploy:
- ``deploy.bbclass``
- ==================
- The :ref:`deploy <ref-classes-deploy>` class handles deploying files to the
- :term:`DEPLOY_DIR_IMAGE` directory. The main
- function of this class is to allow the deploy step to be accelerated by
- shared state. Recipes that inherit this class should define their own
- :ref:`ref-tasks-deploy` function to copy the files to be
- deployed to :term:`DEPLOYDIR`, and use ``addtask`` to
- add the task at the appropriate place, which is usually after
- :ref:`ref-tasks-compile` or
- :ref:`ref-tasks-install`. The class then takes care of
- staging the files from :term:`DEPLOYDIR` to :term:`DEPLOY_DIR_IMAGE`.
- .. _ref-classes-devshell:
- ``devshell.bbclass``
- ====================
- The :ref:`devshell <ref-classes-devshell>` class adds the :ref:`ref-tasks-devshell` task. Distribution
- policy dictates whether to include this class. See the ":ref:`dev-manual/development-shell:using a development shell`"
- section in the Yocto Project Development Tasks Manual for more
- information about using :ref:`devshell <ref-classes-devshell>`.
- .. _ref-classes-devupstream:
- ``devupstream.bbclass``
- =======================
- The :ref:`devupstream <ref-classes-devupstream>` class uses
- :term:`BBCLASSEXTEND` to add a variant of the
- recipe that fetches from an alternative URI (e.g. Git) instead of a
- tarball. Following is an example::
- BBCLASSEXTEND = "devupstream:target"
- SRC_URI:class-devupstream = "git://git.example.com/example;branch=main"
- SRCREV:class-devupstream = "abcd1234"
- Adding the above statements to your recipe creates a variant that has
- :term:`DEFAULT_PREFERENCE` set to "-1".
- Consequently, you need to select the variant of the recipe to use it.
- Any development-specific adjustments can be done by using the
- ``class-devupstream`` override. Here is an example::
- DEPENDS:append:class-devupstream = " gperf-native"
- do_configure:prepend:class-devupstream() {
- touch ${S}/README
- }
- The class
- currently only supports creating a development variant of the target
- recipe, not :ref:`native <ref-classes-native>` or :ref:`nativesdk <ref-classes-nativesdk>` variants.
- The :term:`BBCLASSEXTEND` syntax (i.e. ``devupstream:target``) provides
- support for :ref:`native <ref-classes-native>` and :ref:`nativesdk <ref-classes-nativesdk>` variants. Consequently, this
- functionality can be added in a future release.
- Support for other version control systems such as Subversion is limited
- due to BitBake's automatic fetch dependencies (e.g.
- ``subversion-native``).
- .. _ref-classes-externalsrc:
- ``externalsrc.bbclass``
- =======================
- The :ref:`externalsrc <ref-classes-externalsrc>` class supports building software from source code
- that is external to the OpenEmbedded build system. Building software
- from an external source tree means that the build system's normal fetch,
- unpack, and patch process is not used.
- By default, the OpenEmbedded build system uses the :term:`S`
- and :term:`B` variables to locate unpacked recipe source code
- and to build it, respectively. When your recipe inherits the
- :ref:`externalsrc <ref-classes-externalsrc>` class, you use the
- :term:`EXTERNALSRC` and :term:`EXTERNALSRC_BUILD` variables to
- ultimately define :term:`S` and :term:`B`.
- By default, this class expects the source code to support recipe builds
- that use the :term:`B` variable to point to the directory in
- which the OpenEmbedded build system places the generated objects built
- from the recipes. By default, the :term:`B` directory is set to the
- following, which is separate from the source directory (:term:`S`)::
- ${WORKDIR}/${BPN}-{PV}/
- See these variables for more information:
- :term:`WORKDIR`, :term:`BPN`, and
- :term:`PV`,
- For more information on the :ref:`externalsrc <ref-classes-externalsrc>` class, see the comments in
- ``meta/classes/externalsrc.bbclass`` in the :term:`Source Directory`.
- For information on how to use the
- :ref:`externalsrc <ref-classes-externalsrc>` class, see the
- ":ref:`dev-manual/building:building software from an external source`"
- section in the Yocto Project Development Tasks Manual.
- .. _ref-classes-extrausers:
- ``extrausers.bbclass``
- ======================
- The :ref:`extrausers <ref-classes-extrausers>` class allows additional user and group configuration
- to be applied at the image level. Inheriting this class either globally
- or from an image recipe allows additional user and group operations to
- be performed using the
- :term:`EXTRA_USERS_PARAMS` variable.
- .. note::
- The user and group operations added using the
- :ref:`extrausers <ref-classes-extrausers>`
- class are not tied to a specific recipe outside of the recipe for the
- image. Thus, the operations can be performed across the image as a
- whole. Use the
- :ref:`useradd <ref-classes-useradd>`
- class to add user and group configuration to a specific recipe.
- Here is an example that uses this class in an image recipe::
- inherit extrausers
- EXTRA_USERS_PARAMS = "\
- useradd -p '' tester; \
- groupadd developers; \
- userdel nobody; \
- groupdel -g video; \
- groupmod -g 1020 developers; \
- usermod -s /bin/sh tester; \
- "
- Here is an example that adds two users named "tester-jim" and "tester-sue" and assigns
- passwords. First on host, create the (escaped) password hash::
- printf "%q" $(mkpasswd -m sha256crypt tester01)
- The resulting hash is set to a variable and used in ``useradd`` command parameters::
- inherit extrausers
- PASSWD = "\$X\$ABC123\$A-Long-Hash"
- EXTRA_USERS_PARAMS = "\
- useradd -p '${PASSWD}' tester-jim; \
- useradd -p '${PASSWD}' tester-sue; \
- "
- Finally, here is an example that sets the root password::
- inherit extrausers
- EXTRA_USERS_PARAMS = "\
- usermod -p '${PASSWD}' root; \
- "
- .. note::
- From a security perspective, hardcoding a default password is not
- generally a good idea or even legal in some jurisdictions. It is
- recommended that you do not do this if you are building a production
- image.
- .. _ref-classes-features_check:
- ``features_check.bbclass``
- =================================
- The :ref:`features_check <ref-classes-features_check>` class allows individual recipes to check
- for required and conflicting
- :term:`DISTRO_FEATURES`, :term:`MACHINE_FEATURES` or :term:`COMBINED_FEATURES`.
- This class provides support for the following variables:
- - :term:`REQUIRED_DISTRO_FEATURES`
- - :term:`CONFLICT_DISTRO_FEATURES`
- - :term:`ANY_OF_DISTRO_FEATURES`
- - ``REQUIRED_MACHINE_FEATURES``
- - ``CONFLICT_MACHINE_FEATURES``
- - ``ANY_OF_MACHINE_FEATURES``
- - ``REQUIRED_COMBINED_FEATURES``
- - ``CONFLICT_COMBINED_FEATURES``
- - ``ANY_OF_COMBINED_FEATURES``
- If any conditions specified in the recipe using the above
- variables are not met, the recipe will be skipped, and if the
- build system attempts to build the recipe then an error will be
- triggered.
- .. _ref-classes-fontcache:
- ``fontcache.bbclass``
- =====================
- The :ref:`fontcache <ref-classes-fontcache>` class generates the proper post-install and
- post-remove (postinst and postrm) scriptlets for font packages. These
- scriptlets call ``fc-cache`` (part of ``Fontconfig``) to add the fonts
- to the font information cache. Since the cache files are
- architecture-specific, ``fc-cache`` runs using QEMU if the postinst
- scriptlets need to be run on the build host during image creation.
- If the fonts being installed are in packages other than the main
- package, set :term:`FONT_PACKAGES` to specify the
- packages containing the fonts.
- .. _ref-classes-fs-uuid:
- ``fs-uuid.bbclass``
- ===================
- The :ref:`fs-uuid <ref-classes-fs-uuid>` class extracts UUID from
- ``${``\ :term:`ROOTFS`\ ``}``, which must have been built
- by the time that this function gets called. The :ref:`fs-uuid <ref-classes-fs-uuid>` class only
- works on ``ext`` file systems and depends on ``tune2fs``.
- .. _ref-classes-gconf:
- ``gconf.bbclass``
- =================
- The :ref:`gconf <ref-classes-gconf>` class provides common functionality for recipes that need
- to install GConf schemas. The schemas will be put into a separate
- package (``${``\ :term:`PN`\ ``}-gconf``) that is created
- automatically when this class is inherited. This package uses the
- appropriate post-install and post-remove (postinst/postrm) scriptlets to
- register and unregister the schemas in the target image.
- .. _ref-classes-gettext:
- ``gettext.bbclass``
- ===================
- The :ref:`gettext <ref-classes-gettext>` class provides support for building
- software that uses the GNU ``gettext`` internationalization and localization
- system. All recipes building software that use ``gettext`` should inherit this
- class.
- .. _ref-classes-github-releases:
- ``github-releases.bbclass``
- ===========================
- For recipes that fetch release tarballs from github, the :ref:`github-releases <ref-classes-github-releases>`
- class sets up a standard way for checking available upstream versions
- (to support ``devtool upgrade`` and the Automated Upgrade Helper (AUH)).
- To use it, add ":ref:`github-releases <ref-classes-github-releases>`" to the inherit line in the recipe,
- and if the default value of :term:`GITHUB_BASE_URI` is not suitable,
- then set your own value in the recipe. You should then use ``${GITHUB_BASE_URI}``
- in the value you set for :term:`SRC_URI` within the recipe.
- .. _ref-classes-gnomebase:
- ``gnomebase.bbclass``
- =====================
- The :ref:`gnomebase <ref-classes-gnomebase>` class is the base class for recipes that build
- software from the GNOME stack. This class sets
- :term:`SRC_URI` to download the source from the GNOME
- mirrors as well as extending :term:`FILES` with the typical
- GNOME installation paths.
- .. _ref-classes-gobject-introspection:
- ``gobject-introspection.bbclass``
- =================================
- Provides support for recipes building software that supports GObject
- introspection. This functionality is only enabled if the
- "gobject-introspection-data" feature is in
- :term:`DISTRO_FEATURES` as well as
- "qemu-usermode" being in
- :term:`MACHINE_FEATURES`.
- .. note::
- This functionality is backfilled by default and, if not applicable,
- should be disabled through :term:`DISTRO_FEATURES_BACKFILL_CONSIDERED` or
- :term:`MACHINE_FEATURES_BACKFILL_CONSIDERED`, respectively.
- .. _ref-classes-grub-efi:
- ``grub-efi.bbclass``
- ====================
- The :ref:`grub-efi <ref-classes-grub-efi>` class provides ``grub-efi``-specific functions for
- building bootable images.
- This class supports several variables:
- - :term:`INITRD`: Indicates list of filesystem images to
- concatenate and use as an initial RAM disk (initrd) (optional).
- - :term:`ROOTFS`: Indicates a filesystem image to include
- as the root filesystem (optional).
- - :term:`GRUB_GFXSERIAL`: Set this to "1" to have
- graphics and serial in the boot menu.
- - :term:`LABELS`: A list of targets for the automatic
- configuration.
- - :term:`APPEND`: An override list of append strings for
- each ``LABEL``.
- - :term:`GRUB_OPTS`: Additional options to add to the
- configuration (optional). Options are delimited using semi-colon
- characters (``;``).
- - :term:`GRUB_TIMEOUT`: Timeout before executing
- the default ``LABEL`` (optional).
- .. _ref-classes-gsettings:
- ``gsettings.bbclass``
- =====================
- The :ref:`gsettings <ref-classes-gsettings>` class provides common functionality for recipes that
- need to install GSettings (glib) schemas. The schemas are assumed to be
- part of the main package. Appropriate post-install and post-remove
- (postinst/postrm) scriptlets are added to register and unregister the
- schemas in the target image.
- .. _ref-classes-gtk-doc:
- ``gtk-doc.bbclass``
- ===================
- The :ref:`gtk-doc <ref-classes-gtk-doc>` class is a helper class to pull in the appropriate
- ``gtk-doc`` dependencies and disable ``gtk-doc``.
- .. _ref-classes-gtk-icon-cache:
- ``gtk-icon-cache.bbclass``
- ==========================
- The :ref:`gtk-icon-cache <ref-classes-gtk-icon-cache>` class generates the proper post-install and
- post-remove (postinst/postrm) scriptlets for packages that use GTK+ and
- install icons. These scriptlets call ``gtk-update-icon-cache`` to add
- the fonts to GTK+'s icon cache. Since the cache files are
- architecture-specific, ``gtk-update-icon-cache`` is run using QEMU if
- the postinst scriptlets need to be run on the build host during image
- creation.
- .. _ref-classes-gtk-immodules-cache:
- ``gtk-immodules-cache.bbclass``
- ===============================
- The :ref:`gtk-immodules-cache <ref-classes-gtk-immodules-cache>` class generates the proper post-install and
- post-remove (postinst/postrm) scriptlets for packages that install GTK+
- input method modules for virtual keyboards. These scriptlets call
- ``gtk-update-icon-cache`` to add the input method modules to the cache.
- Since the cache files are architecture-specific,
- ``gtk-update-icon-cache`` is run using QEMU if the postinst scriptlets
- need to be run on the build host during image creation.
- If the input method modules being installed are in packages other than
- the main package, set
- :term:`GTKIMMODULES_PACKAGES` to specify
- the packages containing the modules.
- .. _ref-classes-gzipnative:
- ``gzipnative.bbclass``
- ======================
- The :ref:`gzipnative <ref-classes-gzipnative>` class enables the use of different native versions of
- ``gzip`` and ``pigz`` rather than the versions of these tools from the
- build host.
- .. _ref-classes-icecc:
- ``icecc.bbclass``
- =================
- The :ref:`icecc <ref-classes-icecc>` class supports
- `Icecream <https://github.com/icecc/icecream>`__, which facilitates
- taking compile jobs and distributing them among remote machines.
- The class stages directories with symlinks from ``gcc`` and ``g++`` to
- ``icecc``, for both native and cross compilers. Depending on each
- configure or compile, the OpenEmbedded build system adds the directories
- at the head of the ``PATH`` list and then sets the ``ICECC_CXX`` and
- ``ICECC_CC`` variables, which are the paths to the ``g++`` and ``gcc``
- compilers, respectively.
- For the cross compiler, the class creates a ``tar.gz`` file that
- contains the Yocto Project toolchain and sets ``ICECC_VERSION``, which
- is the version of the cross-compiler used in the cross-development
- toolchain, accordingly.
- The class handles all three different compile stages (i.e native,
- cross-kernel and target) and creates the necessary environment
- ``tar.gz`` file to be used by the remote machines. The class also
- supports SDK generation.
- If :term:`ICECC_PATH` is not set in your
- ``local.conf`` file, then the class tries to locate the ``icecc`` binary
- using ``which``. If :term:`ICECC_ENV_EXEC` is set
- in your ``local.conf`` file, the variable should point to the
- ``icecc-create-env`` script provided by the user. If you do not point to
- a user-provided script, the build system uses the default script
- provided by the recipe :oe_git:`icecc-create-env_0.1.bb
- </openembedded-core/tree/meta/recipes-devtools/icecc-create-env/icecc-create-env_0.1.bb>`.
- .. note::
- This script is a modified version and not the one that comes with
- ``icecream``.
- If you do not want the Icecream distributed compile support to apply to
- specific recipes or classes, you can ask them to be ignored by Icecream
- by listing the recipes and classes using the
- :term:`ICECC_RECIPE_DISABLE` and
- :term:`ICECC_CLASS_DISABLE` variables,
- respectively, in your ``local.conf`` file. Doing so causes the
- OpenEmbedded build system to handle these compilations locally.
- Additionally, you can list recipes using the
- :term:`ICECC_RECIPE_ENABLE` variable in
- your ``local.conf`` file to force ``icecc`` to be enabled for recipes
- using an empty :term:`PARALLEL_MAKE` variable.
- Inheriting the :ref:`icecc <ref-classes-icecc>` class changes all sstate signatures.
- Consequently, if a development team has a dedicated build system that
- populates :term:`SSTATE_MIRRORS` and they want to
- reuse sstate from :term:`SSTATE_MIRRORS`, then all developers and the build
- system need to either inherit the :ref:`icecc <ref-classes-icecc>` class or nobody should.
- At the distribution level, you can inherit the :ref:`icecc <ref-classes-icecc>` class to be
- sure that all builders start with the same sstate signatures. After
- inheriting the class, you can then disable the feature by setting the
- :term:`ICECC_DISABLED` variable to "1" as follows::
- INHERIT_DISTRO:append = " icecc"
- ICECC_DISABLED ??= "1"
- This practice
- makes sure everyone is using the same signatures but also requires
- individuals that do want to use Icecream to enable the feature
- individually as follows in your ``local.conf`` file::
- ICECC_DISABLED = ""
- .. _ref-classes-image:
- ``image.bbclass``
- =================
- The :ref:`image <ref-classes-image>` class helps support creating images in different formats.
- First, the root filesystem is created from packages using one of the
- ``rootfs*.bbclass`` files (depending on the package format used) and
- then one or more image files are created.
- - The :term:`IMAGE_FSTYPES` variable controls the types of images to
- generate.
- - The :term:`IMAGE_INSTALL` variable controls the list of packages to
- install into the image.
- For information on customizing images, see the
- ":ref:`dev-manual/customizing-images:customizing images`" section
- in the Yocto Project Development Tasks Manual. For information on how
- images are created, see the
- ":ref:`overview-manual/concepts:images`" section in the
- Yocto Project Overview and Concepts Manual.
- .. _ref-classes-image-buildinfo:
- ``image-buildinfo.bbclass``
- ===========================
- The :ref:`image-buildinfo <ref-classes-image-buildinfo>` class writes a plain text file containing
- build information to the target filesystem at ``${sysconfdir}/buildinfo``
- by default (as specified by :term:`IMAGE_BUILDINFO_FILE`).
- This can be useful for manually determining the origin of any given
- image. It writes out two sections:
- 1. `Build Configuration`: a list of variables and their values (specified
- by :term:`IMAGE_BUILDINFO_VARS`, which defaults to :term:`DISTRO` and
- :term:`DISTRO_VERSION`)
- 2. `Layer Revisions`: the revisions of all of the layers used in the
- build.
- Additionally, when building an SDK it will write the same contents
- to ``/buildinfo`` by default (as specified by
- :term:`SDK_BUILDINFO_FILE`).
- .. _ref-classes-image_types:
- ``image_types.bbclass``
- =======================
- The :ref:`image_types <ref-classes-image_types>` class defines all of the standard image output types
- that you can enable through the
- :term:`IMAGE_FSTYPES` variable. You can use this
- class as a reference on how to add support for custom image output
- types.
- By default, the :ref:`image <ref-classes-image>` class automatically
- enables the :ref:`image_types <ref-classes-image_types>` class. The :ref:`image <ref-classes-image>` class uses the
- ``IMGCLASSES`` variable as follows::
- IMGCLASSES = "rootfs_${IMAGE_PKGTYPE} image_types ${IMAGE_CLASSES}"
- IMGCLASSES += "${@['populate_sdk_base', 'populate_sdk_ext']['linux' in d.getVar("SDK_OS")]}"
- IMGCLASSES += "${@bb.utils.contains_any('IMAGE_FSTYPES', 'live iso hddimg', 'image-live', '', d)}"
- IMGCLASSES += "${@bb.utils.contains('IMAGE_FSTYPES', 'container', 'image-container', '', d)}"
- IMGCLASSES += "image_types_wic"
- IMGCLASSES += "rootfs-postcommands"
- IMGCLASSES += "image-postinst-intercepts"
- inherit ${IMGCLASSES}
- The :ref:`image_types <ref-classes-image_types>` class also handles conversion and compression of images.
- .. note::
- To build a VMware VMDK image, you need to add "wic.vmdk" to
- :term:`IMAGE_FSTYPES`. This would also be similar for Virtual Box Virtual Disk
- Image ("vdi") and QEMU Copy On Write Version 2 ("qcow2") images.
- .. _ref-classes-image-live:
- ``image-live.bbclass``
- ======================
- This class controls building "live" (i.e. HDDIMG and ISO) images. Live
- images contain syslinux for legacy booting, as well as the bootloader
- specified by :term:`EFI_PROVIDER` if
- :term:`MACHINE_FEATURES` contains "efi".
- Normally, you do not use this class directly. Instead, you add "live" to
- :term:`IMAGE_FSTYPES`.
- .. _ref-classes-insane:
- ``insane.bbclass``
- ==================
- The :ref:`insane <ref-classes-insane>` class adds a step to the package generation process so
- that output quality assurance checks are generated by the OpenEmbedded
- build system. A range of checks are performed that check the build's
- output for common problems that show up during runtime. Distribution
- policy usually dictates whether to include this class.
- You can configure the sanity checks so that specific test failures
- either raise a warning or an error message. Typically, failures for new
- tests generate a warning. Subsequent failures for the same test would
- then generate an error message once the metadata is in a known and good
- condition. See the ":doc:`/ref-manual/qa-checks`" Chapter for a list of all the warning
- and error messages you might encounter using a default configuration.
- Use the :term:`WARN_QA` and
- :term:`ERROR_QA` variables to control the behavior of
- these checks at the global level (i.e. in your custom distro
- configuration). However, to skip one or more checks in recipes, you
- should use :term:`INSANE_SKIP`. For example, to skip
- the check for symbolic link ``.so`` files in the main package of a
- recipe, add the following to the recipe. You need to realize that the
- package name override, in this example ``${PN}``, must be used::
- INSANE_SKIP:${PN} += "dev-so"
- Please keep in mind that the QA checks
- are meant to detect real or potential problems in the packaged
- output. So exercise caution when disabling these checks.
- Here are the tests you can list with the :term:`WARN_QA` and
- :term:`ERROR_QA` variables:
- - ``already-stripped:`` Checks that produced binaries have not
- already been stripped prior to the build system extracting debug
- symbols. It is common for upstream software projects to default to
- stripping debug symbols for output binaries. In order for debugging
- to work on the target using ``-dbg`` packages, this stripping must be
- disabled.
- - ``arch:`` Checks the Executable and Linkable Format (ELF) type, bit
- size, and endianness of any binaries to ensure they match the target
- architecture. This test fails if any binaries do not match the type
- since there would be an incompatibility. The test could indicate that
- the wrong compiler or compiler options have been used. Sometimes
- software, like bootloaders, might need to bypass this check.
- - ``buildpaths:`` Checks for paths to locations on the build host
- inside the output files. Not only can these leak information about
- the build environment, they also hinder binary reproducibility.
- - ``build-deps:`` Determines if a build-time dependency that is
- specified through :term:`DEPENDS`, explicit
- :term:`RDEPENDS`, or task-level dependencies exists
- to match any runtime dependency. This determination is particularly
- useful to discover where runtime dependencies are detected and added
- during packaging. If no explicit dependency has been specified within
- the metadata, at the packaging stage it is too late to ensure that
- the dependency is built, and thus you can end up with an error when
- the package is installed into the image during the
- :ref:`ref-tasks-rootfs` task because the auto-detected
- dependency was not satisfied. An example of this would be where the
- :ref:`update-rc.d <ref-classes-update-rc.d>` class automatically
- adds a dependency on the ``initscripts-functions`` package to
- packages that install an initscript that refers to
- ``/etc/init.d/functions``. The recipe should really have an explicit
- :term:`RDEPENDS` for the package in question on ``initscripts-functions``
- so that the OpenEmbedded build system is able to ensure that the
- ``initscripts`` recipe is actually built and thus the
- ``initscripts-functions`` package is made available.
- - ``compile-host-path:`` Checks the
- :ref:`ref-tasks-compile` log for indications that
- paths to locations on the build host were used. Using such paths
- might result in host contamination of the build output.
- - ``debug-deps:`` Checks that all packages except ``-dbg`` packages
- do not depend on ``-dbg`` packages, which would cause a packaging
- bug.
- - ``debug-files:`` Checks for ``.debug`` directories in anything but
- the ``-dbg`` package. The debug files should all be in the ``-dbg``
- package. Thus, anything packaged elsewhere is incorrect packaging.
- - ``dep-cmp:`` Checks for invalid version comparison statements in
- runtime dependency relationships between packages (i.e. in
- :term:`RDEPENDS`,
- :term:`RRECOMMENDS`,
- :term:`RSUGGESTS`,
- :term:`RPROVIDES`,
- :term:`RREPLACES`, and
- :term:`RCONFLICTS` variable values). Any invalid
- comparisons might trigger failures or undesirable behavior when
- passed to the package manager.
- - ``desktop:`` Runs the ``desktop-file-validate`` program against any
- ``.desktop`` files to validate their contents against the
- specification for ``.desktop`` files.
- - ``dev-deps:`` Checks that all packages except ``-dev`` or
- ``-staticdev`` packages do not depend on ``-dev`` packages, which
- would be a packaging bug.
- - ``dev-so:`` Checks that the ``.so`` symbolic links are in the
- ``-dev`` package and not in any of the other packages. In general,
- these symlinks are only useful for development purposes. Thus, the
- ``-dev`` package is the correct location for them. In very rare
- cases, such as dynamically loaded modules, these symlinks
- are needed instead in the main package.
- - ``empty-dirs:`` Checks that packages are not installing files to
- directories that are normally expected to be empty (such as ``/tmp``)
- The list of directories that are checked is specified by the
- :term:`QA_EMPTY_DIRS` variable.
- - ``file-rdeps:`` Checks that file-level dependencies identified by
- the OpenEmbedded build system at packaging time are satisfied. For
- example, a shell script might start with the line ``#!/bin/bash``.
- This line would translate to a file dependency on ``/bin/bash``. Of
- the three package managers that the OpenEmbedded build system
- supports, only RPM directly handles file-level dependencies,
- resolving them automatically to packages providing the files.
- However, the lack of that functionality in the other two package
- managers does not mean the dependencies do not still need resolving.
- This QA check attempts to ensure that explicitly declared
- :term:`RDEPENDS` exist to handle any file-level
- dependency detected in packaged files.
- - ``files-invalid:`` Checks for :term:`FILES` variable
- values that contain "//", which is invalid.
- - ``host-user-contaminated:`` Checks that no package produced by the
- recipe contains any files outside of ``/home`` with a user or group
- ID that matches the user running BitBake. A match usually indicates
- that the files are being installed with an incorrect UID/GID, since
- target IDs are independent from host IDs. For additional information,
- see the section describing the
- :ref:`ref-tasks-install` task.
- - ``incompatible-license:`` Report when packages are excluded from
- being created due to being marked with a license that is in
- :term:`INCOMPATIBLE_LICENSE`.
- - ``install-host-path:`` Checks the
- :ref:`ref-tasks-install` log for indications that
- paths to locations on the build host were used. Using such paths
- might result in host contamination of the build output.
- - ``installed-vs-shipped:`` Reports when files have been installed
- within :ref:`ref-tasks-install` but have not been included in any package by
- way of the :term:`FILES` variable. Files that do not
- appear in any package cannot be present in an image later on in the
- build process. Ideally, all installed files should be packaged or not
- installed at all. These files can be deleted at the end of
- :ref:`ref-tasks-install` if the files are not needed in any package.
- - ``invalid-chars:`` Checks that the recipe metadata variables
- :term:`DESCRIPTION`,
- :term:`SUMMARY`, :term:`LICENSE`, and
- :term:`SECTION` do not contain non-UTF-8 characters.
- Some package managers do not support such characters.
- - ``invalid-packageconfig:`` Checks that no undefined features are
- being added to :term:`PACKAGECONFIG`. For
- example, any name "foo" for which the following form does not exist::
- PACKAGECONFIG[foo] = "..."
- - ``la:`` Checks ``.la`` files for any :term:`TMPDIR` paths. Any ``.la``
- file containing these paths is incorrect since ``libtool`` adds the
- correct sysroot prefix when using the files automatically itself.
- - ``ldflags:`` Ensures that the binaries were linked with the
- :term:`LDFLAGS` options provided by the build system.
- If this test fails, check that the :term:`LDFLAGS` variable is being
- passed to the linker command.
- - ``libdir:`` Checks for libraries being installed into incorrect
- (possibly hardcoded) installation paths. For example, this test will
- catch recipes that install ``/lib/bar.so`` when ``${base_libdir}`` is
- "lib32". Another example is when recipes install
- ``/usr/lib64/foo.so`` when ``${libdir}`` is "/usr/lib".
- - ``libexec:`` Checks if a package contains files in
- ``/usr/libexec``. This check is not performed if the ``libexecdir``
- variable has been set explicitly to ``/usr/libexec``.
- - ``packages-list:`` Checks for the same package being listed
- multiple times through the :term:`PACKAGES` variable
- value. Installing the package in this manner can cause errors during
- packaging.
- - ``perm-config:`` Reports lines in ``fs-perms.txt`` that have an
- invalid format.
- - ``perm-line:`` Reports lines in ``fs-perms.txt`` that have an
- invalid format.
- - ``perm-link:`` Reports lines in ``fs-perms.txt`` that specify
- 'link' where the specified target already exists.
- - ``perms:`` Currently, this check is unused but reserved.
- - ``pkgconfig:`` Checks ``.pc`` files for any
- :term:`TMPDIR`/:term:`WORKDIR` paths.
- Any ``.pc`` file containing these paths is incorrect since
- ``pkg-config`` itself adds the correct sysroot prefix when the files
- are accessed.
- - ``pkgname:`` Checks that all packages in
- :term:`PACKAGES` have names that do not contain
- invalid characters (i.e. characters other than 0-9, a-z, ., +, and
- -).
- - ``pkgv-undefined:`` Checks to see if the :term:`PKGV` variable is
- undefined during :ref:`ref-tasks-package`.
- - ``pkgvarcheck:`` Checks through the variables
- :term:`RDEPENDS`,
- :term:`RRECOMMENDS`,
- :term:`RSUGGESTS`,
- :term:`RCONFLICTS`,
- :term:`RPROVIDES`,
- :term:`RREPLACES`, :term:`FILES`,
- :term:`ALLOW_EMPTY`, ``pkg_preinst``,
- ``pkg_postinst``, ``pkg_prerm`` and ``pkg_postrm``, and reports if
- there are variable sets that are not package-specific. Using these
- variables without a package suffix is bad practice, and might
- unnecessarily complicate dependencies of other packages within the
- same recipe or have other unintended consequences.
- - ``pn-overrides:`` Checks that a recipe does not have a name
- (:term:`PN`) value that appears in
- :term:`OVERRIDES`. If a recipe is named such that
- its :term:`PN` value matches something already in :term:`OVERRIDES` (e.g.
- :term:`PN` happens to be the same as :term:`MACHINE` or
- :term:`DISTRO`), it can have unexpected consequences.
- For example, assignments such as ``FILES:${PN} = "xyz"`` effectively
- turn into ``FILES = "xyz"``.
- - ``rpaths:`` Checks for rpaths in the binaries that contain build
- system paths such as :term:`TMPDIR`. If this test fails, bad ``-rpath``
- options are being passed to the linker commands and your binaries
- have potential security issues.
- - ``split-strip:`` Reports that splitting or stripping debug symbols
- from binaries has failed.
- - ``staticdev:`` Checks for static library files (``*.a``) in
- non-``staticdev`` packages.
- - ``symlink-to-sysroot:`` Checks for symlinks in packages that point
- into :term:`TMPDIR` on the host. Such symlinks will
- work on the host, but are clearly invalid when running on the target.
- - ``textrel:`` Checks for ELF binaries that contain relocations in
- their ``.text`` sections, which can result in a performance impact at
- runtime. See the explanation for the ``ELF binary`` message in
- ":doc:`/ref-manual/qa-checks`" for more information regarding runtime performance
- issues.
- - ``unlisted-pkg-lics:`` Checks that all declared licenses applying
- for a package are also declared on the recipe level (i.e. any license
- in ``LICENSE:*`` should appear in :term:`LICENSE`).
- - ``useless-rpaths:`` Checks for dynamic library load paths (rpaths)
- in the binaries that by default on a standard system are searched by
- the linker (e.g. ``/lib`` and ``/usr/lib``). While these paths will
- not cause any breakage, they do waste space and are unnecessary.
- - ``var-undefined:`` Reports when variables fundamental to packaging
- (i.e. :term:`WORKDIR`,
- :term:`DEPLOY_DIR`, :term:`D`,
- :term:`PN`, and :term:`PKGD`) are undefined
- during :ref:`ref-tasks-package`.
- - ``version-going-backwards:`` If Build History is enabled, reports
- when a package being written out has a lower version than the
- previously written package under the same name. If you are placing
- output packages into a feed and upgrading packages on a target system
- using that feed, the version of a package going backwards can result
- in the target system not correctly upgrading to the "new" version of
- the package.
- .. note::
- This is only relevant when you are using runtime package management
- on your target system.
- - ``xorg-driver-abi:`` Checks that all packages containing Xorg
- drivers have ABI dependencies. The ``xserver-xorg`` recipe provides
- driver ABI names. All drivers should depend on the ABI versions that
- they have been built against. Driver recipes that include
- ``xorg-driver-input.inc`` or ``xorg-driver-video.inc`` will
- automatically get these versions. Consequently, you should only need
- to explicitly add dependencies to binary driver recipes.
- .. _ref-classes-insserv:
- ``insserv.bbclass``
- ===================
- The :ref:`insserv <ref-classes-insserv>` class uses the ``insserv`` utility to update the order
- of symbolic links in ``/etc/rc?.d/`` within an image based on
- dependencies specified by LSB headers in the ``init.d`` scripts
- themselves.
- .. _ref-classes-kernel:
- ``kernel.bbclass``
- ==================
- The :ref:`kernel <ref-classes-kernel>` class handles building Linux kernels. The class contains
- code to build all kernel trees. All needed headers are staged into the
- :term:`STAGING_KERNEL_DIR` directory to allow out-of-tree module builds
- using the :ref:`module <ref-classes-module>` class.
- This means that each built kernel module is packaged separately and
- inter-module dependencies are created by parsing the ``modinfo`` output.
- If all modules are required, then installing the ``kernel-modules``
- package installs all packages with modules and various other kernel
- packages such as ``kernel-vmlinux``.
- The :ref:`kernel <ref-classes-kernel>` class contains logic that allows you to embed an initial
- RAM filesystem (:term:`Initramfs`) image when you build the kernel image. For
- information on how to build an :term:`Initramfs`, see the
- ":ref:`dev-manual/building:building an initial ram filesystem (Initramfs) image`" section in
- the Yocto Project Development Tasks Manual.
- Various other classes are used by the :ref:`kernel <ref-classes-kernel>` and :ref:`module <ref-classes-module>` classes
- internally including the :ref:`kernel-arch <ref-classes-kernel-arch>`,
- :ref:`module-base <ref-classes-module-base>`, and
- :ref:`linux-kernel-base <ref-classes-linux-kernel-base>` classes.
- .. _ref-classes-kernel-arch:
- ``kernel-arch.bbclass``
- =======================
- The :ref:`kernel-arch <ref-classes-kernel-arch>` class sets the ``ARCH`` environment variable for
- Linux kernel compilation (including modules).
- .. _ref-classes-kernel-devicetree:
- ``kernel-devicetree.bbclass``
- =============================
- The :ref:`kernel-devicetree <ref-classes-kernel-devicetree>` class, which is inherited by the
- :ref:`kernel <ref-classes-kernel>` class, supports device tree
- generation.
- .. _ref-classes-kernel-fitimage:
- ``kernel-fitimage.bbclass``
- ===========================
- The :ref:`kernel-fitimage <ref-classes-kernel-fitimage>` class provides support to pack a kernel image,
- device trees, a U-boot script, a Initramfs bundle and a RAM disk
- into a single FIT image. In theory, a FIT image can support any number
- of kernels, U-boot scripts, Initramfs bundles, RAM disks and device-trees.
- However, :ref:`kernel-fitimage <ref-classes-kernel-fitimage>` currently only supports
- limited usecases: just one kernel image, an optional U-boot script,
- an optional Initramfs bundle, an optional RAM disk, and any number of
- device tree.
- To create a FIT image, it is required that :term:`KERNEL_CLASSES`
- is set to include ":ref:`kernel-fitimage <ref-classes-kernel-fitimage>`" and :term:`KERNEL_IMAGETYPE`
- is set to "fitImage".
- The options for the device tree compiler passed to ``mkimage -D``
- when creating the FIT image are specified using the
- :term:`UBOOT_MKIMAGE_DTCOPTS` variable.
- Only a single kernel can be added to the FIT image created by
- :ref:`kernel-fitimage <ref-classes-kernel-fitimage>` and the kernel image in FIT is mandatory. The
- address where the kernel image is to be loaded by U-Boot is
- specified by :term:`UBOOT_LOADADDRESS` and the entrypoint by
- :term:`UBOOT_ENTRYPOINT`.
- Multiple device trees can be added to the FIT image created by
- :ref:`kernel-fitimage <ref-classes-kernel-fitimage>` and the device tree is optional.
- The address where the device tree is to be loaded by U-Boot is
- specified by :term:`UBOOT_DTBO_LOADADDRESS` for device tree overlays
- and by :term:`UBOOT_DTB_LOADADDRESS` for device tree binaries.
- Only a single RAM disk can be added to the FIT image created by
- :ref:`kernel-fitimage <ref-classes-kernel-fitimage>` and the RAM disk in FIT is optional.
- The address where the RAM disk image is to be loaded by U-Boot
- is specified by :term:`UBOOT_RD_LOADADDRESS` and the entrypoint by
- :term:`UBOOT_RD_ENTRYPOINT`. The ramdisk is added to FIT image when
- :term:`INITRAMFS_IMAGE` is specified and that :term:`INITRAMFS_IMAGE_BUNDLE`
- is set to 0.
- Only a single Initramfs bundle can be added to the FIT image created by
- :ref:`kernel-fitimage <ref-classes-kernel-fitimage>` and the Initramfs bundle in FIT is optional.
- In case of Initramfs, the kernel is configured to be bundled with the root filesystem
- in the same binary (example: zImage-initramfs-:term:`MACHINE`.bin).
- When the kernel is copied to RAM and executed, it unpacks the Initramfs root filesystem.
- The Initramfs bundle can be enabled when :term:`INITRAMFS_IMAGE`
- is specified and that :term:`INITRAMFS_IMAGE_BUNDLE` is set to 1.
- The address where the Initramfs bundle is to be loaded by U-boot is specified
- by :term:`UBOOT_LOADADDRESS` and the entrypoint by :term:`UBOOT_ENTRYPOINT`.
- Only a single U-boot boot script can be added to the FIT image created by
- :ref:`kernel-fitimage <ref-classes-kernel-fitimage>` and the boot script is optional.
- The boot script is specified in the ITS file as a text file containing
- U-boot commands. When using a boot script the user should configure the
- U-boot :ref:`ref-tasks-install` task to copy the script to sysroot.
- So the script can be included in the FIT image by the :ref:`kernel-fitimage <ref-classes-kernel-fitimage>`
- class. At run-time, U-boot CONFIG_BOOTCOMMAND define can be configured to
- load the boot script from the FIT image and executes it.
- The FIT image generated by :ref:`kernel-fitimage <ref-classes-kernel-fitimage>` class is signed when the
- variables :term:`UBOOT_SIGN_ENABLE`, :term:`UBOOT_MKIMAGE_DTCOPTS`,
- :term:`UBOOT_SIGN_KEYDIR` and :term:`UBOOT_SIGN_KEYNAME` are set
- appropriately. The default values used for :term:`FIT_HASH_ALG` and
- :term:`FIT_SIGN_ALG` in :ref:`kernel-fitimage <ref-classes-kernel-fitimage>` are "sha256" and
- "rsa2048" respectively. The keys for signing fitImage can be generated using
- the :ref:`kernel-fitimage <ref-classes-kernel-fitimage>` class when both :term:`FIT_GENERATE_KEYS` and
- :term:`UBOOT_SIGN_ENABLE` are set to "1".
- .. _ref-classes-kernel-grub:
- ``kernel-grub.bbclass``
- =======================
- The :ref:`kernel-grub <ref-classes-kernel-grub>` class updates the boot area and the boot menu with
- the kernel as the priority boot mechanism while installing a RPM to
- update the kernel on a deployed target.
- .. _ref-classes-kernel-module-split:
- ``kernel-module-split.bbclass``
- ===============================
- The :ref:`kernel-module-split <ref-classes-kernel-module-split>` class provides common functionality for
- splitting Linux kernel modules into separate packages.
- .. _ref-classes-kernel-uboot:
- ``kernel-uboot.bbclass``
- ========================
- The :ref:`kernel-uboot <ref-classes-kernel-uboot>` class provides support for building from
- vmlinux-style kernel sources.
- .. _ref-classes-kernel-uimage:
- ``kernel-uimage.bbclass``
- =========================
- The :ref:`kernel-uimage <ref-classes-kernel-uimage>` class provides support to pack uImage.
- .. _ref-classes-kernel-yocto:
- ``kernel-yocto.bbclass``
- ========================
- The :ref:`kernel-yocto <ref-classes-kernel-yocto>` class provides common functionality for building
- from linux-yocto style kernel source repositories.
- .. _ref-classes-kernelsrc:
- ``kernelsrc.bbclass``
- =====================
- The :ref:`kernelsrc <ref-classes-kernelsrc>` class sets the Linux kernel source and version.
- .. _ref-classes-lib_package:
- ``lib_package.bbclass``
- =======================
- The :ref:`lib_package <ref-classes-lib_package>` class supports recipes that build libraries and
- produce executable binaries, where those binaries should not be
- installed by default along with the library. Instead, the binaries are
- added to a separate ``${``\ :term:`PN`\ ``}-bin`` package to
- make their installation optional.
- .. _ref-classes-libc*:
- ``libc*.bbclass``
- =================
- The :ref:`libc* <ref-classes-libc*>` classes support recipes that build packages with ``libc``:
- - The :ref:`libc-common <ref-classes-libc*>` class provides common support for building with
- ``libc``.
- - The :ref:`libc-package <ref-classes-libc*>` class supports packaging up ``glibc`` and
- ``eglibc``.
- .. _ref-classes-license:
- ``license.bbclass``
- ===================
- The :ref:`license <ref-classes-license>` class provides license manifest creation and license
- exclusion. This class is enabled by default using the default value for
- the :term:`INHERIT_DISTRO` variable.
- .. _ref-classes-linux-kernel-base:
- ``linux-kernel-base.bbclass``
- =============================
- The :ref:`linux-kernel-base <ref-classes-linux-kernel-base>` class provides common functionality for
- recipes that build out of the Linux kernel source tree. These builds
- goes beyond the kernel itself. For example, the Perf recipe also
- inherits this class.
- .. _ref-classes-linuxloader:
- ``linuxloader.bbclass``
- =======================
- Provides the function ``linuxloader()``, which gives the value of the
- dynamic loader/linker provided on the platform. This value is used by a
- number of other classes.
- .. _ref-classes-logging:
- ``logging.bbclass``
- ===================
- The :ref:`logging <ref-classes-logging>` class provides the standard shell functions used to log
- messages for various BitBake severity levels (i.e. ``bbplain``,
- ``bbnote``, ``bbwarn``, ``bberror``, ``bbfatal``, and ``bbdebug``).
- This class is enabled by default since it is inherited by the :ref:`base <ref-classes-base>`
- class.
- .. _ref-classes-metadata_scm:
- ``metadata_scm.bbclass``
- ========================
- The :ref:`metadata_scm <ref-classes-metadata_scm>` class provides functionality for querying the
- branch and revision of a Source Code Manager (SCM) repository.
- The :ref:`base <ref-classes-base>` class uses this class to print the
- revisions of each layer before starting every build. The
- :ref:`metadata_scm <ref-classes-metadata_scm>` class is enabled by default because it is inherited by
- the :ref:`base <ref-classes-base>` class.
- .. _ref-classes-migrate_localcount:
- ``migrate_localcount.bbclass``
- ==============================
- The :ref:`migrate_localcount <ref-classes-migrate_localcount>` class verifies a recipe's localcount data and
- increments it appropriately.
- .. _ref-classes-mime:
- ``mime.bbclass``
- ================
- The :ref:`mime <ref-classes-mime>` class generates the proper post-install and post-remove
- (postinst/postrm) scriptlets for packages that install MIME type files.
- These scriptlets call ``update-mime-database`` to add the MIME types to
- the shared database.
- .. _ref-classes-mime-xdg:
- ``mime-xdg.bbclass``
- ====================
- The :ref:`mime-xdg <ref-classes-mime-xdg>` class generates the proper
- post-install and post-remove (postinst/postrm) scriptlets for packages
- that install ``.desktop`` files containing ``MimeType`` entries.
- These scriptlets call ``update-desktop-database`` to add the MIME types
- to the database of MIME types handled by desktop files.
- Thanks to this class, when users open a file through a file browser
- on recently created images, they don't have to choose the application
- to open the file from the pool of all known applications, even the ones
- that cannot open the selected file.
- If you have recipes installing their ``.desktop`` files as absolute
- symbolic links, the detection of such files cannot be done by the current
- implementation of this class. In this case, you have to add the corresponding
- package names to the :term:`MIME_XDG_PACKAGES` variable.
- .. _ref-classes-mirrors:
- ``mirrors.bbclass``
- ===================
- The :ref:`mirrors <ref-classes-mirrors>` class sets up some standard
- :term:`MIRRORS` entries for source code mirrors. These
- mirrors provide a fall-back path in case the upstream source specified
- in :term:`SRC_URI` within recipes is unavailable.
- This class is enabled by default since it is inherited by the
- :ref:`base <ref-classes-base>` class.
- .. _ref-classes-module:
- ``module.bbclass``
- ==================
- The :ref:`module <ref-classes-module>` class provides support for building out-of-tree Linux
- kernel modules. The class inherits the
- :ref:`module-base <ref-classes-module-base>` and
- :ref:`kernel-module-split <ref-classes-kernel-module-split>` classes,
- and implements the :ref:`ref-tasks-compile` and
- :ref:`ref-tasks-install` tasks. The class provides
- everything needed to build and package a kernel module.
- For general information on out-of-tree Linux kernel modules, see the
- ":ref:`kernel-dev/common:incorporating out-of-tree modules`"
- section in the Yocto Project Linux Kernel Development Manual.
- .. _ref-classes-module-base:
- ``module-base.bbclass``
- =======================
- The :ref:`module-base <ref-classes-module-base>` class provides the base functionality for building
- Linux kernel modules. Typically, a recipe that builds software that
- includes one or more kernel modules and has its own means of building
- the module inherits this class as opposed to inheriting the
- :ref:`module <ref-classes-module>` class.
- .. _ref-classes-multilib*:
- ``multilib*.bbclass``
- =====================
- The :ref:`multilib* <ref-classes-multilib*>` classes provide support for building libraries with
- different target optimizations or target architectures and installing
- them side-by-side in the same image.
- For more information on using the Multilib feature, see the
- ":ref:`dev-manual/libraries:combining multiple versions of library files into one image`"
- section in the Yocto Project Development Tasks Manual.
- .. _ref-classes-native:
- ``native.bbclass``
- ==================
- The :ref:`native <ref-classes-native>` class provides common functionality for recipes that
- build tools to run on the :term:`Build Host` (i.e. tools that use the compiler
- or other tools from the build host).
- You can create a recipe that builds tools that run natively on the host
- a couple different ways:
- - Create a ``myrecipe-native.bb`` recipe that inherits the :ref:`native <ref-classes-native>`
- class. If you use this method, you must order the inherit statement
- in the recipe after all other inherit statements so that the
- :ref:`native <ref-classes-native>` class is inherited last.
- .. note::
- When creating a recipe this way, the recipe name must follow this
- naming convention::
- myrecipe-native.bb
- Not using this naming convention can lead to subtle problems
- caused by existing code that depends on that naming convention.
- - Create or modify a target recipe that contains the following::
- BBCLASSEXTEND = "native"
- Inside the
- recipe, use ``:class-native`` and ``:class-target`` overrides to
- specify any functionality specific to the respective native or target
- case.
- Although applied differently, the :ref:`native <ref-classes-native>` class is used with both
- methods. The advantage of the second method is that you do not need to
- have two separate recipes (assuming you need both) for native and
- target. All common parts of the recipe are automatically shared.
- .. _ref-classes-nativesdk:
- ``nativesdk.bbclass``
- =====================
- The :ref:`nativesdk <ref-classes-nativesdk>` class provides common functionality for recipes that
- wish to build tools to run as part of an SDK (i.e. tools that run on
- :term:`SDKMACHINE`).
- You can create a recipe that builds tools that run on the SDK machine a
- couple different ways:
- - Create a ``nativesdk-myrecipe.bb`` recipe that inherits the
- :ref:`nativesdk <ref-classes-nativesdk>` class. If you use this method, you must order the
- inherit statement in the recipe after all other inherit statements so
- that the :ref:`nativesdk <ref-classes-nativesdk>` class is inherited last.
- - Create a :ref:`nativesdk <ref-classes-nativesdk>` variant of any recipe by adding the following::
- BBCLASSEXTEND = "nativesdk"
- Inside the
- recipe, use ``:class-nativesdk`` and ``:class-target`` overrides to
- specify any functionality specific to the respective SDK machine or
- target case.
- .. note::
- When creating a recipe, you must follow this naming convention::
- nativesdk-myrecipe.bb
- Not doing so can lead to subtle problems because there is code that
- depends on the naming convention.
- Although applied differently, the :ref:`nativesdk <ref-classes-nativesdk>` class is used with both
- methods. The advantage of the second method is that you do not need to
- have two separate recipes (assuming you need both) for the SDK machine
- and the target. All common parts of the recipe are automatically shared.
- .. _ref-classes-nopackages:
- ``nopackages.bbclass``
- ======================
- Disables packaging tasks for those recipes and classes where packaging
- is not needed.
- .. _ref-classes-npm:
- ``npm.bbclass``
- ===============
- Provides support for building Node.js software fetched using the
- :wikipedia:`node package manager (NPM) <Npm_(software)>`.
- .. note::
- Currently, recipes inheriting this class must use the ``npm://``
- fetcher to have dependencies fetched and packaged automatically.
- For information on how to create NPM packages, see the
- ":ref:`dev-manual/packages:creating node package manager (npm) packages`"
- section in the Yocto Project Development Tasks Manual.
- .. _ref-classes-oelint:
- ``oelint.bbclass``
- ==================
- The :ref:`oelint <ref-classes-oelint>` class is an obsolete lint checking tool available in
- ``meta/classes`` in the :term:`Source Directory`.
- There are some classes that could be generally useful in OE-Core but
- are never actually used within OE-Core itself. The :ref:`oelint <ref-classes-oelint>` class is
- one such example. However, being aware of this class can reduce the
- proliferation of different versions of similar classes across multiple
- layers.
- .. _ref-classes-overlayfs:
- ``overlayfs.bbclass``
- =======================
- It's often desired in Embedded System design to have a read-only root filesystem.
- But a lot of different applications might want to have read-write access to
- some parts of a filesystem. It can be especially useful when your update mechanism
- overwrites the whole root filesystem, but you may want your application data to be preserved
- between updates. The :ref:`overlayfs <ref-classes-overlayfs>` class provides a way
- to achieve that by means of ``overlayfs`` and at the same time keeping the base
- root filesystem read-only.
- To use this class, set a mount point for a partition ``overlayfs`` is going to use as upper
- layer in your machine configuration. The underlying file system can be anything that
- is supported by ``overlayfs``. This has to be done in your machine configuration::
- OVERLAYFS_MOUNT_POINT[data] = "/data"
- .. note::
- * QA checks fail to catch file existence if you redefine this variable in your recipe!
- * Only the existence of the systemd mount unit file is checked, not its contents.
- * To get more details on ``overlayfs``, its internals and supported operations, please refer
- to the official documentation of the `Linux kernel <https://www.kernel.org/doc/html/latest/filesystems/overlayfs.html>`__.
- The class assumes you have a ``data.mount`` systemd unit defined elsewhere in your BSP
- (e.g. in ``systemd-machine-units`` recipe) and it's installed into the image.
- Then you can specify writable directories on a recipe basis (e.g. in my-application.bb)::
- OVERLAYFS_WRITABLE_PATHS[data] = "/usr/share/my-custom-application"
- To support several mount points you can use a different variable flag. Assuming we
- want to have a writable location on the file system, but do not need that the data
- survives a reboot, then we could have a ``mnt-overlay.mount`` unit for a ``tmpfs``
- file system.
- In your machine configuration::
- OVERLAYFS_MOUNT_POINT[mnt-overlay] = "/mnt/overlay"
- and then in your recipe::
- OVERLAYFS_WRITABLE_PATHS[mnt-overlay] = "/usr/share/another-application"
- On a practical note, your application recipe might require multiple
- overlays to be mounted before running to avoid writing to the underlying
- file system (which can be forbidden in case of read-only file system)
- To achieve that :ref:`overlayfs <ref-classes-overlayfs>` provides a ``systemd``
- helper service for mounting overlays. This helper service is named
- ``${PN}-overlays.service`` and can be depended on in your application recipe
- (named ``application`` in the following example) ``systemd`` unit by adding
- to the unit the following::
- [Unit]
- After=application-overlays.service
- Requires=application-overlays.service
- .. note::
- The class does not support the ``/etc`` directory itself, because ``systemd`` depends on it.
- In order to get ``/etc`` in overlayfs, see :ref:`overlayfs-etc <ref-classes-overlayfs-etc>`.
- .. _ref-classes-overlayfs-etc:
- ``overlayfs-etc.bbclass``
- =========================
- In order to have the ``/etc`` directory in overlayfs a special handling at early
- boot stage is required. The idea is to supply a custom init script that mounts
- ``/etc`` before launching the actual init program, because the latter already
- requires ``/etc`` to be mounted.
- Example usage in image recipe::
- IMAGE_FEATURES += "overlayfs-etc"
- .. note::
- This class must not be inherited directly. Use :term:`IMAGE_FEATURES` or :term:`EXTRA_IMAGE_FEATURES`
- Your machine configuration should define at least the device, mount point, and file system type
- you are going to use for ``overlayfs``::
- OVERLAYFS_ETC_MOUNT_POINT = "/data"
- OVERLAYFS_ETC_DEVICE = "/dev/mmcblk0p2"
- OVERLAYFS_ETC_FSTYPE ?= "ext4"
- To control more mount options you should consider setting mount options
- (``defaults`` is used by default)::
- OVERLAYFS_ETC_MOUNT_OPTIONS = "wsync"
- The class provides two options for ``/sbin/init`` generation:
- - The default option is to rename the original ``/sbin/init`` to ``/sbin/init.orig``
- and place the generated init under original name, i.e. ``/sbin/init``. It has an advantage
- that you won't need to change any kernel parameters in order to make it work,
- but it poses a restriction that package-management can't be used, because updating
- the init manager would remove the generated script.
- - If you wish to keep original init as is, you can set::
- OVERLAYFS_ETC_USE_ORIG_INIT_NAME = "0"
- Then the generated init will be named ``/sbin/preinit`` and you would need to extend your
- kernel parameters manually in your bootloader configuration.
- .. _ref-classes-own-mirrors:
- ``own-mirrors.bbclass``
- =======================
- The :ref:`own-mirrors <ref-classes-own-mirrors>` class makes it easier to set up your own
- :term:`PREMIRRORS` from which to first fetch source
- before attempting to fetch it from the upstream specified in
- :term:`SRC_URI` within each recipe.
- To use this class, inherit it globally and specify
- :term:`SOURCE_MIRROR_URL`. Here is an example::
- INHERIT += "own-mirrors"
- SOURCE_MIRROR_URL = "http://example.com/my-source-mirror"
- You can specify only a single URL
- in :term:`SOURCE_MIRROR_URL`.
- .. _ref-classes-package:
- ``package.bbclass``
- ===================
- The :ref:`package <ref-classes-package>` class supports generating packages from a build's
- output. The core generic functionality is in ``package.bbclass``. The
- code specific to particular package types resides in these
- package-specific classes:
- :ref:`package_deb <ref-classes-package_deb>`,
- :ref:`package_rpm <ref-classes-package_rpm>`,
- :ref:`package_ipk <ref-classes-package_ipk>`, and
- :ref:`package_tar <ref-classes-package_tar>`.
- .. note::
- The :ref:`package_tar <ref-classes-package_tar>` class is broken and
- not supported. It is recommended that you do not use this class.
- You can control the list of resulting package formats by using the
- :term:`PACKAGE_CLASSES` variable defined in your ``conf/local.conf``
- configuration file, which is located in the :term:`Build Directory`.
- When defining the variable, you can specify one or more package types.
- Since images are generated from packages, a packaging class is needed
- to enable image generation. The first class listed in this variable is
- used for image generation.
- If you take the optional step to set up a repository (package feed) on
- the development host that can be used by DNF, you can install packages
- from the feed while you are running the image on the target (i.e.
- runtime installation of packages). For more information, see the
- ":ref:`dev-manual/packages:using runtime package management`"
- section in the Yocto Project Development Tasks Manual.
- The package-specific class you choose can affect build-time performance
- and has space ramifications. In general, building a package with IPK
- takes about thirty percent less time as compared to using RPM to build
- the same or similar package. This comparison takes into account a
- complete build of the package with all dependencies previously built.
- The reason for this discrepancy is because the RPM package manager
- creates and processes more :term:`Metadata` than the IPK package
- manager. Consequently, you might consider setting :term:`PACKAGE_CLASSES` to
- ":ref:`package_ipk <ref-classes-package_ipk>`" if you are building smaller systems.
- Before making your package manager decision, however, you should
- consider some further things about using RPM:
- - RPM starts to provide more abilities than IPK due to the fact that it
- processes more Metadata. For example, this information includes
- individual file types, file checksum generation and evaluation on
- install, sparse file support, conflict detection and resolution for
- Multilib systems, ACID style upgrade, and repackaging abilities for
- rollbacks.
- - For smaller systems, the extra space used for the Berkeley Database
- and the amount of metadata when using RPM can affect your ability to
- perform on-device upgrades.
- You can find additional information on the effects of the package class
- at these two Yocto Project mailing list links:
- - :yocto_lists:`/pipermail/poky/2011-May/006362.html`
- - :yocto_lists:`/pipermail/poky/2011-May/006363.html`
- .. _ref-classes-package_deb:
- ``package_deb.bbclass``
- =======================
- The :ref:`package_deb <ref-classes-package_deb>` class provides support for creating packages that
- use the Debian (i.e. ``.deb``) file format. The class ensures the
- packages are written out in a ``.deb`` file format to the
- ``${``\ :term:`DEPLOY_DIR_DEB`\ ``}`` directory.
- This class inherits the :ref:`package <ref-classes-package>` class and
- is enabled through the :term:`PACKAGE_CLASSES`
- variable in the ``local.conf`` file.
- .. _ref-classes-package_ipk:
- ``package_ipk.bbclass``
- =======================
- The :ref:`package_ipk <ref-classes-package_ipk>` class provides support for creating packages that
- use the IPK (i.e. ``.ipk``) file format. The class ensures the packages
- are written out in a ``.ipk`` file format to the
- ``${``\ :term:`DEPLOY_DIR_IPK`\ ``}`` directory.
- This class inherits the :ref:`package <ref-classes-package>` class and
- is enabled through the :term:`PACKAGE_CLASSES`
- variable in the ``local.conf`` file.
- .. _ref-classes-package_rpm:
- ``package_rpm.bbclass``
- =======================
- The :ref:`package_rpm <ref-classes-package_rpm>` class provides support for creating packages that
- use the RPM (i.e. ``.rpm``) file format. The class ensures the packages
- are written out in a ``.rpm`` file format to the
- ``${``\ :term:`DEPLOY_DIR_RPM`\ ``}`` directory.
- This class inherits the :ref:`package <ref-classes-package>` class and
- is enabled through the :term:`PACKAGE_CLASSES`
- variable in the ``local.conf`` file.
- .. _ref-classes-package_tar:
- ``package_tar.bbclass``
- =======================
- The :ref:`package_tar <ref-classes-package_tar>` class provides support for creating tarballs. The
- class ensures the packages are written out in a tarball format to the
- ``${``\ :term:`DEPLOY_DIR_TAR`\ ``}`` directory.
- This class inherits the :ref:`package <ref-classes-package>` class and
- is enabled through the :term:`PACKAGE_CLASSES`
- variable in the ``local.conf`` file.
- .. note::
- You cannot specify the :ref:`package_tar <ref-classes-package_tar>` class first using the
- :term:`PACKAGE_CLASSES` variable. You must use ``.deb``, ``.ipk``, or ``.rpm``
- file formats for your image or SDK.
- .. _ref-classes-packagedata:
- ``packagedata.bbclass``
- =======================
- The :ref:`packagedata <ref-classes-packagedata>` class provides common functionality for reading
- ``pkgdata`` files found in :term:`PKGDATA_DIR`. These
- files contain information about each output package produced by the
- OpenEmbedded build system.
- This class is enabled by default because it is inherited by the
- :ref:`package <ref-classes-package>` class.
- .. _ref-classes-packagegroup:
- ``packagegroup.bbclass``
- ========================
- The :ref:`packagegroup <ref-classes-packagegroup>` class sets default values appropriate for package
- group recipes (e.g. :term:`PACKAGES`, :term:`PACKAGE_ARCH`, :term:`ALLOW_EMPTY`, and
- so forth). It is highly recommended that all package group recipes
- inherit this class.
- For information on how to use this class, see the
- ":ref:`dev-manual/customizing-images:customizing images using custom package groups`"
- section in the Yocto Project Development Tasks Manual.
- Previously, this class was called the ``task`` class.
- .. _ref-classes-patch:
- ``patch.bbclass``
- =================
- The :ref:`patch <ref-classes-patch>` class provides all functionality for applying patches
- during the :ref:`ref-tasks-patch` task.
- This class is enabled by default because it is inherited by the
- :ref:`base <ref-classes-base>` class.
- .. _ref-classes-perlnative:
- ``perlnative.bbclass``
- ======================
- When inherited by a recipe, the :ref:`perlnative <ref-classes-perlnative>` class supports using the
- native version of Perl built by the build system rather than using the
- version provided by the build host.
- .. _ref-classes-pypi:
- ``pypi.bbclass``
- ================
- The :ref:`pypi <ref-classes-pypi>` class sets variables appropriately for recipes that build
- Python modules from `PyPI <https://pypi.org/>`__, the Python Package Index.
- By default it determines the PyPI package name based upon :term:`BPN`
- (stripping the "python-" or "python3-" prefix off if present), however in
- some cases you may need to set it manually in the recipe by setting
- :term:`PYPI_PACKAGE`.
- Variables set by the :ref:`pypi <ref-classes-pypi>` class include :term:`SRC_URI`, :term:`SECTION`,
- :term:`HOMEPAGE`, :term:`UPSTREAM_CHECK_URI`, :term:`UPSTREAM_CHECK_REGEX`
- and :term:`CVE_PRODUCT`.
- .. _ref-classes-python_flit_core:
- ``python_flit_core.bbclass``
- ============================
- The :ref:`python_flit_core <ref-classes-python_flit_core>` class enables building Python modules which declare
- the `PEP-517 <https://www.python.org/dev/peps/pep-0517/>`__ compliant
- ``flit_core.buildapi`` ``build-backend`` in the ``[build-system]``
- section of ``pyproject.toml`` (See `PEP-518 <https://www.python.org/dev/peps/pep-0518/>`__).
- Python modules built with ``flit_core.buildapi`` are pure Python (no
- ``C`` or ``Rust`` extensions).
- Internally this uses the :ref:`python_pep517 <ref-classes-python_pep517>` class.
- .. _ref-classes-python_pep517:
- ``python_pep517.bbclass``
- =========================
- The :ref:`python_pep517 <ref-classes-python_pep517>` class builds and installs a Python ``wheel`` binary
- archive (see `PEP-517 <https://peps.python.org/pep-0517/>`__).
- Recipes wouldn't inherit this directly, instead typically another class will
- inherit this and add the relevant native dependencies.
- Examples of classes which do this are :ref:`python_flit_core
- <ref-classes-python_flit_core>`, :ref:`python_setuptools_build_meta
- <ref-classes-python_setuptools_build_meta>`, and :ref:`python_poetry_core
- <ref-classes-python_poetry_core>`.
- .. _ref-classes-python_poetry_core:
- ``python_poetry_core.bbclass``
- ==============================
- The :ref:`python_poetry_core <ref-classes-python_poetry_core>` class enables building Python modules which use the
- `Poetry Core <https://python-poetry.org>`__ build system.
- Internally this uses the :ref:`python_pep517 <ref-classes-python_pep517>` class.
- .. _ref-classes-pixbufcache:
- ``pixbufcache.bbclass``
- =======================
- The :ref:`pixbufcache <ref-classes-pixbufcache>` class generates the proper post-install and
- post-remove (postinst/postrm) scriptlets for packages that install
- pixbuf loaders, which are used with ``gdk-pixbuf``. These scriptlets
- call ``update_pixbuf_cache`` to add the pixbuf loaders to the cache.
- Since the cache files are architecture-specific, ``update_pixbuf_cache``
- is run using QEMU if the postinst scriptlets need to be run on the build
- host during image creation.
- If the pixbuf loaders being installed are in packages other than the
- recipe's main package, set
- :term:`PIXBUF_PACKAGES` to specify the packages
- containing the loaders.
- .. _ref-classes-pkgconfig:
- ``pkgconfig.bbclass``
- =====================
- The :ref:`pkgconfig <ref-classes-pkgconfig>` class provides a standard way to get header and
- library information by using ``pkg-config``. This class aims to smooth
- integration of ``pkg-config`` into libraries that use it.
- During staging, BitBake installs ``pkg-config`` data into the
- ``sysroots/`` directory. By making use of sysroot functionality within
- ``pkg-config``, the :ref:`pkgconfig <ref-classes-pkgconfig>` class no longer has to manipulate the
- files.
- .. _ref-classes-populate-sdk:
- ``populate_sdk.bbclass``
- ========================
- The :ref:`populate_sdk <ref-classes-populate-sdk>` class provides support for SDK-only recipes. For
- information on advantages gained when building a cross-development
- toolchain using the :ref:`ref-tasks-populate_sdk`
- task, see the ":ref:`sdk-manual/appendix-obtain:building an sdk installer`"
- section in the Yocto Project Application Development and the Extensible
- Software Development Kit (eSDK) manual.
- .. _ref-classes-populate-sdk-*:
- ``populate_sdk_*.bbclass``
- ==========================
- The :ref:`populate_sdk_* <ref-classes-populate-sdk-*>` classes support SDK creation and consist of the
- following classes:
- - :ref:`populate_sdk_base <ref-classes-populate-sdk-*>`: The base class supporting SDK creation under
- all package managers (i.e. DEB, RPM, and opkg).
- - :ref:`populate_sdk_deb <ref-classes-populate-sdk-*>`: Supports creation of the SDK given the Debian
- package manager.
- - :ref:`populate_sdk_rpm <ref-classes-populate-sdk-*>`: Supports creation of the SDK given the RPM
- package manager.
- - :ref:`populate_sdk_ipk <ref-classes-populate-sdk-*>`: Supports creation of the SDK given the opkg
- (IPK format) package manager.
- - :ref:`populate_sdk_ext <ref-classes-populate-sdk-*>`: Supports extensible SDK creation under all
- package managers.
- The :ref:`populate_sdk_base <ref-classes-populate-sdk-*>` class inherits the appropriate
- ``populate_sdk_*`` (i.e. ``deb``, ``rpm``, and ``ipk``) based on
- :term:`IMAGE_PKGTYPE`.
- The base class ensures all source and destination directories are
- established and then populates the SDK. After populating the SDK, the
- :ref:`populate_sdk_base <ref-classes-populate-sdk-*>` class constructs two sysroots:
- ``${``\ :term:`SDK_ARCH`\ ``}-nativesdk``, which
- contains the cross-compiler and associated tooling, and the target,
- which contains a target root filesystem that is configured for the SDK
- usage. These two images reside in :term:`SDK_OUTPUT`,
- which consists of the following::
- ${SDK_OUTPUT}/${SDK_ARCH}-nativesdk-pkgs
- ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/target-pkgs
- Finally, the base populate SDK class creates the toolchain environment
- setup script, the tarball of the SDK, and the installer.
- The respective :ref:`populate_sdk_deb <ref-classes-populate-sdk-*>`, :ref:`populate_sdk_rpm <ref-classes-populate-sdk-*>`, and
- :ref:`populate_sdk_ipk <ref-classes-populate-sdk-*>` classes each support the specific type of SDK.
- These classes are inherited by and used with the :ref:`populate_sdk_base <ref-classes-populate-sdk-*>`
- class.
- For more information on the cross-development toolchain generation, see
- the ":ref:`overview-manual/concepts:cross-development toolchain generation`"
- section in the Yocto Project Overview and Concepts Manual. For
- information on advantages gained when building a cross-development
- toolchain using the :ref:`ref-tasks-populate_sdk`
- task, see the
- ":ref:`sdk-manual/appendix-obtain:building an sdk installer`"
- section in the Yocto Project Application Development and the Extensible
- Software Development Kit (eSDK) manual.
- .. _ref-classes-prexport:
- ``prexport.bbclass``
- ====================
- The :ref:`prexport <ref-classes-prexport>` class provides functionality for exporting
- :term:`PR` values.
- .. note::
- This class is not intended to be used directly. Rather, it is enabled
- when using "``bitbake-prserv-tool export``".
- .. _ref-classes-primport:
- ``primport.bbclass``
- ====================
- The :ref:`primport <ref-classes-primport>` class provides functionality for importing
- :term:`PR` values.
- .. note::
- This class is not intended to be used directly. Rather, it is enabled
- when using "``bitbake-prserv-tool import``".
- .. _ref-classes-prserv:
- ``prserv.bbclass``
- ==================
- The :ref:`prserv <ref-classes-prserv>` class provides functionality for using a :ref:`PR
- service <dev-manual/packages:working with a pr service>` in order to
- automatically manage the incrementing of the :term:`PR`
- variable for each recipe.
- This class is enabled by default because it is inherited by the
- :ref:`package <ref-classes-package>` class. However, the OpenEmbedded
- build system will not enable the functionality of this class unless
- :term:`PRSERV_HOST` has been set.
- .. _ref-classes-ptest:
- ``ptest.bbclass``
- =================
- The :ref:`ptest <ref-classes-ptest>` class provides functionality for packaging and installing
- runtime tests for recipes that build software that provides these tests.
- This class is intended to be inherited by individual recipes. However,
- the class' functionality is largely disabled unless "ptest" appears in
- :term:`DISTRO_FEATURES`. See the
- ":ref:`dev-manual/packages:testing packages with ptest`"
- section in the Yocto Project Development Tasks Manual for more information
- on ptest.
- .. _ref-classes-ptest-gnome:
- ``ptest-gnome.bbclass``
- =======================
- Enables package tests (ptests) specifically for GNOME packages, which
- have tests intended to be executed with ``gnome-desktop-testing``.
- For information on setting up and running ptests, see the
- ":ref:`dev-manual/packages:testing packages with ptest`"
- section in the Yocto Project Development Tasks Manual.
- .. _ref-classes-python3-dir:
- ``python3-dir.bbclass``
- =======================
- The :ref:`python3-dir <ref-classes-python3-dir>` class provides the base version, location, and site
- package location for Python 3.
- .. _ref-classes-python3native:
- ``python3native.bbclass``
- =========================
- The :ref:`python3native <ref-classes-python3native>` class supports using the native version of Python
- 3 built by the build system rather than support of the version provided
- by the build host.
- .. _ref-classes-python3targetconfig:
- ``python3targetconfig.bbclass``
- ===============================
- The :ref:`python3targetconfig <ref-classes-python3targetconfig>` class supports using the native version of Python
- 3 built by the build system rather than support of the version provided
- by the build host, except that the configuration for the target machine
- is accessible (such as correct installation directories). This also adds a
- dependency on target ``python3``, so should only be used where appropriate
- in order to avoid unnecessarily lengthening builds.
- .. _ref-classes-qemu:
- ``qemu.bbclass``
- ================
- The :ref:`qemu <ref-classes-qemu>` class provides functionality for recipes that either need
- QEMU or test for the existence of QEMU. Typically, this class is used to
- run programs for a target system on the build host using QEMU's
- application emulation mode.
- .. _ref-classes-recipe_sanity:
- ``recipe_sanity.bbclass``
- =========================
- The :ref:`recipe_sanity <ref-classes-recipe_sanity>` class checks for the presence of any host system
- recipe prerequisites that might affect the build (e.g. variables that
- are set or software that is present).
- .. _ref-classes-relocatable:
- ``relocatable.bbclass``
- =======================
- The :ref:`relocatable <ref-classes-relocatable>` class enables relocation of binaries when they are
- installed into the sysroot.
- This class makes use of the :ref:`chrpath <ref-classes-chrpath>` class
- and is used by both the :ref:`cross <ref-classes-cross>` and
- :ref:`native <ref-classes-native>` classes.
- .. _ref-classes-remove-libtool:
- ``remove-libtool.bbclass``
- ==========================
- The :ref:`remove-libtool <ref-classes-remove-libtool>` class adds a post function to the
- :ref:`ref-tasks-install` task to remove all ``.la`` files
- installed by ``libtool``. Removing these files results in them being
- absent from both the sysroot and target packages.
- If a recipe needs the ``.la`` files to be installed, then the recipe can
- override the removal by setting ``REMOVE_LIBTOOL_LA`` to "0" as follows::
- REMOVE_LIBTOOL_LA = "0"
- .. note::
- The :ref:`remove-libtool <ref-classes-remove-libtool>` class is not enabled by default.
- .. _ref-classes-report-error:
- ``report-error.bbclass``
- ========================
- The :ref:`report-error <ref-classes-report-error>` class supports enabling the :ref:`error reporting
- tool <dev-manual/error-reporting-tool:using the error reporting tool>`",
- which allows you to submit build error information to a central database.
- The class collects debug information for recipe, recipe version, task,
- machine, distro, build system, target system, host distro, branch,
- commit, and log. From the information, report files using a JSON format
- are created and stored in
- ``${``\ :term:`LOG_DIR`\ ``}/error-report``.
- .. _ref-classes-rm-work:
- ``rm_work.bbclass``
- ===================
- The :ref:`rm_work <ref-classes-rm-work>` class supports deletion of temporary workspace, which
- can ease your hard drive demands during builds.
- The OpenEmbedded build system can use a substantial amount of disk space
- during the build process. A portion of this space is the work files
- under the ``${TMPDIR}/work`` directory for each recipe. Once the build
- system generates the packages for a recipe, the work files for that
- recipe are no longer needed. However, by default, the build system
- preserves these files for inspection and possible debugging purposes. If
- you would rather have these files deleted to save disk space as the
- build progresses, you can enable :ref:`rm_work <ref-classes-rm-work>` by adding the following to
- your ``local.conf`` file, which is found in the :term:`Build Directory`::
- INHERIT += "rm_work"
- If you are
- modifying and building source code out of the work directory for a
- recipe, enabling :ref:`rm_work <ref-classes-rm-work>` will potentially result in your changes to
- the source being lost. To exclude some recipes from having their work
- directories deleted by :ref:`rm_work <ref-classes-rm-work>`, you can add the names of the recipe
- or recipes you are working on to the :term:`RM_WORK_EXCLUDE` variable, which
- can also be set in your ``local.conf`` file. Here is an example::
- RM_WORK_EXCLUDE += "busybox glibc"
- .. _ref-classes-rootfs*:
- ``rootfs*.bbclass``
- ===================
- The :ref:`rootfs* <ref-classes-rootfs*>` classes support creating the root filesystem for an
- image and consist of the following classes:
- - The :ref:`rootfs-postcommands <ref-classes-rootfs*>` class, which defines filesystem
- post-processing functions for image recipes.
- - The :ref:`rootfs_deb <ref-classes-rootfs*>` class, which supports creation of root filesystems
- for images built using ``.deb`` packages.
- - The :ref:`rootfs_rpm <ref-classes-rootfs*>` class, which supports creation of root filesystems
- for images built using ``.rpm`` packages.
- - The :ref:`rootfs_ipk <ref-classes-rootfs*>` class, which supports creation of root filesystems
- for images built using ``.ipk`` packages.
- - The :ref:`rootfsdebugfiles <ref-classes-rootfs*>` class, which installs additional files found
- on the build host directly into the root filesystem.
- The root filesystem is created from packages using one of the
- :ref:`rootfs*.bbclass <ref-classes-rootfs*>` files as determined by the
- :term:`PACKAGE_CLASSES` variable.
- For information on how root filesystem images are created, see the
- ":ref:`overview-manual/concepts:image generation`"
- section in the Yocto Project Overview and Concepts Manual.
- .. _ref-classes-sanity:
- ``sanity.bbclass``
- ==================
- The :ref:`sanity <ref-classes-sanity>` class checks to see if prerequisite software is present
- on the host system so that users can be notified of potential problems
- that might affect their build. The class also performs basic user
- configuration checks from the ``local.conf`` configuration file to
- prevent common mistakes that cause build failures. Distribution policy
- usually determines whether to include this class.
- .. _ref-classes-scons:
- ``scons.bbclass``
- =================
- The :ref:`scons <ref-classes-scons>` class supports recipes that need to build software that
- uses the SCons build system. You can use the
- :term:`EXTRA_OESCONS` variable to specify
- additional configuration options you want to pass SCons command line.
- .. _ref-classes-sdl:
- ``sdl.bbclass``
- ===============
- The :ref:`sdl <ref-classes-sdl>` class supports recipes that need to build software that uses
- the Simple DirectMedia Layer (SDL) library.
- .. _ref-classes-python_setuptools_build_meta:
- ``python_setuptools_build_meta.bbclass``
- ========================================
- The :ref:`python_setuptools_build_meta <ref-classes-python_setuptools_build_meta>` class enables building Python modules which
- declare the
- `PEP-517 <https://www.python.org/dev/peps/pep-0517/>`__ compliant
- ``setuptools.build_meta`` ``build-backend`` in the ``[build-system]``
- section of ``pyproject.toml`` (See `PEP-518 <https://www.python.org/dev/peps/pep-0518/>`__).
- Python modules built with ``setuptools.build_meta`` can be pure Python or
- include ``C`` or ``Rust`` extensions).
- Internally this uses the :ref:`python_pep517 <ref-classes-python_pep517>` class.
- .. _ref-classes-setuptools3:
- ``setuptools3.bbclass``
- =======================
- The :ref:`setuptools3 <ref-classes-setuptools3>` class supports Python version 3.x extensions that
- use build systems based on ``setuptools`` (e.g. only have a ``setup.py`` and
- have not migrated to the official ``pyproject.toml`` format). If your recipe
- uses these build systems, the recipe needs to inherit the :ref:`setuptools3 <ref-classes-setuptools3>` class.
- .. note::
- The :ref:`setuptools3 <ref-classes-setuptools3>` class :ref:`ref-tasks-compile` task now calls
- ``setup.py bdist_wheel`` to build the ``wheel`` binary archive format
- (See `PEP-427 <https://www.python.org/dev/peps/pep-0427/>`__).
- A consequence of this is that legacy software still using deprecated
- ``distutils`` from the Python standard library cannot be packaged as
- ``wheels``. A common solution is the replace
- ``from distutils.core import setup`` with ``from setuptools import setup``.
- .. note::
- The :ref:`setuptools3 <ref-classes-setuptools3>` class :ref:`ref-tasks-install` task now installs the ``wheel``
- binary archive. In current versions of ``setuptools`` the legacy ``setup.py
- install`` method is deprecated. If the ``setup.py`` cannot be used with
- wheels, for example it creates files outside of the Python module or
- standard entry points, then :ref:`setuptools3_legacy
- <ref-classes-setuptools3_legacy>` should be used.
- .. _ref-classes-setuptools3_legacy:
- ``setuptools3_legacy.bbclass``
- ==============================
- The :ref:`setuptools3_legacy <ref-classes-setuptools3_legacy>` class supports
- Python version 3.x extensions that use build systems based on ``setuptools``
- (e.g. only have a ``setup.py`` and have not migrated to the official
- ``pyproject.toml`` format). Unlike :ref:`setuptools3 <ref-classes-setuptools3>`,
- this uses the traditional ``setup.py`` ``build`` and ``install`` commands and
- not wheels. This use of ``setuptools`` like this is
- `deprecated <https://github.com/pypa/setuptools/blob/main/CHANGES.rst#v5830>`__
- but still relatively common.
- .. _ref-classes-setuptools3-base:
- ``setuptools3-base.bbclass``
- ============================
- The :ref:`setuptools3-base <ref-classes-setuptools3-base>` class provides a reusable base for other classes
- that support building Python version 3.x extensions. If you need
- functionality that is not provided by the :ref:`setuptools3 <ref-classes-setuptools3>` class, you may
- want to ``inherit setuptools3-base``. Some recipes do not need the tasks
- in the :ref:`setuptools3 <ref-classes-setuptools3>` class and inherit this class instead.
- .. _ref-classes-sign_rpm:
- ``sign_rpm.bbclass``
- ====================
- The :ref:`sign_rpm <ref-classes-sign_rpm>` class supports generating signed RPM packages.
- .. _ref-classes-siteconfig:
- ``siteconfig.bbclass``
- ======================
- The :ref:`siteconfig <ref-classes-siteconfig>` class provides functionality for handling site
- configuration. The class is used by the
- :ref:`autotools <ref-classes-autotools>` class to accelerate the
- :ref:`ref-tasks-configure` task.
- .. _ref-classes-siteinfo:
- ``siteinfo.bbclass``
- ====================
- The :ref:`siteinfo <ref-classes-siteinfo>` class provides information about the targets that might
- be needed by other classes or recipes.
- As an example, consider Autotools, which can require tests that must
- execute on the target hardware. Since this is not possible in general
- when cross compiling, site information is used to provide cached test
- results so these tests can be skipped over but still make the correct
- values available. The ``meta/site directory`` contains test results
- sorted into different categories such as architecture, endianness, and
- the ``libc`` used. Site information provides a list of files containing
- data relevant to the current build in the :term:`CONFIG_SITE` variable that
- Autotools automatically picks up.
- The class also provides variables like :term:`SITEINFO_ENDIANNESS` and
- :term:`SITEINFO_BITS` that can be used elsewhere in the metadata.
- .. _ref-classes-sstate:
- ``sstate.bbclass``
- ==================
- The :ref:`sstate <ref-classes-sstate>` class provides support for Shared State (sstate). By
- default, the class is enabled through the
- :term:`INHERIT_DISTRO` variable's default value.
- For more information on sstate, see the
- ":ref:`overview-manual/concepts:shared state cache`"
- section in the Yocto Project Overview and Concepts Manual.
- .. _ref-classes-staging:
- ``staging.bbclass``
- ===================
- The :ref:`staging <ref-classes-staging>` class installs files into individual recipe work
- directories for sysroots. The class contains the following key tasks:
- - The :ref:`ref-tasks-populate_sysroot` task,
- which is responsible for handing the files that end up in the recipe
- sysroots.
- - The
- :ref:`ref-tasks-prepare_recipe_sysroot`
- task (a "partner" task to the ``populate_sysroot`` task), which
- installs the files into the individual recipe work directories (i.e.
- :term:`WORKDIR`).
- The code in the :ref:`staging <ref-classes-staging>` class is complex and basically works in two
- stages:
- - *Stage One:* The first stage addresses recipes that have files they
- want to share with other recipes that have dependencies on the
- originating recipe. Normally these dependencies are installed through
- the :ref:`ref-tasks-install` task into
- ``${``\ :term:`D`\ ``}``. The :ref:`ref-tasks-populate_sysroot` task
- copies a subset of these files into ``${SYSROOT_DESTDIR}``. This
- subset of files is controlled by the
- :term:`SYSROOT_DIRS`,
- :term:`SYSROOT_DIRS_NATIVE`, and
- :term:`SYSROOT_DIRS_IGNORE`
- variables.
- .. note::
- Additionally, a recipe can customize the files further by
- declaring a processing function in the :term:`SYSROOT_PREPROCESS_FUNCS`
- variable.
- A shared state (sstate) object is built from these files and the
- files are placed into a subdirectory of
- :ref:`structure-build-tmp-sysroots-components`.
- The files are scanned for hardcoded paths to the original
- installation location. If the location is found in text files, the
- hardcoded locations are replaced by tokens and a list of the files
- needing such replacements is created. These adjustments are referred
- to as "FIXMEs". The list of files that are scanned for paths is
- controlled by the :term:`SSTATE_SCAN_FILES`
- variable.
- - *Stage Two:* The second stage addresses recipes that want to use
- something from another recipe and declare a dependency on that recipe
- through the :term:`DEPENDS` variable. The recipe will
- have a
- :ref:`ref-tasks-prepare_recipe_sysroot`
- task and when this task executes, it creates the ``recipe-sysroot``
- and ``recipe-sysroot-native`` in the recipe work directory (i.e.
- :term:`WORKDIR`). The OpenEmbedded build system
- creates hard links to copies of the relevant files from
- ``sysroots-components`` into the recipe work directory.
- .. note::
- If hard links are not possible, the build system uses actual
- copies.
- The build system then addresses any "FIXMEs" to paths as defined from
- the list created in the first stage.
- Finally, any files in ``${bindir}`` within the sysroot that have the
- prefix "``postinst-``" are executed.
- .. note::
- Although such sysroot post installation scripts are not
- recommended for general use, the files do allow some issues such
- as user creation and module indexes to be addressed.
- Because recipes can have other dependencies outside of :term:`DEPENDS`
- (e.g. ``do_unpack[depends] += "tar-native:do_populate_sysroot"``),
- the sysroot creation function ``extend_recipe_sysroot`` is also added
- as a pre-function for those tasks whose dependencies are not through
- :term:`DEPENDS` but operate similarly.
- When installing dependencies into the sysroot, the code traverses the
- dependency graph and processes dependencies in exactly the same way
- as the dependencies would or would not be when installed from sstate.
- This processing means, for example, a native tool would have its
- native dependencies added but a target library would not have its
- dependencies traversed or installed. The same sstate dependency code
- is used so that builds should be identical regardless of whether
- sstate was used or not. For a closer look, see the
- ``setscene_depvalid()`` function in the
- :ref:`sstate <ref-classes-sstate>` class.
- The build system is careful to maintain manifests of the files it
- installs so that any given dependency can be installed as needed. The
- sstate hash of the installed item is also stored so that if it
- changes, the build system can reinstall it.
- .. _ref-classes-syslinux:
- ``syslinux.bbclass``
- ====================
- The :ref:`syslinux <ref-classes-syslinux>` class provides syslinux-specific functions for building
- bootable images.
- The class supports the following variables:
- - :term:`INITRD`: Indicates list of filesystem images to
- concatenate and use as an initial RAM disk (initrd). This variable is
- optional.
- - :term:`ROOTFS`: Indicates a filesystem image to include
- as the root filesystem. This variable is optional.
- - :term:`AUTO_SYSLINUXMENU`: Enables creating
- an automatic menu when set to "1".
- - :term:`LABELS`: Lists targets for automatic
- configuration.
- - :term:`APPEND`: Lists append string overrides for each
- label.
- - :term:`SYSLINUX_OPTS`: Lists additional options
- to add to the syslinux file. Semicolon characters separate multiple
- options.
- - :term:`SYSLINUX_SPLASH`: Lists a background
- for the VGA boot menu when you are using the boot menu.
- - :term:`SYSLINUX_DEFAULT_CONSOLE`: Set
- to "console=ttyX" to change kernel boot default console.
- - :term:`SYSLINUX_SERIAL`: Sets an alternate
- serial port. Or, turns off serial when the variable is set with an
- empty string.
- - :term:`SYSLINUX_SERIAL_TTY`: Sets an
- alternate "console=tty..." kernel boot argument.
- .. _ref-classes-systemd:
- ``systemd.bbclass``
- ===================
- The :ref:`systemd <ref-classes-systemd>` class provides support for recipes that install systemd
- unit files.
- The functionality for this class is disabled unless you have "systemd"
- in :term:`DISTRO_FEATURES`.
- Under this class, the recipe or Makefile (i.e. whatever the recipe is
- calling during the :ref:`ref-tasks-install` task)
- installs unit files into
- ``${``\ :term:`D`\ ``}${systemd_unitdir}/system``. If the unit
- files being installed go into packages other than the main package, you
- need to set :term:`SYSTEMD_PACKAGES` in your
- recipe to identify the packages in which the files will be installed.
- You should set :term:`SYSTEMD_SERVICE` to the
- name of the service file. You should also use a package name override to
- indicate the package to which the value applies. If the value applies to
- the recipe's main package, use ``${``\ :term:`PN`\ ``}``. Here
- is an example from the connman recipe::
- SYSTEMD_SERVICE:${PN} = "connman.service"
- Services are set up to start on boot automatically
- unless you have set
- :term:`SYSTEMD_AUTO_ENABLE` to "disable".
- For more information on :ref:`systemd <ref-classes-systemd>`, see the
- ":ref:`dev-manual/init-manager:selecting an initialization manager`"
- section in the Yocto Project Development Tasks Manual.
- .. _ref-classes-systemd-boot:
- ``systemd-boot.bbclass``
- ========================
- The :ref:`systemd-boot <ref-classes-systemd-boot>` class provides functions specific to the
- systemd-boot bootloader for building bootable images. This is an
- internal class and is not intended to be used directly.
- .. note::
- The :ref:`systemd-boot <ref-classes-systemd-boot>` class is a result from merging the ``gummiboot`` class
- used in previous Yocto Project releases with the ``systemd`` project.
- Set the :term:`EFI_PROVIDER` variable to
- ":ref:`systemd-boot <ref-classes-systemd-boot>`" to use this class. Doing so creates a standalone EFI
- bootloader that is not dependent on systemd.
- For information on more variables used and supported in this class, see
- the :term:`SYSTEMD_BOOT_CFG`,
- :term:`SYSTEMD_BOOT_ENTRIES`, and
- :term:`SYSTEMD_BOOT_TIMEOUT` variables.
- You can also see the `Systemd-boot
- documentation <https://www.freedesktop.org/wiki/Software/systemd/systemd-boot/>`__
- for more information.
- .. _ref-classes-terminal:
- ``terminal.bbclass``
- ====================
- The :ref:`terminal <ref-classes-terminal>` class provides support for starting a terminal session.
- The :term:`OE_TERMINAL` variable controls which
- terminal emulator is used for the session.
- Other classes use the :ref:`terminal <ref-classes-terminal>` class anywhere a separate terminal
- session needs to be started. For example, the
- :ref:`patch <ref-classes-patch>` class assuming
- :term:`PATCHRESOLVE` is set to "user", the
- :ref:`cml1 <ref-classes-cml1>` class, and the
- :ref:`devshell <ref-classes-devshell>` class all use the :ref:`terminal <ref-classes-terminal>`
- class.
- .. _ref-classes-testimage:
- ``testimage.bbclass``
- =====================
- The :ref:`testimage <ref-classes-testimage>` class supports running automated tests against
- images using QEMU and on actual hardware. The classes handle loading the
- tests and starting the image. To use the classes, you need to perform
- steps to set up the environment.
- To enable this class, add the following to your configuration::
- IMAGE_CLASSES += "testimage"
- The tests are commands that run on the target system over ``ssh``. Each
- test is written in Python and makes use of the ``unittest`` module.
- The :ref:`testimage <ref-classes-testimage>` class runs tests on an image when called using the
- following::
- $ bitbake -c testimage image
- Alternatively, if you wish to have tests automatically run for each image
- after it is built, you can set :term:`TESTIMAGE_AUTO`::
- TESTIMAGE_AUTO = "1"
- For information on how to enable, run, and create new tests, see the
- ":ref:`dev-manual/runtime-testing:performing automated runtime testing`"
- section in the Yocto Project Development Tasks Manual.
- .. _ref-classes-testsdk:
- ``testsdk.bbclass``
- ===================
- This class supports running automated tests against software development
- kits (SDKs). The :ref:`testsdk <ref-classes-testsdk>` class runs tests on an SDK when called
- using the following::
- $ bitbake -c testsdk image
- .. note::
- Best practices include using :term:`IMAGE_CLASSES` rather than
- :term:`INHERIT` to inherit the :ref:`testsdk <ref-classes-testsdk>` class for automated SDK
- testing.
- .. _ref-classes-texinfo:
- ``texinfo.bbclass``
- ===================
- This class should be inherited by recipes whose upstream packages invoke
- the ``texinfo`` utilities at build-time. Native and cross recipes are
- made to use the dummy scripts provided by ``texinfo-dummy-native``, for
- improved performance. Target architecture recipes use the genuine
- Texinfo utilities. By default, they use the Texinfo utilities on the
- host system.
- .. note::
- If you want to use the Texinfo recipe shipped with the build system,
- you can remove "texinfo-native" from :term:`ASSUME_PROVIDED` and makeinfo
- from :term:`SANITY_REQUIRED_UTILITIES`.
- .. _ref-classes-toaster:
- ``toaster.bbclass``
- ===================
- The :ref:`toaster <ref-classes-toaster>` class collects information about packages and images and
- sends them as events that the BitBake user interface can receive. The
- class is enabled when the Toaster user interface is running.
- This class is not intended to be used directly.
- .. _ref-classes-toolchain-scripts:
- ``toolchain-scripts.bbclass``
- =============================
- The :ref:`toolchain-scripts <ref-classes-toolchain-scripts>` class provides the scripts used for setting up
- the environment for installed SDKs.
- .. _ref-classes-typecheck:
- ``typecheck.bbclass``
- =====================
- The :ref:`typecheck <ref-classes-typecheck>` class provides support for validating the values of
- variables set at the configuration level against their defined types.
- The OpenEmbedded build system allows you to define the type of a
- variable using the "type" varflag. Here is an example::
- IMAGE_FEATURES[type] = "list"
- .. _ref-classes-uboot-config:
- ``uboot-config.bbclass``
- ========================
- The :ref:`uboot-config <ref-classes-uboot-config>` class provides support for U-Boot configuration for
- a machine. Specify the machine in your recipe as follows::
- UBOOT_CONFIG ??= <default>
- UBOOT_CONFIG[foo] = "config,images"
- You can also specify the machine using this method::
- UBOOT_MACHINE = "config"
- See the :term:`UBOOT_CONFIG` and :term:`UBOOT_MACHINE` variables for additional
- information.
- .. _ref-classes-uninative:
- ``uninative.bbclass``
- =====================
- Attempts to isolate the build system from the host distribution's C
- library in order to make re-use of native shared state artifacts across
- different host distributions practical. With this class enabled, a
- tarball containing a pre-built C library is downloaded at the start of
- the build. In the Poky reference distribution this is enabled by default
- through ``meta/conf/distro/include/yocto-uninative.inc``. Other
- distributions that do not derive from poky can also
- "``require conf/distro/include/yocto-uninative.inc``" to use this.
- Alternatively if you prefer, you can build the uninative-tarball recipe
- yourself, publish the resulting tarball (e.g. via HTTP) and set
- ``UNINATIVE_URL`` and ``UNINATIVE_CHECKSUM`` appropriately. For an
- example, see the ``meta/conf/distro/include/yocto-uninative.inc``.
- The :ref:`uninative <ref-classes-uninative>` class is also used unconditionally by the extensible
- SDK. When building the extensible SDK, ``uninative-tarball`` is built
- and the resulting tarball is included within the SDK.
- .. _ref-classes-update-alternatives:
- ``update-alternatives.bbclass``
- ===============================
- The :ref:`update-alternatives <ref-classes-update-alternatives>` class helps the alternatives system when
- multiple sources provide the same command. This situation occurs when
- several programs that have the same or similar function are installed
- with the same name. For example, the ``ar`` command is available from
- the ``busybox``, ``binutils`` and ``elfutils`` packages. The
- :ref:`update-alternatives <ref-classes-update-alternatives>` class handles renaming the binaries so that
- multiple packages can be installed without conflicts. The ``ar`` command
- still works regardless of which packages are installed or subsequently
- removed. The class renames the conflicting binary in each package and
- symlinks the highest priority binary during installation or removal of
- packages.
- To use this class, you need to define a number of variables:
- - :term:`ALTERNATIVE`
- - :term:`ALTERNATIVE_LINK_NAME`
- - :term:`ALTERNATIVE_TARGET`
- - :term:`ALTERNATIVE_PRIORITY`
- These variables list alternative commands needed by a package, provide
- pathnames for links, default links for targets, and so forth. For
- details on how to use this class, see the comments in the
- :yocto_git:`update-alternatives.bbclass </poky/tree/meta/classes-recipe/update-alternatives.bbclass>`
- file.
- .. note::
- You can use the ``update-alternatives`` command directly in your recipes.
- However, this class simplifies things in most cases.
- .. _ref-classes-update-rc.d:
- ``update-rc.d.bbclass``
- =======================
- The :ref:`update-rc.d <ref-classes-update-rc.d>` class uses ``update-rc.d`` to safely install an
- initialization script on behalf of the package. The OpenEmbedded build
- system takes care of details such as making sure the script is stopped
- before a package is removed and started when the package is installed.
- Three variables control this class: :term:`INITSCRIPT_PACKAGES`,
- :term:`INITSCRIPT_NAME` and :term:`INITSCRIPT_PARAMS`. See the variable links
- for details.
- .. _ref-classes-useradd:
- ``useradd*.bbclass``
- ====================
- The :ref:`useradd* <ref-classes-useradd>` classes support the addition of users or groups for
- usage by the package on the target. For example, if you have packages
- that contain system services that should be run under their own user or
- group, you can use these classes to enable creation of the user or
- group. The :oe_git:`meta-skeleton/recipes-skeleton/useradd/useradd-example.bb
- </openembedded-core/tree/meta-skeleton/recipes-skeleton/useradd/useradd-example.bb>`
- recipe in the :term:`Source Directory` provides a simple
- example that shows how to add three users and groups to two packages.
- The :ref:`useradd_base <ref-classes-useradd>` class provides basic functionality for user or
- groups settings.
- The :ref:`useradd* <ref-classes-useradd>` classes support the
- :term:`USERADD_PACKAGES`,
- :term:`USERADD_PARAM`,
- :term:`GROUPADD_PARAM`, and
- :term:`GROUPMEMS_PARAM` variables.
- The :ref:`useradd-staticids <ref-classes-useradd>` class supports the addition of users or groups
- that have static user identification (``uid``) and group identification
- (``gid``) values.
- The default behavior of the OpenEmbedded build system for assigning
- ``uid`` and ``gid`` values when packages add users and groups during
- package install time is to add them dynamically. This works fine for
- programs that do not care what the values of the resulting users and
- groups become. In these cases, the order of the installation determines
- the final ``uid`` and ``gid`` values. However, if non-deterministic
- ``uid`` and ``gid`` values are a problem, you can override the default,
- dynamic application of these values by setting static values. When you
- set static values, the OpenEmbedded build system looks in
- :term:`BBPATH` for ``files/passwd`` and ``files/group``
- files for the values.
- To use static ``uid`` and ``gid`` values, you need to set some
- variables. See the :term:`USERADDEXTENSION`,
- :term:`USERADD_UID_TABLES`,
- :term:`USERADD_GID_TABLES`, and
- :term:`USERADD_ERROR_DYNAMIC` variables.
- You can also see the :ref:`useradd <ref-classes-useradd>` class for
- additional information.
- .. note::
- You do not use the :ref:`useradd-staticids <ref-classes-useradd>` class directly. You either enable
- or disable the class by setting the :term:`USERADDEXTENSION` variable. If you
- enable or disable the class in a configured system, :term:`TMPDIR` might
- contain incorrect ``uid`` and ``gid`` values. Deleting the :term:`TMPDIR`
- directory will correct this condition.
- .. _ref-classes-utility-tasks:
- ``utility-tasks.bbclass``
- =========================
- The :ref:`utility-tasks <ref-classes-utility-tasks>` class provides support for various "utility" type
- tasks that are applicable to all recipes, such as
- :ref:`ref-tasks-clean` and
- :ref:`ref-tasks-listtasks`.
- This class is enabled by default because it is inherited by the
- :ref:`base <ref-classes-base>` class.
- .. _ref-classes-utils:
- ``utils.bbclass``
- =================
- The :ref:`utils <ref-classes-utils>` class provides some useful Python functions that are
- typically used in inline Python expressions (e.g. ``${@...}``). One
- example use is for ``bb.utils.contains()``.
- This class is enabled by default because it is inherited by the
- :ref:`base <ref-classes-base>` class.
- .. _ref-classes-vala:
- ``vala.bbclass``
- ================
- The :ref:`vala <ref-classes-vala>` class supports recipes that need to build software written
- using the Vala programming language.
- .. _ref-classes-waf:
- ``waf.bbclass``
- ===============
- The :ref:`waf <ref-classes-waf>` class supports recipes that need to build software that uses
- the Waf build system. You can use the
- :term:`EXTRA_OECONF` or
- :term:`PACKAGECONFIG_CONFARGS` variables
- to specify additional configuration options to be passed on the Waf
- command line.
|