structure.rst 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861
  1. .. SPDX-License-Identifier: CC-BY-SA-2.0-UK
  2. **************************
  3. Source Directory Structure
  4. **************************
  5. The :term:`Source Directory` consists of numerous files,
  6. directories and subdirectories; understanding their locations and
  7. contents is key to using the Yocto Project effectively. This chapter
  8. describes the Source Directory and gives information about those files
  9. and directories.
  10. For information on how to establish a local Source Directory on your
  11. development system, see the
  12. ":ref:`dev-manual/start:locating yocto project source files`"
  13. section in the Yocto Project Development Tasks Manual.
  14. .. note::
  15. The OpenEmbedded build system does not support file or directory
  16. names that contain spaces. Be sure that the Source Directory you use
  17. does not contain these types of names.
  18. .. _structure-core:
  19. Top-Level Core Components
  20. =========================
  21. This section describes the top-level components of the :term:`Source Directory`.
  22. .. _structure-core-bitbake:
  23. ``bitbake/``
  24. ------------
  25. This directory includes a copy of BitBake for ease of use. The copy
  26. usually matches the current stable BitBake release from the BitBake
  27. project. BitBake, a :term:`Metadata` interpreter, reads the
  28. Yocto Project Metadata and runs the tasks defined by that data. Failures
  29. are usually caused by errors in your Metadata and not from BitBake
  30. itself.
  31. When you run the ``bitbake`` command, the main BitBake executable (which
  32. resides in the ``bitbake/bin/`` directory) starts. Sourcing the
  33. environment setup script (i.e. :ref:`structure-core-script`) places
  34. the ``scripts/`` and ``bitbake/bin/`` directories (in that order) into
  35. the shell's ``PATH`` environment variable.
  36. For more information on BitBake, see the :doc:`BitBake User Manual
  37. <bitbake:index>`.
  38. .. _structure-core-build:
  39. ``build/``
  40. ----------
  41. This directory contains user configuration files and the output
  42. generated by the OpenEmbedded build system in its standard configuration
  43. where the source tree is combined with the output. The :term:`Build Directory`
  44. is created initially when you ``source``
  45. the OpenEmbedded build environment setup script (i.e.
  46. :ref:`structure-core-script`).
  47. It is also possible to place output and configuration files in a
  48. directory separate from the :term:`Source Directory` by
  49. providing a directory name when you ``source`` the setup script. For
  50. information on separating output from your local Source Directory files
  51. (commonly described as an "out of tree" build), see the
  52. ":ref:`structure-core-script`" section.
  53. .. _handbook:
  54. ``documentation/``
  55. ------------------
  56. This directory holds the source for the Yocto Project documentation as
  57. well as templates and tools that allow you to generate PDF and HTML
  58. versions of the manuals. Each manual is contained in its own sub-folder;
  59. for example, the files for this reference manual reside in the
  60. ``ref-manual/`` directory.
  61. .. _structure-core-meta:
  62. ``meta/``
  63. ---------
  64. This directory contains the minimal, underlying OpenEmbedded-Core
  65. metadata. The directory holds recipes, common classes, and machine
  66. configuration for strictly emulated targets (``qemux86``, ``qemuarm``,
  67. and so forth.)
  68. .. _structure-core-meta-poky:
  69. ``meta-poky/``
  70. --------------
  71. Designed above the ``meta/`` content, this directory adds just enough
  72. metadata to define the Poky reference distribution.
  73. .. _structure-core-meta-yocto-bsp:
  74. ``meta-yocto-bsp/``
  75. -------------------
  76. This directory contains the Yocto Project reference hardware Board
  77. Support Packages (BSPs). For more information on BSPs, see the
  78. :doc:`/bsp-guide/index`.
  79. .. _structure-meta-selftest:
  80. ``meta-selftest/``
  81. ------------------
  82. This directory adds additional recipes and append files used by the
  83. OpenEmbedded selftests to verify the behavior of the build system. You
  84. do not have to add this layer to your ``bblayers.conf`` file unless you
  85. want to run the selftests.
  86. .. _structure-meta-skeleton:
  87. ``meta-skeleton/``
  88. ------------------
  89. This directory contains template recipes for BSP and kernel development.
  90. .. _structure-core-scripts:
  91. ``scripts/``
  92. ------------
  93. This directory contains various integration scripts that implement extra
  94. functionality in the Yocto Project environment (e.g. QEMU scripts). The
  95. :ref:`structure-core-script` script prepends this directory to the
  96. shell's ``PATH`` environment variable.
  97. The ``scripts`` directory has useful scripts that assist in contributing
  98. back to the Yocto Project, such as ``create-pull-request`` and
  99. ``send-pull-request``.
  100. .. _structure-core-script:
  101. ``oe-init-build-env``
  102. ---------------------
  103. This script sets up the OpenEmbedded build environment. Running this
  104. script with the ``source`` command in a shell makes changes to ``PATH``
  105. and sets other core BitBake variables based on the current working
  106. directory. You need to run an environment setup script before running
  107. BitBake commands. The script uses other scripts within the ``scripts``
  108. directory to do the bulk of the work.
  109. When you run this script, your Yocto Project environment is set up, a
  110. :term:`Build Directory` is created, your working
  111. directory becomes the Build Directory, and you are presented with some
  112. simple suggestions as to what to do next, including a list of some
  113. possible targets to build. Here is an example::
  114. $ source oe-init-build-env
  115. ### Shell environment set up for builds. ###
  116. You can now run 'bitbake <target>'
  117. Common targets are:
  118. core-image-minimal
  119. core-image-sato
  120. meta-toolchain
  121. meta-ide-support
  122. You can also run generated QEMU images with a command like 'runqemu qemux86-64'
  123. The default output of the ``oe-init-build-env`` script is from the
  124. ``conf-notes.txt`` file, which is found in the ``meta-poky`` directory
  125. within the :term:`Source Directory`. If you design a
  126. custom distribution, you can include your own version of this
  127. configuration file to mention the targets defined by your distribution.
  128. See the
  129. ":ref:`dev-manual/common-tasks:creating a custom template configuration directory`"
  130. section in the Yocto Project Development Tasks Manual for more
  131. information.
  132. By default, running this script without a Build Directory argument
  133. creates the ``build/`` directory in your current working directory. If
  134. you provide a Build Directory argument when you ``source`` the script,
  135. you direct the OpenEmbedded build system to create a Build Directory of
  136. your choice. For example, the following command creates a Build
  137. Directory named ``mybuilds/`` that is outside of the :term:`Source Directory`::
  138. $ source oe-init-build-env ~/mybuilds
  139. The OpenEmbedded build system uses the template configuration files, which
  140. are found by default in the ``meta-poky/conf/`` directory in the Source
  141. Directory. See the
  142. ":ref:`dev-manual/common-tasks:creating a custom template configuration directory`"
  143. section in the Yocto Project Development Tasks Manual for more
  144. information.
  145. .. note::
  146. The OpenEmbedded build system does not support file or directory
  147. names that contain spaces. If you attempt to run the ``oe-init-build-env``
  148. script from a Source Directory that contains spaces in either the
  149. filenames or directory names, the script returns an error indicating
  150. no such file or directory. Be sure to use a Source Directory free of
  151. names containing spaces.
  152. .. _structure-basic-top-level:
  153. ``LICENSE, README, and README.hardware``
  154. ----------------------------------------
  155. These files are standard top-level files.
  156. .. _structure-build:
  157. The Build Directory --- ``build/``
  158. ==================================
  159. The OpenEmbedded build system creates the :term:`Build Directory`
  160. when you run the build environment setup
  161. script :ref:`structure-core-script`. If you do not give the Build
  162. Directory a specific name when you run the setup script, the name
  163. defaults to ``build/``.
  164. For subsequent parsing and processing, the name of the Build directory
  165. is available via the :term:`TOPDIR` variable.
  166. .. _structure-build-buildhistory:
  167. ``build/buildhistory/``
  168. -----------------------
  169. The OpenEmbedded build system creates this directory when you enable
  170. build history via the :ref:`buildhistory <ref-classes-buildhistory>` class file. The directory
  171. organizes build information into image, packages, and SDK
  172. subdirectories. For information on the build history feature, see the
  173. ":ref:`dev-manual/common-tasks:maintaining build output quality`"
  174. section in the Yocto Project Development Tasks Manual.
  175. .. _structure-build-conf-local.conf:
  176. ``build/conf/local.conf``
  177. -------------------------
  178. This configuration file contains all the local user configurations for
  179. your build environment. The ``local.conf`` file contains documentation
  180. on the various configuration options. Any variable set here overrides
  181. any variable set elsewhere within the environment unless that variable
  182. is hard-coded within a file (e.g. by using '=' instead of '?='). Some
  183. variables are hard-coded for various reasons but such variables are
  184. relatively rare.
  185. At a minimum, you would normally edit this file to select the target
  186. :term:`MACHINE`, which package types you wish to use
  187. (:term:`PACKAGE_CLASSES`), and the location from
  188. which you want to access downloaded files (:term:`DL_DIR`).
  189. If ``local.conf`` is not present when you start the build, the
  190. OpenEmbedded build system creates it from ``local.conf.sample`` when you
  191. ``source`` the top-level build environment setup script
  192. :ref:`structure-core-script`.
  193. The source ``local.conf.sample`` file used depends on the
  194. :term:`TEMPLATECONF` script variable, which defaults to ``meta-poky/conf/``
  195. when you are building from the Yocto Project development environment,
  196. and to ``meta/conf/`` when you are building from the OpenEmbedded-Core
  197. environment. Because the script variable points to the source of the
  198. ``local.conf.sample`` file, this implies that you can configure your
  199. build environment from any layer by setting the variable in the
  200. top-level build environment setup script as follows::
  201. TEMPLATECONF=your_layer/conf
  202. Once the build process gets the sample
  203. file, it uses ``sed`` to substitute final
  204. ``${``\ :term:`OEROOT`\ ``}`` values for all
  205. ``##OEROOT##`` values.
  206. .. note::
  207. You can see how the :term:`TEMPLATECONF` variable is used by looking at the
  208. ``scripts/oe-setup-builddir`` script in the :term:`Source Directory`.
  209. You can find the Yocto Project version of the ``local.conf.sample`` file in
  210. the ``meta-poky/conf`` directory.
  211. .. _structure-build-conf-bblayers.conf:
  212. ``build/conf/bblayers.conf``
  213. ----------------------------
  214. This configuration file defines
  215. :ref:`layers <dev-manual/common-tasks:understanding and creating layers>`,
  216. which are directory trees, traversed (or walked) by BitBake. The
  217. ``bblayers.conf`` file uses the :term:`BBLAYERS`
  218. variable to list the layers BitBake tries to find.
  219. If ``bblayers.conf`` is not present when you start the build, the
  220. OpenEmbedded build system creates it from ``bblayers.conf.sample`` when
  221. you ``source`` the top-level build environment setup script (i.e.
  222. :ref:`structure-core-script`).
  223. As with the ``local.conf`` file, the source ``bblayers.conf.sample``
  224. file used depends on the :term:`TEMPLATECONF` script variable, which
  225. defaults to ``meta-poky/conf/`` when you are building from the Yocto
  226. Project development environment, and to ``meta/conf/`` when you are
  227. building from the OpenEmbedded-Core environment. Because the script
  228. variable points to the source of the ``bblayers.conf.sample`` file, this
  229. implies that you can base your build from any layer by setting the
  230. variable in the top-level build environment setup script as follows::
  231. TEMPLATECONF=your_layer/conf
  232. Once the build process gets the sample file, it uses ``sed`` to substitute final
  233. ``${``\ :term:`OEROOT`\ ``}`` values for all ``##OEROOT##`` values.
  234. .. note::
  235. You can see how the :term:`TEMPLATECONF` variable is defined by the ``scripts/oe-setup-builddir``
  236. script in the :term:`Source Directory`. You can find the Yocto Project
  237. version of the ``bblayers.conf.sample`` file in the ``meta-poky/conf/``
  238. directory.
  239. .. _structure-build-conf-sanity_info:
  240. ``build/cache/sanity_info``
  241. ---------------------------
  242. This file indicates the state of the sanity checks and is created during
  243. the build.
  244. .. _structure-build-downloads:
  245. ``build/downloads/``
  246. --------------------
  247. This directory contains downloaded upstream source tarballs. You can
  248. reuse the directory for multiple builds or move the directory to another
  249. location. You can control the location of this directory through the
  250. :term:`DL_DIR` variable.
  251. .. _structure-build-sstate-cache:
  252. ``build/sstate-cache/``
  253. -----------------------
  254. This directory contains the shared state cache. You can reuse the
  255. directory for multiple builds or move the directory to another location.
  256. You can control the location of this directory through the
  257. :term:`SSTATE_DIR` variable.
  258. .. _structure-build-tmp:
  259. ``build/tmp/``
  260. --------------
  261. The OpenEmbedded build system creates and uses this directory for all
  262. the build system's output. The :term:`TMPDIR` variable
  263. points to this directory.
  264. BitBake creates this directory if it does not exist. As a last resort,
  265. to clean up a build and start it from scratch (other than the
  266. downloads), you can remove everything in the ``tmp`` directory or get
  267. rid of the directory completely. If you do, you should also completely
  268. remove the ``build/sstate-cache`` directory.
  269. .. _structure-build-tmp-buildstats:
  270. ``build/tmp/buildstats/``
  271. -------------------------
  272. This directory stores the build statistics.
  273. .. _structure-build-tmp-cache:
  274. ``build/tmp/cache/``
  275. --------------------
  276. When BitBake parses the metadata (recipes and configuration files), it
  277. caches the results in ``build/tmp/cache/`` to speed up future builds.
  278. The results are stored on a per-machine basis.
  279. During subsequent builds, BitBake checks each recipe (together with, for
  280. example, any files included or appended to it) to see if they have been
  281. modified. Changes can be detected, for example, through file
  282. modification time (mtime) changes and hashing of file contents. If no
  283. changes to the file are detected, then the parsed result stored in the
  284. cache is reused. If the file has changed, it is reparsed.
  285. .. _structure-build-tmp-deploy:
  286. ``build/tmp/deploy/``
  287. ---------------------
  288. This directory contains any "end result" output from the OpenEmbedded
  289. build process. The :term:`DEPLOY_DIR` variable points
  290. to this directory. For more detail on the contents of the ``deploy``
  291. directory, see the
  292. ":ref:`overview-manual/concepts:images`" and
  293. ":ref:`overview-manual/concepts:application development sdk`" sections in the Yocto
  294. Project Overview and Concepts Manual.
  295. .. _structure-build-tmp-deploy-deb:
  296. ``build/tmp/deploy/deb/``
  297. -------------------------
  298. This directory receives any ``.deb`` packages produced by the build
  299. process. The packages are sorted into feeds for different architecture
  300. types.
  301. .. _structure-build-tmp-deploy-rpm:
  302. ``build/tmp/deploy/rpm/``
  303. -------------------------
  304. This directory receives any ``.rpm`` packages produced by the build
  305. process. The packages are sorted into feeds for different architecture
  306. types.
  307. .. _structure-build-tmp-deploy-ipk:
  308. ``build/tmp/deploy/ipk/``
  309. -------------------------
  310. This directory receives ``.ipk`` packages produced by the build process.
  311. .. _structure-build-tmp-deploy-licenses:
  312. ``build/tmp/deploy/licenses/``
  313. ------------------------------
  314. This directory receives package licensing information. For example, the
  315. directory contains sub-directories for ``bash``, ``busybox``, and
  316. ``glibc`` (among others) that in turn contain appropriate ``COPYING``
  317. license files with other licensing information. For information on
  318. licensing, see the
  319. ":ref:`dev-manual/common-tasks:maintaining open source license compliance during your product's lifecycle`"
  320. section in the Yocto Project Development Tasks Manual.
  321. .. _structure-build-tmp-deploy-images:
  322. ``build/tmp/deploy/images/``
  323. ----------------------------
  324. This directory is populated with the basic output objects of the build
  325. (think of them as the "generated artifacts" of the build process),
  326. including things like the boot loader image, kernel, root filesystem and
  327. more. If you want to flash the resulting image from a build onto a
  328. device, look here for the necessary components.
  329. Be careful when deleting files in this directory. You can safely delete
  330. old images from this directory (e.g. ``core-image-*``). However, the
  331. kernel (``*zImage*``, ``*uImage*``, etc.), bootloader and other
  332. supplementary files might be deployed here prior to building an image.
  333. Because these files are not directly produced from the image, if you
  334. delete them they will not be automatically re-created when you build the
  335. image again.
  336. If you do accidentally delete files here, you will need to force them to
  337. be re-created. In order to do that, you will need to know the target
  338. that produced them. For example, these commands rebuild and re-create
  339. the kernel files::
  340. $ bitbake -c clean virtual/kernel
  341. $ bitbake virtual/kernel
  342. .. _structure-build-tmp-deploy-sdk:
  343. ``build/tmp/deploy/sdk/``
  344. -------------------------
  345. The OpenEmbedded build system creates this directory to hold toolchain
  346. installer scripts which, when executed, install the sysroot that matches
  347. your target hardware. You can find out more about these installers in
  348. the ":ref:`sdk-manual/appendix-obtain:building an sdk installer`"
  349. section in the Yocto Project Application Development and the Extensible
  350. Software Development Kit (eSDK) manual.
  351. .. _structure-build-tmp-sstate-control:
  352. ``build/tmp/sstate-control/``
  353. -----------------------------
  354. The OpenEmbedded build system uses this directory for the shared state
  355. manifest files. The shared state code uses these files to record the
  356. files installed by each sstate task so that the files can be removed
  357. when cleaning the recipe or when a newer version is about to be
  358. installed. The build system also uses the manifests to detect and
  359. produce a warning when files from one task are overwriting those from
  360. another.
  361. .. _structure-build-tmp-sysroots-components:
  362. ``build/tmp/sysroots-components/``
  363. ----------------------------------
  364. This directory is the location of the sysroot contents that the task
  365. :ref:`ref-tasks-prepare_recipe_sysroot`
  366. links or copies into the recipe-specific sysroot for each recipe listed
  367. in :term:`DEPENDS`. Population of this directory is
  368. handled through shared state, while the path is specified by the
  369. :term:`COMPONENTS_DIR` variable. Apart from a few
  370. unusual circumstances, handling of the ``sysroots-components`` directory
  371. should be automatic, and recipes should not directly reference
  372. ``build/tmp/sysroots-components``.
  373. .. _structure-build-tmp-sysroots:
  374. ``build/tmp/sysroots/``
  375. -----------------------
  376. Previous versions of the OpenEmbedded build system used to create a
  377. global shared sysroot per machine along with a native sysroot. Since
  378. the 2.3 version of the Yocto Project, there are sysroots in
  379. recipe-specific :term:`WORKDIR` directories. Thus, the
  380. ``build/tmp/sysroots/`` directory is unused.
  381. .. note::
  382. The ``build/tmp/sysroots/`` directory can still be populated using the
  383. ``bitbake build-sysroots`` command and can be used for compatibility in some
  384. cases. However, in general it is not recommended to populate this directory.
  385. Individual recipe-specific sysroots should be used.
  386. .. _structure-build-tmp-stamps:
  387. ``build/tmp/stamps/``
  388. ---------------------
  389. This directory holds information that BitBake uses for accounting
  390. purposes to track what tasks have run and when they have run. The
  391. directory is sub-divided by architecture, package name, and version.
  392. Following is an example::
  393. stamps/all-poky-linux/distcc-config/1.0-r0.do_build-2fdd....2do
  394. Although the files in the directory are empty of data, BitBake uses the filenames
  395. and timestamps for tracking purposes.
  396. For information on how BitBake uses stamp files to determine if a task
  397. should be rerun, see the
  398. ":ref:`overview-manual/concepts:stamp files and the rerunning of tasks`"
  399. section in the Yocto Project Overview and Concepts Manual.
  400. .. _structure-build-tmp-log:
  401. ``build/tmp/log/``
  402. ------------------
  403. This directory contains general logs that are not otherwise placed using
  404. the package's :term:`WORKDIR`. Examples of logs are the output from the
  405. ``do_check_pkg`` or ``do_distro_check`` tasks. Running a build does not
  406. necessarily mean this directory is created.
  407. .. _structure-build-tmp-work:
  408. ``build/tmp/work/``
  409. -------------------
  410. This directory contains architecture-specific work sub-directories for
  411. packages built by BitBake. All tasks execute from the appropriate work
  412. directory. For example, the source for a particular package is unpacked,
  413. patched, configured and compiled all within its own work directory.
  414. Within the work directory, organization is based on the package group
  415. and version for which the source is being compiled as defined by the
  416. :term:`WORKDIR`.
  417. It is worth considering the structure of a typical work directory. As an
  418. example, consider ``linux-yocto-kernel-3.0`` on the machine ``qemux86``
  419. built within the Yocto Project. For this package, a work directory of
  420. ``tmp/work/qemux86-poky-linux/linux-yocto/3.0+git1+<.....>``, referred
  421. to as the :term:`WORKDIR`, is created. Within this directory, the source is
  422. unpacked to ``linux-qemux86-standard-build`` and then patched by Quilt.
  423. (See the ":ref:`dev-manual/common-tasks:using quilt in your workflow`" section in
  424. the Yocto Project Development Tasks Manual for more information.) Within
  425. the ``linux-qemux86-standard-build`` directory, standard Quilt
  426. directories ``linux-3.0/patches`` and ``linux-3.0/.pc`` are created, and
  427. standard Quilt commands can be used.
  428. There are other directories generated within :term:`WORKDIR`. The most
  429. important directory is ``WORKDIR/temp/``, which has log files for each
  430. task (``log.do_*.pid``) and contains the scripts BitBake runs for each
  431. task (``run.do_*.pid``). The ``WORKDIR/image/`` directory is where "make
  432. install" places its output that is then split into sub-packages within
  433. ``WORKDIR/packages-split/``.
  434. .. _structure-build-tmp-work-tunearch-recipename-version:
  435. ``build/tmp/work/tunearch/recipename/version/``
  436. -----------------------------------------------
  437. The recipe work directory --- ``${WORKDIR}``.
  438. As described earlier in the
  439. ":ref:`structure-build-tmp-sysroots`" section,
  440. beginning with the 2.3 release of the Yocto Project, the OpenEmbedded
  441. build system builds each recipe in its own work directory (i.e.
  442. :term:`WORKDIR`). The path to the work directory is
  443. constructed using the architecture of the given build (e.g.
  444. :term:`TUNE_PKGARCH`, :term:`MACHINE_ARCH`, or "allarch"), the recipe
  445. name, and the version of the recipe (i.e.
  446. :term:`PE`\ ``:``\ :term:`PV`\ ``-``\ :term:`PR`).
  447. Here are key subdirectories within each recipe work directory:
  448. - ``${WORKDIR}/temp``: Contains the log files of each task executed for
  449. this recipe, the "run" files for each executed task, which contain
  450. the code run, and a ``log.task_order`` file, which lists the order in
  451. which tasks were executed.
  452. - ``${WORKDIR}/image``: Contains the output of the
  453. :ref:`ref-tasks-install` task, which corresponds to
  454. the ``${``\ :term:`D`\ ``}`` variable in that task.
  455. - ``${WORKDIR}/pseudo``: Contains the pseudo database and log for any
  456. tasks executed under pseudo for the recipe.
  457. - ``${WORKDIR}/sysroot-destdir``: Contains the output of the
  458. :ref:`ref-tasks-populate_sysroot` task.
  459. - ``${WORKDIR}/package``: Contains the output of the
  460. :ref:`ref-tasks-package` task before the output is
  461. split into individual packages.
  462. - ``${WORKDIR}/packages-split``: Contains the output of the
  463. ``do_package`` task after the output has been split into individual
  464. packages. There are subdirectories for each individual package created by
  465. the recipe.
  466. - ``${WORKDIR}/recipe-sysroot``: A directory populated with the target
  467. dependencies of the recipe. This directory looks like the target
  468. filesystem and contains libraries that the recipe might need to link
  469. against (e.g. the C library).
  470. - ``${WORKDIR}/recipe-sysroot-native``: A directory populated with the
  471. native dependencies of the recipe. This directory contains the tools
  472. the recipe needs to build (e.g. the compiler, Autoconf, libtool, and
  473. so forth).
  474. - ``${WORKDIR}/build``: This subdirectory applies only to recipes that
  475. support builds where the source is separate from the build artifacts.
  476. The OpenEmbedded build system uses this directory as a separate build
  477. directory (i.e. ``${``\ :term:`B`\ ``}``).
  478. .. _structure-build-work-shared:
  479. ``build/tmp/work-shared/``
  480. --------------------------
  481. For efficiency, the OpenEmbedded build system creates and uses this
  482. directory to hold recipes that share a work directory with other
  483. recipes. In practice, this is only used for ``gcc`` and its variants
  484. (e.g. ``gcc-cross``, ``libgcc``, ``gcc-runtime``, and so forth).
  485. .. _structure-meta:
  486. The Metadata --- ``meta/``
  487. ==========================
  488. As mentioned previously, :term:`Metadata` is the core of the
  489. Yocto Project. Metadata has several important subdivisions:
  490. .. _structure-meta-classes:
  491. ``meta/classes/``
  492. -----------------
  493. This directory contains the ``*.bbclass`` files. Class files are used to
  494. abstract common code so it can be reused by multiple packages. Every
  495. package inherits the :ref:`ref-classes-base` file. Examples of other important
  496. classes are :ref:`ref-classes-autotools`, which in theory allows any
  497. Autotool-enabled package to work with the Yocto Project with minimal
  498. effort. Another example is :ref:`ref-classes-kernel` that contains common code
  499. and functions for working with the Linux kernel. Functions like image
  500. generation or packaging also have their specific class files such as
  501. :ref:`ref-classes-image`, :ref:`ref-classes-rootfs*` and
  502. :ref:`package*.bbclass <ref-classes-package>`.
  503. For reference information on classes, see the
  504. ":doc:`/ref-manual/classes`" chapter.
  505. .. _structure-meta-conf:
  506. ``meta/conf/``
  507. --------------
  508. This directory contains the core set of configuration files that start
  509. from ``bitbake.conf`` and from which all other configuration files are
  510. included. See the include statements at the end of the ``bitbake.conf``
  511. file and you will note that even ``local.conf`` is loaded from there.
  512. While ``bitbake.conf`` sets up the defaults, you can often override
  513. these by using the (``local.conf``) file, machine file or the
  514. distribution configuration file.
  515. .. _structure-meta-conf-machine:
  516. ``meta/conf/machine/``
  517. ----------------------
  518. This directory contains all the machine configuration files. If you set
  519. ``MACHINE = "qemux86"``, the OpenEmbedded build system looks for a
  520. ``qemux86.conf`` file in this directory. The ``include`` directory
  521. contains various data common to multiple machines. If you want to add
  522. support for a new machine to the Yocto Project, look in this directory.
  523. .. _structure-meta-conf-distro:
  524. ``meta/conf/distro/``
  525. ---------------------
  526. The contents of this directory controls any distribution-specific
  527. configurations. For the Yocto Project, the ``defaultsetup.conf`` is the
  528. main file here. This directory includes the versions and the :term:`SRCDATE`
  529. definitions for applications that are configured here. An example of an
  530. alternative configuration might be ``poky-bleeding.conf``. Although this
  531. file mainly inherits its configuration from Poky.
  532. .. _structure-meta-conf-machine-sdk:
  533. ``meta/conf/machine-sdk/``
  534. --------------------------
  535. The OpenEmbedded build system searches this directory for configuration
  536. files that correspond to the value of
  537. :term:`SDKMACHINE`. By default, 32-bit and 64-bit x86
  538. files ship with the Yocto Project that support some SDK hosts. However,
  539. it is possible to extend that support to other SDK hosts by adding
  540. additional configuration files in this subdirectory within another
  541. layer.
  542. .. _structure-meta-files:
  543. ``meta/files/``
  544. ---------------
  545. This directory contains common license files and several text files used
  546. by the build system. The text files contain minimal device information
  547. and lists of files and directories with known permissions.
  548. .. _structure-meta-lib:
  549. ``meta/lib/``
  550. -------------
  551. This directory contains OpenEmbedded Python library code used during the
  552. build process.
  553. .. _structure-meta-recipes-bsp:
  554. ``meta/recipes-bsp/``
  555. ---------------------
  556. This directory contains anything linking to specific hardware or
  557. hardware configuration information such as "u-boot" and "grub".
  558. .. _structure-meta-recipes-connectivity:
  559. ``meta/recipes-connectivity/``
  560. ------------------------------
  561. This directory contains libraries and applications related to
  562. communication with other devices.
  563. .. _structure-meta-recipes-core:
  564. ``meta/recipes-core/``
  565. ----------------------
  566. This directory contains what is needed to build a basic working Linux
  567. image including commonly used dependencies.
  568. .. _structure-meta-recipes-devtools:
  569. ``meta/recipes-devtools/``
  570. --------------------------
  571. This directory contains tools that are primarily used by the build
  572. system. The tools, however, can also be used on targets.
  573. .. _structure-meta-recipes-extended:
  574. ``meta/recipes-extended/``
  575. --------------------------
  576. This directory contains non-essential applications that add features
  577. compared to the alternatives in core. You might need this directory for
  578. full tool functionality.
  579. .. _structure-meta-recipes-gnome:
  580. ``meta/recipes-gnome/``
  581. -----------------------
  582. This directory contains all things related to the GTK+ application
  583. framework.
  584. .. _structure-meta-recipes-graphics:
  585. ``meta/recipes-graphics/``
  586. --------------------------
  587. This directory contains X and other graphically related system
  588. libraries.
  589. .. _structure-meta-recipes-kernel:
  590. ``meta/recipes-kernel/``
  591. ------------------------
  592. This directory contains the kernel and generic applications and
  593. libraries that have strong kernel dependencies.
  594. .. _structure-meta-recipes-multimedia:
  595. ``meta/recipes-multimedia/``
  596. ----------------------------
  597. This directory contains codecs and support utilities for audio, images
  598. and video.
  599. .. _structure-meta-recipes-rt:
  600. ``meta/recipes-rt/``
  601. --------------------
  602. This directory contains package and image recipes for using and testing
  603. the ``PREEMPT_RT`` kernel.
  604. .. _structure-meta-recipes-sato:
  605. ``meta/recipes-sato/``
  606. ----------------------
  607. This directory contains the Sato demo/reference UI/UX and its associated
  608. applications and configuration data.
  609. .. _structure-meta-recipes-support:
  610. ``meta/recipes-support/``
  611. -------------------------
  612. This directory contains recipes used by other recipes, but that are not
  613. directly included in images (i.e. dependencies of other recipes).
  614. .. _structure-meta-site:
  615. ``meta/site/``
  616. --------------
  617. This directory contains a list of cached results for various
  618. architectures. Because certain "autoconf" test results cannot be
  619. determined when cross-compiling due to the tests not able to run on a
  620. live system, the information in this directory is passed to "autoconf"
  621. for the various architectures.
  622. .. _structure-meta-recipes-txt:
  623. ``meta/recipes.txt``
  624. --------------------
  625. This file is a description of the contents of ``recipes-*``.