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