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