ref-structure.xml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  1. <!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
  2. "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
  3. <appendix id='ref-structure'>
  4. <title>Reference: Directory Structure</title>
  5. <para>
  6. Poky consists of several components and understanding what these are
  7. and where they're located is one of the keys to use it. This section walks
  8. through the Poky directory structure giving information about the various
  9. files and directories.
  10. </para>
  11. <section id='structure-core'>
  12. <title>Top level core components</title>
  13. <section id='structure-core-bitbake'>
  14. <title><filename class="directory">bitbake/</filename></title>
  15. <para>
  16. A copy of BitBake is included within Poky for ease of use, and should
  17. usually match the current BitBake stable release from the BitBake project.
  18. Bitbake, a metadata interpreter, reads the Poky metadata and runs the tasks
  19. defined in the Poky metadata. Failures are usually from the metadata, not
  20. BitBake itself, so most users don't need to worry about BitBake. The
  21. <filename class="directory">bitbake/bin/</filename> directory is placed
  22. into the PATH environment variable by the <link
  23. linkend="structure-core-script">poky-init-build-env</link> script.
  24. </para>
  25. <para>
  26. For more information on BitBake please see the BitBake project site at
  27. <ulink url="http://bitbake.berlios.de/"/>
  28. and the BitBake on-line manual at <ulink url="http://bitbake.berlios.de/manual/"/>.
  29. </para>
  30. </section>
  31. <section id='structure-core-build'>
  32. <title><filename class="directory">build/</filename></title>
  33. <para>
  34. This directory contains user configuration files and the output
  35. generated by Poky in its standard configuration where the source tree is
  36. combined with the output. It is also possible to place output and configuration
  37. files in a directory separate from the Poky source, see the section <link
  38. linkend='structure-core-script'>seperate output directory</link>.
  39. </para>
  40. </section>
  41. <section id='structure-core-meta'>
  42. <title><filename class="directory">meta/</filename></title>
  43. <para>
  44. This directory contains the core metadata, a key part of Poky. Within this
  45. directory there are definitions of the machines, the Poky distribution
  46. and the packages that make up a given system.
  47. </para>
  48. </section>
  49. <section id='structure-core-meta-extras'>
  50. <title><filename class="directory">meta-extras/</filename></title>
  51. <para>
  52. This directory is similar to <filename class="directory">meta/</filename>,
  53. and contains some extra metadata not included in standard Poky. These are
  54. disabled by default, and are not supported as part of Poky.
  55. </para>
  56. </section>
  57. <section id='structure-core-meta-***'>
  58. <title><filename class="directory">meta-***/</filename></title>
  59. <para>
  60. These directories are optional layers to be added to core metadata, which
  61. are enabled by adding them to conf/bblayers.conf.
  62. </para>
  63. </section>
  64. <section id='structure-core-scripts'>
  65. <title><filename class="directory">scripts/</filename></title>
  66. <para>
  67. This directory contains various integration scripts which implement
  68. extra functionality in the Poky environment, such as the QEMU
  69. scripts. This directory is appended to the PATH environment variable by the
  70. <link linkend="structure-core-script">poky-init-build-env</link> script.
  71. </para>
  72. </section>
  73. <section id='structure-core-sources'>
  74. <title><filename class="directory">sources/</filename></title>
  75. <para>
  76. While not part of a checkout, Poky will create this directory as
  77. part of any build. Any downloads are placed in this directory (as
  78. specified by the <glossterm><link linkend='var-DL_DIR'>DL_DIR</link>
  79. </glossterm> variable). This directory can be shared between Poky
  80. builds to save downloading files multiple times. SCM checkouts are
  81. also stored here as e.g. <filename class="directory">sources/svn/
  82. </filename>, <filename class="directory">sources/cvs/</filename> or
  83. <filename class="directory">sources/git/</filename> and the
  84. sources directory may contain archives of checkouts for various
  85. revisions or dates.
  86. </para>
  87. <para>
  88. It's worth noting that BitBake creates <filename class="extension">.md5
  89. </filename> stamp files for downloads. It uses these to mark downloads as
  90. complete as well as for checksum and access accounting purposes. If you add
  91. a file manually to the directory, you need to touch the corresponding
  92. <filename class="extension">.md5</filename> file too.
  93. </para>
  94. <para>
  95. This location can be overridden by setting <glossterm><link
  96. linkend='var-DL_DIR'>DL_DIR</link></glossterm> in <filename>local.conf
  97. </filename>. This directory can be shared between builds and even between
  98. machines via NFS, so downloads are only made once, speeding up builds.
  99. </para>
  100. </section>
  101. <section id='handbook'>
  102. <title><filename class="directory">handbook</filename></title>
  103. <para>
  104. This is the location where this handbook is generated
  105. </para>
  106. </section>
  107. <section id='structure-core-script'>
  108. <title><filename>poky-init-build-env</filename></title>
  109. <para>
  110. This script is used to setup the Poky build environment. Sourcing this file in
  111. a shell makes changes to PATH and sets other core BitBake variables based on the
  112. current working directory. You need to use this before running Poky commands.
  113. Internally it uses scripts within the <filename class="directory">scripts/
  114. </filename> directory to do the bulk of the work. This script supports
  115. specifying any directory as the build output:
  116. </para>
  117. <programlisting>
  118. source POKY_SRC/poky-init-build-env [BUILDDIR]
  119. </programlisting>
  120. <para>
  121. The above command can be typed from any directory, as long as POKY_SRC points to
  122. the desired Poky source tree. The optional BUILDDIR could be any directory you'd
  123. like Poky to generate the build output into.
  124. </para>
  125. </section>
  126. </section>
  127. <section id='structure-build'>
  128. <title><filename class="directory">build/</filename> - The Build Directory</title>
  129. <section id='structure-build-conf-local.conf'>
  130. <title><filename>build/conf/local.conf</filename></title>
  131. <para>
  132. This file contains all the local user configuration of Poky. If there
  133. is no <filename>local.conf</filename> present, it is created from
  134. <filename>local.conf.sample</filename>. The <filename>local.conf</filename>
  135. file contains documentation on the various configuration options. Any
  136. variable set here overrides any variable set elsewhere within Poky unless
  137. that variable is hardcoded within Poky (e.g. by using '=' instead of '?=').
  138. Some variables are hardcoded for various reasons but these variables are
  139. relatively rare.
  140. </para>
  141. <para>
  142. Edit this file to set the <glossterm><link linkend='var-MACHINE'>MACHINE</link></glossterm> for which you want to build, which package types you
  143. wish to use (PACKAGE_CLASSES) or where downloaded files should go
  144. (<glossterm><link linkend='var-DL_DIR'>DL_DIR</link></glossterm>).
  145. </para>
  146. </section>
  147. <section id='structure-build-conf-bblayers.conf'>
  148. <title><filename>build/conf/bblayers.conf</filename></title>
  149. <para>
  150. This file defines layers walked by bitbake. If there's no <filename>
  151. bblayers.conf</filename> present, it is created from <filename>bblayers.conf.sample
  152. </filename> when the environment setup script is sourced.
  153. </para>
  154. </section>
  155. <section id='structure-build-tmp'>
  156. <title><filename class="directory">build/tmp/</filename></title>
  157. <para>
  158. This is created by BitBake if it doesn't exist and is where all the Poky output
  159. is placed. To clean Poky and start a build from scratch (other than downloads),
  160. you can wipe this directory. The <filename class="directory">tmp/
  161. </filename> directory has some important sub-components detailed below.
  162. </para>
  163. </section>
  164. <section id='structure-build-tmp-cache'>
  165. <title><filename class="directory">build/tmp/cache/</filename></title>
  166. <para>
  167. When BitBake parses the metadata it creates a cache file of the result which can
  168. be used when subsequently running commands. These are stored here on
  169. a per machine basis.
  170. </para>
  171. </section>
  172. <section id='structure-build-tmp-deploy'>
  173. <title><filename class="directory">build/tmp/deploy/</filename></title>
  174. <para>Any 'end result' output from Poky is placed under here.</para>
  175. </section>
  176. <section id='structure-build-tmp-deploy-deb'>
  177. <title><filename class="directory">build/tmp/deploy/deb/</filename></title>
  178. <para>
  179. Any .deb packages emitted by Poky are placed here, sorted into feeds for
  180. different architecture types.
  181. </para>
  182. </section>
  183. <section id='structure-build-tmp-deploy-rpm'>
  184. <title><filename class="directory">build/tmp/deploy/rpm/</filename></title>
  185. <para>
  186. Any .rpm packages emitted by Poky are placed here, sorted into feeds for
  187. different architecture types.
  188. </para>
  189. </section>
  190. <section id='structure-build-tmp-deploy-images'>
  191. <title><filename class="directory">build/tmp/deploy/images/</filename></title>
  192. <para>
  193. Complete filesystem images are placed here. If you want to flash the resulting
  194. image from a build onto a device, look here for them.
  195. </para>
  196. </section>
  197. <section id='structure-build-tmp-deploy-ipk'>
  198. <title><filename class="directory">build/tmp/deploy/ipk/</filename></title>
  199. <para>Any resulting .ipk packages emitted by Poky are placed here.</para>
  200. </section>
  201. <section id='structure-build-tmp-sysroots'>
  202. <title><filename class="directory">build/tmp/sysroots/</filename></title>
  203. <para>
  204. Any package needing to share output with other packages does so within sysroots.
  205. This means it contains any shared header files and any shared libraries amongst
  206. other data. It is subdivided by architecture so multiple builds can run within
  207. the one build directory.
  208. </para>
  209. </section>
  210. <section id='structure-build-tmp-stamps'>
  211. <title><filename class="directory">build/tmp/stamps/</filename></title>
  212. <para>
  213. This is used by BitBake for accounting purposes to keep track of which tasks
  214. have been run and when. It is also subdivided by architecture. The files are
  215. empty and the important information is the filenames and timestamps.
  216. </para>
  217. </section>
  218. <section id='structure-build-tmp-log'>
  219. <title><filename class="directory">build/tmp/log/</filename></title>
  220. <para>
  221. This contains some general logs if not placing in a package's
  222. <glossterm><link linkend='var-WORKDIR'>WORKDIR</link></glossterm>, such as
  223. the log output from check_pkg or distro_check tasks.
  224. </para>
  225. </section>
  226. <section id='structure-build-tmp-pkgdata'>
  227. <title><filename class="directory">build/tmp/pkgdata/</filename></title>
  228. <para>
  229. This is an intermediate place for saving packaging data, which will be used
  230. in later packaging process. For detail please refer to <link linkend='ref-classes-package'>
  231. package.bbclass</link>.
  232. </para>
  233. </section>
  234. <section id='structure-build-tmp-pstagelogs'>
  235. <title><filename class="directory">build/tmp/pstagelogs/</filename></title>
  236. <para>
  237. This directory contains manifest for task based prebuilt. Each manifest is basically
  238. a file list for installed files from a given task, which would be useful for later
  239. packaging or cleanup process.
  240. </para>
  241. </section>
  242. <section id='structure-build-tmp-work'>
  243. <title><filename class="directory">build/tmp/work/</filename></title>
  244. <para>
  245. This directory contains various subdirectories for each architecture, and each package built by BitBake has its own work directory under the appropriate architecture subdirectory. All tasks are executed from this work directory. As an example, the source for a particular package will be unpacked, patched, configured and compiled all within its own work directory.
  246. </para>
  247. <para>
  248. It is worth considering the structure of a typical work directory. An
  249. example is the linux-rp kernel, version 2.6.20 r7 on the machine spitz
  250. built within Poky. For this package a work directory of <filename
  251. class="directory">tmp/work/spitz-poky-linux-gnueabi/linux-rp-2.6.20-r7/
  252. </filename>, referred to as <glossterm><link linkend='var-WORKDIR'>WORKDIR
  253. </link></glossterm>, is created. Within this directory, the source is
  254. unpacked to linux-2.6.20 and then patched by quilt (see <link
  255. linkend="usingpoky-modifying-packages-quilt">Section 3.5.1</link>).
  256. Within the <filename class="directory">linux-2.6.20</filename> directory,
  257. standard Quilt directories <filename class="directory">linux-2.6.20/patches</filename>
  258. and <filename class="directory">linux-2.6.20/.pc</filename> are created,
  259. and standard quilt commands can be used.
  260. </para>
  261. <para>
  262. There are other directories generated within <glossterm><link
  263. linkend='var-WORKDIR'>WORKDIR</link></glossterm>. The most important
  264. is <glossterm><link linkend='var-WORKDIR'>WORKDIR</link></glossterm><filename class="directory">/temp/</filename> which has log files for each
  265. task (<filename>log.do_*.pid</filename>) and the scripts BitBake runs for
  266. each task (<filename>run.do_*.pid</filename>). The <glossterm><link
  267. linkend='var-WORKDIR'>WORKDIR</link></glossterm><filename
  268. class="directory">/image/</filename> directory is where <command>make
  269. install</command> places its output which is then split into subpackages
  270. within <glossterm><link linkend='var-WORKDIR'>WORKDIR</link></glossterm>
  271. <filename class="directory">/packages-split/</filename>.
  272. </para>
  273. </section>
  274. </section>
  275. <section id='structure-meta'>
  276. <title><filename class="directory">meta/</filename> - The Metadata</title>
  277. <para>
  278. As mentioned previously, this is the core of Poky. It has several
  279. important subdivisions:
  280. </para>
  281. <section id='structure-meta-classes'>
  282. <title><filename class="directory">meta/classes/</filename></title>
  283. <para>
  284. Contains the <filename class="extension">*.bbclass</filename> files. Class
  285. files are used to abstract common code allowing it to be reused by multiple
  286. packages. The <filename>base.bbclass</filename> file is inherited by every
  287. package. Examples of other important classes are
  288. <filename>autotools.bbclass</filename> that in theory allows any
  289. Autotool-enabled package to work with Poky with minimal effort, or
  290. <filename>kernel.bbclass</filename> that contains common code and functions
  291. for working with the linux kernel. Functions like image generation or
  292. packaging also have their specific class files (<filename>image.bbclass
  293. </filename>, <filename>rootfs_*.bbclass</filename> and
  294. <filename>package*.bbclass</filename>).
  295. </para>
  296. </section>
  297. <section id='structure-meta-conf'>
  298. <title><filename class="directory">meta/conf/</filename></title>
  299. <para>
  300. This is the core set of configuration files which start from
  301. <filename>bitbake.conf</filename> and from which all other configuration
  302. files are included (see the includes at the end of the file, even
  303. <filename>local.conf</filename> is loaded from there!). While
  304. <filename>bitbake.conf</filename> sets up the defaults, these can often be
  305. overridden by user (<filename>local.conf</filename>), machine or
  306. distribution configuration files.
  307. </para>
  308. </section>
  309. <section id='structure-meta-conf-machine'>
  310. <title><filename class="directory">meta/conf/machine/</filename></title>
  311. <para>
  312. Contains all the machine configuration files. If you set MACHINE="spitz", the
  313. end result is Poky looking for a <filename>spitz.conf</filename> file in this directory. The includes
  314. directory contains various data common to multiple machines. If you want to add
  315. support for a new machine to Poky, this is the directory to look in.
  316. </para>
  317. </section>
  318. <section id='structure-meta-conf-distro'>
  319. <title><filename class="directory">meta/conf/distro/</filename></title>
  320. <para>
  321. Any distribution specific configuration is controlled from here. OpenEmbedded
  322. supports multiple distributions of which Poky is one. Poky only contains the
  323. Poky distribution so poky.conf is the main file here. This includes the
  324. versions and SRCDATES for applications which are configured here. An example of
  325. an alternative configuration is poky-bleeding.conf although this mainly inherits
  326. its configuration from Poky itself.
  327. </para>
  328. </section>
  329. <section id='structure-meta-recipes-bsp'>
  330. <title><filename class="directory">meta/recipes-bsp/</filename></title>
  331. <para>
  332. Anything linking to specific hardware or hardware configuration information
  333. are placed here, such as uboot, grub, etc.
  334. </para>
  335. </section>
  336. <section id='structure-meta-recipes-connectivity'>
  337. <title><filename class="directory">meta/recipes-connectivity/</filename></title>
  338. <para>
  339. Libraries and applications related to communication with other devices
  340. </para>
  341. </section>
  342. <section id='structure-meta-recipes-core'>
  343. <title><filename class="directory">meta/recipes-core/</filename></title>
  344. <para>
  345. What's needed to build a basic working Linux image including commonly used dependencies
  346. </para>
  347. </section>
  348. <section id='structure-meta-recipes-devtools'>
  349. <title><filename class="directory">meta/recipes-devtools/</filename></title>
  350. <para>
  351. Tools primarily used by the build system (but can also be used on targets)
  352. </para>
  353. </section>
  354. <section id='structure-meta-recipes-extended'>
  355. <title><filename class="directory">meta/recipes-extended/</filename></title>
  356. <para>
  357. Applications which whilst not essential add features compared to the alternatives in
  358. core. May be needed for full tool functionality or LSB compliance.
  359. </para>
  360. </section>
  361. <section id='structure-meta-recipes-gnome'>
  362. <title><filename class="directory">meta/recipes-gnome/</filename></title>
  363. <para>
  364. All things related to the GTK+ application framework
  365. </para>
  366. </section>
  367. <section id='structure-meta-recipes-graphics'>
  368. <title><filename class="directory">meta/recipes-graphics/</filename></title>
  369. <para>
  370. X and other graphically related system libraries
  371. </para>
  372. </section>
  373. <section id='structure-meta-recipes-kernel'>
  374. <title><filename class="directory">meta/recipes-kernel/</filename></title>
  375. <para>
  376. The kernel and generic applications/libraries with strong kernel dependencies
  377. </para>
  378. </section>
  379. <section id='structure-meta-recipes-multimedia'>
  380. <title><filename class="directory">meta/recipes-multimedia/</filename></title>
  381. <para>
  382. Codecs and support utilties for audio, images and video
  383. </para>
  384. </section>
  385. <section id='structure-meta-recipes-qt'>
  386. <title><filename class="directory">meta/recipes-qt/</filename></title>
  387. <para>
  388. All things related to the QT application framework
  389. </para>
  390. </section>
  391. <section id='structure-meta-recipes-sato'>
  392. <title><filename class="directory">meta/recipes-sato/</filename></title>
  393. <para>
  394. The Sato demo/reference UI/UX, its associated apps and configuration
  395. </para>
  396. </section>
  397. <section id='structure-meta-packages'>
  398. <title><filename class="directory">meta/packages/</filename></title>
  399. <para>
  400. this is a catch-all place for the rest which not fits into above
  401. recipes-***. Images and tasks are also placed here.
  402. </para>
  403. </section>
  404. <section id='structure-meta-site'>
  405. <title><filename class="directory">meta/site/</filename></title>
  406. <para>
  407. Certain autoconf test results cannot be determined when cross compiling since it
  408. can't run tests on a live system. This directory therefore contains a list of
  409. cached results for various architectures which is passed to autoconf.
  410. </para>
  411. </section>
  412. </section>
  413. </appendix>
  414. <!--
  415. vim: expandtab tw=80 ts=4
  416. -->