ref-classes.xml 157 KB

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