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