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-tasks'> |
| 6 | <title>Tasks</title> |
| 7 | |
| 8 | <para> |
| 9 | Tasks are units of execution for BitBake. |
| 10 | Recipes (<filename>.bb</filename> files) use tasks to complete |
| 11 | configuring, compiling, and packaging software. |
| 12 | This chapter provides a reference of the tasks defined in the |
| 13 | OpenEmbedded build system. |
| 14 | </para> |
| 15 | |
| 16 | <section id='normal-recipe-build-tasks'> |
| 17 | <title>Normal Recipe Build Tasks</title> |
| 18 | |
| 19 | <para> |
| 20 | The following sections describe normal tasks associated with building |
| 21 | a recipe. |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 22 | For more information on tasks and dependencies, see the |
| 23 | "<ulink url='&YOCTO_DOCS_BB_URL;#tasks'>Tasks</ulink>" and |
| 24 | "<ulink url='&YOCTO_DOCS_BB_URL;#dependencies'>Dependencies</ulink>" |
| 25 | sections in the BitBake User Manual. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 26 | </para> |
| 27 | |
| 28 | <section id='ref-tasks-build'> |
| 29 | <title><filename>do_build</filename></title> |
| 30 | |
| 31 | <para> |
| 32 | The default task for all recipes. |
| 33 | This task depends on all other normal tasks |
| 34 | required to build a recipe. |
| 35 | </para> |
| 36 | </section> |
| 37 | |
| 38 | <section id='ref-tasks-compile'> |
| 39 | <title><filename>do_compile</filename></title> |
| 40 | |
| 41 | <para> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 42 | Compiles the source code. |
| 43 | This task runs with the current working directory set |
| 44 | to |
| 45 | <filename>${</filename><link linkend='var-B'><filename>B</filename></link><filename>}</filename>. |
| 46 | </para> |
| 47 | |
| 48 | <para> |
| 49 | The default behavior of this task is to run the |
| 50 | <filename>oe_runmake</filename> function if a makefile |
| 51 | (<filename>Makefile</filename>, <filename>makefile</filename>, |
| 52 | or <filename>GNUmakefile</filename>) is found. |
| 53 | If no such file is found, the <filename>do_compile</filename> |
| 54 | task does nothing. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 55 | </para> |
| 56 | </section> |
| 57 | |
| 58 | <section id='ref-tasks-compile_ptest_base'> |
| 59 | <title><filename>do_compile_ptest_base</filename></title> |
| 60 | |
| 61 | <para> |
| 62 | Compiles the runtime test suite included in the software being |
| 63 | built. |
| 64 | </para> |
| 65 | </section> |
| 66 | |
| 67 | <section id='ref-tasks-configure'> |
| 68 | <title><filename>do_configure</filename></title> |
| 69 | |
| 70 | <para> |
| 71 | Configures the source by enabling and disabling any build-time and |
| 72 | configuration options for the software being built. |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 73 | The task runs with the current working directory set to |
| 74 | <filename>${</filename><link linkend='var-B'><filename>B</filename></link><filename>}</filename>. |
| 75 | </para> |
| 76 | |
| 77 | <para> |
| 78 | The default behavior of this task is to run |
| 79 | <filename>oe_runmake clean</filename> if a makefile |
| 80 | (<filename>Makefile</filename>, <filename>makefile</filename>, |
| 81 | or <filename>GNUmakefile</filename>) is found and |
| 82 | <link linkend='var-CLEANBROKEN'><filename>CLEANBROKEN</filename></link> |
| 83 | is not set to "1". |
| 84 | If no such file is found or the <filename>CLEANBROKEN</filename> |
| 85 | variable is set to "1", the <filename>do_configure</filename> |
| 86 | task does nothing. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 87 | </para> |
| 88 | </section> |
| 89 | |
| 90 | <section id='ref-tasks-configure_ptest_base'> |
| 91 | <title><filename>do_configure_ptest_base</filename></title> |
| 92 | |
| 93 | <para> |
| 94 | Configures the runtime test suite included in the software being |
| 95 | built. |
| 96 | </para> |
| 97 | </section> |
| 98 | |
| 99 | <section id='ref-tasks-deploy'> |
| 100 | <title><filename>do_deploy</filename></title> |
| 101 | |
| 102 | <para> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 103 | Writes output files that are to be deployed to |
| 104 | <filename>${</filename><link linkend='var-DEPLOY_DIR_IMAGE'><filename>DEPLOY_DIR_IMAGE</filename></link><filename>}</filename>. |
| 105 | The task runs with the current working directory set to |
| 106 | <filename>${</filename><link linkend='var-B'><filename>B</filename></link><filename>}</filename>. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 107 | </para> |
| 108 | |
| 109 | <para> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 110 | Recipes implementing this task should inherit the |
| 111 | <link linkend='ref-classes-deploy'><filename>deploy</filename></link> |
| 112 | class and should write the output to |
| 113 | <filename>${</filename><link linkend='var-DEPLOYDIR'><filename>DEPLOYDIR</filename></link><filename>}</filename>, |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 114 | which is not to be confused with <filename>${DEPLOY_DIR}</filename>. |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 115 | The <filename>deploy</filename> class sets up |
| 116 | <filename>do_deploy</filename> as a shared state (sstate) task that |
| 117 | can be accelerated through sstate use. |
| 118 | The sstate mechanism takes care of copying the output from |
| 119 | <filename>${DEPLOYDIR}</filename> to |
| 120 | <filename>${DEPLOY_DIR_IMAGE}</filename>. |
| 121 | <note> |
| 122 | <title>Caution</title> |
| 123 | Do not write the output directly to |
| 124 | <filename>${DEPLOY_DIR_IMAGE}</filename>, as this causes |
| 125 | the sstate mechanism to malfunction. |
| 126 | </note> |
| 127 | </para> |
| 128 | |
| 129 | <para> |
| 130 | The <filename>do_deploy</filename> task is not added as a task |
| 131 | by default and consequently needs to be added manually. |
| 132 | If you want the task to run after |
| 133 | <link linkend='ref-tasks-compile'><filename>do_compile</filename></link>, |
| 134 | you can add it by doing the following: |
| 135 | <literallayout class='monospaced'> |
| 136 | addtask deploy after do_compile |
| 137 | </literallayout> |
| 138 | Adding <filename>do_deploy</filename> after other tasks works the |
| 139 | same way. |
| 140 | <note> |
| 141 | You do not need to add <filename>before do_build</filename> |
| 142 | to the <filename>addtask</filename> command (though it is |
| 143 | harmless), because the |
| 144 | <link linkend='ref-classes-base'><filename>base</filename></link> |
| 145 | class contains the following: |
| 146 | <literallayout class='monospaced'> |
| 147 | do_build[recrdeptask] += "do_deploy" |
| 148 | </literallayout> |
| 149 | See the |
| 150 | "<ulink url='&YOCTO_DOCS_BB_URL;#dependencies'>Dependencies</ulink>" |
| 151 | section in the BitBake User Manual for more information. |
| 152 | </note> |
| 153 | </para> |
| 154 | |
| 155 | <para> |
| 156 | If the <filename>do_deploy</filename> task re-executes, any |
| 157 | previous output is removed (i.e. "cleaned"). |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 158 | </para> |
| 159 | </section> |
| 160 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 161 | <section id='ref-tasks-distrodata'> |
| 162 | <title><filename>do_distrodata</filename></title> |
| 163 | |
| 164 | <para> |
| 165 | Provides information about the recipe. |
| 166 | </para> |
| 167 | |
| 168 | <para> |
| 169 | The <filename>distrodata</filename> task is included as part of the |
| 170 | <link linkend='ref-classes-distrodata'><filename>distrodata</filename></link> |
| 171 | class. |
| 172 | </para> |
| 173 | |
| 174 | <para> |
| 175 | To build the <filename>distrodata</filename> task, use the |
| 176 | <filename>bitbake</filename> command with the "-c" option and |
| 177 | task name: |
| 178 | <literallayout class='monospaced'> |
| 179 | $ bitbake core-image-minimal -c distrodata |
| 180 | </literallayout> |
| 181 | By default, the results are stored in |
| 182 | <link linkend='var-LOG_DIR'><filename>$LOG_DIR</filename></link> |
| 183 | (e.g. <filename>$BUILD_DIR/tmp/log</filename>). |
| 184 | </para> |
| 185 | </section> |
| 186 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 187 | <section id='ref-tasks-fetch'> |
| 188 | <title><filename>do_fetch</filename></title> |
| 189 | |
| 190 | <para> |
| 191 | Fetches the source code. |
| 192 | This task uses the |
| 193 | <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link> |
| 194 | variable and the argument's prefix to determine the correct |
| 195 | fetcher module. |
| 196 | </para> |
| 197 | </section> |
| 198 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 199 | <section id='ref-tasks-image'> |
| 200 | <title><filename>do_image</filename></title> |
| 201 | |
| 202 | <para> |
| 203 | Starts the image generation process. |
| 204 | The <filename>do_image</filename> task runs after the |
| 205 | OpenEmbedded build system has run the |
| 206 | <link linkend='ref-tasks-rootfs'><filename>do_rootfs</filename></link> |
| 207 | task during which packages are identified for installation into |
| 208 | the image and the root filesystem is created, complete with |
| 209 | post-processing. |
| 210 | </para> |
| 211 | |
| 212 | <para> |
| 213 | The <filename>do_image</filename> task performs pre-processing |
| 214 | on the image through the |
| 215 | <link linkend='var-IMAGE_PREPROCESS_COMMAND'><filename>IMAGE_PREPROCESS_COMMAND</filename></link> |
| 216 | and dynamically generates supporting |
| 217 | <filename>do_image_*</filename> tasks as needed. |
| 218 | </para> |
| 219 | |
| 220 | <para> |
| 221 | For more information on image creation, see the |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 222 | "<ulink url='&YOCTO_DOCS_OM_URL;#image-generation-dev-environment'>Image Generation</ulink>" |
| 223 | section in the Yocto Project Overview and Concepts Manual. |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 224 | </para> |
| 225 | </section> |
| 226 | |
| 227 | <section id='ref-tasks-image-complete'> |
| 228 | <title><filename>do_image_complete</filename></title> |
| 229 | |
| 230 | <para> |
| 231 | Completes the image generation process. |
| 232 | The <filename>do_image_complete</filename> task runs after the |
| 233 | OpenEmbedded build system has run the |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 234 | <link linkend='ref-tasks-image'><filename>do_image</filename></link> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 235 | task during which image pre-processing occurs and through |
| 236 | dynamically generated <filename>do_image_*</filename> tasks the |
| 237 | image is constructed. |
| 238 | </para> |
| 239 | |
| 240 | <para> |
| 241 | The <filename>do_image_complete</filename> task performs |
| 242 | post-processing on the image through the |
| 243 | <link linkend='var-IMAGE_POSTPROCESS_COMMAND'><filename>IMAGE_POSTPROCESS_COMMAND</filename></link>. |
| 244 | </para> |
| 245 | |
| 246 | <para> |
| 247 | For more information on image creation, see the |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 248 | "<ulink url='&YOCTO_DOCS_OM_URL;#image-generation-dev-environment'>Image Generation</ulink>" |
| 249 | section in the Yocto Project Overview and Concepts Manual. |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 250 | </para> |
| 251 | </section> |
| 252 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 253 | <section id='ref-tasks-install'> |
| 254 | <title><filename>do_install</filename></title> |
| 255 | |
| 256 | <para> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 257 | Copies files that are to be packaged into the holding area |
| 258 | <filename>${</filename><link linkend='var-D'><filename>D</filename></link><filename>}</filename>. |
| 259 | This task runs with the current working directory set to |
| 260 | <filename>${</filename><link linkend='var-B'><filename>B</filename></link><filename>}</filename>, |
| 261 | which is the compilation directory. |
| 262 | The <filename>do_install</filename> task, as well as other tasks |
| 263 | that either directly or indirectly depend on the installed files |
| 264 | (e.g. |
| 265 | <link linkend='ref-tasks-package'><filename>do_package</filename></link>, |
| 266 | <link linkend='ref-tasks-package_write_deb'><filename>do_package_write_*</filename></link>, |
| 267 | and |
| 268 | <link linkend='ref-tasks-rootfs'><filename>do_rootfs</filename></link>), |
| 269 | run under |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 270 | <ulink url='&YOCTO_DOCS_OM_URL;#fakeroot-and-pseudo'>fakeroot</ulink>. |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 271 | <note> |
| 272 | <title>Caution</title> |
| 273 | |
| 274 | <para> |
| 275 | When installing files, be careful not to set the owner and |
| 276 | group IDs of the installed files to unintended values. |
| 277 | Some methods of copying files, notably when using the |
| 278 | recursive <filename>cp</filename> command, can preserve the |
| 279 | UID and/or GID of the original file, which is usually not |
| 280 | what you want. |
| 281 | The |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 282 | <link linkend='insane-host-user-contaminated'><filename>host-user-contaminated</filename></link> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 283 | QA check checks for files that probably have the wrong |
| 284 | ownership. |
| 285 | </para> |
| 286 | |
| 287 | <para> |
| 288 | Safe methods for installing files include the following: |
| 289 | <itemizedlist> |
| 290 | <listitem><para> |
| 291 | The <filename>install</filename> utility. |
| 292 | This utility is the preferred method. |
| 293 | </para></listitem> |
| 294 | <listitem><para> |
| 295 | The <filename>cp</filename> command with the |
| 296 | "--no-preserve=ownership" option. |
| 297 | </para></listitem> |
| 298 | <listitem><para> |
| 299 | The <filename>tar</filename> command with the |
| 300 | "--no-same-owner" option. |
| 301 | See the <filename>bin_package.bbclass</filename> |
| 302 | file in the <filename>meta/classes</filename> |
| 303 | directory of the |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 304 | <link linkend='source-directory'>Source Directory</link> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 305 | for an example. |
| 306 | </para></listitem> |
| 307 | </itemizedlist> |
| 308 | </para> |
| 309 | </note> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 310 | </para> |
| 311 | </section> |
| 312 | |
| 313 | <section id='ref-tasks-install_ptest_base'> |
| 314 | <title><filename>do_install_ptest_base</filename></title> |
| 315 | |
| 316 | <para> |
| 317 | Copies the runtime test suite files from the compilation directory |
| 318 | to a holding area. |
| 319 | </para> |
| 320 | </section> |
| 321 | |
| 322 | <section id='ref-tasks-package'> |
| 323 | <title><filename>do_package</filename></title> |
| 324 | |
| 325 | <para> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 326 | Analyzes the content of the holding area |
| 327 | <filename>${</filename><link linkend='var-D'><filename>D</filename></link><filename>}</filename> |
| 328 | and splits the content into subsets based on available packages |
| 329 | and files. |
| 330 | This task makes use of the |
| 331 | <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link> |
| 332 | and |
| 333 | <link linkend='var-FILES'><filename>FILES</filename></link> |
| 334 | variables. |
| 335 | </para> |
| 336 | |
| 337 | <para> |
| 338 | The <filename>do_package</filename> task, in conjunction with the |
| 339 | <link linkend='ref-tasks-packagedata'><filename>do_packagedata</filename></link> |
| 340 | task, also saves some important package metadata. |
| 341 | For additional information, see the |
| 342 | <link linkend='var-PKGDESTWORK'><filename>PKGDESTWORK</filename></link> |
| 343 | variable and the |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 344 | "<ulink url='&YOCTO_DOCS_OM_URL;#automatically-added-runtime-dependencies'>Automatically Added Runtime Dependencies</ulink>" |
| 345 | section in the Yocto Project Overview and Concepts Manual. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 346 | </para> |
| 347 | </section> |
| 348 | |
| 349 | <section id='ref-tasks-package_qa'> |
| 350 | <title><filename>do_package_qa</filename></title> |
| 351 | |
| 352 | <para> |
| 353 | Runs QA checks on packaged files. |
| 354 | For more information on these checks, see the |
| 355 | <link linkend='ref-classes-insane'><filename>insane</filename></link> |
| 356 | class. |
| 357 | </para> |
| 358 | </section> |
| 359 | |
| 360 | <section id='ref-tasks-package_write_deb'> |
| 361 | <title><filename>do_package_write_deb</filename></title> |
| 362 | |
| 363 | <para> |
| 364 | Creates Debian packages (i.e. <filename>*.deb</filename> files) and |
| 365 | places them in the |
| 366 | <filename>${</filename><link linkend='var-DEPLOY_DIR_DEB'><filename>DEPLOY_DIR_DEB</filename></link><filename>}</filename> |
| 367 | directory in the package feeds area. |
| 368 | For more information, see the |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 369 | "<ulink url='&YOCTO_DOCS_OM_URL;#package-feeds-dev-environment'>Package Feeds</ulink>" |
| 370 | section in the Yocto Project Overview and Concepts Manual. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 371 | </para> |
| 372 | </section> |
| 373 | |
| 374 | <section id='ref-tasks-package_write_ipk'> |
| 375 | <title><filename>do_package_write_ipk</filename></title> |
| 376 | |
| 377 | <para> |
| 378 | Creates IPK packages (i.e. <filename>*.ipk</filename> files) and |
| 379 | places them in the |
| 380 | <filename>${</filename><link linkend='var-DEPLOY_DIR_IPK'><filename>DEPLOY_DIR_IPK</filename></link><filename>}</filename> |
| 381 | directory in the package feeds area. |
| 382 | For more information, see the |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 383 | "<ulink url='&YOCTO_DOCS_OM_URL;#package-feeds-dev-environment'>Package Feeds</ulink>" |
| 384 | section in the Yocto Project Overview and Concepts Manual. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 385 | </para> |
| 386 | </section> |
| 387 | |
| 388 | <section id='ref-tasks-package_write_rpm'> |
| 389 | <title><filename>do_package_write_rpm</filename></title> |
| 390 | |
| 391 | <para> |
| 392 | Creates RPM packages (i.e. <filename>*.rpm</filename> files) and |
| 393 | places them in the |
| 394 | <filename>${</filename><link linkend='var-DEPLOY_DIR_RPM'><filename>DEPLOY_DIR_RPM</filename></link><filename>}</filename> |
| 395 | directory in the package feeds area. |
| 396 | For more information, see the |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 397 | "<ulink url='&YOCTO_DOCS_OM_URL;#package-feeds-dev-environment'>Package Feeds</ulink>" |
| 398 | section in the Yocto Project Overview and Concepts Manual. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 399 | </para> |
| 400 | </section> |
| 401 | |
| 402 | <section id='ref-tasks-package_write_tar'> |
| 403 | <title><filename>do_package_write_tar</filename></title> |
| 404 | |
| 405 | <para> |
| 406 | Creates tarballs and places them in the |
| 407 | <filename>${</filename><link linkend='var-DEPLOY_DIR_TAR'><filename>DEPLOY_DIR_TAR</filename></link><filename>}</filename> |
| 408 | directory in the package feeds area. |
| 409 | For more information, see the |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 410 | "<ulink url='&YOCTO_DOCS_OM_URL;#package-feeds-dev-environment'>Package Feeds</ulink>" |
| 411 | section in the Yocto Project Overview and Concepts Manual. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 412 | </para> |
| 413 | </section> |
| 414 | |
| 415 | <section id='ref-tasks-packagedata'> |
| 416 | <title><filename>do_packagedata</filename></title> |
| 417 | |
| 418 | <para> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 419 | Saves package metadata generated by the |
| 420 | <link linkend='ref-tasks-package'><filename>do_package</filename></link> |
| 421 | task in |
| 422 | <link linkend='var-PKGDATA_DIR'><filename>PKGDATA_DIR</filename></link> |
| 423 | to make it available globally. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 424 | </para> |
| 425 | </section> |
| 426 | |
| 427 | <section id='ref-tasks-patch'> |
| 428 | <title><filename>do_patch</filename></title> |
| 429 | |
| 430 | <para> |
| 431 | Locates patch files and applies them to the source code. |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 432 | </para> |
| 433 | |
| 434 | <para> |
| 435 | After fetching and unpacking source files, the build system |
| 436 | uses the recipe's |
| 437 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink> |
| 438 | statements to locate and apply patch files to the source code. |
| 439 | <note> |
| 440 | The build system uses the |
| 441 | <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESPATH'><filename>FILESPATH</filename></ulink> |
| 442 | variable to determine the default set of directories when |
| 443 | searching for patches. |
| 444 | </note> |
| 445 | Patch files, by default, are <filename>*.patch</filename> and |
| 446 | <filename>*.diff</filename> files created and kept in a |
| 447 | subdirectory of the directory holding the recipe file. |
| 448 | For example, consider the |
| 449 | <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/meta/recipes-connectivity/bluez5'><filename>bluez5</filename></ulink> |
| 450 | recipe from the OE-Core layer (i.e. |
| 451 | <filename>poky/meta</filename>): |
| 452 | <literallayout class='monospaced'> |
| 453 | poky/meta/recipes-connectivity/bluez5 |
| 454 | </literallayout> |
| 455 | This recipe has two patch files located here: |
| 456 | <literallayout class='monospaced'> |
| 457 | poky/meta/recipes-connectivity/bluez5/bluez5 |
| 458 | </literallayout> |
| 459 | </para> |
| 460 | |
| 461 | <para> |
| 462 | In the <filename>bluez5</filename> recipe, the |
| 463 | <filename>SRC_URI</filename> statements point to the source and |
| 464 | patch files needed to build the package. |
| 465 | <note> |
| 466 | In the case for the <filename>bluez5_5.48.bb</filename> |
| 467 | recipe, the <filename>SRC_URI</filename> statements are from an |
| 468 | include file <filename>bluez5.inc</filename>. |
| 469 | </note> |
| 470 | </para> |
| 471 | |
| 472 | <para> |
| 473 | As mentioned earlier, the build system treats files whose file |
| 474 | types are <filename>.patch</filename> and |
| 475 | <filename>.diff</filename> as patch files. |
| 476 | However, you can use the "apply=yes" parameter with the |
| 477 | <filename>SRC_URI</filename> statement to indicate any file as a |
| 478 | patch file: |
| 479 | <literallayout class='monospaced'> |
| 480 | SRC_URI = " \ |
| 481 | git://<replaceable>path_to_repo</replaceable>/<replaceable>some_package</replaceable> \ |
| 482 | file://<replaceable>file</replaceable>;apply=yes \ |
| 483 | " |
| 484 | </literallayout> |
| 485 | </para> |
| 486 | |
| 487 | <para> |
| 488 | Conversely, if you have a directory full of patch files and you |
| 489 | want to exclude some so that the <filename>do_patch</filename> |
| 490 | task does not apply them during the patch phase, you can use |
| 491 | the "apply=no" parameter with the <filename>SRC_URI</filename> |
| 492 | statement: |
| 493 | <literallayout class='monospaced'> |
| 494 | SRC_URI = " \ |
| 495 | git://<replaceable>path_to_repo</replaceable>/<replaceable>some_package</replaceable> \ |
| 496 | file://<replaceable>path_to_lots_of_patch_files</replaceable> \ |
| 497 | file://<replaceable>path_to_lots_of_patch_files</replaceable>/<replaceable>patch_file5</replaceable>;apply=no \ |
| 498 | " |
| 499 | </literallayout> |
| 500 | In the previous example, assuming all the files in the directory |
| 501 | holding the patch files end with either <filename>.patch</filename> |
| 502 | or <filename>.diff</filename>, every file would be applied as a |
| 503 | patch by default except for the |
| 504 | <replaceable>patch_file5</replaceable> patch. |
| 505 | </para> |
| 506 | |
| 507 | <para> |
| 508 | You can find out more about the patching process in the |
| 509 | "<ulink url='&YOCTO_DOCS_OM_URL;#patching-dev-environment'>Patching</ulink>" |
| 510 | section in the Yocto Project Overview and Concepts Manual and the |
| 511 | "<ulink url='&YOCTO_DOCS_DEV_URL;#new-recipe-patching-code'>Patching Code</ulink>" |
| 512 | section in the Yocto Project Development Tasks Manual. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 513 | </para> |
| 514 | </section> |
| 515 | |
| 516 | <section id='ref-tasks-populate_lic'> |
| 517 | <title><filename>do_populate_lic</filename></title> |
| 518 | |
| 519 | <para> |
| 520 | Writes license information for the recipe that is collected later |
| 521 | when the image is constructed. |
| 522 | </para> |
| 523 | </section> |
| 524 | |
| 525 | <section id='ref-tasks-populate_sdk'> |
| 526 | <title><filename>do_populate_sdk</filename></title> |
| 527 | |
| 528 | <para> |
| 529 | Creates the file and directory structure for an installable SDK. |
| 530 | See the |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 531 | "<ulink url='&YOCTO_DOCS_OM_URL;#sdk-generation-dev-environment'>SDK Generation</ulink>" |
| 532 | section in the Yocto Project Overview and Concepts Manual for more |
| 533 | information. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 534 | </para> |
| 535 | </section> |
| 536 | |
| 537 | <section id='ref-tasks-populate_sysroot'> |
| 538 | <title><filename>do_populate_sysroot</filename></title> |
| 539 | |
| 540 | <para> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 541 | Stages (copies) a subset of the files installed by the |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 542 | <link linkend='ref-tasks-install'><filename>do_install</filename></link> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 543 | task into the appropriate sysroot. |
| 544 | For information on how to access these files from other recipes, |
| 545 | see the |
| 546 | <link linkend='var-STAGING_DIR_HOST'><filename>STAGING_DIR*</filename></link> |
| 547 | variables. |
| 548 | Directories that would typically not be needed by other recipes at |
| 549 | build time (e.g. <filename>/etc</filename>) are not copied by |
| 550 | default. |
| 551 | </para> |
| 552 | |
| 553 | <para> |
| 554 | For information on what directories are copied by default, see the |
| 555 | <link linkend='var-SYSROOT_DIRS'><filename>SYSROOT_DIRS*</filename></link> |
| 556 | variables. |
| 557 | You can change these variables inside your recipe if you need |
| 558 | to make additional (or fewer) directories available to other |
| 559 | recipes at build time. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 560 | </para> |
| 561 | |
| 562 | <para> |
| 563 | The <filename>do_populate_sysroot</filename> task is a |
| 564 | shared state (sstate) task, which means that the task can |
| 565 | be accelerated through sstate use. |
| 566 | Realize also that if the task is re-executed, any previous output |
| 567 | is removed (i.e. "cleaned"). |
| 568 | </para> |
| 569 | </section> |
| 570 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 571 | <section id='ref-tasks-prepare_recipe_sysroot'> |
| 572 | <title><filename>do_prepare_recipe_sysroot</filename></title> |
| 573 | |
| 574 | <para> |
| 575 | Installs the files into the individual recipe specific sysroots |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 576 | (i.e. <filename>recipe-sysroot</filename> and |
| 577 | <filename>recipe-sysroot-native</filename> under |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 578 | <filename>${</filename><link linkend='var-WORKDIR'><filename>WORKDIR</filename></link><filename>}</filename> |
| 579 | based upon the dependencies specified by |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 580 | <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>). |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 581 | See the |
| 582 | "<link linkend='ref-classes-staging'><filename>staging</filename></link>" |
| 583 | class for more information. |
| 584 | </para> |
| 585 | </section> |
| 586 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 587 | <section id='ref-tasks-rm_work'> |
| 588 | <title><filename>do_rm_work</filename></title> |
| 589 | |
| 590 | <para> |
| 591 | Removes work files after the OpenEmbedded build system has |
| 592 | finished with them. |
| 593 | You can learn more by looking at the |
| 594 | "<link linkend='ref-classes-rm-work'><filename>rm_work.bbclass</filename></link>" |
| 595 | section. |
| 596 | </para> |
| 597 | </section> |
| 598 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 599 | <section id='ref-tasks-unpack'> |
| 600 | <title><filename>do_unpack</filename></title> |
| 601 | |
| 602 | <para> |
| 603 | Unpacks the source code into a working directory pointed to |
| 604 | by |
| 605 | <filename>${</filename><link linkend='var-WORKDIR'><filename>WORKDIR</filename></link><filename>}</filename>. |
| 606 | The |
| 607 | <link linkend='var-S'><filename>S</filename></link> variable also |
| 608 | plays a role in where unpacked source files ultimately reside. |
| 609 | For more information on how source files are unpacked, see the |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 610 | "<ulink url='&YOCTO_DOCS_OM_URL;#source-fetching-dev-environment'>Source Fetching</ulink>" |
| 611 | section in the Yocto Project Overview and Concepts Manual and also |
| 612 | see the <filename>WORKDIR</filename> and |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 613 | <filename>S</filename> variable descriptions. |
| 614 | </para> |
| 615 | </section> |
| 616 | </section> |
| 617 | |
| 618 | <section id='manually-called-tasks'> |
| 619 | <title>Manually Called Tasks</title> |
| 620 | |
| 621 | <para> |
| 622 | These tasks are typically manually triggered (e.g. by using the |
| 623 | <filename>bitbake -c</filename> command-line option): |
| 624 | </para> |
| 625 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 626 | <section id='ref-tasks-checkpkg'> |
| 627 | <title><filename>do_checkpkg</filename></title> |
| 628 | |
| 629 | <para> |
| 630 | Provides information about the recipe including its upstream |
| 631 | version and status. |
| 632 | The upstream version and status reveals whether or not a version |
| 633 | of the recipe exists upstream and a status of not updated, updated, |
| 634 | or unknown. |
| 635 | </para> |
| 636 | |
| 637 | <para> |
| 638 | The <filename>checkpkg</filename> task is included as part of the |
| 639 | <link linkend='ref-classes-distrodata'><filename>distrodata</filename></link> |
| 640 | class. |
| 641 | </para> |
| 642 | |
| 643 | <para> |
| 644 | To build the <filename>checkpkg</filename> task, use the |
| 645 | <filename>bitbake</filename> command with the "-c" option and |
| 646 | task name: |
| 647 | <literallayout class='monospaced'> |
| 648 | $ bitbake core-image-minimal -c checkpkg |
| 649 | </literallayout> |
| 650 | By default, the results are stored in |
| 651 | <link linkend='var-LOG_DIR'><filename>$LOG_DIR</filename></link> |
| 652 | (e.g. <filename>$BUILD_DIR/tmp/log</filename>). |
| 653 | </para> |
| 654 | </section> |
| 655 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 656 | <section id='ref-tasks-checkuri'> |
| 657 | <title><filename>do_checkuri</filename></title> |
| 658 | |
| 659 | <para> |
| 660 | Validates the |
| 661 | <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link> |
| 662 | value. |
| 663 | </para> |
| 664 | </section> |
| 665 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 666 | <section id='ref-tasks-clean'> |
| 667 | <title><filename>do_clean</filename></title> |
| 668 | |
| 669 | <para> |
| 670 | Removes all output files for a target from the |
| 671 | <link linkend='ref-tasks-unpack'><filename>do_unpack</filename></link> |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 672 | task forward (i.e. <filename>do_unpack</filename>, |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 673 | <link linkend='ref-tasks-configure'><filename>do_configure</filename></link>, |
| 674 | <link linkend='ref-tasks-compile'><filename>do_compile</filename></link>, |
| 675 | <link linkend='ref-tasks-install'><filename>do_install</filename></link>, |
| 676 | and |
| 677 | <link linkend='ref-tasks-package'><filename>do_package</filename></link>). |
| 678 | </para> |
| 679 | |
| 680 | <para> |
| 681 | You can run this task using BitBake as follows: |
| 682 | <literallayout class='monospaced'> |
| 683 | $ bitbake -c clean <replaceable>recipe</replaceable> |
| 684 | </literallayout> |
| 685 | </para> |
| 686 | |
| 687 | <para> |
| 688 | Running this task does not remove the |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 689 | <ulink url='&YOCTO_DOCS_OM_URL;#shared-state-cache'>sstate</ulink> |
| 690 | cache files. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 691 | Consequently, if no changes have been made and the recipe is |
| 692 | rebuilt after cleaning, output files are simply restored from the |
| 693 | sstate cache. |
| 694 | If you want to remove the sstate cache files for the recipe, |
| 695 | you need to use the |
| 696 | <link linkend='ref-tasks-cleansstate'><filename>do_cleansstate</filename></link> |
| 697 | task instead (i.e. <filename>bitbake -c cleansstate</filename> <replaceable>recipe</replaceable>). |
| 698 | </para> |
| 699 | </section> |
| 700 | |
| 701 | <section id='ref-tasks-cleanall'> |
| 702 | <title><filename>do_cleanall</filename></title> |
| 703 | |
| 704 | <para> |
| 705 | Removes all output files, shared state |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 706 | (<ulink url='&YOCTO_DOCS_OM_URL;#shared-state-cache'>sstate</ulink>) |
| 707 | cache, and downloaded source files for a target (i.e. the contents |
| 708 | of |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 709 | <link linkend='var-DL_DIR'><filename>DL_DIR</filename></link>). |
| 710 | Essentially, the <filename>do_cleanall</filename> task is |
| 711 | identical to the |
| 712 | <link linkend='ref-tasks-cleansstate'><filename>do_cleansstate</filename></link> |
| 713 | task with the added removal of downloaded source files. |
| 714 | </para> |
| 715 | |
| 716 | <para> |
| 717 | You can run this task using BitBake as follows: |
| 718 | <literallayout class='monospaced'> |
| 719 | $ bitbake -c cleanall <replaceable>recipe</replaceable> |
| 720 | </literallayout> |
| 721 | </para> |
| 722 | |
| 723 | <para> |
| 724 | Typically, you would not normally use the |
| 725 | <filename>cleanall</filename> task. |
| 726 | Do so only if you want to start fresh with the |
| 727 | <link linkend='ref-tasks-fetch'><filename>do_fetch</filename></link> |
| 728 | task. |
| 729 | </para> |
| 730 | </section> |
| 731 | |
| 732 | <section id='ref-tasks-cleansstate'> |
| 733 | <title><filename>do_cleansstate</filename></title> |
| 734 | |
| 735 | <para> |
| 736 | Removes all output files and shared state |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 737 | (<ulink url='&YOCTO_DOCS_OM_URL;#shared-state-cache'>sstate</ulink>) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 738 | cache for a target. |
| 739 | Essentially, the <filename>do_cleansstate</filename> task is |
| 740 | identical to the |
| 741 | <link linkend='ref-tasks-clean'><filename>do_clean</filename></link> |
| 742 | task with the added removal of shared state |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 743 | (<ulink url='&YOCTO_DOCS_OM_URL;#shared-state-cache'>sstate</ulink>) |
| 744 | cache. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 745 | </para> |
| 746 | |
| 747 | <para> |
| 748 | You can run this task using BitBake as follows: |
| 749 | <literallayout class='monospaced'> |
| 750 | $ bitbake -c cleansstate <replaceable>recipe</replaceable> |
| 751 | </literallayout> |
| 752 | </para> |
| 753 | |
| 754 | <para> |
| 755 | When you run the <filename>do_cleansstate</filename> task, |
| 756 | the OpenEmbedded build system no longer uses any |
| 757 | sstate. |
| 758 | Consequently, building the recipe from scratch is guaranteed. |
| 759 | <note> |
| 760 | The <filename>do_cleansstate</filename> task cannot remove |
| 761 | sstate from a remote sstate mirror. |
| 762 | If you need to build a target from scratch using remote |
| 763 | mirrors, use the "-f" option as follows: |
| 764 | <literallayout class='monospaced'> |
| 765 | $ bitbake -f -c do_cleansstate <replaceable>target</replaceable> |
| 766 | </literallayout> |
| 767 | </note> |
| 768 | </para> |
| 769 | </section> |
| 770 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 771 | <section id='ref-tasks-devpyshell'> |
| 772 | <title><filename>do_devpyshell</filename></title> |
| 773 | |
| 774 | <para> |
| 775 | Starts a shell in which an interactive Python interpreter allows |
| 776 | you to interact with the BitBake build environment. |
| 777 | From within this shell, you can directly examine and set |
| 778 | bits from the data store and execute functions as if within |
| 779 | the BitBake environment. |
| 780 | See the |
| 781 | "<ulink url='&YOCTO_DOCS_DEV_URL;#platdev-appdev-devpyshell'>Using a Development Python Shell</ulink>" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 782 | section in the Yocto Project Development Tasks Manual for more |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 783 | information about using <filename>devpyshell</filename>. |
| 784 | </para> |
| 785 | </section> |
| 786 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 787 | <section id='ref-tasks-devshell'> |
| 788 | <title><filename>do_devshell</filename></title> |
| 789 | |
| 790 | <para> |
| 791 | Starts a shell whose environment is set up for |
| 792 | development, debugging, or both. |
| 793 | See the |
| 794 | "<ulink url='&YOCTO_DOCS_DEV_URL;#platdev-appdev-devshell'>Using a Development Shell</ulink>" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 795 | section in the Yocto Project Development Tasks Manual for more |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 796 | information about using <filename>devshell</filename>. |
| 797 | </para> |
| 798 | </section> |
| 799 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 800 | <section id='ref-tasks-listtasks'> |
| 801 | <title><filename>do_listtasks</filename></title> |
| 802 | |
| 803 | <para> |
| 804 | Lists all defined tasks for a target. |
| 805 | </para> |
| 806 | </section> |
| 807 | |
| 808 | <section id='ref-tasks-package_index'> |
| 809 | <title><filename>do_package_index</filename></title> |
| 810 | |
| 811 | <para> |
| 812 | Creates or updates the index in the |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 813 | <ulink url='&YOCTO_DOCS_OM_URL;#package-feeds-dev-environment'>Package Feeds</ulink> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 814 | area. |
| 815 | <note> |
| 816 | This task is not triggered with the |
| 817 | <filename>bitbake -c</filename> command-line option as |
| 818 | are the other tasks in this section. |
| 819 | Because this task is specifically for the |
| 820 | <filename>package-index</filename> recipe, |
| 821 | you run it using |
| 822 | <filename>bitbake package-index</filename>. |
| 823 | </note> |
| 824 | </para> |
| 825 | </section> |
| 826 | </section> |
| 827 | |
| 828 | <section id='image-related-tasks'> |
| 829 | <title>Image-Related Tasks</title> |
| 830 | |
| 831 | <para> |
| 832 | The following tasks are applicable to image recipes. |
| 833 | </para> |
| 834 | |
| 835 | <section id='ref-tasks-bootimg'> |
| 836 | <title><filename>do_bootimg</filename></title> |
| 837 | |
| 838 | <para> |
| 839 | Creates a bootable live image. |
| 840 | See the |
| 841 | <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link> |
| 842 | variable for additional information on live image types. |
| 843 | </para> |
| 844 | </section> |
| 845 | |
| 846 | <section id='ref-tasks-bundle_initramfs'> |
| 847 | <title><filename>do_bundle_initramfs</filename></title> |
| 848 | |
| 849 | <para> |
| 850 | Combines an initial RAM disk (initramfs) image and kernel |
| 851 | together to form a single image. |
| 852 | The |
| 853 | <link linkend='var-CONFIG_INITRAMFS_SOURCE'><filename>CONFIG_INITRAMFS_SOURCE</filename></link> |
| 854 | variable has some more information about these types of images. |
| 855 | </para> |
| 856 | </section> |
| 857 | |
| 858 | <section id='ref-tasks-rootfs'> |
| 859 | <title><filename>do_rootfs</filename></title> |
| 860 | |
| 861 | <para> |
| 862 | Creates the root filesystem (file and directory structure) for an |
| 863 | image. |
| 864 | See the |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 865 | "<ulink url='&YOCTO_DOCS_OM_URL;#image-generation-dev-environment'>Image Generation</ulink>" |
| 866 | section in the Yocto Project Overview and Concepts Manual for more |
| 867 | information on how the root filesystem is created. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 868 | </para> |
| 869 | </section> |
| 870 | |
| 871 | <section id='ref-tasks-testimage'> |
| 872 | <title><filename>do_testimage</filename></title> |
| 873 | |
| 874 | <para> |
| 875 | Boots an image and performs runtime tests within the image. |
| 876 | For information on automatically testing images, see the |
| 877 | "<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] | 878 | section in the Yocto Project Development Tasks Manual. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 879 | </para> |
| 880 | </section> |
| 881 | |
| 882 | <section id='ref-tasks-testimage_auto'> |
| 883 | <title><filename>do_testimage_auto</filename></title> |
| 884 | |
| 885 | <para> |
| 886 | Boots an image and performs runtime tests within the image |
| 887 | immediately after it has been built. |
| 888 | This task is enabled when you set |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 889 | <link linkend='var-TESTIMAGE_AUTO'><filename>TESTIMAGE_AUTO</filename></link> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 890 | equal to "1". |
| 891 | </para> |
| 892 | |
| 893 | <para> |
| 894 | For information on automatically testing images, see the |
| 895 | "<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] | 896 | section in the Yocto Project Development Tasks Manual. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 897 | </para> |
| 898 | </section> |
| 899 | </section> |
| 900 | |
| 901 | <section id='kernel-related-tasks'> |
| 902 | <title>Kernel-Related Tasks</title> |
| 903 | |
| 904 | <para> |
| 905 | The following tasks are applicable to kernel recipes. |
| 906 | Some of these tasks (e.g. the |
| 907 | <link linkend='ref-tasks-menuconfig'><filename>do_menuconfig</filename></link> |
| 908 | task) are also applicable to recipes that use |
| 909 | Linux kernel style configuration such as the BusyBox recipe. |
| 910 | </para> |
| 911 | |
| 912 | <section id='ref-tasks-compile_kernelmodules'> |
| 913 | <title><filename>do_compile_kernelmodules</filename></title> |
| 914 | |
| 915 | <para> |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 916 | Runs the step that builds the kernel modules (if needed). |
| 917 | Building a kernel consists of two steps: 1) the kernel |
| 918 | (<filename>vmlinux</filename>) is built, and 2) the modules |
| 919 | are built (i.e. <filename>make modules</filename>). |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 920 | </para> |
| 921 | </section> |
| 922 | |
| 923 | <section id='ref-tasks-diffconfig'> |
| 924 | <title><filename>do_diffconfig</filename></title> |
| 925 | |
| 926 | <para> |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 927 | When invoked by the user, this task creates a file containing the |
| 928 | differences between the original config as produced by |
| 929 | <link linkend='ref-tasks-kernel_configme'><filename>do_kernel_configme</filename></link> |
| 930 | task and the changes made by the user with other methods |
| 931 | (i.e. using |
| 932 | (<link linkend='ref-tasks-kernel_menuconfig'><filename>do_kernel_menuconfig</filename></link>). |
| 933 | Once the file of differences is created, it can be used to create |
| 934 | a config fragment that only contains the differences. |
| 935 | You can invoke this task from the command line as follows: |
| 936 | <literallayout class='monospaced'> |
| 937 | $ bitbake linux-yocto -c diffconfig |
| 938 | </literallayout> |
| 939 | For more information, see the |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 940 | "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#creating-config-fragments'>Creating Configuration Fragments</ulink>" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 941 | section in the Yocto Project Linux Kernel Development Manual. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 942 | </para> |
| 943 | </section> |
| 944 | |
| 945 | <section id='ref-tasks-kernel_checkout'> |
| 946 | <title><filename>do_kernel_checkout</filename></title> |
| 947 | |
| 948 | <para> |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 949 | Converts the newly unpacked kernel source into a form with which |
| 950 | the OpenEmbedded build system can work. |
| 951 | Because the kernel source can be fetched in several different ways, |
| 952 | the <filename>do_kernel_checkout</filename> task makes sure that |
| 953 | subsequent tasks are given a clean working tree copy of the kernel |
| 954 | with the correct branches checked out. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 955 | </para> |
| 956 | </section> |
| 957 | |
| 958 | <section id='ref-tasks-kernel_configcheck'> |
| 959 | <title><filename>do_kernel_configcheck</filename></title> |
| 960 | |
| 961 | <para> |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 962 | Validates the configuration produced by the |
| 963 | <link linkend='ref-tasks-kernel_menuconfig'><filename>do_kernel_menuconfig</filename></link> |
| 964 | task. |
| 965 | The <filename>do_kernel_configcheck</filename> task produces |
| 966 | warnings when a requested configuration does not appear in the |
| 967 | final <filename>.config</filename> file or when you override a |
| 968 | policy configuration in a hardware configuration fragment. |
| 969 | You can run this task explicitly and view the output by using |
| 970 | the following command: |
| 971 | <literallayout class='monospaced'> |
| 972 | $ bitbake linux-yocto -c kernel_configcheck -f |
| 973 | </literallayout> |
| 974 | For more information, see the |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 975 | "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#validating-configuration'>Validating Configuration</ulink>" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 976 | section in the Yocto Project Linux Kernel Development Manual. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 977 | </para> |
| 978 | </section> |
| 979 | |
| 980 | <section id='ref-tasks-kernel_configme'> |
| 981 | <title><filename>do_kernel_configme</filename></title> |
| 982 | |
| 983 | <para> |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 984 | After the kernel is patched by the |
| 985 | <link linkend='ref-tasks-patch'><filename>do_patch</filename></link> |
| 986 | task, the <filename>do_kernel_configme</filename> task assembles |
| 987 | and merges all the kernel config fragments into a merged |
| 988 | configuration that can then be passed to the kernel configuration |
| 989 | phase proper. |
| 990 | This is also the time during which user-specified defconfigs |
| 991 | are applied if present, and where configuration modes such as |
| 992 | <filename>--allnoconfig</filename> are applied. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 993 | </para> |
| 994 | </section> |
| 995 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 996 | <section id='ref-tasks-kernel_menuconfig'> |
| 997 | <title><filename>do_kernel_menuconfig</filename></title> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 998 | |
| 999 | <para> |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 1000 | Invoked by the user to manipulate the |
| 1001 | <filename>.config</filename> file used to build a linux-yocto |
| 1002 | recipe. |
| 1003 | This task starts the Linux kernel configuration tool, which you |
| 1004 | then use to modify the kernel configuration. |
| 1005 | <note> |
| 1006 | You can also invoke this tool from the command line as |
| 1007 | follows: |
| 1008 | <literallayout class='monospaced'> |
| 1009 | $ bitbake linux-yocto -c menuconfig |
| 1010 | </literallayout> |
| 1011 | </note> |
| 1012 | See the |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 1013 | "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#using-menuconfig'>Using <filename>menuconfig</filename></ulink>" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 1014 | section in the Yocto Project Linux Kernel Development Manual |
| 1015 | for more information on this configuration tool. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1016 | </para> |
| 1017 | </section> |
| 1018 | |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 1019 | <section id='ref-tasks-kernel_metadata'> |
| 1020 | <title><filename>do_kernel_metadata</filename></title> |
| 1021 | |
| 1022 | <para> |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 1023 | Collects all the features required for a given kernel build, |
| 1024 | whether the features come from |
| 1025 | <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link> |
| 1026 | or from Git repositories. |
| 1027 | After collection, the <filename>do_kernel_metadata</filename> task |
| 1028 | processes the features into a series of config fragments and |
| 1029 | patches, which can then be applied by subsequent tasks such as |
| 1030 | <link linkend='ref-tasks-patch'><filename>do_patch</filename></link> |
| 1031 | and |
| 1032 | <link linkend='ref-tasks-kernel_configme'><filename>do_kernel_configme</filename></link>. |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 1033 | </para> |
| 1034 | </section> |
| 1035 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1036 | <section id='ref-tasks-menuconfig'> |
| 1037 | <title><filename>do_menuconfig</filename></title> |
| 1038 | |
| 1039 | <para> |
| 1040 | Runs <filename>make menuconfig</filename> for the kernel. |
| 1041 | For information on <filename>menuconfig</filename>, see the |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 1042 | "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#using-menuconfig'>Using <filename>menuconfig</filename></ulink>" |
| 1043 | section in the Yocto Project Linux Kernel Development Manual. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1044 | </para> |
| 1045 | </section> |
| 1046 | |
| 1047 | <section id='ref-tasks-savedefconfig'> |
| 1048 | <title><filename>do_savedefconfig</filename></title> |
| 1049 | |
| 1050 | <para> |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 1051 | When invoked by the user, creates a defconfig file that can be |
| 1052 | used instead of the default defconfig. |
| 1053 | The saved defconfig contains the differences between the default |
| 1054 | defconfig and the changes made by the user using other methods |
| 1055 | (i.e. the |
| 1056 | <link linkend='ref-tasks-kernel_menuconfig'><filename>do_kernel_menuconfig</filename></link> |
| 1057 | task. |
| 1058 | You can invoke the task using the following command: |
| 1059 | <literallayout class='monospaced'> |
| 1060 | $ bitbake linux-yocto -c savedefconfig |
| 1061 | </literallayout> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1062 | </para> |
| 1063 | </section> |
| 1064 | |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 1065 | <section id='ref-tasks-shared_workdir'> |
| 1066 | <title><filename>do_shared_workdir</filename></title> |
| 1067 | |
| 1068 | <para> |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 1069 | After the kernel has been compiled but before the kernel modules |
| 1070 | have been compiled, this task copies files required for module |
| 1071 | builds and which are generated from the kernel build into the |
| 1072 | shared work directory. |
| 1073 | With these copies successfully copied, the |
| 1074 | <link linkend='ref-tasks-compile_kernelmodules'><filename>do_compile_kernelmodules</filename></link> |
| 1075 | task can successfully build the kernel modules in the next step |
| 1076 | of the build. |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 1077 | </para> |
| 1078 | </section> |
| 1079 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1080 | <section id='ref-tasks-sizecheck'> |
| 1081 | <title><filename>do_sizecheck</filename></title> |
| 1082 | |
| 1083 | <para> |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 1084 | After the kernel has been built, this task checks the size of the |
| 1085 | stripped kernel image against |
| 1086 | <link linkend='var-KERNEL_IMAGE_MAXSIZE'><filename>KERNEL_IMAGE_MAXSIZE</filename></link>. |
| 1087 | If that variable was set and the size of the stripped kernel |
| 1088 | exceeds that size, the kernel build produces a warning to that |
| 1089 | effect. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1090 | </para> |
| 1091 | </section> |
| 1092 | |
| 1093 | <section id='ref-tasks-strip'> |
| 1094 | <title><filename>do_strip</filename></title> |
| 1095 | |
| 1096 | <para> |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 1097 | If |
| 1098 | <filename>KERNEL_IMAGE_STRIP_EXTRA_SECTIONS</filename> is defined, |
| 1099 | this task strips the sections named in that variable from |
| 1100 | <filename>vmlinux</filename>. |
| 1101 | This stripping is typically used to remove nonessential sections |
| 1102 | such as <filename>.comment</filename> sections from a |
| 1103 | size-sensitive configuration. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1104 | </para> |
| 1105 | </section> |
| 1106 | |
| 1107 | <section id='ref-tasks-validate_branches'> |
| 1108 | <title><filename>do_validate_branches</filename></title> |
| 1109 | |
| 1110 | <para> |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 1111 | After the kernel is unpacked but before it is patched, this task |
| 1112 | makes sure that the machine and metadata branches as specified |
| 1113 | by the <link linkend='var-SRCREV'><filename>SRCREV</filename></link> |
| 1114 | variables actually exist on the specified branches. |
| 1115 | If these branches do not exist and |
| 1116 | <link linkend='var-AUTOREV'><filename>AUTOREV</filename></link> |
| 1117 | is not being used, the <filename>do_validate_branches</filename> |
| 1118 | task fails during the build. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1119 | </para> |
| 1120 | </section> |
| 1121 | </section> |
| 1122 | |
| 1123 | <section id='miscellaneous-tasks'> |
| 1124 | <title>Miscellaneous Tasks</title> |
| 1125 | |
| 1126 | <para> |
| 1127 | The following sections describe miscellaneous tasks. |
| 1128 | </para> |
| 1129 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1130 | <section id='ref-tasks-spdx'> |
| 1131 | <title><filename>do_spdx</filename></title> |
| 1132 | |
| 1133 | <para> |
| 1134 | A build stage that takes the source code and scans it on a remote |
| 1135 | FOSSOLOGY server in order to produce an SPDX document. |
| 1136 | This task applies only to the |
| 1137 | <link linkend='ref-classes-spdx'><filename>spdx</filename></link> |
| 1138 | class. |
| 1139 | </para> |
| 1140 | </section> |
| 1141 | </section> |
| 1142 | |
| 1143 | </chapter> |
| 1144 | <!-- |
| 1145 | vim: expandtab tw=80 ts=4 |
| 1146 | --> |