tasks.rst 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812
  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:`UNPACKDIR`\ ``}``. A legacy way to specify
  293. this directory is through the :term:`S` and :term:`WORKDIR` variables.
  294. 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.
  297. Manually Called Tasks
  298. =====================
  299. These tasks are typically manually triggered (e.g. by using the
  300. ``bitbake -c`` command-line option):
  301. ``do_checkuri``
  302. ---------------
  303. Validates the :term:`SRC_URI` value.
  304. .. _ref-tasks-clean:
  305. ``do_clean``
  306. ------------
  307. Removes all output files for a target from the
  308. :ref:`ref-tasks-unpack` task forward (i.e. :ref:`ref-tasks-unpack`,
  309. :ref:`ref-tasks-configure`,
  310. :ref:`ref-tasks-compile`,
  311. :ref:`ref-tasks-install`, and
  312. :ref:`ref-tasks-package`).
  313. You can run this task using BitBake as follows::
  314. $ bitbake -c clean recipe
  315. Running this task does not remove the
  316. :ref:`sstate <overview-manual/concepts:shared state cache>` cache files.
  317. Consequently, if no changes have been made and the recipe is rebuilt
  318. after cleaning, output files are simply restored from the sstate cache.
  319. If you want to remove the sstate cache files for the recipe, you need to
  320. use the :ref:`ref-tasks-cleansstate` task instead
  321. (i.e. ``bitbake -c cleansstate`` recipe).
  322. .. _ref-tasks-cleanall:
  323. ``do_cleanall``
  324. ---------------
  325. Removes all output files, shared state
  326. (:ref:`sstate <overview-manual/concepts:shared state cache>`) cache, and
  327. downloaded source files for a target (i.e. the contents of
  328. :term:`DL_DIR`). Essentially, the :ref:`ref-tasks-cleanall` task is
  329. identical to the :ref:`ref-tasks-cleansstate` task
  330. with the added removal of downloaded source files.
  331. You can run this task using BitBake as follows::
  332. $ bitbake -c cleanall recipe
  333. You should never use the :ref:`ref-tasks-cleanall` task in a normal
  334. scenario. If you want to start fresh with the :ref:`ref-tasks-fetch` task,
  335. use instead::
  336. $ bitbake -f -c fetch recipe
  337. .. note::
  338. The reason to prefer ``bitbake -f -c fetch`` is that the
  339. :ref:`ref-tasks-cleanall` task would break in some cases, such as::
  340. $ bitbake -c fetch recipe
  341. $ bitbake -c cleanall recipe-native
  342. $ bitbake -c unpack recipe
  343. because after step 1 there is a stamp file for the
  344. :ref:`ref-tasks-fetch` task of ``recipe``, and it won't be removed at
  345. step 2 because step 2 uses a different work directory. So the unpack task
  346. at step 3 will try to extract the downloaded archive and fail as it has
  347. been deleted in step 2.
  348. Note that this also applies to BitBake from concurrent processes when a
  349. shared download directory (:term:`DL_DIR`) is setup.
  350. .. _ref-tasks-cleansstate:
  351. ``do_cleansstate``
  352. ------------------
  353. Removes all output files and shared state
  354. (:ref:`sstate <overview-manual/concepts:shared state cache>`) cache for a
  355. target. Essentially, the :ref:`ref-tasks-cleansstate` task is identical to the
  356. :ref:`ref-tasks-clean` task with the added removal of
  357. shared state (:ref:`sstate <overview-manual/concepts:shared state cache>`)
  358. cache.
  359. You can run this task using BitBake as follows::
  360. $ bitbake -c cleansstate recipe
  361. When you run the :ref:`ref-tasks-cleansstate` task, the OpenEmbedded build system
  362. no longer uses any sstate. Consequently, building the recipe from
  363. scratch is guaranteed.
  364. .. note::
  365. Using :ref:`ref-tasks-cleansstate` with a shared :term:`SSTATE_DIR` is
  366. not recommended because it could trigger an error during the build of a
  367. separate BitBake instance. This is because the builds check sstate "up
  368. front" but download the files later, so it if is deleted in the
  369. meantime, it will cause an error but not a total failure as it will
  370. rebuild it.
  371. The reliable and preferred way to force a new build is to use ``bitbake
  372. -f`` instead.
  373. .. note::
  374. The :ref:`ref-tasks-cleansstate` task cannot remove sstate from a remote sstate
  375. mirror. If you need to build a target from scratch using remote mirrors, use
  376. the "-f" option as follows::
  377. $ bitbake -f -c do_cleansstate target
  378. .. _ref-tasks-pydevshell:
  379. ``do_pydevshell``
  380. -----------------
  381. Starts a shell in which an interactive Python interpreter allows you to
  382. interact with the BitBake build environment. From within this shell, you
  383. can directly examine and set bits from the data store and execute
  384. functions as if within the BitBake environment. See the ":ref:`dev-manual/python-development-shell:using a Python development shell`" section in
  385. the Yocto Project Development Tasks Manual for more information about
  386. using ``pydevshell``.
  387. .. _ref-tasks-devshell:
  388. ``do_devshell``
  389. ---------------
  390. Starts a shell whose environment is set up for development, debugging,
  391. or both. See the ":ref:`dev-manual/development-shell:using a development shell`" section in the
  392. Yocto Project Development Tasks Manual for more information about using
  393. ``devshell``.
  394. .. _ref-tasks-listtasks:
  395. ``do_listtasks``
  396. ----------------
  397. Lists all defined tasks for a target.
  398. .. _ref-tasks-package_index:
  399. ``do_package_index``
  400. --------------------
  401. Creates or updates the index in the :ref:`overview-manual/concepts:package feeds` area.
  402. .. note::
  403. This task is not triggered with the ``bitbake -c`` command-line option as
  404. are the other tasks in this section. Because this task is specifically for
  405. the ``package-index`` recipe, you run it using ``bitbake package-index``.
  406. Image-Related Tasks
  407. ===================
  408. The following tasks are applicable to image recipes.
  409. .. _ref-tasks-bootimg:
  410. ``do_bootimg``
  411. --------------
  412. Creates a bootable live image. See the
  413. :term:`IMAGE_FSTYPES` variable for additional
  414. information on live image types.
  415. .. _ref-tasks-bundle_initramfs:
  416. ``do_bundle_initramfs``
  417. -----------------------
  418. Combines an :term:`Initramfs` image and kernel together to
  419. form a single image.
  420. .. _ref-tasks-rootfs:
  421. ``do_rootfs``
  422. -------------
  423. Creates the root filesystem (file and directory structure) for an image.
  424. See the ":ref:`overview-manual/concepts:image generation`"
  425. section in the Yocto Project Overview and Concepts Manual for more
  426. information on how the root filesystem is created.
  427. .. _ref-tasks-testimage:
  428. ``do_testimage``
  429. ----------------
  430. Boots an image and performs runtime tests within the image. For
  431. information on automatically testing images, see the
  432. ":ref:`test-manual/runtime-testing:performing automated runtime testing`"
  433. section in the Yocto Project Test Environment Manual.
  434. .. _ref-tasks-testimage_auto:
  435. ``do_testimage_auto``
  436. ---------------------
  437. Boots an image and performs runtime tests within the image immediately
  438. after it has been built. This task is enabled when you set
  439. :term:`TESTIMAGE_AUTO` equal to "1".
  440. For information on automatically testing images, see the
  441. ":ref:`test-manual/runtime-testing:performing automated runtime testing`"
  442. section in the Yocto Project Test Environment Manual.
  443. Kernel-Related Tasks
  444. ====================
  445. The following tasks are applicable to kernel recipes. Some of these
  446. tasks (e.g. the :ref:`ref-tasks-menuconfig` task) are
  447. also applicable to recipes that use Linux kernel style configuration
  448. such as the BusyBox recipe.
  449. .. _ref-tasks-compile_kernelmodules:
  450. ``do_compile_kernelmodules``
  451. ----------------------------
  452. Runs the step that builds the kernel modules (if needed). Building a
  453. kernel consists of two steps: 1) the kernel (``vmlinux``) is built, and
  454. 2) the modules are built (i.e. ``make modules``).
  455. .. _ref-tasks-diffconfig:
  456. ``do_diffconfig``
  457. -----------------
  458. When invoked by the user, this task creates a file containing the
  459. differences between the original config as produced by
  460. :ref:`ref-tasks-kernel_configme` task and the
  461. changes made by the user with other methods (i.e. using
  462. (:ref:`ref-tasks-kernel_menuconfig`). Once the
  463. file of differences is created, it can be used to create a config
  464. fragment that only contains the differences. You can invoke this task
  465. from the command line as follows::
  466. $ bitbake linux-yocto -c diffconfig
  467. For more information, see the
  468. ":ref:`kernel-dev/common:creating configuration fragments`"
  469. section in the Yocto Project Linux Kernel Development Manual.
  470. .. _ref-tasks-kernel_checkout:
  471. ``do_kernel_checkout``
  472. ----------------------
  473. Converts the newly unpacked kernel source into a form with which the
  474. OpenEmbedded build system can work. Because the kernel source can be
  475. fetched in several different ways, the :ref:`ref-tasks-kernel_checkout` task makes
  476. sure that subsequent tasks are given a clean working tree copy of the
  477. kernel with the correct branches checked out.
  478. .. _ref-tasks-kernel_configcheck:
  479. ``do_kernel_configcheck``
  480. -------------------------
  481. Validates the configuration produced by the
  482. :ref:`ref-tasks-kernel_menuconfig` task. The
  483. :ref:`ref-tasks-kernel_configcheck` task produces warnings when a requested
  484. configuration does not appear in the final ``.config`` file or when you
  485. override a policy configuration in a hardware configuration fragment.
  486. You can run this task explicitly and view the output by using the
  487. following command::
  488. $ bitbake linux-yocto -c kernel_configcheck -f
  489. For more information, see the
  490. ":ref:`kernel-dev/common:validating configuration`"
  491. section in the Yocto Project Linux Kernel Development Manual.
  492. .. _ref-tasks-kernel_configme:
  493. ``do_kernel_configme``
  494. ----------------------
  495. After the kernel is patched by the :ref:`ref-tasks-patch`
  496. task, the :ref:`ref-tasks-kernel_configme` task assembles and merges all the
  497. kernel config fragments into a merged configuration that can then be
  498. passed to the kernel configuration phase proper. This is also the time
  499. during which user-specified defconfigs are applied if present, and where
  500. configuration modes such as ``--allnoconfig`` are applied.
  501. .. _ref-tasks-kernel_menuconfig:
  502. ``do_kernel_menuconfig``
  503. ------------------------
  504. Invoked by the user to manipulate the ``.config`` file used to build a
  505. linux-yocto recipe. This task starts the Linux kernel configuration
  506. tool, which you then use to modify the kernel configuration.
  507. .. note::
  508. You can also invoke this tool from the command line as follows::
  509. $ bitbake linux-yocto -c menuconfig
  510. See the ":ref:`kernel-dev/common:using ``menuconfig```"
  511. section in the Yocto Project Linux Kernel Development Manual for more
  512. information on this configuration tool.
  513. .. _ref-tasks-kernel_metadata:
  514. ``do_kernel_metadata``
  515. ----------------------
  516. Collects all the features required for a given kernel build, whether the
  517. features come from :term:`SRC_URI` or from Git
  518. repositories. After collection, the :ref:`ref-tasks-kernel_metadata` task
  519. processes the features into a series of config fragments and patches,
  520. which can then be applied by subsequent tasks such as
  521. :ref:`ref-tasks-patch` and
  522. :ref:`ref-tasks-kernel_configme`.
  523. .. _ref-tasks-menuconfig:
  524. ``do_menuconfig``
  525. -----------------
  526. Runs ``make menuconfig`` for the kernel. For information on
  527. ``menuconfig``, see the
  528. ":ref:`kernel-dev/common:using ``menuconfig```"
  529. section in the Yocto Project Linux Kernel Development Manual.
  530. .. _ref-tasks-savedefconfig:
  531. ``do_savedefconfig``
  532. --------------------
  533. When invoked by the user, creates a defconfig file that can be used
  534. instead of the default defconfig. The saved defconfig contains the
  535. differences between the default defconfig and the changes made by the
  536. user using other methods (i.e. the
  537. :ref:`ref-tasks-kernel_menuconfig` task. You
  538. can invoke the task using the following command::
  539. $ bitbake linux-yocto -c savedefconfig
  540. .. _ref-tasks-shared_workdir:
  541. ``do_shared_workdir``
  542. ---------------------
  543. After the kernel has been compiled but before the kernel modules have
  544. been compiled, this task copies files required for module builds and
  545. which are generated from the kernel build into the shared work
  546. directory. With these copies successfully copied, the
  547. :ref:`ref-tasks-compile_kernelmodules` task
  548. can successfully build the kernel modules in the next step of the build.
  549. .. _ref-tasks-sizecheck:
  550. ``do_sizecheck``
  551. ----------------
  552. After the kernel has been built, this task checks the size of the
  553. stripped kernel image against
  554. :term:`KERNEL_IMAGE_MAXSIZE`. If that
  555. variable was set and the size of the stripped kernel exceeds that size,
  556. the kernel build produces a warning to that effect.
  557. .. _ref-tasks-strip:
  558. ``do_strip``
  559. ------------
  560. If ``KERNEL_IMAGE_STRIP_EXTRA_SECTIONS`` is defined, this task strips
  561. the sections named in that variable from ``vmlinux``. This stripping is
  562. typically used to remove nonessential sections such as ``.comment``
  563. sections from a size-sensitive configuration.
  564. .. _ref-tasks-validate_branches:
  565. ``do_validate_branches``
  566. ------------------------
  567. After the kernel is unpacked but before it is patched, this task makes
  568. sure that the machine and metadata branches as specified by the
  569. :term:`SRCREV` variables actually exist on the specified
  570. branches. Otherwise, if :term:`AUTOREV` is not being used, the
  571. :ref:`ref-tasks-validate_branches` task fails during the build.