tasks.rst 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813
  1. .. SPDX-License-Identifier: CC-BY-SA-2.0-UK
  2. *****
  3. Tasks
  4. *****
  5. Tasks are units of execution for BitBake. Recipes (``.bb`` files) use
  6. tasks to complete configuring, compiling, and packaging software. This
  7. chapter provides a reference of the tasks defined in the OpenEmbedded
  8. build system.
  9. Normal Recipe Build Tasks
  10. =========================
  11. The following sections describe normal tasks associated with building a
  12. recipe. For more information on tasks and dependencies, see the
  13. ":ref:`bitbake-user-manual/bitbake-user-manual-metadata:tasks`" and
  14. ":ref:`bitbake-user-manual/bitbake-user-manual-execution:dependencies`" sections in the
  15. BitBake User Manual.
  16. .. _ref-tasks-build:
  17. ``do_build``
  18. ------------
  19. The default task for all recipes. This task depends on all other normal
  20. tasks required to build a recipe.
  21. .. _ref-tasks-compile:
  22. ``do_compile``
  23. --------------
  24. Compiles the source code. This task runs with the current working
  25. directory set to ``${``\ :term:`B`\ ``}``.
  26. The default behavior of this task is to run the ``oe_runmake`` function
  27. if a makefile (``Makefile``, ``makefile``, or ``GNUmakefile``) is found.
  28. If no such file is found, the :ref:`ref-tasks-compile` task does nothing.
  29. .. _ref-tasks-compile_ptest_base:
  30. ``do_compile_ptest_base``
  31. -------------------------
  32. Compiles the runtime test suite included in the software being built.
  33. .. _ref-tasks-configure:
  34. ``do_configure``
  35. ----------------
  36. Configures the source by enabling and disabling any build-time and
  37. configuration options for the software being built. The task runs with
  38. the current working directory set to ``${``\ :term:`B`\ ``}``.
  39. The default behavior of this task is to run ``oe_runmake clean`` if a
  40. makefile (``Makefile``, ``makefile``, or ``GNUmakefile``) is found and
  41. :term:`CLEANBROKEN` is not set to "1". If no such
  42. file is found or the :term:`CLEANBROKEN` variable is set to "1", the
  43. :ref:`ref-tasks-configure` task does nothing.
  44. .. _ref-tasks-configure_ptest_base:
  45. ``do_configure_ptest_base``
  46. ---------------------------
  47. Configures the runtime test suite included in the software being built.
  48. .. _ref-tasks-deploy:
  49. ``do_deploy``
  50. -------------
  51. Writes output files that are to be deployed to
  52. ``${``\ :term:`DEPLOY_DIR_IMAGE`\ ``}``. The
  53. task runs with the current working directory set to
  54. ``${``\ :term:`B`\ ``}``.
  55. Recipes implementing this task should inherit the
  56. :ref:`ref-classes-deploy` class and should write the output
  57. to ``${``\ :term:`DEPLOYDIR`\ ``}``, which is not to be
  58. confused with ``${DEPLOY_DIR}``. The :ref:`ref-classes-deploy` class sets up
  59. :ref:`ref-tasks-deploy` as a shared state (sstate) task that can be accelerated
  60. through sstate use. The sstate mechanism takes care of copying the
  61. output from ``${DEPLOYDIR}`` to ``${DEPLOY_DIR_IMAGE}``.
  62. .. note::
  63. Do not write the output directly to ``${DEPLOY_DIR_IMAGE}``, as this causes
  64. the sstate mechanism to malfunction.
  65. The :ref:`ref-tasks-deploy` task is not added as a task by default and
  66. consequently needs to be added manually. If you want the task to run
  67. after :ref:`ref-tasks-compile`, you can add it by doing
  68. the following::
  69. addtask deploy after do_compile
  70. Adding :ref:`ref-tasks-deploy` after other tasks works the same way.
  71. .. note::
  72. You do not need to add ``before do_build`` to the ``addtask`` command
  73. (though it is harmless), because the :ref:`ref-classes-base` class contains the following::
  74. do_build[recrdeptask] += "do_deploy"
  75. See the ":ref:`bitbake-user-manual/bitbake-user-manual-execution:dependencies`"
  76. section in the BitBake User Manual for more information.
  77. If the :ref:`ref-tasks-deploy` task re-executes, any previous output is removed
  78. (i.e. "cleaned").
  79. .. _ref-tasks-fetch:
  80. ``do_fetch``
  81. ------------
  82. Fetches the source code. This task uses the :term:`SRC_URI` variable and the
  83. argument's prefix to determine the correct
  84. :ref:`fetcher <bitbake-user-manual/bitbake-user-manual-fetching:fetchers>`
  85. module.
  86. .. _ref-tasks-image:
  87. ``do_image``
  88. ------------
  89. Starts the image generation process. The :ref:`ref-tasks-image` task runs after
  90. the OpenEmbedded build system has run the
  91. :ref:`ref-tasks-rootfs` task during which packages are
  92. identified for installation into the image and the root filesystem is
  93. created, complete with post-processing.
  94. The :ref:`ref-tasks-image` task performs pre-processing on the image through the
  95. :term:`IMAGE_PREPROCESS_COMMAND` and
  96. dynamically generates supporting :ref:`do_image_* <ref-tasks-image>` tasks as needed.
  97. For more information on image creation, see the ":ref:`overview-manual/concepts:image generation`"
  98. section in the Yocto Project Overview and Concepts Manual.
  99. .. _ref-tasks-image-complete:
  100. ``do_image_complete``
  101. ---------------------
  102. Completes the image generation process. The :ref:`do_image_complete <ref-tasks-image-complete>` task
  103. runs after the OpenEmbedded build system has run the
  104. :ref:`ref-tasks-image` task during which image
  105. pre-processing occurs and through dynamically generated :ref:`do_image_* <ref-tasks-image>`
  106. tasks the image is constructed.
  107. The :ref:`do_image_complete <ref-tasks-image-complete>` task performs post-processing on the image
  108. through the
  109. :term:`IMAGE_POSTPROCESS_COMMAND`.
  110. For more information on image creation, see the
  111. ":ref:`overview-manual/concepts:image generation`"
  112. section in the Yocto Project Overview and Concepts Manual.
  113. .. _ref-tasks-install:
  114. ``do_install``
  115. --------------
  116. Copies files that are to be packaged into the holding area
  117. ``${``\ :term:`D`\ ``}``. This task runs with the current
  118. working directory set to ``${``\ :term:`B`\ ``}``, which is the
  119. compilation directory. The :ref:`ref-tasks-install` task, as well as other tasks
  120. that either directly or indirectly depend on the installed files (e.g.
  121. :ref:`ref-tasks-package`, :ref:`do_package_write_* <ref-tasks-package_write_deb>`, and
  122. :ref:`ref-tasks-rootfs`), run under
  123. :ref:`fakeroot <overview-manual/concepts:fakeroot and pseudo>`.
  124. .. note::
  125. When installing files, be careful not to set the owner and group IDs
  126. of the installed files to unintended values. Some methods of copying
  127. files, notably when using the recursive ``cp`` command, can preserve
  128. the UID and/or GID of the original file, which is usually not what
  129. you want. The ``host-user-contaminated`` QA check checks for files
  130. that probably have the wrong ownership.
  131. Safe methods for installing files include the following:
  132. - The ``install`` utility. This utility is the preferred method.
  133. - The ``cp`` command with the ``--no-preserve=ownership`` option.
  134. - The ``tar`` command with the ``--no-same-owner`` option. See the
  135. ``bin_package.bbclass`` file in the ``meta/classes-recipe``
  136. subdirectory of the :term:`Source Directory` for an example.
  137. .. _ref-tasks-install_ptest_base:
  138. ``do_install_ptest_base``
  139. -------------------------
  140. Copies the runtime test suite files from the compilation directory to a
  141. holding area.
  142. .. _ref-tasks-package:
  143. ``do_package``
  144. --------------
  145. Analyzes the content of the holding area
  146. ``${``\ :term:`D`\ ``}`` and splits the content into subsets
  147. based on available packages and files. This task makes use of the
  148. :term:`PACKAGES` and :term:`FILES`
  149. variables.
  150. The :ref:`ref-tasks-package` task, in conjunction with the
  151. :ref:`ref-tasks-packagedata` task, also saves some
  152. important package metadata. For additional information, see the
  153. :term:`PKGDESTWORK` variable and the
  154. ":ref:`overview-manual/concepts:automatically added runtime dependencies`"
  155. section in the Yocto Project Overview and Concepts Manual.
  156. .. _ref-tasks-package_qa:
  157. ``do_package_qa``
  158. -----------------
  159. Runs QA checks on packaged files. For more information on these checks,
  160. see the :ref:`ref-classes-insane` class.
  161. .. _ref-tasks-package_write_deb:
  162. ``do_package_write_deb``
  163. ------------------------
  164. Creates Debian packages (i.e. ``*.deb`` files) and places them in the
  165. ``${``\ :term:`DEPLOY_DIR_DEB`\ ``}`` directory in
  166. the package feeds area. For more information, see the
  167. ":ref:`overview-manual/concepts:package feeds`" section in
  168. the Yocto Project Overview and Concepts Manual.
  169. .. _ref-tasks-package_write_ipk:
  170. ``do_package_write_ipk``
  171. ------------------------
  172. Creates IPK packages (i.e. ``*.ipk`` files) and places them in the
  173. ``${``\ :term:`DEPLOY_DIR_IPK`\ ``}`` directory in
  174. the package feeds area. For more information, see the
  175. ":ref:`overview-manual/concepts:package feeds`" section in
  176. the Yocto Project Overview and Concepts Manual.
  177. .. _ref-tasks-package_write_rpm:
  178. ``do_package_write_rpm``
  179. ------------------------
  180. Creates RPM packages (i.e. ``*.rpm`` files) and places them in the
  181. ``${``\ :term:`DEPLOY_DIR_RPM`\ ``}`` directory in
  182. the package feeds area. For more information, see the
  183. ":ref:`overview-manual/concepts:package feeds`" section in
  184. the Yocto Project Overview and Concepts Manual.
  185. .. _ref-tasks-packagedata:
  186. ``do_packagedata``
  187. ------------------
  188. Saves package metadata generated by the
  189. :ref:`ref-tasks-package` task in
  190. :term:`PKGDATA_DIR` to make it available globally.
  191. .. _ref-tasks-patch:
  192. ``do_patch``
  193. ------------
  194. Locates patch files and applies them to the source code.
  195. After fetching and unpacking source files, the build system uses the
  196. recipe's :term:`SRC_URI` statements
  197. to locate and apply patch files to the source code.
  198. .. note::
  199. The build system uses the :term:`FILESPATH` variable to determine the
  200. default set of directories when searching for patches.
  201. Patch files, by default, are ``*.patch`` and ``*.diff`` files created
  202. and kept in a subdirectory of the directory holding the recipe file. For
  203. example, consider the
  204. :yocto_git:`bluez5 </poky/tree/meta/recipes-connectivity/bluez5>`
  205. recipe from the OE-Core layer (i.e. ``poky/meta``)::
  206. poky/meta/recipes-connectivity/bluez5
  207. This recipe has two patch files located here::
  208. poky/meta/recipes-connectivity/bluez5/bluez5
  209. In the ``bluez5`` recipe, the :term:`SRC_URI` statements point to the source
  210. and patch files needed to build the package.
  211. .. note::
  212. In the case for the ``bluez5_5.48.bb`` recipe, the :term:`SRC_URI` statements
  213. are from an include file ``bluez5.inc``.
  214. As mentioned earlier, the build system treats files whose file types are
  215. ``.patch`` and ``.diff`` as patch files. However, you can use the
  216. "apply=yes" parameter with the :term:`SRC_URI` statement to indicate any
  217. file as a patch file::
  218. SRC_URI = " \
  219. git://path_to_repo/some_package \
  220. file://file;apply=yes \
  221. "
  222. Conversely, if you have a file whose file type is ``.patch`` or ``.diff``
  223. and you want to exclude it so that the :ref:`ref-tasks-patch` task does not apply
  224. it during the patch phase, you can use the "apply=no" parameter with the
  225. :term:`SRC_URI` statement::
  226. SRC_URI = " \
  227. git://path_to_repo/some_package \
  228. file://file1.patch \
  229. file://file2.patch;apply=no \
  230. "
  231. In the previous example ``file1.patch`` would be applied as a patch by default
  232. while ``file2.patch`` would not be applied.
  233. You can find out more about the patching process in the
  234. ":ref:`overview-manual/concepts:patching`" section in
  235. the Yocto Project Overview and Concepts Manual and the
  236. ":ref:`dev-manual/new-recipe:patching code`" section in the
  237. Yocto Project Development Tasks Manual.
  238. .. _ref-tasks-populate_lic:
  239. ``do_populate_lic``
  240. -------------------
  241. Writes license information for the recipe that is collected later when
  242. the image is constructed.
  243. .. _ref-tasks-populate_sdk:
  244. ``do_populate_sdk``
  245. -------------------
  246. Creates the file and directory structure for an installable SDK. See the
  247. ":ref:`overview-manual/concepts:sdk generation`"
  248. section in the Yocto Project Overview and Concepts Manual for more
  249. information.
  250. .. _ref-tasks-populate_sdk_ext:
  251. ``do_populate_sdk_ext``
  252. -----------------------
  253. Creates the file and directory structure for an installable extensible
  254. SDK (eSDK). See the ":ref:`overview-manual/concepts:sdk generation`"
  255. section in the Yocto Project Overview and Concepts Manual for more
  256. information.
  257. .. _ref-tasks-populate_sysroot:
  258. ``do_populate_sysroot``
  259. -----------------------
  260. Stages (copies) a subset of the files installed by the
  261. :ref:`ref-tasks-install` task into the appropriate
  262. sysroot. For information on how to access these files from other
  263. recipes, see the :term:`STAGING_DIR* <STAGING_DIR_HOST>` variables.
  264. Directories that would typically not be needed by other recipes at build
  265. time (e.g. ``/etc``) are not copied by default.
  266. For information on what directories are copied by default, see the
  267. :term:`SYSROOT_DIRS* <SYSROOT_DIRS>` variables. You can change
  268. these variables inside your recipe if you need to make additional (or
  269. fewer) directories available to other recipes at build time.
  270. The :ref:`ref-tasks-populate_sysroot` task is a shared state (sstate) task, which
  271. means that the task can be accelerated through sstate use. Realize also
  272. that if the task is re-executed, any previous output is removed (i.e.
  273. "cleaned").
  274. .. _ref-tasks-prepare_recipe_sysroot:
  275. ``do_prepare_recipe_sysroot``
  276. -----------------------------
  277. Installs the files into the individual recipe specific sysroots (i.e.
  278. ``recipe-sysroot`` and ``recipe-sysroot-native`` under
  279. ``${``\ :term:`WORKDIR`\ ``}`` based upon the
  280. dependencies specified by :term:`DEPENDS`). See the
  281. ":ref:`ref-classes-staging`" class for more information.
  282. .. _ref-tasks-rm_work:
  283. ``do_rm_work``
  284. --------------
  285. Removes work files after the OpenEmbedded build system has finished with
  286. them. You can learn more by looking at the
  287. ":ref:`ref-classes-rm-work`" section.
  288. .. _ref-tasks-unpack:
  289. ``do_unpack``
  290. -------------
  291. Unpacks the source code into a working directory pointed to by
  292. ``${``\ :term:`WORKDIR`\ ``}``. The :term:`S`
  293. variable also plays a role in where unpacked source files ultimately
  294. reside. For more information on how source files are unpacked, see the
  295. ":ref:`overview-manual/concepts:source fetching`"
  296. section in the Yocto Project Overview and Concepts Manual and also see
  297. the :term:`WORKDIR` and :term:`S` variable descriptions.
  298. Manually Called Tasks
  299. =====================
  300. These tasks are typically manually triggered (e.g. by using the
  301. ``bitbake -c`` command-line option):
  302. ``do_checkuri``
  303. ---------------
  304. Validates the :term:`SRC_URI` value.
  305. .. _ref-tasks-clean:
  306. ``do_clean``
  307. ------------
  308. Removes all output files for a target from the
  309. :ref:`ref-tasks-unpack` task forward (i.e. :ref:`ref-tasks-unpack`,
  310. :ref:`ref-tasks-configure`,
  311. :ref:`ref-tasks-compile`,
  312. :ref:`ref-tasks-install`, and
  313. :ref:`ref-tasks-package`).
  314. You can run this task using BitBake as follows::
  315. $ bitbake -c clean recipe
  316. Running this task does not remove the
  317. :ref:`sstate <overview-manual/concepts:shared state cache>` cache files.
  318. Consequently, if no changes have been made and the recipe is rebuilt
  319. after cleaning, output files are simply restored from the sstate cache.
  320. If you want to remove the sstate cache files for the recipe, you need to
  321. use the :ref:`ref-tasks-cleansstate` task instead
  322. (i.e. ``bitbake -c cleansstate`` recipe).
  323. .. _ref-tasks-cleanall:
  324. ``do_cleanall``
  325. ---------------
  326. Removes all output files, shared state
  327. (:ref:`sstate <overview-manual/concepts:shared state cache>`) cache, and
  328. downloaded source files for a target (i.e. the contents of
  329. :term:`DL_DIR`). Essentially, the :ref:`ref-tasks-cleanall` task is
  330. identical to the :ref:`ref-tasks-cleansstate` task
  331. with the added removal of downloaded source files.
  332. You can run this task using BitBake as follows::
  333. $ bitbake -c cleanall recipe
  334. You should never use the :ref:`ref-tasks-cleanall` task in a normal
  335. scenario. If you want to start fresh with the :ref:`ref-tasks-fetch` task,
  336. use instead::
  337. $ bitbake -f -c fetch recipe
  338. .. note::
  339. The reason to prefer ``bitbake -f -c fetch`` is that the
  340. :ref:`ref-tasks-cleanall` task would break in some cases, such as::
  341. $ bitbake -c fetch recipe
  342. $ bitbake -c cleanall recipe-native
  343. $ bitbake -c unpack recipe
  344. because after step 1 there is a stamp file for the
  345. :ref:`ref-tasks-fetch` task of ``recipe``, and it won't be removed at
  346. step 2 because step 2 uses a different work directory. So the unpack task
  347. at step 3 will try to extract the downloaded archive and fail as it has
  348. been deleted in step 2.
  349. Note that this also applies to BitBake from concurrent processes when a
  350. shared download directory (:term:`DL_DIR`) is setup.
  351. .. _ref-tasks-cleansstate:
  352. ``do_cleansstate``
  353. ------------------
  354. Removes all output files and shared state
  355. (:ref:`sstate <overview-manual/concepts:shared state cache>`) cache for a
  356. target. Essentially, the :ref:`ref-tasks-cleansstate` task is identical to the
  357. :ref:`ref-tasks-clean` task with the added removal of
  358. shared state (:ref:`sstate <overview-manual/concepts:shared state cache>`)
  359. cache.
  360. You can run this task using BitBake as follows::
  361. $ bitbake -c cleansstate recipe
  362. When you run the :ref:`ref-tasks-cleansstate` task, the OpenEmbedded build system
  363. no longer uses any sstate. Consequently, building the recipe from
  364. scratch is guaranteed.
  365. .. note::
  366. Using :ref:`ref-tasks-cleansstate` with a shared :term:`SSTATE_DIR` is
  367. not recommended because it could trigger an error during the build of a
  368. separate BitBake instance. This is because the builds check sstate "up
  369. front" but download the files later, so it if is deleted in the
  370. meantime, it will cause an error but not a total failure as it will
  371. rebuild it.
  372. The reliable and preferred way to force a new build is to use ``bitbake
  373. -f`` instead.
  374. .. note::
  375. The :ref:`ref-tasks-cleansstate` task cannot remove sstate from a remote sstate
  376. mirror. If you need to build a target from scratch using remote mirrors, use
  377. the "-f" option as follows::
  378. $ bitbake -f -c do_cleansstate target
  379. .. _ref-tasks-pydevshell:
  380. ``do_pydevshell``
  381. -----------------
  382. Starts a shell in which an interactive Python interpreter allows you to
  383. interact with the BitBake build environment. From within this shell, you
  384. can directly examine and set bits from the data store and execute
  385. functions as if within the BitBake environment. See the ":ref:`dev-manual/python-development-shell:using a Python development shell`" section in
  386. the Yocto Project Development Tasks Manual for more information about
  387. using ``pydevshell``.
  388. .. _ref-tasks-devshell:
  389. ``do_devshell``
  390. ---------------
  391. Starts a shell whose environment is set up for development, debugging,
  392. or both. See the ":ref:`dev-manual/development-shell:using a development shell`" section in the
  393. Yocto Project Development Tasks Manual for more information about using
  394. ``devshell``.
  395. .. _ref-tasks-listtasks:
  396. ``do_listtasks``
  397. ----------------
  398. Lists all defined tasks for a target.
  399. .. _ref-tasks-package_index:
  400. ``do_package_index``
  401. --------------------
  402. Creates or updates the index in the :ref:`overview-manual/concepts:package feeds` area.
  403. .. note::
  404. This task is not triggered with the ``bitbake -c`` command-line option as
  405. are the other tasks in this section. Because this task is specifically for
  406. the ``package-index`` recipe, you run it using ``bitbake package-index``.
  407. Image-Related Tasks
  408. ===================
  409. The following tasks are applicable to image recipes.
  410. .. _ref-tasks-bootimg:
  411. ``do_bootimg``
  412. --------------
  413. Creates a bootable live image. See the
  414. :term:`IMAGE_FSTYPES` variable for additional
  415. information on live image types.
  416. .. _ref-tasks-bundle_initramfs:
  417. ``do_bundle_initramfs``
  418. -----------------------
  419. Combines an :term:`Initramfs` image and kernel together to
  420. form a single image.
  421. .. _ref-tasks-rootfs:
  422. ``do_rootfs``
  423. -------------
  424. Creates the root filesystem (file and directory structure) for an image.
  425. See the ":ref:`overview-manual/concepts:image generation`"
  426. section in the Yocto Project Overview and Concepts Manual for more
  427. information on how the root filesystem is created.
  428. .. _ref-tasks-testimage:
  429. ``do_testimage``
  430. ----------------
  431. Boots an image and performs runtime tests within the image. For
  432. information on automatically testing images, see the
  433. ":ref:`test-manual/runtime-testing:performing automated runtime testing`"
  434. section in the Yocto Project Test Environment Manual.
  435. .. _ref-tasks-testimage_auto:
  436. ``do_testimage_auto``
  437. ---------------------
  438. Boots an image and performs runtime tests within the image immediately
  439. after it has been built. This task is enabled when you set
  440. :term:`TESTIMAGE_AUTO` equal to "1".
  441. For information on automatically testing images, see the
  442. ":ref:`test-manual/runtime-testing:performing automated runtime testing`"
  443. section in the Yocto Project Test Environment Manual.
  444. Kernel-Related Tasks
  445. ====================
  446. The following tasks are applicable to kernel recipes. Some of these
  447. tasks (e.g. the :ref:`ref-tasks-menuconfig` task) are
  448. also applicable to recipes that use Linux kernel style configuration
  449. such as the BusyBox recipe.
  450. .. _ref-tasks-compile_kernelmodules:
  451. ``do_compile_kernelmodules``
  452. ----------------------------
  453. Runs the step that builds the kernel modules (if needed). Building a
  454. kernel consists of two steps: 1) the kernel (``vmlinux``) is built, and
  455. 2) the modules are built (i.e. ``make modules``).
  456. .. _ref-tasks-diffconfig:
  457. ``do_diffconfig``
  458. -----------------
  459. When invoked by the user, this task creates a file containing the
  460. differences between the original config as produced by
  461. :ref:`ref-tasks-kernel_configme` task and the
  462. changes made by the user with other methods (i.e. using
  463. (:ref:`ref-tasks-kernel_menuconfig`). Once the
  464. file of differences is created, it can be used to create a config
  465. fragment that only contains the differences. You can invoke this task
  466. from the command line as follows::
  467. $ bitbake linux-yocto -c diffconfig
  468. For more information, see the
  469. ":ref:`kernel-dev/common:creating configuration fragments`"
  470. section in the Yocto Project Linux Kernel Development Manual.
  471. .. _ref-tasks-kernel_checkout:
  472. ``do_kernel_checkout``
  473. ----------------------
  474. Converts the newly unpacked kernel source into a form with which the
  475. OpenEmbedded build system can work. Because the kernel source can be
  476. fetched in several different ways, the :ref:`ref-tasks-kernel_checkout` task makes
  477. sure that subsequent tasks are given a clean working tree copy of the
  478. kernel with the correct branches checked out.
  479. .. _ref-tasks-kernel_configcheck:
  480. ``do_kernel_configcheck``
  481. -------------------------
  482. Validates the configuration produced by the
  483. :ref:`ref-tasks-kernel_menuconfig` task. The
  484. :ref:`ref-tasks-kernel_configcheck` task produces warnings when a requested
  485. configuration does not appear in the final ``.config`` file or when you
  486. override a policy configuration in a hardware configuration fragment.
  487. You can run this task explicitly and view the output by using the
  488. following command::
  489. $ bitbake linux-yocto -c kernel_configcheck -f
  490. For more information, see the
  491. ":ref:`kernel-dev/common:validating configuration`"
  492. section in the Yocto Project Linux Kernel Development Manual.
  493. .. _ref-tasks-kernel_configme:
  494. ``do_kernel_configme``
  495. ----------------------
  496. After the kernel is patched by the :ref:`ref-tasks-patch`
  497. task, the :ref:`ref-tasks-kernel_configme` task assembles and merges all the
  498. kernel config fragments into a merged configuration that can then be
  499. passed to the kernel configuration phase proper. This is also the time
  500. during which user-specified defconfigs are applied if present, and where
  501. configuration modes such as ``--allnoconfig`` are applied.
  502. .. _ref-tasks-kernel_menuconfig:
  503. ``do_kernel_menuconfig``
  504. ------------------------
  505. Invoked by the user to manipulate the ``.config`` file used to build a
  506. linux-yocto recipe. This task starts the Linux kernel configuration
  507. tool, which you then use to modify the kernel configuration.
  508. .. note::
  509. You can also invoke this tool from the command line as follows::
  510. $ bitbake linux-yocto -c menuconfig
  511. See the ":ref:`kernel-dev/common:using \`\`menuconfig\`\``"
  512. section in the Yocto Project Linux Kernel Development Manual for more
  513. information on this configuration tool.
  514. .. _ref-tasks-kernel_metadata:
  515. ``do_kernel_metadata``
  516. ----------------------
  517. Collects all the features required for a given kernel build, whether the
  518. features come from :term:`SRC_URI` or from Git
  519. repositories. After collection, the :ref:`ref-tasks-kernel_metadata` task
  520. processes the features into a series of config fragments and patches,
  521. which can then be applied by subsequent tasks such as
  522. :ref:`ref-tasks-patch` and
  523. :ref:`ref-tasks-kernel_configme`.
  524. .. _ref-tasks-menuconfig:
  525. ``do_menuconfig``
  526. -----------------
  527. Runs ``make menuconfig`` for the kernel. For information on
  528. ``menuconfig``, see the
  529. ":ref:`kernel-dev/common:using \`\`menuconfig\`\``"
  530. section in the Yocto Project Linux Kernel Development Manual.
  531. .. _ref-tasks-savedefconfig:
  532. ``do_savedefconfig``
  533. --------------------
  534. When invoked by the user, creates a defconfig file that can be used
  535. instead of the default defconfig. The saved defconfig contains the
  536. differences between the default defconfig and the changes made by the
  537. user using other methods (i.e. the
  538. :ref:`ref-tasks-kernel_menuconfig` task. You
  539. can invoke the task using the following command::
  540. $ bitbake linux-yocto -c savedefconfig
  541. .. _ref-tasks-shared_workdir:
  542. ``do_shared_workdir``
  543. ---------------------
  544. After the kernel has been compiled but before the kernel modules have
  545. been compiled, this task copies files required for module builds and
  546. which are generated from the kernel build into the shared work
  547. directory. With these copies successfully copied, the
  548. :ref:`ref-tasks-compile_kernelmodules` task
  549. can successfully build the kernel modules in the next step of the build.
  550. .. _ref-tasks-sizecheck:
  551. ``do_sizecheck``
  552. ----------------
  553. After the kernel has been built, this task checks the size of the
  554. stripped kernel image against
  555. :term:`KERNEL_IMAGE_MAXSIZE`. If that
  556. variable was set and the size of the stripped kernel exceeds that size,
  557. the kernel build produces a warning to that effect.
  558. .. _ref-tasks-strip:
  559. ``do_strip``
  560. ------------
  561. If ``KERNEL_IMAGE_STRIP_EXTRA_SECTIONS`` is defined, this task strips
  562. the sections named in that variable from ``vmlinux``. This stripping is
  563. typically used to remove nonessential sections such as ``.comment``
  564. sections from a size-sensitive configuration.
  565. .. _ref-tasks-validate_branches:
  566. ``do_validate_branches``
  567. ------------------------
  568. After the kernel is unpacked but before it is patched, this task makes
  569. sure that the machine and metadata branches as specified by the
  570. :term:`SRCREV` variables actually exist on the specified
  571. branches. Otherwise, if :term:`AUTOREV` is not being used, the
  572. :ref:`ref-tasks-validate_branches` task fails during the build.