blob: 59b4d9607a27dd3a167b37230a91b4c318ce6cd8 [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.
22 </para>
23
24 <section id='ref-tasks-build'>
25 <title><filename>do_build</filename></title>
26
27 <para>
28 The default task for all recipes.
29 This task depends on all other normal tasks
30 required to build a recipe.
31 </para>
32 </section>
33
34 <section id='ref-tasks-compile'>
35 <title><filename>do_compile</filename></title>
36
37 <para>
38 Compiles the source in the compilation directory, which is pointed
39 to by the
40 <link linkend='var-B'><filename>B</filename></link> variable.
41 </para>
42 </section>
43
44 <section id='ref-tasks-compile_ptest_base'>
45 <title><filename>do_compile_ptest_base</filename></title>
46
47 <para>
48 Compiles the runtime test suite included in the software being
49 built.
50 </para>
51 </section>
52
53 <section id='ref-tasks-configure'>
54 <title><filename>do_configure</filename></title>
55
56 <para>
57 Configures the source by enabling and disabling any build-time and
58 configuration options for the software being built.
59 </para>
60 </section>
61
62 <section id='ref-tasks-configure_ptest_base'>
63 <title><filename>do_configure_ptest_base</filename></title>
64
65 <para>
66 Configures the runtime test suite included in the software being
67 built.
68 </para>
69 </section>
70
71 <section id='ref-tasks-deploy'>
72 <title><filename>do_deploy</filename></title>
73
74 <para>
75 Writes output files that are to be deployed to the deploy
76 directory, which is defined by the
77 <link linkend='var-DEPLOYDIR'><filename>DEPLOYDIR</filename></link>
78 variable.
79 </para>
80
81 <para>
82 The <filename>do_deploy</filename> task is a
83 shared state (sstate) task, which means that the task can
84 be accelerated through sstate use.
85 Realize also that if the task is re-executed, any previous output
86 is removed (i.e. "cleaned").
87 </para>
88 </section>
89
90 <section id='ref-tasks-fetch'>
91 <title><filename>do_fetch</filename></title>
92
93 <para>
94 Fetches the source code.
95 This task uses the
96 <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>
97 variable and the argument's prefix to determine the correct
98 fetcher module.
99 </para>
100 </section>
101
102 <section id='ref-tasks-install'>
103 <title><filename>do_install</filename></title>
104
105 <para>
106 Copies files from the compilation directory, which is defined by
107 the
108 <link linkend='var-B'><filename>B</filename></link> variable,
109 to a holding area defined by the
110 <link linkend='var-D'><filename>D</filename></link> variable.
111 </para>
112 </section>
113
114 <section id='ref-tasks-install_ptest_base'>
115 <title><filename>do_install_ptest_base</filename></title>
116
117 <para>
118 Copies the runtime test suite files from the compilation directory
119 to a holding area.
120 </para>
121 </section>
122
123 <section id='ref-tasks-package'>
124 <title><filename>do_package</filename></title>
125
126 <para>
127 Analyzes the content of the holding area and splits it into subsets
128 based on available packages and files.
129 </para>
130 </section>
131
132 <section id='ref-tasks-package_qa'>
133 <title><filename>do_package_qa</filename></title>
134
135 <para>
136 Runs QA checks on packaged files.
137 For more information on these checks, see the
138 <link linkend='ref-classes-insane'><filename>insane</filename></link>
139 class.
140 </para>
141 </section>
142
143 <section id='ref-tasks-package_write_deb'>
144 <title><filename>do_package_write_deb</filename></title>
145
146 <para>
147 Creates Debian packages (i.e. <filename>*.deb</filename> files) and
148 places them in the
149 <filename>${</filename><link linkend='var-DEPLOY_DIR_DEB'><filename>DEPLOY_DIR_DEB</filename></link><filename>}</filename>
150 directory in the package feeds area.
151 For more information, see the
152 "<link linkend='package-feeds-dev-environment'>Package Feeds</link>"
153 section.
154 </para>
155 </section>
156
157 <section id='ref-tasks-package_write_ipk'>
158 <title><filename>do_package_write_ipk</filename></title>
159
160 <para>
161 Creates IPK packages (i.e. <filename>*.ipk</filename> files) and
162 places them in the
163 <filename>${</filename><link linkend='var-DEPLOY_DIR_IPK'><filename>DEPLOY_DIR_IPK</filename></link><filename>}</filename>
164 directory in the package feeds area.
165 For more information, see the
166 "<link linkend='package-feeds-dev-environment'>Package Feeds</link>"
167 section.
168 </para>
169 </section>
170
171 <section id='ref-tasks-package_write_rpm'>
172 <title><filename>do_package_write_rpm</filename></title>
173
174 <para>
175 Creates RPM packages (i.e. <filename>*.rpm</filename> files) and
176 places them in the
177 <filename>${</filename><link linkend='var-DEPLOY_DIR_RPM'><filename>DEPLOY_DIR_RPM</filename></link><filename>}</filename>
178 directory in the package feeds area.
179 For more information, see the
180 "<link linkend='package-feeds-dev-environment'>Package Feeds</link>"
181 section.
182 </para>
183 </section>
184
185 <section id='ref-tasks-package_write_tar'>
186 <title><filename>do_package_write_tar</filename></title>
187
188 <para>
189 Creates tarballs and places them in the
190 <filename>${</filename><link linkend='var-DEPLOY_DIR_TAR'><filename>DEPLOY_DIR_TAR</filename></link><filename>}</filename>
191 directory in the package feeds area.
192 For more information, see the
193 "<link linkend='package-feeds-dev-environment'>Package Feeds</link>"
194 section.
195 </para>
196 </section>
197
198 <section id='ref-tasks-packagedata'>
199 <title><filename>do_packagedata</filename></title>
200
201 <para>
202 Creates package metadata used by the build system to generate the
203 final packages.
204 </para>
205 </section>
206
207 <section id='ref-tasks-patch'>
208 <title><filename>do_patch</filename></title>
209
210 <para>
211 Locates patch files and applies them to the source code.
212 See the
213 "<link linkend='patching-dev-environment'>Patching</link>"
214 section for more information.
215 </para>
216 </section>
217
218 <section id='ref-tasks-populate_lic'>
219 <title><filename>do_populate_lic</filename></title>
220
221 <para>
222 Writes license information for the recipe that is collected later
223 when the image is constructed.
224 </para>
225 </section>
226
227 <section id='ref-tasks-populate_sdk'>
228 <title><filename>do_populate_sdk</filename></title>
229
230 <para>
231 Creates the file and directory structure for an installable SDK.
232 See the
233 "<link linkend='sdk-generation-dev-environment'>SDK Generation</link>"
234 section for more information.
235 </para>
236 </section>
237
238 <section id='ref-tasks-populate_sysroot'>
239 <title><filename>do_populate_sysroot</filename></title>
240
241 <para>
242 Copies a subset of files installed by the
243 <link linkend='ref-tasks-install'><filename>do_install</filename></link>
244 task into the sysroot in order to make them available to other
245 recipes.
246 </para>
247
248 <para>
249 The <filename>do_populate_sysroot</filename> task is a
250 shared state (sstate) task, which means that the task can
251 be accelerated through sstate use.
252 Realize also that if the task is re-executed, any previous output
253 is removed (i.e. "cleaned").
254 </para>
255 </section>
256
257 <section id='ref-tasks-rm_work'>
258 <title><filename>do_rm_work</filename></title>
259
260 <para>
261 Removes work files after the OpenEmbedded build system has
262 finished with them.
263 You can learn more by looking at the
264 "<link linkend='ref-classes-rm-work'><filename>rm_work.bbclass</filename></link>"
265 section.
266 </para>
267 </section>
268
269 <section id='ref-tasks-rm_work_all'>
270 <title><filename>do_rm_work_all</filename></title>
271
272 <para>
273 Top-level task for removing work files after the build system has
274 finished with them.
275 </para>
276 </section>
277
278 <section id='ref-tasks-unpack'>
279 <title><filename>do_unpack</filename></title>
280
281 <para>
282 Unpacks the source code into a working directory pointed to
283 by
284 <filename>${</filename><link linkend='var-WORKDIR'><filename>WORKDIR</filename></link><filename>}</filename>.
285 The
286 <link linkend='var-S'><filename>S</filename></link> variable also
287 plays a role in where unpacked source files ultimately reside.
288 For more information on how source files are unpacked, see the
289 "<link linkend='source-fetching-dev-environment'>Source Fetching</link>"
290 section and the <filename>WORKDIR</filename> and
291 <filename>S</filename> variable descriptions.
292 </para>
293 </section>
294</section>
295
296<section id='manually-called-tasks'>
297 <title>Manually Called Tasks</title>
298
299 <para>
300 These tasks are typically manually triggered (e.g. by using the
301 <filename>bitbake -c</filename> command-line option):
302 </para>
303
304 <section id='ref-tasks-checkuri'>
305 <title><filename>do_checkuri</filename></title>
306
307 <para>
308 Validates the
309 <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>
310 value.
311 </para>
312 </section>
313
314 <section id='ref-tasks-checkuriall'>
315 <title><filename>do_checkuriall</filename></title>
316
317 <para>
318 Validates the
319 <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>
320 value for all recipes required to build a target.
321 </para>
322 </section>
323
324 <section id='ref-tasks-clean'>
325 <title><filename>do_clean</filename></title>
326
327 <para>
328 Removes all output files for a target from the
329 <link linkend='ref-tasks-unpack'><filename>do_unpack</filename></link>
330 task forward (i.e.
331 <link linkend='ref-tasks-patch'><filename>do_unpack</filename></link>,
332 <link linkend='ref-tasks-configure'><filename>do_configure</filename></link>,
333 <link linkend='ref-tasks-compile'><filename>do_compile</filename></link>,
334 <link linkend='ref-tasks-install'><filename>do_install</filename></link>,
335 and
336 <link linkend='ref-tasks-package'><filename>do_package</filename></link>).
337 </para>
338
339 <para>
340 You can run this task using BitBake as follows:
341 <literallayout class='monospaced'>
342 $ bitbake -c clean <replaceable>recipe</replaceable>
343 </literallayout>
344 </para>
345
346 <para>
347 Running this task does not remove the
348 <link linkend='shared-state-cache'>sstate</link>) cache
349 files.
350 Consequently, if no changes have been made and the recipe is
351 rebuilt after cleaning, output files are simply restored from the
352 sstate cache.
353 If you want to remove the sstate cache files for the recipe,
354 you need to use the
355 <link linkend='ref-tasks-cleansstate'><filename>do_cleansstate</filename></link>
356 task instead (i.e. <filename>bitbake -c cleansstate</filename> <replaceable>recipe</replaceable>).
357 </para>
358 </section>
359
360 <section id='ref-tasks-cleanall'>
361 <title><filename>do_cleanall</filename></title>
362
363 <para>
364 Removes all output files, shared state
365 (<link linkend='shared-state-cache'>sstate</link>) cache, and
366 downloaded source files for a target (i.e. the contents of
367 <link linkend='var-DL_DIR'><filename>DL_DIR</filename></link>).
368 Essentially, the <filename>do_cleanall</filename> task is
369 identical to the
370 <link linkend='ref-tasks-cleansstate'><filename>do_cleansstate</filename></link>
371 task with the added removal of downloaded source files.
372 </para>
373
374 <para>
375 You can run this task using BitBake as follows:
376 <literallayout class='monospaced'>
377 $ bitbake -c cleanall <replaceable>recipe</replaceable>
378 </literallayout>
379 </para>
380
381 <para>
382 Typically, you would not normally use the
383 <filename>cleanall</filename> task.
384 Do so only if you want to start fresh with the
385 <link linkend='ref-tasks-fetch'><filename>do_fetch</filename></link>
386 task.
387 </para>
388 </section>
389
390 <section id='ref-tasks-cleansstate'>
391 <title><filename>do_cleansstate</filename></title>
392
393 <para>
394 Removes all output files and shared state
395 (<link linkend='shared-state-cache'>sstate</link>)
396 cache for a target.
397 Essentially, the <filename>do_cleansstate</filename> task is
398 identical to the
399 <link linkend='ref-tasks-clean'><filename>do_clean</filename></link>
400 task with the added removal of shared state
401 (<link linkend='shared-state-cache'>sstate</link>) cache.
402 </para>
403
404 <para>
405 You can run this task using BitBake as follows:
406 <literallayout class='monospaced'>
407 $ bitbake -c cleansstate <replaceable>recipe</replaceable>
408 </literallayout>
409 </para>
410
411 <para>
412 When you run the <filename>do_cleansstate</filename> task,
413 the OpenEmbedded build system no longer uses any
414 sstate.
415 Consequently, building the recipe from scratch is guaranteed.
416 <note>
417 The <filename>do_cleansstate</filename> task cannot remove
418 sstate from a remote sstate mirror.
419 If you need to build a target from scratch using remote
420 mirrors, use the "-f" option as follows:
421 <literallayout class='monospaced'>
422 $ bitbake -f -c do_cleansstate <replaceable>target</replaceable>
423 </literallayout>
424 </note>
425 </para>
426 </section>
427
428 <section id='ref-tasks-devshell'>
429 <title><filename>do_devshell</filename></title>
430
431 <para>
432 Starts a shell whose environment is set up for
433 development, debugging, or both.
434 See the
435 "<ulink url='&YOCTO_DOCS_DEV_URL;#platdev-appdev-devshell'>Using a Development Shell</ulink>"
436 section in the Yocto Project Development Manual for more
437 information about using <filename>devshell</filename>.
438 </para>
439 </section>
440
441 <section id='ref-tasks-fetchall'>
442 <title><filename>do_fetchall</filename></title>
443
444 <para>
445 Fetches all remote sources required to build a target.
446 </para>
447 </section>
448
449 <section id='ref-tasks-listtasks'>
450 <title><filename>do_listtasks</filename></title>
451
452 <para>
453 Lists all defined tasks for a target.
454 </para>
455 </section>
456
457 <section id='ref-tasks-package_index'>
458 <title><filename>do_package_index</filename></title>
459
460 <para>
461 Creates or updates the index in the
462 <link linkend='package-feeds-dev-environment'>Package Feeds</link>
463 area.
464 <note>
465 This task is not triggered with the
466 <filename>bitbake -c</filename> command-line option as
467 are the other tasks in this section.
468 Because this task is specifically for the
469 <filename>package-index</filename> recipe,
470 you run it using
471 <filename>bitbake package-index</filename>.
472 </note>
473 </para>
474 </section>
475</section>
476
477<section id='image-related-tasks'>
478 <title>Image-Related Tasks</title>
479
480 <para>
481 The following tasks are applicable to image recipes.
482 </para>
483
484 <section id='ref-tasks-bootimg'>
485 <title><filename>do_bootimg</filename></title>
486
487 <para>
488 Creates a bootable live image.
489 See the
490 <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>
491 variable for additional information on live image types.
492 </para>
493 </section>
494
495 <section id='ref-tasks-bundle_initramfs'>
496 <title><filename>do_bundle_initramfs</filename></title>
497
498 <para>
499 Combines an initial RAM disk (initramfs) image and kernel
500 together to form a single image.
501 The
502 <link linkend='var-CONFIG_INITRAMFS_SOURCE'><filename>CONFIG_INITRAMFS_SOURCE</filename></link>
503 variable has some more information about these types of images.
504 </para>
505 </section>
506
507 <section id='ref-tasks-rootfs'>
508 <title><filename>do_rootfs</filename></title>
509
510 <para>
511 Creates the root filesystem (file and directory structure) for an
512 image.
513 See the
514 "<link linkend='image-generation-dev-environment'>Image Generation</link>"
515 section for more information on how the root filesystem is created.
516 </para>
517 </section>
518
519 <section id='ref-tasks-testimage'>
520 <title><filename>do_testimage</filename></title>
521
522 <para>
523 Boots an image and performs runtime tests within the image.
524 For information on automatically testing images, see the
525 "<ulink url='&YOCTO_DOCS_DEV_URL;#performing-automated-runtime-testing'>Performing Automated Runtime Testing</ulink>"
526 section in the Yocto Project Development Manual.
527 </para>
528 </section>
529
530 <section id='ref-tasks-testimage_auto'>
531 <title><filename>do_testimage_auto</filename></title>
532
533 <para>
534 Boots an image and performs runtime tests within the image
535 immediately after it has been built.
536 This task is enabled when you set
537 <link linkend='var-TEST_IMAGE'><filename>TEST_IMAGE</filename></link>
538 equal to "1".
539 </para>
540
541 <para>
542 For information on automatically testing images, see the
543 "<ulink url='&YOCTO_DOCS_DEV_URL;#performing-automated-runtime-testing'>Performing Automated Runtime Testing</ulink>"
544 section in the Yocto Project Development Manual.
545 </para>
546 </section>
547
548 <section id='ref-tasks-vmdkimg'>
549 <title><filename>do_vmdkimg</filename></title>
550
551 <para>
552 Creates a <filename>.vmdk</filename> image for use with
553 <ulink url='http://www.vmware.com/'>VMware</ulink>
554 and compatible virtual machine hosts.
555 </para>
556 </section>
557</section>
558
559<section id='kernel-related-tasks'>
560 <title>Kernel-Related Tasks</title>
561
562 <para>
563 The following tasks are applicable to kernel recipes.
564 Some of these tasks (e.g. the
565 <link linkend='ref-tasks-menuconfig'><filename>do_menuconfig</filename></link>
566 task) are also applicable to recipes that use
567 Linux kernel style configuration such as the BusyBox recipe.
568 </para>
569
570 <section id='ref-tasks-compile_kernelmodules'>
571 <title><filename>do_compile_kernelmodules</filename></title>
572
573 <para>
574 Compiles loadable modules for the Linux kernel.
575 </para>
576 </section>
577
578 <section id='ref-tasks-diffconfig'>
579 <title><filename>do_diffconfig</filename></title>
580
581 <para>
582 Compares the old and new config files after running the
583 <link linkend='ref-tasks-menuconfig'><filename>do_menuconfig</filename></link>
584 task for the kernel.
585 </para>
586 </section>
587
588 <section id='ref-tasks-kernel_checkout'>
589 <title><filename>do_kernel_checkout</filename></title>
590
591 <para>
592 Checks out source/meta branches for a linux-yocto style kernel.
593 </para>
594 </section>
595
596 <section id='ref-tasks-kernel_configcheck'>
597 <title><filename>do_kernel_configcheck</filename></title>
598
599 <para>
600 Validates the kernel configuration for a linux-yocto style kernel.
601 </para>
602 </section>
603
604 <section id='ref-tasks-kernel_configme'>
605 <title><filename>do_kernel_configme</filename></title>
606
607 <para>
608 Assembles the kernel configuration for a linux-yocto style kernel.
609 </para>
610 </section>
611
612 <section id='ref-tasks-kernel_link_vmlinux'>
613 <title><filename>do_kernel_link_vmlinux</filename></title>
614
615 <para>
616 Creates a symbolic link in
617 <filename>arch/$arch/boot</filename> for vmlinux kernel
618 images.
619 </para>
620 </section>
621
622 <section id='ref-tasks-menuconfig'>
623 <title><filename>do_menuconfig</filename></title>
624
625 <para>
626 Runs <filename>make menuconfig</filename> for the kernel.
627 For information on <filename>menuconfig</filename>, see the
628 "<ulink url='&YOCTO_DOCS_DEV_URL;#using-menuconfig'>Using&nbsp;&nbsp;<filename>menuconfig</filename></ulink>"
629 section in the Yocto Project Development Manual.
630 </para>
631 </section>
632
633 <section id='ref-tasks-savedefconfig'>
634 <title><filename>do_savedefconfig</filename></title>
635
636 <para>
637 Creates a minimal Linux kernel configuration file.
638 </para>
639 </section>
640
641 <section id='ref-tasks-sizecheck'>
642 <title><filename>do_sizecheck</filename></title>
643
644 <para>
645 Checks the size of the kernel image against
646 <link linkend='var-KERNEL_IMAGE_MAXSIZE'><filename>KERNEL_IMAGE_MAXSIZE</filename></link>
647 when set.
648 </para>
649 </section>
650
651 <section id='ref-tasks-strip'>
652 <title><filename>do_strip</filename></title>
653
654 <para>
655 Strips unneeded sections out of the Linux kernel image.
656 </para>
657 </section>
658
659 <section id='ref-tasks-uboot_mkimage'>
660 <title><filename>do_uboot_mkimage</filename></title>
661
662 <para>
663 Creates a uImage file from the kernel for the U-Boot bootloader.
664 </para>
665 </section>
666
667 <section id='ref-tasks-validate_branches'>
668 <title><filename>do_validate_branches</filename></title>
669
670 <para>
671 Ensures that the source, metadata (or both) branches are on the
672 locations specified by their
673 <link linkend='var-SRCREV'><filename>SRCREV</filename></link>
674 values for a linux-yocto style kernel.
675 </para>
676 </section>
677</section>
678
679<section id='miscellaneous-tasks'>
680 <title>Miscellaneous Tasks</title>
681
682 <para>
683 The following sections describe miscellaneous tasks.
684 </para>
685
686 <section id='ref-tasks-generate_qt_config_file'>
687 <title><filename>do_generate_qt_config_file</filename></title>
688
689 <para>
690 Writes a <filename>qt.conf</filename> configuration
691 file used for building a Qt-based application.
692 </para>
693 </section>
694
695 <section id='ref-tasks-spdx'>
696 <title><filename>do_spdx</filename></title>
697
698 <para>
699 A build stage that takes the source code and scans it on a remote
700 FOSSOLOGY server in order to produce an SPDX document.
701 This task applies only to the
702 <link linkend='ref-classes-spdx'><filename>spdx</filename></link>
703 class.
704 </para>
705 </section>
706</section>
707
708</chapter>
709<!--
710vim: expandtab tw=80 ts=4
711-->