ref-structure.rst 31 KB

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