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