ref-tasks.xml 44 KB

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