blob: e9859c1fa94521b2a2c115b4167c90c0e6f4cc8e [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
493 <section id='ref-tasks-rm_work'>
494 <title><filename>do_rm_work</filename></title>
495
496 <para>
497 Removes work files after the OpenEmbedded build system has
498 finished with them.
499 You can learn more by looking at the
500 "<link linkend='ref-classes-rm-work'><filename>rm_work.bbclass</filename></link>"
501 section.
502 </para>
503 </section>
504
505 <section id='ref-tasks-rm_work_all'>
506 <title><filename>do_rm_work_all</filename></title>
507
508 <para>
509 Top-level task for removing work files after the build system has
510 finished with them.
511 </para>
512 </section>
513
514 <section id='ref-tasks-unpack'>
515 <title><filename>do_unpack</filename></title>
516
517 <para>
518 Unpacks the source code into a working directory pointed to
519 by
520 <filename>${</filename><link linkend='var-WORKDIR'><filename>WORKDIR</filename></link><filename>}</filename>.
521 The
522 <link linkend='var-S'><filename>S</filename></link> variable also
523 plays a role in where unpacked source files ultimately reside.
524 For more information on how source files are unpacked, see the
525 "<link linkend='source-fetching-dev-environment'>Source Fetching</link>"
526 section and the <filename>WORKDIR</filename> and
527 <filename>S</filename> variable descriptions.
528 </para>
529 </section>
530</section>
531
532<section id='manually-called-tasks'>
533 <title>Manually Called Tasks</title>
534
535 <para>
536 These tasks are typically manually triggered (e.g. by using the
537 <filename>bitbake -c</filename> command-line option):
538 </para>
539
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600540 <section id='ref-tasks-checkpkg'>
541 <title><filename>do_checkpkg</filename></title>
542
543 <para>
544 Provides information about the recipe including its upstream
545 version and status.
546 The upstream version and status reveals whether or not a version
547 of the recipe exists upstream and a status of not updated, updated,
548 or unknown.
549 </para>
550
551 <para>
552 The <filename>checkpkg</filename> task is included as part of the
553 <link linkend='ref-classes-distrodata'><filename>distrodata</filename></link>
554 class.
555 </para>
556
557 <para>
558 To build the <filename>checkpkg</filename> task, use the
559 <filename>bitbake</filename> command with the "-c" option and
560 task name:
561 <literallayout class='monospaced'>
562 $ bitbake core-image-minimal -c checkpkg
563 </literallayout>
564 By default, the results are stored in
565 <link linkend='var-LOG_DIR'><filename>$LOG_DIR</filename></link>
566 (e.g. <filename>$BUILD_DIR/tmp/log</filename>).
567 </para>
568 </section>
569
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500570 <section id='ref-tasks-checkuri'>
571 <title><filename>do_checkuri</filename></title>
572
573 <para>
574 Validates the
575 <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>
576 value.
577 </para>
578 </section>
579
580 <section id='ref-tasks-checkuriall'>
581 <title><filename>do_checkuriall</filename></title>
582
583 <para>
584 Validates the
585 <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>
586 value for all recipes required to build a target.
587 </para>
588 </section>
589
590 <section id='ref-tasks-clean'>
591 <title><filename>do_clean</filename></title>
592
593 <para>
594 Removes all output files for a target from the
595 <link linkend='ref-tasks-unpack'><filename>do_unpack</filename></link>
596 task forward (i.e.
597 <link linkend='ref-tasks-patch'><filename>do_unpack</filename></link>,
598 <link linkend='ref-tasks-configure'><filename>do_configure</filename></link>,
599 <link linkend='ref-tasks-compile'><filename>do_compile</filename></link>,
600 <link linkend='ref-tasks-install'><filename>do_install</filename></link>,
601 and
602 <link linkend='ref-tasks-package'><filename>do_package</filename></link>).
603 </para>
604
605 <para>
606 You can run this task using BitBake as follows:
607 <literallayout class='monospaced'>
608 $ bitbake -c clean <replaceable>recipe</replaceable>
609 </literallayout>
610 </para>
611
612 <para>
613 Running this task does not remove the
614 <link linkend='shared-state-cache'>sstate</link>) cache
615 files.
616 Consequently, if no changes have been made and the recipe is
617 rebuilt after cleaning, output files are simply restored from the
618 sstate cache.
619 If you want to remove the sstate cache files for the recipe,
620 you need to use the
621 <link linkend='ref-tasks-cleansstate'><filename>do_cleansstate</filename></link>
622 task instead (i.e. <filename>bitbake -c cleansstate</filename> <replaceable>recipe</replaceable>).
623 </para>
624 </section>
625
626 <section id='ref-tasks-cleanall'>
627 <title><filename>do_cleanall</filename></title>
628
629 <para>
630 Removes all output files, shared state
631 (<link linkend='shared-state-cache'>sstate</link>) cache, and
632 downloaded source files for a target (i.e. the contents of
633 <link linkend='var-DL_DIR'><filename>DL_DIR</filename></link>).
634 Essentially, the <filename>do_cleanall</filename> task is
635 identical to the
636 <link linkend='ref-tasks-cleansstate'><filename>do_cleansstate</filename></link>
637 task with the added removal of downloaded source files.
638 </para>
639
640 <para>
641 You can run this task using BitBake as follows:
642 <literallayout class='monospaced'>
643 $ bitbake -c cleanall <replaceable>recipe</replaceable>
644 </literallayout>
645 </para>
646
647 <para>
648 Typically, you would not normally use the
649 <filename>cleanall</filename> task.
650 Do so only if you want to start fresh with the
651 <link linkend='ref-tasks-fetch'><filename>do_fetch</filename></link>
652 task.
653 </para>
654 </section>
655
656 <section id='ref-tasks-cleansstate'>
657 <title><filename>do_cleansstate</filename></title>
658
659 <para>
660 Removes all output files and shared state
661 (<link linkend='shared-state-cache'>sstate</link>)
662 cache for a target.
663 Essentially, the <filename>do_cleansstate</filename> task is
664 identical to the
665 <link linkend='ref-tasks-clean'><filename>do_clean</filename></link>
666 task with the added removal of shared state
667 (<link linkend='shared-state-cache'>sstate</link>) cache.
668 </para>
669
670 <para>
671 You can run this task using BitBake as follows:
672 <literallayout class='monospaced'>
673 $ bitbake -c cleansstate <replaceable>recipe</replaceable>
674 </literallayout>
675 </para>
676
677 <para>
678 When you run the <filename>do_cleansstate</filename> task,
679 the OpenEmbedded build system no longer uses any
680 sstate.
681 Consequently, building the recipe from scratch is guaranteed.
682 <note>
683 The <filename>do_cleansstate</filename> task cannot remove
684 sstate from a remote sstate mirror.
685 If you need to build a target from scratch using remote
686 mirrors, use the "-f" option as follows:
687 <literallayout class='monospaced'>
688 $ bitbake -f -c do_cleansstate <replaceable>target</replaceable>
689 </literallayout>
690 </note>
691 </para>
692 </section>
693
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600694 <section id='ref-tasks-devpyshell'>
695 <title><filename>do_devpyshell</filename></title>
696
697 <para>
698 Starts a shell in which an interactive Python interpreter allows
699 you to interact with the BitBake build environment.
700 From within this shell, you can directly examine and set
701 bits from the data store and execute functions as if within
702 the BitBake environment.
703 See the
704 "<ulink url='&YOCTO_DOCS_DEV_URL;#platdev-appdev-devpyshell'>Using a Development Python Shell</ulink>"
705 section in the Yocto Project Development Manual for more
706 information about using <filename>devpyshell</filename>.
707 </para>
708 </section>
709
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500710 <section id='ref-tasks-devshell'>
711 <title><filename>do_devshell</filename></title>
712
713 <para>
714 Starts a shell whose environment is set up for
715 development, debugging, or both.
716 See the
717 "<ulink url='&YOCTO_DOCS_DEV_URL;#platdev-appdev-devshell'>Using a Development Shell</ulink>"
718 section in the Yocto Project Development Manual for more
719 information about using <filename>devshell</filename>.
720 </para>
721 </section>
722
723 <section id='ref-tasks-fetchall'>
724 <title><filename>do_fetchall</filename></title>
725
726 <para>
727 Fetches all remote sources required to build a target.
728 </para>
729 </section>
730
731 <section id='ref-tasks-listtasks'>
732 <title><filename>do_listtasks</filename></title>
733
734 <para>
735 Lists all defined tasks for a target.
736 </para>
737 </section>
738
739 <section id='ref-tasks-package_index'>
740 <title><filename>do_package_index</filename></title>
741
742 <para>
743 Creates or updates the index in the
744 <link linkend='package-feeds-dev-environment'>Package Feeds</link>
745 area.
746 <note>
747 This task is not triggered with the
748 <filename>bitbake -c</filename> command-line option as
749 are the other tasks in this section.
750 Because this task is specifically for the
751 <filename>package-index</filename> recipe,
752 you run it using
753 <filename>bitbake package-index</filename>.
754 </note>
755 </para>
756 </section>
757</section>
758
759<section id='image-related-tasks'>
760 <title>Image-Related Tasks</title>
761
762 <para>
763 The following tasks are applicable to image recipes.
764 </para>
765
766 <section id='ref-tasks-bootimg'>
767 <title><filename>do_bootimg</filename></title>
768
769 <para>
770 Creates a bootable live image.
771 See the
772 <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>
773 variable for additional information on live image types.
774 </para>
775 </section>
776
777 <section id='ref-tasks-bundle_initramfs'>
778 <title><filename>do_bundle_initramfs</filename></title>
779
780 <para>
781 Combines an initial RAM disk (initramfs) image and kernel
782 together to form a single image.
783 The
784 <link linkend='var-CONFIG_INITRAMFS_SOURCE'><filename>CONFIG_INITRAMFS_SOURCE</filename></link>
785 variable has some more information about these types of images.
786 </para>
787 </section>
788
789 <section id='ref-tasks-rootfs'>
790 <title><filename>do_rootfs</filename></title>
791
792 <para>
793 Creates the root filesystem (file and directory structure) for an
794 image.
795 See the
796 "<link linkend='image-generation-dev-environment'>Image Generation</link>"
797 section for more information on how the root filesystem is created.
798 </para>
799 </section>
800
801 <section id='ref-tasks-testimage'>
802 <title><filename>do_testimage</filename></title>
803
804 <para>
805 Boots an image and performs runtime tests within the image.
806 For information on automatically testing images, see the
807 "<ulink url='&YOCTO_DOCS_DEV_URL;#performing-automated-runtime-testing'>Performing Automated Runtime Testing</ulink>"
808 section in the Yocto Project Development Manual.
809 </para>
810 </section>
811
812 <section id='ref-tasks-testimage_auto'>
813 <title><filename>do_testimage_auto</filename></title>
814
815 <para>
816 Boots an image and performs runtime tests within the image
817 immediately after it has been built.
818 This task is enabled when you set
819 <link linkend='var-TEST_IMAGE'><filename>TEST_IMAGE</filename></link>
820 equal to "1".
821 </para>
822
823 <para>
824 For information on automatically testing images, see the
825 "<ulink url='&YOCTO_DOCS_DEV_URL;#performing-automated-runtime-testing'>Performing Automated Runtime Testing</ulink>"
826 section in the Yocto Project Development Manual.
827 </para>
828 </section>
829
830 <section id='ref-tasks-vmdkimg'>
831 <title><filename>do_vmdkimg</filename></title>
832
833 <para>
834 Creates a <filename>.vmdk</filename> image for use with
835 <ulink url='http://www.vmware.com/'>VMware</ulink>
836 and compatible virtual machine hosts.
837 </para>
838 </section>
839</section>
840
841<section id='kernel-related-tasks'>
842 <title>Kernel-Related Tasks</title>
843
844 <para>
845 The following tasks are applicable to kernel recipes.
846 Some of these tasks (e.g. the
847 <link linkend='ref-tasks-menuconfig'><filename>do_menuconfig</filename></link>
848 task) are also applicable to recipes that use
849 Linux kernel style configuration such as the BusyBox recipe.
850 </para>
851
852 <section id='ref-tasks-compile_kernelmodules'>
853 <title><filename>do_compile_kernelmodules</filename></title>
854
855 <para>
856 Compiles loadable modules for the Linux kernel.
857 </para>
858 </section>
859
860 <section id='ref-tasks-diffconfig'>
861 <title><filename>do_diffconfig</filename></title>
862
863 <para>
864 Compares the old and new config files after running the
865 <link linkend='ref-tasks-menuconfig'><filename>do_menuconfig</filename></link>
866 task for the kernel.
867 </para>
868 </section>
869
870 <section id='ref-tasks-kernel_checkout'>
871 <title><filename>do_kernel_checkout</filename></title>
872
873 <para>
874 Checks out source/meta branches for a linux-yocto style kernel.
875 </para>
876 </section>
877
878 <section id='ref-tasks-kernel_configcheck'>
879 <title><filename>do_kernel_configcheck</filename></title>
880
881 <para>
882 Validates the kernel configuration for a linux-yocto style kernel.
883 </para>
884 </section>
885
886 <section id='ref-tasks-kernel_configme'>
887 <title><filename>do_kernel_configme</filename></title>
888
889 <para>
890 Assembles the kernel configuration for a linux-yocto style kernel.
891 </para>
892 </section>
893
894 <section id='ref-tasks-kernel_link_vmlinux'>
895 <title><filename>do_kernel_link_vmlinux</filename></title>
896
897 <para>
898 Creates a symbolic link in
899 <filename>arch/$arch/boot</filename> for vmlinux kernel
900 images.
901 </para>
902 </section>
903
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500904 <section id='ref-tasks-kernel_metadata'>
905 <title><filename>do_kernel_metadata</filename></title>
906
907 <para>
908 Collects kernel metadata for a
909 <filename>linux-yocto</filename> style kernel.
910 </para>
911 </section>
912
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500913 <section id='ref-tasks-menuconfig'>
914 <title><filename>do_menuconfig</filename></title>
915
916 <para>
917 Runs <filename>make menuconfig</filename> for the kernel.
918 For information on <filename>menuconfig</filename>, see the
919 "<ulink url='&YOCTO_DOCS_DEV_URL;#using-menuconfig'>Using&nbsp;&nbsp;<filename>menuconfig</filename></ulink>"
920 section in the Yocto Project Development Manual.
921 </para>
922 </section>
923
924 <section id='ref-tasks-savedefconfig'>
925 <title><filename>do_savedefconfig</filename></title>
926
927 <para>
928 Creates a minimal Linux kernel configuration file.
929 </para>
930 </section>
931
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500932 <section id='ref-tasks-shared_workdir'>
933 <title><filename>do_shared_workdir</filename></title>
934
935 <para>
936 Creates the shared working directory for the kernel.
937 </para>
938 </section>
939
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500940 <section id='ref-tasks-sizecheck'>
941 <title><filename>do_sizecheck</filename></title>
942
943 <para>
944 Checks the size of the kernel image against
945 <link linkend='var-KERNEL_IMAGE_MAXSIZE'><filename>KERNEL_IMAGE_MAXSIZE</filename></link>
946 when set.
947 </para>
948 </section>
949
950 <section id='ref-tasks-strip'>
951 <title><filename>do_strip</filename></title>
952
953 <para>
954 Strips unneeded sections out of the Linux kernel image.
955 </para>
956 </section>
957
958 <section id='ref-tasks-uboot_mkimage'>
959 <title><filename>do_uboot_mkimage</filename></title>
960
961 <para>
962 Creates a uImage file from the kernel for the U-Boot bootloader.
963 </para>
964 </section>
965
966 <section id='ref-tasks-validate_branches'>
967 <title><filename>do_validate_branches</filename></title>
968
969 <para>
970 Ensures that the source, metadata (or both) branches are on the
971 locations specified by their
972 <link linkend='var-SRCREV'><filename>SRCREV</filename></link>
973 values for a linux-yocto style kernel.
974 </para>
975 </section>
976</section>
977
978<section id='miscellaneous-tasks'>
979 <title>Miscellaneous Tasks</title>
980
981 <para>
982 The following sections describe miscellaneous tasks.
983 </para>
984
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500985 <section id='ref-tasks-spdx'>
986 <title><filename>do_spdx</filename></title>
987
988 <para>
989 A build stage that takes the source code and scans it on a remote
990 FOSSOLOGY server in order to produce an SPDX document.
991 This task applies only to the
992 <link linkend='ref-classes-spdx'><filename>spdx</filename></link>
993 class.
994 </para>
995 </section>
996</section>
997
998</chapter>
999<!--
1000vim: expandtab tw=80 ts=4
1001-->