tasks.rst 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794
  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:bitbake-user-manual/bitbake-user-manual-metadata:tasks`" and
  14. ":ref:`bitbake: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 ``do_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. ``do_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:`deploy <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:`deploy <ref-classes-deploy>` class sets up
  59. ``do_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 ``do_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 ``do_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:`base <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 ``do_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
  83. :term:`SRC_URI` variable and the argument's prefix to
  84. determine the correct :ref:`fetcher <bitbake: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 ``do_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 ``do_image`` task performs pre-processing on the image through the
  95. :term:`IMAGE_PREPROCESS_COMMAND` and
  96. dynamically generates supporting ``do_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 ``do_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 ``do_image_*``
  106. tasks the image is constructed.
  107. The ``do_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 ``do_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`, ``do_package_write_*``, 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`` directory of
  136. 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 ``do_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:`insane <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-package_write_tar:
  186. ``do_package_write_tar``
  187. ------------------------
  188. Creates tarballs and places them in the
  189. ``${``\ :term:`DEPLOY_DIR_TAR`\ ``}`` directory in
  190. the package feeds area. For more information, see the
  191. ":ref:`overview-manual/concepts:package feeds`" section in
  192. the Yocto Project Overview and Concepts Manual.
  193. .. _ref-tasks-packagedata:
  194. ``do_packagedata``
  195. ------------------
  196. Saves package metadata generated by the
  197. :ref:`ref-tasks-package` task in
  198. :term:`PKGDATA_DIR` to make it available globally.
  199. .. _ref-tasks-patch:
  200. ``do_patch``
  201. ------------
  202. Locates patch files and applies them to the source code.
  203. After fetching and unpacking source files, the build system uses the
  204. recipe's :term:`SRC_URI` statements
  205. to locate and apply patch files to the source code.
  206. .. note::
  207. The build system uses the :term:`FILESPATH` variable to determine the
  208. default set of directories when searching for patches.
  209. Patch files, by default, are ``*.patch`` and ``*.diff`` files created
  210. and kept in a subdirectory of the directory holding the recipe file. For
  211. example, consider the
  212. :yocto_git:`bluez5 </poky/tree/meta/recipes-connectivity/bluez5>`
  213. recipe from the OE-Core layer (i.e. ``poky/meta``)::
  214. poky/meta/recipes-connectivity/bluez5
  215. This recipe has two patch files located here::
  216. poky/meta/recipes-connectivity/bluez5/bluez5
  217. In the ``bluez5`` recipe, the :term:`SRC_URI` statements point to the source
  218. and patch files needed to build the package.
  219. .. note::
  220. In the case for the ``bluez5_5.48.bb`` recipe, the :term:`SRC_URI` statements
  221. are from an include file ``bluez5.inc``.
  222. As mentioned earlier, the build system treats files whose file types are
  223. ``.patch`` and ``.diff`` as patch files. However, you can use the
  224. "apply=yes" parameter with the :term:`SRC_URI` statement to indicate any
  225. file as a patch file::
  226. SRC_URI = " \
  227. git://path_to_repo/some_package \
  228. file://file;apply=yes \
  229. "
  230. Conversely, if you have a file whose file type is ``.patch`` or ``.diff``
  231. and you want to exclude it so that the ``do_patch`` task does not apply
  232. it during the patch phase, you can use the "apply=no" parameter with the
  233. :term:`SRC_URI` statement::
  234. SRC_URI = " \
  235. git://path_to_repo/some_package \
  236. file://file1.patch \
  237. file://file2.patch;apply=no \
  238. "
  239. In the previous example ``file1.patch`` would be applied as a patch by default
  240. while ``file2.patch`` would not be applied.
  241. You can find out more about the patching process in the
  242. ":ref:`overview-manual/concepts:patching`" section in
  243. the Yocto Project Overview and Concepts Manual and the
  244. ":ref:`dev-manual/common-tasks:patching code`" section in the
  245. Yocto Project Development Tasks Manual.
  246. .. _ref-tasks-populate_lic:
  247. ``do_populate_lic``
  248. -------------------
  249. Writes license information for the recipe that is collected later when
  250. the image is constructed.
  251. .. _ref-tasks-populate_sdk:
  252. ``do_populate_sdk``
  253. -------------------
  254. Creates the file and directory structure for an installable SDK. See the
  255. ":ref:`overview-manual/concepts:sdk generation`"
  256. section in the Yocto Project Overview and Concepts Manual for more
  257. information.
  258. .. _ref-tasks-populate_sdk_ext:
  259. ``do_populate_sdk_ext``
  260. -----------------------
  261. Creates the file and directory structure for an installable extensible
  262. SDK (eSDK). See the ":ref:`overview-manual/concepts:sdk generation`"
  263. section in the Yocto Project Overview and Concepts Manual for more
  264. information.
  265. .. _ref-tasks-populate_sysroot:
  266. ``do_populate_sysroot``
  267. -----------------------
  268. Stages (copies) a subset of the files installed by the
  269. :ref:`ref-tasks-install` task into the appropriate
  270. sysroot. For information on how to access these files from other
  271. recipes, see the :term:`STAGING_DIR* <STAGING_DIR_HOST>` variables.
  272. Directories that would typically not be needed by other recipes at build
  273. time (e.g. ``/etc``) are not copied by default.
  274. For information on what directories are copied by default, see the
  275. :term:`SYSROOT_DIRS* <SYSROOT_DIRS>` variables. You can change
  276. these variables inside your recipe if you need to make additional (or
  277. fewer) directories available to other recipes at build time.
  278. The ``do_populate_sysroot`` task is a shared state (sstate) task, which
  279. means that the task can be accelerated through sstate use. Realize also
  280. that if the task is re-executed, any previous output is removed (i.e.
  281. "cleaned").
  282. .. _ref-tasks-prepare_recipe_sysroot:
  283. ``do_prepare_recipe_sysroot``
  284. -----------------------------
  285. Installs the files into the individual recipe specific sysroots (i.e.
  286. ``recipe-sysroot`` and ``recipe-sysroot-native`` under
  287. ``${``\ :term:`WORKDIR`\ ``}`` based upon the
  288. dependencies specified by :term:`DEPENDS`). See the
  289. ":ref:`staging <ref-classes-staging>`" class for more information.
  290. .. _ref-tasks-rm_work:
  291. ``do_rm_work``
  292. --------------
  293. Removes work files after the OpenEmbedded build system has finished with
  294. them. You can learn more by looking at the
  295. ":ref:`ref-classes-rm-work`" section.
  296. .. _ref-tasks-unpack:
  297. ``do_unpack``
  298. -------------
  299. Unpacks the source code into a working directory pointed to by
  300. ``${``\ :term:`WORKDIR`\ ``}``. The :term:`S`
  301. variable also plays a role in where unpacked source files ultimately
  302. reside. For more information on how source files are unpacked, see the
  303. ":ref:`overview-manual/concepts:source fetching`"
  304. section in the Yocto Project Overview and Concepts Manual and also see
  305. the :term:`WORKDIR` and :term:`S` variable descriptions.
  306. Manually Called Tasks
  307. =====================
  308. These tasks are typically manually triggered (e.g. by using the
  309. ``bitbake -c`` command-line option):
  310. ``do_checkuri``
  311. ---------------
  312. Validates the :term:`SRC_URI` value.
  313. .. _ref-tasks-clean:
  314. ``do_clean``
  315. ------------
  316. Removes all output files for a target from the
  317. :ref:`ref-tasks-unpack` task forward (i.e. ``do_unpack``,
  318. :ref:`ref-tasks-configure`,
  319. :ref:`ref-tasks-compile`,
  320. :ref:`ref-tasks-install`, and
  321. :ref:`ref-tasks-package`).
  322. You can run this task using BitBake as follows::
  323. $ bitbake -c clean recipe
  324. Running this task does not remove the
  325. :ref:`sstate <overview-manual/concepts:shared state cache>` cache files.
  326. Consequently, if no changes have been made and the recipe is rebuilt
  327. after cleaning, output files are simply restored from the sstate cache.
  328. If you want to remove the sstate cache files for the recipe, you need to
  329. use the :ref:`ref-tasks-cleansstate` task instead
  330. (i.e. ``bitbake -c cleansstate`` recipe).
  331. .. _ref-tasks-cleanall:
  332. ``do_cleanall``
  333. ---------------
  334. Removes all output files, shared state
  335. (:ref:`sstate <overview-manual/concepts:shared state cache>`) cache, and
  336. downloaded source files for a target (i.e. the contents of
  337. :term:`DL_DIR`). Essentially, the ``do_cleanall`` task is
  338. identical to the :ref:`ref-tasks-cleansstate` task
  339. with the added removal of downloaded source files.
  340. You can run this task using BitBake as follows::
  341. $ bitbake -c cleanall recipe
  342. Typically, you would not normally use the ``cleanall`` task. Do so only
  343. if you want to start fresh with the :ref:`ref-tasks-fetch`
  344. task.
  345. .. _ref-tasks-cleansstate:
  346. ``do_cleansstate``
  347. ------------------
  348. Removes all output files and shared state
  349. (:ref:`sstate <overview-manual/concepts:shared state cache>`) cache for a
  350. target. Essentially, the ``do_cleansstate`` task is identical to the
  351. :ref:`ref-tasks-clean` task with the added removal of
  352. shared state (:ref:`sstate <overview-manual/concepts:shared state cache>`)
  353. cache.
  354. You can run this task using BitBake as follows::
  355. $ bitbake -c cleansstate recipe
  356. When you run the ``do_cleansstate`` task, the OpenEmbedded build system
  357. no longer uses any sstate. Consequently, building the recipe from
  358. scratch is guaranteed.
  359. .. note::
  360. The ``do_cleansstate`` task cannot remove sstate from a remote sstate
  361. mirror. If you need to build a target from scratch using remote mirrors, use
  362. the "-f" option as follows::
  363. $ bitbake -f -c do_cleansstate target
  364. .. _ref-tasks-pydevshell:
  365. ``do_pydevshell``
  366. -----------------
  367. Starts a shell in which an interactive Python interpreter allows you to
  368. interact with the BitBake build environment. From within this shell, you
  369. can directly examine and set bits from the data store and execute
  370. functions as if within the BitBake environment. See the ":ref:`dev-manual/common-tasks:using a Python development shell`" section in
  371. the Yocto Project Development Tasks Manual for more information about
  372. using ``pydevshell``.
  373. .. _ref-tasks-devshell:
  374. ``do_devshell``
  375. ---------------
  376. Starts a shell whose environment is set up for development, debugging,
  377. or both. See the ":ref:`dev-manual/common-tasks:using a development shell`" section in the
  378. Yocto Project Development Tasks Manual for more information about using
  379. ``devshell``.
  380. .. _ref-tasks-listtasks:
  381. ``do_listtasks``
  382. ----------------
  383. Lists all defined tasks for a target.
  384. .. _ref-tasks-package_index:
  385. ``do_package_index``
  386. --------------------
  387. Creates or updates the index in the :ref:`overview-manual/concepts:package feeds` area.
  388. .. note::
  389. This task is not triggered with the ``bitbake -c`` command-line option as
  390. are the other tasks in this section. Because this task is specifically for
  391. the ``package-index`` recipe, you run it using ``bitbake package-index``.
  392. Image-Related Tasks
  393. ===================
  394. The following tasks are applicable to image recipes.
  395. .. _ref-tasks-bootimg:
  396. ``do_bootimg``
  397. --------------
  398. Creates a bootable live image. See the
  399. :term:`IMAGE_FSTYPES` variable for additional
  400. information on live image types.
  401. .. _ref-tasks-bundle_initramfs:
  402. ``do_bundle_initramfs``
  403. -----------------------
  404. Combines an initial RAM disk (initramfs) image and kernel together to
  405. form a single image. The
  406. :term:`CONFIG_INITRAMFS_SOURCE` variable
  407. has some more information about these types of images.
  408. .. _ref-tasks-rootfs:
  409. ``do_rootfs``
  410. -------------
  411. Creates the root filesystem (file and directory structure) for an image.
  412. See the ":ref:`overview-manual/concepts:image generation`"
  413. section in the Yocto Project Overview and Concepts Manual for more
  414. information on how the root filesystem is created.
  415. .. _ref-tasks-testimage:
  416. ``do_testimage``
  417. ----------------
  418. Boots an image and performs runtime tests within the image. For
  419. information on automatically testing images, see the
  420. ":ref:`dev-manual/common-tasks:performing automated runtime testing`"
  421. section in the Yocto Project Development Tasks Manual.
  422. .. _ref-tasks-testimage_auto:
  423. ``do_testimage_auto``
  424. ---------------------
  425. Boots an image and performs runtime tests within the image immediately
  426. after it has been built. This task is enabled when you set
  427. :term:`TESTIMAGE_AUTO` equal to "1".
  428. For information on automatically testing images, see the
  429. ":ref:`dev-manual/common-tasks:performing automated runtime testing`"
  430. section in the Yocto Project Development Tasks Manual.
  431. Kernel-Related Tasks
  432. ====================
  433. The following tasks are applicable to kernel recipes. Some of these
  434. tasks (e.g. the :ref:`ref-tasks-menuconfig` task) are
  435. also applicable to recipes that use Linux kernel style configuration
  436. such as the BusyBox recipe.
  437. .. _ref-tasks-compile_kernelmodules:
  438. ``do_compile_kernelmodules``
  439. ----------------------------
  440. Runs the step that builds the kernel modules (if needed). Building a
  441. kernel consists of two steps: 1) the kernel (``vmlinux``) is built, and
  442. 2) the modules are built (i.e. ``make modules``).
  443. .. _ref-tasks-diffconfig:
  444. ``do_diffconfig``
  445. -----------------
  446. When invoked by the user, this task creates a file containing the
  447. differences between the original config as produced by
  448. :ref:`ref-tasks-kernel_configme` task and the
  449. changes made by the user with other methods (i.e. using
  450. (:ref:`ref-tasks-kernel_menuconfig`). Once the
  451. file of differences is created, it can be used to create a config
  452. fragment that only contains the differences. You can invoke this task
  453. from the command line as follows::
  454. $ bitbake linux-yocto -c diffconfig
  455. For more information, see the
  456. ":ref:`kernel-dev/common:creating configuration fragments`"
  457. section in the Yocto Project Linux Kernel Development Manual.
  458. .. _ref-tasks-kernel_checkout:
  459. ``do_kernel_checkout``
  460. ----------------------
  461. Converts the newly unpacked kernel source into a form with which the
  462. OpenEmbedded build system can work. Because the kernel source can be
  463. fetched in several different ways, the ``do_kernel_checkout`` task makes
  464. sure that subsequent tasks are given a clean working tree copy of the
  465. kernel with the correct branches checked out.
  466. .. _ref-tasks-kernel_configcheck:
  467. ``do_kernel_configcheck``
  468. -------------------------
  469. Validates the configuration produced by the
  470. :ref:`ref-tasks-kernel_menuconfig` task. The
  471. ``do_kernel_configcheck`` task produces warnings when a requested
  472. configuration does not appear in the final ``.config`` file or when you
  473. override a policy configuration in a hardware configuration fragment.
  474. You can run this task explicitly and view the output by using the
  475. following command::
  476. $ bitbake linux-yocto -c kernel_configcheck -f
  477. For more information, see the
  478. ":ref:`kernel-dev/common:validating configuration`"
  479. section in the Yocto Project Linux Kernel Development Manual.
  480. .. _ref-tasks-kernel_configme:
  481. ``do_kernel_configme``
  482. ----------------------
  483. After the kernel is patched by the :ref:`ref-tasks-patch`
  484. task, the ``do_kernel_configme`` task assembles and merges all the
  485. kernel config fragments into a merged configuration that can then be
  486. passed to the kernel configuration phase proper. This is also the time
  487. during which user-specified defconfigs are applied if present, and where
  488. configuration modes such as ``--allnoconfig`` are applied.
  489. .. _ref-tasks-kernel_menuconfig:
  490. ``do_kernel_menuconfig``
  491. ------------------------
  492. Invoked by the user to manipulate the ``.config`` file used to build a
  493. linux-yocto recipe. This task starts the Linux kernel configuration
  494. tool, which you then use to modify the kernel configuration.
  495. .. note::
  496. You can also invoke this tool from the command line as follows::
  497. $ bitbake linux-yocto -c menuconfig
  498. See the ":ref:`kernel-dev/common:using \`\`menuconfig\`\``"
  499. section in the Yocto Project Linux Kernel Development Manual for more
  500. information on this configuration tool.
  501. .. _ref-tasks-kernel_metadata:
  502. ``do_kernel_metadata``
  503. ----------------------
  504. Collects all the features required for a given kernel build, whether the
  505. features come from :term:`SRC_URI` or from Git
  506. repositories. After collection, the ``do_kernel_metadata`` task
  507. processes the features into a series of config fragments and patches,
  508. which can then be applied by subsequent tasks such as
  509. :ref:`ref-tasks-patch` and
  510. :ref:`ref-tasks-kernel_configme`.
  511. .. _ref-tasks-menuconfig:
  512. ``do_menuconfig``
  513. -----------------
  514. Runs ``make menuconfig`` for the kernel. For information on
  515. ``menuconfig``, see the
  516. ":ref:`kernel-dev/common:using \`\`menuconfig\`\``"
  517. section in the Yocto Project Linux Kernel Development Manual.
  518. .. _ref-tasks-savedefconfig:
  519. ``do_savedefconfig``
  520. --------------------
  521. When invoked by the user, creates a defconfig file that can be used
  522. instead of the default defconfig. The saved defconfig contains the
  523. differences between the default defconfig and the changes made by the
  524. user using other methods (i.e. the
  525. :ref:`ref-tasks-kernel_menuconfig` task. You
  526. can invoke the task using the following command::
  527. $ bitbake linux-yocto -c savedefconfig
  528. .. _ref-tasks-shared_workdir:
  529. ``do_shared_workdir``
  530. ---------------------
  531. After the kernel has been compiled but before the kernel modules have
  532. been compiled, this task copies files required for module builds and
  533. which are generated from the kernel build into the shared work
  534. directory. With these copies successfully copied, the
  535. :ref:`ref-tasks-compile_kernelmodules` task
  536. can successfully build the kernel modules in the next step of the build.
  537. .. _ref-tasks-sizecheck:
  538. ``do_sizecheck``
  539. ----------------
  540. After the kernel has been built, this task checks the size of the
  541. stripped kernel image against
  542. :term:`KERNEL_IMAGE_MAXSIZE`. If that
  543. variable was set and the size of the stripped kernel exceeds that size,
  544. the kernel build produces a warning to that effect.
  545. .. _ref-tasks-strip:
  546. ``do_strip``
  547. ------------
  548. If ``KERNEL_IMAGE_STRIP_EXTRA_SECTIONS`` is defined, this task strips
  549. the sections named in that variable from ``vmlinux``. This stripping is
  550. typically used to remove nonessential sections such as ``.comment``
  551. sections from a size-sensitive configuration.
  552. .. _ref-tasks-validate_branches:
  553. ``do_validate_branches``
  554. ------------------------
  555. After the kernel is unpacked but before it is patched, this task makes
  556. sure that the machine and metadata branches as specified by the
  557. :term:`SRCREV` variables actually exist on the specified
  558. branches. Otherwise, if :term:`AUTOREV` is not being used, the
  559. ``do_validate_branches`` task fails during the build.