Reference: Directory Structure Poky consists of several components and understanding what these are and where they're located is one of the keys to using it. This section walks through the Poky directory structure giving information about the various files and directories.
Top level core components
<filename class="directory">bitbake/</filename> A copy of BitBake is included within Poky for ease of use, and should usually match the current BitBake stable release from the BitBake project. Bitbake, a metadata interpreter, reads the Poky metadata and runs the tasks defined in the Poky metadata. Failures are usually from the metadata, not BitBake itself, so most users don't need to worry about BitBake. The bitbake/bin/ directory is placed into the PATH environment variable by the poky-init-build-env script. For more information on BitBake please see the BitBake project site at and the BitBake on-line manual at .
<filename class="directory">build/</filename> This directory contains user configuration files and the output from Poky.
<filename class="directory">meta/</filename> This directory contains the core metadata, a key part of Poky. Within this directory there are definitions of the machines, the Poky distribution and the packages that make up a given system.
<filename class="directory">meta-extras/</filename> This directory is similar to meta/, and contains some extra metadata not included in standard Poky. These are disabled by default, and are not supported as part of Poky.
<filename class="directory">scripts/</filename> This directory contains various integration scripts which implement extra functionality in the Poky environment, such as the QEMU scripts. This directory is appended to the PATH environment variable by the poky-init-build-env script.
<filename class="directory">sources/</filename> While not part of a checkout, Poky will create this directory as part of any build. Any downloads are placed in this directory (as specified by the DL_DIR variable). This directory can be shared between Poky builds to save downloading files multiple times. SCM checkouts are also stored here as e.g. sources/svn/ , sources/cvs/ or sources/git/ and the sources directory may contain archives of checkouts for various revisions or dates. It's worth noting that BitBake creates .md5 stamp files for downloads. It uses these to mark downloads as complete as well as for checksum and access accounting purposes. If you add a file manually to the directory, you need to touch the corresponding .md5 file too. This location can be overridden by setting DL_DIR in local.conf . This directory can be shared between builds and even between machines via NFS, so downloads are only made once, speeding up builds.
<filename>poky-init-build-env</filename> This script is used to setup the Poky build environment. Sourcing this file in a shell makes changes to PATH and sets other core BitBake variables based on the current working directory. You need to use this before running Poky commands. Internally it uses scripts within the scripts/ directory to do the bulk of the work.
<filename class="directory">build/</filename> - The Build Directory
<filename>build/conf/local.conf</filename> This file contains all the local user configuration of Poky. If there is no local.conf present, it is created from local.conf.sample. The local.conf file contains documentation on the various configuration options. Any variable set here overrides any variable set elsewhere within Poky unless that variable is hardcoded within Poky (e.g. by using '=' instead of '?='). Some variables are hardcoded for various reasons but these variables are relatively rare. Edit this file to set the MACHINE for which you want to build, which package types you wish to use (PACKAGE_CLASSES) or where downloaded files should go (DL_DIR).
<filename class="directory">build/tmp/</filename> This is created by BitBake if it doesn't exist and is where all the Poky output is placed. To clean Poky and start a build from scratch (other than downloads), you can wipe this directory. The tmp/ directory has some important sub-components detailed below.
<filename class="directory">build/tmp/cache/</filename> When BitBake parses the metadata it creates a cache file of the result which can be used when subsequently running commands. These are stored here on a per machine basis.
<filename class="directory">build/tmp/cross/</filename> The cross compiler when generated is placed into this directory and those beneath it.
<filename class="directory">build/tmp/deploy/</filename> Any 'end result' output from Poky is placed under here.
<filename class="directory">build/tmp/deploy/deb/</filename> Any .deb packages emitted by Poky are placed here, sorted into feeds for different architecture types.
<filename class="directory">build/tmp/deploy/images/</filename> Complete filesystem images are placed here. If you want to flash the resulting image from a build onto a device, look here for them.
<filename class="directory">build/tmp/deploy/ipk/</filename> Any resulting .ipk packages emitted by Poky are placed here.
<filename class="directory">build/tmp/rootfs/</filename> This is a temporary scratch area used when creating filesystem images. It is run under fakeroot and is not useful once that fakeroot session has ended as information is lost. It is left around since it is still useful in debugging image creation problems.
<filename class="directory">build/tmp/staging/</filename> Any package needing to share output with other packages does so within staging. This means it contains any shared header files and any shared libraries amongst other data. It is subdivided by architecture so multiple builds can run within the one build directory.
<filename class="directory">build/tmp/stamps/</filename> This is used by BitBake for accounting purposes to keep track of which tasks have been run and when. It is also subdivided by architecture. The files are empty and the important information is the filenames and timestamps.
<filename class="directory">build/tmp/work/</filename> 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. It is worth considering the structure of a typical work directory. An example is the linux-rp kernel, version 2.6.20 r7 on the machine spitz built within Poky. For this package a work directory of tmp/work/spitz-poky-linux-gnueabi/linux-rp-2.6.20-r7/ , referred to as WORKDIR , is created. Within this directory, the source is unpacked to linux-2.6.20 and then patched by quilt (see Section 3.5.1). Within the linux-2.6.20 directory, standard Quilt directories linux-2.6.20/patches and linux-2.6.20/.pc are created, and standard quilt commands can be used. There are other directories generated within WORKDIR. The most important is WORKDIR/temp/ which has log files for each task (log.do_*.pid) and the scripts BitBake runs for each task (run.do_*.pid). The WORKDIR/image/ directory is where make install places its output which is then split into subpackages within WORKDIR/install/.
<filename class="directory">meta/</filename> - The Metadata As mentioned previously, this is the core of Poky. It has several important subdivisions:
<filename class="directory">meta/classes/</filename> Contains the *.bbclass files. Class files are used to abstract common code allowing it to be reused by multiple packages. The base.bbclass file is inherited by every package. Examples of other important classes are autotools.bbclass that in theory allows any Autotool-enabled package to work with Poky with minimal effort, or kernel.bbclass that contains common code and functions for working with the linux kernel. Functions like image generation or packaging also have their specific class files (image.bbclass , rootfs_*.bbclass and package*.bbclass).
<filename class="directory">meta/conf/</filename> This is the core set of configuration files which start from bitbake.conf and from which all other configuration files are included (see the includes at the end of the file, even local.conf is loaded from there!). While bitbake.conf sets up the defaults, these can often be overridden by user (local.conf), machine or distribution configuration files.
<filename class="directory">meta/conf/machine/</filename> Contains all the machine configuration files. If you set MACHINE="spitz", the end result is Poky looking for a spitz.conf file in this directory. The includes directory contains various data common to multiple machines. If you want to add support for a new machine to Poky, this is the directory to look in.
<filename class="directory">meta/conf/distro/</filename> Any distribution specific configuration is controlled from here. OpenEmbedded supports multiple distributions of which Poky is one. Poky only contains the Poky distribution so poky.conf is the main file here. This includes the versions and SRCDATES for applications which are configured here. An example of an alternative configuration is poky-bleeding.conf although this mainly inherits its configuration from Poky itself.
<filename class="directory">meta/packages/</filename> Each application (package) Poky can build has an associated .bb file which are all stored under this directory. Poky finds them through the BBFILES variable which defaults to packages/*/*.bb. Adding a new piece of software to Poky consists of adding the appropriate .bb file. The .bb files from OpenEmbedded upstream are usually compatible although they are not supported.
<filename class="directory">meta/site/</filename> Certain autoconf test results cannot be determined when cross compiling since it can't run tests on a live system. This directory therefore contains a list of cached results for various architectures which is passed to autoconf.