Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" |
| 2 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" |
| 3 | [<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] > |
| 4 | |
| 5 | <chapter id='ref-structure'> |
| 6 | |
| 7 | <title>Source Directory Structure</title> |
| 8 | |
| 9 | <para> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 10 | The <link linkend='source-directory'>Source Directory</link> |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 11 | consists of numerous files, directories and subdirectories; |
| 12 | understanding their locations and contents is key to using the |
| 13 | Yocto Project effectively. |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 14 | This chapter describes the Source Directory and gives information about |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 15 | those files and directories. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 16 | </para> |
| 17 | |
| 18 | <para> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 19 | For information on how to establish a local Source Directory on your |
| 20 | development system, see the |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 21 | "<ulink url='&YOCTO_DOCS_DEV_URL;#locating-yocto-project-source-files'>Locating Yocto Project Source Files</ulink>" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 22 | section in the Yocto Project Development Tasks Manual. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 23 | </para> |
| 24 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 25 | <note> |
| 26 | The OpenEmbedded build system does not support file or directory names that |
| 27 | contain spaces. |
| 28 | Be sure that the Source Directory you use does not contain these types |
| 29 | of names. |
| 30 | </note> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 31 | |
| 32 | <section id='structure-core'> |
| 33 | <title>Top-Level Core Components</title> |
| 34 | |
| 35 | <para> |
| 36 | This section describes the top-level components of the |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 37 | <link linkend='source-directory'>Source Directory</link>. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 38 | </para> |
| 39 | |
| 40 | <section id='structure-core-bitbake'> |
| 41 | <title><filename>bitbake/</filename></title> |
| 42 | |
| 43 | <para> |
| 44 | This directory includes a copy of BitBake for ease of use. |
| 45 | The copy usually matches the current stable BitBake release from |
| 46 | the BitBake project. |
| 47 | BitBake, a |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 48 | <link linkend='metadata'>Metadata</link> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 49 | interpreter, reads the Yocto Project Metadata and runs the tasks |
| 50 | defined by that data. |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 51 | Failures are usually caused by errors in your Metadata and not from BitBake itself; |
| 52 | consequently, most users do not need to worry about BitBake. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 53 | </para> |
| 54 | |
| 55 | <para> |
| 56 | When you run the <filename>bitbake</filename> command, the |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 57 | main BitBake executable (which resides in the |
| 58 | <filename>bitbake/bin/</filename> directory) starts. |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 59 | Sourcing the environment setup script (i.e. |
| 60 | <link linkend="structure-core-script"><filename>&OE_INIT_FILE;</filename></link>) |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 61 | places the <filename>scripts/</filename> and |
| 62 | <filename>bitbake/bin/</filename> directories (in that order) into |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 63 | the shell's <filename>PATH</filename> environment variable. |
| 64 | </para> |
| 65 | |
| 66 | <para> |
| 67 | For more information on BitBake, see the |
| 68 | <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>. |
| 69 | </para> |
| 70 | </section> |
| 71 | |
| 72 | <section id='structure-core-build'> |
| 73 | <title><filename>build/</filename></title> |
| 74 | |
| 75 | <para> |
| 76 | This directory contains user configuration files and the output |
| 77 | generated by the OpenEmbedded build system in its standard configuration where |
| 78 | the source tree is combined with the output. |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 79 | The |
| 80 | <link linkend='build-directory'>Build Directory</link> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 81 | is created initially when you <filename>source</filename> |
| 82 | the OpenEmbedded build environment setup script |
| 83 | (i.e. |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 84 | <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>). |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 85 | </para> |
| 86 | |
| 87 | <para> |
| 88 | It is also possible to place output and configuration |
| 89 | files in a directory separate from the |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 90 | <link linkend='source-directory'>Source Directory</link> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 91 | by providing a directory name when you <filename>source</filename> |
| 92 | the setup script. |
| 93 | For information on separating output from your local |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 94 | Source Directory files (commonly described as an "out of tree" build), see the |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 95 | "<link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>" |
| 96 | section. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 97 | </para> |
| 98 | </section> |
| 99 | |
| 100 | <section id='handbook'> |
| 101 | <title><filename>documentation/</filename></title> |
| 102 | |
| 103 | <para> |
| 104 | This directory holds the source for the Yocto Project documentation |
| 105 | as well as templates and tools that allow you to generate PDF and HTML |
| 106 | versions of the manuals. |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 107 | Each manual is contained in its own sub-folder; |
| 108 | for example, the files for this reference manual reside in |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 109 | the <filename>ref-manual/</filename> directory. |
| 110 | </para> |
| 111 | </section> |
| 112 | |
| 113 | <section id='structure-core-meta'> |
| 114 | <title><filename>meta/</filename></title> |
| 115 | |
| 116 | <para> |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 117 | This directory contains the minimal, underlying OpenEmbedded-Core metadata. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 118 | The directory holds recipes, common classes, and machine |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 119 | configuration for strictly emulated targets (<filename>qemux86</filename>, |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 120 | <filename>qemuarm</filename>, and so forth.) |
| 121 | </para> |
| 122 | </section> |
| 123 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 124 | <section id='structure-core-meta-poky'> |
| 125 | <title><filename>meta-poky/</filename></title> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 126 | |
| 127 | <para> |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 128 | Designed above the <filename>meta/</filename> content, this directory |
| 129 | adds just enough metadata to define the Poky reference distribution. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 130 | </para> |
| 131 | </section> |
| 132 | |
| 133 | <section id='structure-core-meta-yocto-bsp'> |
| 134 | <title><filename>meta-yocto-bsp/</filename></title> |
| 135 | |
| 136 | <para> |
| 137 | This directory contains the Yocto Project reference |
| 138 | hardware Board Support Packages (BSPs). |
| 139 | For more information on BSPs, see the |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 140 | <ulink url='&YOCTO_DOCS_BSP_URL;'>Yocto Project Board Support Package (BSP) Developer's Guide</ulink>. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 141 | </para> |
| 142 | </section> |
| 143 | |
| 144 | <section id='structure-meta-selftest'> |
| 145 | <title><filename>meta-selftest/</filename></title> |
| 146 | |
| 147 | <para> |
| 148 | This directory adds additional recipes and append files |
| 149 | used by the OpenEmbedded selftests to verify the behavior |
| 150 | of the build system. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 151 | You do not have to add this layer to your |
| 152 | <filename>bblayers.conf</filename> file unless you want to run the |
| 153 | selftests. |
| 154 | </para> |
| 155 | </section> |
| 156 | |
| 157 | <section id='structure-meta-skeleton'> |
| 158 | <title><filename>meta-skeleton/</filename></title> |
| 159 | |
| 160 | <para> |
| 161 | This directory contains template recipes for BSP and kernel development. |
| 162 | </para> |
| 163 | </section> |
| 164 | |
| 165 | <section id='structure-core-scripts'> |
| 166 | <title><filename>scripts/</filename></title> |
| 167 | |
| 168 | <para> |
| 169 | This directory contains various integration scripts that implement |
| 170 | extra functionality in the Yocto Project environment (e.g. QEMU scripts). |
| 171 | The <link linkend="structure-core-script"><filename>&OE_INIT_FILE;</filename></link> |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 172 | script prepends this directory to the shell's |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 173 | <filename>PATH</filename> environment variable. |
| 174 | </para> |
| 175 | |
| 176 | <para> |
| 177 | The <filename>scripts</filename> directory has useful scripts that assist in contributing |
| 178 | back to the Yocto Project, such as <filename>create-pull-request</filename> and |
| 179 | <filename>send-pull-request</filename>. |
| 180 | </para> |
| 181 | </section> |
| 182 | |
| 183 | <section id='structure-core-script'> |
| 184 | <title><filename>&OE_INIT_FILE;</filename></title> |
| 185 | |
| 186 | <para> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 187 | This script sets up the OpenEmbedded build environment. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 188 | Running this script with the <filename>source</filename> command in |
| 189 | a shell makes changes to <filename>PATH</filename> and sets other |
| 190 | core BitBake variables based on the current working directory. |
| 191 | You need to run an environment setup script before running BitBake |
| 192 | commands. |
| 193 | The script uses other scripts within the |
| 194 | <filename>scripts</filename> directory to do the bulk of the work. |
| 195 | </para> |
| 196 | |
| 197 | <para> |
| 198 | When you run this script, your Yocto Project environment is set |
| 199 | up, a |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 200 | <link linkend='build-directory'>Build Directory</link> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 201 | is created, your working directory becomes the Build Directory, |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 202 | and you are presented with some simple suggestions as to what to do |
| 203 | next, including a list of some possible targets to build. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 204 | Here is an example: |
| 205 | <literallayout class='monospaced'> |
| 206 | $ source oe-init-build-env |
| 207 | |
| 208 | ### Shell environment set up for builds. ### |
| 209 | |
| 210 | You can now run 'bitbake <target>' |
| 211 | |
| 212 | Common targets are: |
| 213 | core-image-minimal |
| 214 | core-image-sato |
| 215 | meta-toolchain |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 216 | meta-ide-support |
| 217 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 218 | You can also run generated qemu images with a command like 'runqemu qemux86-64' |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 219 | </literallayout> |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 220 | The default output of the <filename>oe-init-build-env</filename> script |
| 221 | is from the <filename>conf-notes.txt</filename> file, which is found in the |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 222 | <filename>meta-poky</filename> directory within the |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 223 | <link linkend='source-directory'>Source Directory</link>. |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 224 | If you design a custom distribution, you can include your own version |
| 225 | of this configuration file to mention the targets defined by your |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 226 | distribution. |
| 227 | See the |
| 228 | "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-a-custom-template-configuration-directory'>Creating a Custom Template Configuration Directory</ulink>" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 229 | section in the Yocto Project Development Tasks Manual for more |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 230 | information. |
| 231 | </para> |
| 232 | |
| 233 | <para> |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 234 | By default, running this script without a Build Directory |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 235 | argument creates the <filename>build/</filename> directory |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 236 | in your current working directory. |
| 237 | If you provide a Build Directory argument when you |
| 238 | <filename>source</filename> the script, you direct the OpenEmbedded |
| 239 | build system to create a Build Directory of your choice. |
| 240 | For example, the following command creates a Build Directory named |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 241 | <filename>mybuilds/</filename> that is outside of the |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 242 | <link linkend='source-directory'>Source Directory</link>: |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 243 | <literallayout class='monospaced'> |
| 244 | $ source &OE_INIT_FILE; ~/mybuilds |
| 245 | </literallayout> |
| 246 | The OpenEmbedded build system uses the template configuration |
| 247 | files, which are found by default in the |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 248 | <filename>meta-poky/conf/</filename> directory in the |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 249 | Source Directory. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 250 | See the |
| 251 | "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-a-custom-template-configuration-directory'>Creating a Custom Template Configuration Directory</ulink>" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 252 | section in the Yocto Project Development Tasks Manual for more |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 253 | information. |
| 254 | <note> |
| 255 | The OpenEmbedded build system does not support file or directory names that |
| 256 | contain spaces. |
| 257 | If you attempt to run the <filename>&OE_INIT_FILE;</filename> script |
| 258 | from a Source Directory that contains spaces in either the filenames |
| 259 | or directory names, the script returns an error indicating no such |
| 260 | file or directory. |
| 261 | Be sure to use a Source Directory free of names containing spaces. |
| 262 | </note> |
| 263 | </para> |
| 264 | </section> |
| 265 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 266 | <section id='structure-basic-top-level'> |
| 267 | <title><filename>LICENSE, README, and README.hardware</filename></title> |
| 268 | |
| 269 | <para> |
| 270 | These files are standard top-level files. |
| 271 | </para> |
| 272 | </section> |
| 273 | </section> |
| 274 | |
| 275 | <section id='structure-build'> |
| 276 | <title>The Build Directory - <filename>build/</filename></title> |
| 277 | |
| 278 | <para> |
| 279 | The OpenEmbedded build system creates the |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 280 | <link linkend='build-directory'>Build Directory</link> |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 281 | when you run the build environment setup script |
| 282 | <link |
| 283 | linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 284 | If you do not give the Build Directory a specific name when you run |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 285 | the setup script, the name defaults to <filename>build/</filename>. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 286 | </para> |
| 287 | |
| 288 | <para> |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 289 | For subsequent parsing and processing, the name of the Build |
| 290 | directory is available via the |
| 291 | <link linkend='var-TOPDIR'><filename>TOPDIR</filename></link> variable. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 292 | </para> |
| 293 | |
| 294 | <section id='structure-build-buildhistory'> |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 295 | <title><filename>build/buildhistory/</filename></title> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 296 | |
| 297 | <para> |
| 298 | The OpenEmbedded build system creates this directory when you |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 299 | enable build history via the <filename>buildhistory</filename> class file. |
| 300 | The directory organizes build information into image, packages, and |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 301 | SDK subdirectories. |
| 302 | For information on the build history feature, see the |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 303 | "<ulink url='&YOCTO_DOCS_DEV_URL;#maintaining-build-output-quality'>Maintaining Build Output Quality</ulink>" |
| 304 | section in the Yocto Project Development Tasks Manual. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 305 | </para> |
| 306 | </section> |
| 307 | |
| 308 | <section id='structure-build-conf-local.conf'> |
| 309 | <title><filename>build/conf/local.conf</filename></title> |
| 310 | |
| 311 | <para> |
| 312 | This configuration file contains all the local user configurations |
| 313 | for your build environment. |
| 314 | The <filename>local.conf</filename> file contains documentation on |
| 315 | the various configuration options. |
| 316 | Any variable set here overrides any variable set elsewhere within |
| 317 | the environment unless that variable is hard-coded within a file |
| 318 | (e.g. by using '=' instead of '?='). |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 319 | Some variables are hard-coded for various reasons but such |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 320 | variables are relatively rare. |
| 321 | </para> |
| 322 | |
| 323 | <para> |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 324 | At a minimum, you would normally edit this file to select the target |
| 325 | <filename><link linkend='var-MACHINE'>MACHINE</link></filename>, |
| 326 | which package types you wish to use |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 327 | (<link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link>), |
| 328 | and the location from which you want to access downloaded files |
| 329 | (<filename><link linkend='var-DL_DIR'>DL_DIR</link></filename>). |
| 330 | </para> |
| 331 | |
| 332 | <para> |
| 333 | If <filename>local.conf</filename> is not present when you |
| 334 | start the build, the OpenEmbedded build system creates it from |
| 335 | <filename>local.conf.sample</filename> when |
| 336 | you <filename>source</filename> the top-level build environment |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 337 | setup script |
| 338 | <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 339 | </para> |
| 340 | |
| 341 | <para> |
| 342 | The source <filename>local.conf.sample</filename> file used |
| 343 | depends on the <filename>$TEMPLATECONF</filename> script variable, |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 344 | which defaults to <filename>meta-poky/conf/</filename> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 345 | when you are building from the Yocto Project development |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 346 | environment, and to <filename>meta/conf/</filename> when |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 347 | you are building from the OpenEmbedded-Core environment. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 348 | Because the script variable points to the source of the |
| 349 | <filename>local.conf.sample</filename> file, this implies that |
| 350 | you can configure your build environment from any layer by setting |
| 351 | the variable in the top-level build environment setup script as |
| 352 | follows: |
| 353 | <literallayout class='monospaced'> |
| 354 | TEMPLATECONF=<replaceable>your_layer</replaceable>/conf |
| 355 | </literallayout> |
| 356 | Once the build process gets the sample file, it uses |
| 357 | <filename>sed</filename> to substitute final |
| 358 | <filename>${</filename><link linkend='var-OEROOT'><filename>OEROOT</filename></link><filename>}</filename> |
| 359 | values for all <filename>##OEROOT##</filename> values. |
| 360 | <note> |
| 361 | You can see how the <filename>TEMPLATECONF</filename> variable |
| 362 | is used by looking at the |
| 363 | <filename>scripts/oe-setup-builddir</filename> script in the |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 364 | <link linkend='source-directory'>Source Directory</link>. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 365 | You can find the Yocto Project version of the |
| 366 | <filename>local.conf.sample</filename> file in the |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 367 | <filename>meta-poky/conf</filename> directory. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 368 | </note> |
| 369 | </para> |
| 370 | </section> |
| 371 | |
| 372 | <section id='structure-build-conf-bblayers.conf'> |
| 373 | <title><filename>build/conf/bblayers.conf</filename></title> |
| 374 | |
| 375 | <para> |
| 376 | This configuration file defines |
| 377 | <ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>layers</ulink>, |
| 378 | which are directory trees, traversed (or walked) by BitBake. |
| 379 | The <filename>bblayers.conf</filename> file uses the |
| 380 | <link linkend='var-BBLAYERS'><filename>BBLAYERS</filename></link> |
| 381 | variable to list the layers BitBake tries to find. |
| 382 | </para> |
| 383 | |
| 384 | <para> |
| 385 | If <filename>bblayers.conf</filename> is not present when you |
| 386 | start the build, the OpenEmbedded build system creates it from |
| 387 | <filename>bblayers.conf.sample</filename> when |
| 388 | you <filename>source</filename> the top-level build environment |
| 389 | setup script (i.e. |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 390 | <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>). |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 391 | </para> |
| 392 | |
| 393 | <para> |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 394 | As with the <filename>local.conf</filename> file, |
| 395 | the source <filename>bblayers.conf.sample</filename> file used |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 396 | depends on the <filename>$TEMPLATECONF</filename> script variable, |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 397 | which defaults to <filename>meta-poky/conf/</filename> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 398 | when you are building from the Yocto Project development |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 399 | environment, and to <filename>meta/conf/</filename> when |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 400 | you are building from the OpenEmbedded-Core environment. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 401 | Because the script variable points to the source of the |
| 402 | <filename>bblayers.conf.sample</filename> file, this implies that |
| 403 | you can base your build from any layer by setting the variable in |
| 404 | the top-level build environment setup script as follows: |
| 405 | <literallayout class='monospaced'> |
| 406 | TEMPLATECONF=<replaceable>your_layer</replaceable>/conf |
| 407 | </literallayout> |
| 408 | Once the build process gets the sample file, it uses |
| 409 | <filename>sed</filename> to substitute final |
| 410 | <filename>${</filename><link linkend='var-OEROOT'><filename>OEROOT</filename></link><filename>}</filename> |
| 411 | values for all <filename>##OEROOT##</filename> values. |
| 412 | <note> |
| 413 | You can see how the <filename>TEMPLATECONF</filename> variable |
| 414 | <filename>scripts/oe-setup-builddir</filename> script in the |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 415 | <link linkend='source-directory'>Source Directory</link>. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 416 | You can find the Yocto Project version of the |
| 417 | <filename>bblayers.conf.sample</filename> file in the |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 418 | <filename>meta-poky/conf/</filename> directory. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 419 | </note> |
| 420 | </para> |
| 421 | </section> |
| 422 | |
| 423 | <section id='structure-build-conf-sanity_info'> |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 424 | <title><filename>build/cache/sanity_info</filename></title> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 425 | |
| 426 | <para> |
| 427 | This file indicates the state of the sanity checks and is created |
| 428 | during the build. |
| 429 | </para> |
| 430 | </section> |
| 431 | |
| 432 | <section id='structure-build-downloads'> |
| 433 | <title><filename>build/downloads/</filename></title> |
| 434 | |
| 435 | <para> |
| 436 | This directory contains downloaded upstream source tarballs. |
| 437 | You can reuse the directory for multiple builds or move |
| 438 | the directory to another location. |
| 439 | You can control the location of this directory through the |
| 440 | <filename><link linkend='var-DL_DIR'>DL_DIR</link></filename> variable. |
| 441 | </para> |
| 442 | </section> |
| 443 | |
| 444 | <section id='structure-build-sstate-cache'> |
| 445 | <title><filename>build/sstate-cache/</filename></title> |
| 446 | |
| 447 | <para> |
| 448 | This directory contains the shared state cache. |
| 449 | You can reuse the directory for multiple builds or move |
| 450 | the directory to another location. |
| 451 | You can control the location of this directory through the |
| 452 | <filename><link linkend='var-SSTATE_DIR'>SSTATE_DIR</link></filename> variable. |
| 453 | </para> |
| 454 | </section> |
| 455 | |
| 456 | <section id='structure-build-tmp'> |
| 457 | <title><filename>build/tmp/</filename></title> |
| 458 | |
| 459 | <para> |
| 460 | The OpenEmbedded build system creates and uses this directory |
| 461 | for all the build system's output. |
| 462 | The |
| 463 | <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link> |
| 464 | variable points to this directory. |
| 465 | </para> |
| 466 | |
| 467 | <para> |
| 468 | BitBake creates this directory if it does not exist. |
| 469 | As a last resort, to clean up a build and start it from scratch |
| 470 | (other than the downloads), you can remove everything in the |
| 471 | <filename>tmp</filename> directory or get rid of the |
| 472 | directory completely. |
| 473 | If you do, you should also completely remove the |
| 474 | <filename>build/sstate-cache</filename> directory. |
| 475 | </para> |
| 476 | </section> |
| 477 | |
| 478 | <section id='structure-build-tmp-buildstats'> |
| 479 | <title><filename>build/tmp/buildstats/</filename></title> |
| 480 | |
| 481 | <para> |
| 482 | This directory stores the build statistics. |
| 483 | </para> |
| 484 | </section> |
| 485 | |
| 486 | <section id='structure-build-tmp-cache'> |
| 487 | <title><filename>build/tmp/cache/</filename></title> |
| 488 | |
| 489 | <para> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 490 | When BitBake parses the metadata (recipes and configuration files), |
| 491 | it caches the results in <filename>build/tmp/cache/</filename> |
| 492 | to speed up future builds. |
| 493 | The results are stored on a per-machine basis. |
| 494 | </para> |
| 495 | |
| 496 | <para> |
| 497 | During subsequent builds, BitBake checks each recipe (together |
| 498 | with, for example, any files included or appended to it) to see |
| 499 | if they have been modified. |
| 500 | Changes can be detected, for example, through file modification |
| 501 | time (mtime) changes and hashing of file contents. |
| 502 | If no changes to the file are detected, then the parsed result |
| 503 | stored in the cache is reused. |
| 504 | If the file has changed, it is reparsed. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 505 | </para> |
| 506 | </section> |
| 507 | |
| 508 | <section id='structure-build-tmp-deploy'> |
| 509 | <title><filename>build/tmp/deploy/</filename></title> |
| 510 | |
| 511 | <para> |
| 512 | This directory contains any "end result" output from the |
| 513 | OpenEmbedded build process. |
| 514 | The <link linkend='var-DEPLOY_DIR'><filename>DEPLOY_DIR</filename></link> |
| 515 | variable points to this directory. |
| 516 | For more detail on the contents of the <filename>deploy</filename> |
| 517 | directory, see the |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 518 | "<ulink url='&YOCTO_DOCS_OM_URL;#images-dev-environment'>Images</ulink>" |
| 519 | and |
| 520 | "<ulink url='&YOCTO_DOCS_OM_URL;#sdk-dev-environment'>Application Development SDK</ulink>" |
| 521 | sections in the Yocto Project Overview and Concepts Manual. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 522 | </para> |
| 523 | </section> |
| 524 | |
| 525 | <section id='structure-build-tmp-deploy-deb'> |
| 526 | <title><filename>build/tmp/deploy/deb/</filename></title> |
| 527 | |
| 528 | <para> |
| 529 | This directory receives any <filename>.deb</filename> packages produced by |
| 530 | the build process. |
| 531 | The packages are sorted into feeds for different architecture types. |
| 532 | </para> |
| 533 | </section> |
| 534 | |
| 535 | <section id='structure-build-tmp-deploy-rpm'> |
| 536 | <title><filename>build/tmp/deploy/rpm/</filename></title> |
| 537 | |
| 538 | <para> |
| 539 | This directory receives any <filename>.rpm</filename> packages produced by |
| 540 | the build process. |
| 541 | The packages are sorted into feeds for different architecture types. |
| 542 | </para> |
| 543 | </section> |
| 544 | |
| 545 | <section id='structure-build-tmp-deploy-ipk'> |
| 546 | <title><filename>build/tmp/deploy/ipk/</filename></title> |
| 547 | |
| 548 | <para> |
| 549 | This directory receives <filename>.ipk</filename> packages produced by |
| 550 | the build process. |
| 551 | </para> |
| 552 | </section> |
| 553 | |
| 554 | <section id='structure-build-tmp-deploy-licenses'> |
| 555 | <title><filename>build/tmp/deploy/licenses/</filename></title> |
| 556 | |
| 557 | <para> |
| 558 | This directory receives package licensing information. |
| 559 | For example, the directory contains sub-directories for <filename>bash</filename>, |
| 560 | <filename>busybox</filename>, and <filename>glibc</filename> (among others) that in turn |
| 561 | contain appropriate <filename>COPYING</filename> license files with other licensing information. |
| 562 | For information on licensing, see the |
| 563 | "<ulink url='&YOCTO_DOCS_DEV_URL;#maintaining-open-source-license-compliance-during-your-products-lifecycle'>Maintaining Open Source License Compliance During Your Product's Lifecycle</ulink>" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 564 | section in the Yocto Project Development Tasks Manual. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 565 | </para> |
| 566 | </section> |
| 567 | |
| 568 | <section id='structure-build-tmp-deploy-images'> |
| 569 | <title><filename>build/tmp/deploy/images/</filename></title> |
| 570 | |
| 571 | <para> |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 572 | This directory is populated with the basic output objects of the |
| 573 | build (think of them as the "generated artifacts" of the build process), |
| 574 | including things like the boot loader image, kernel, root filesystem and more. |
| 575 | If you want to flash the resulting image from a build onto a device, |
| 576 | look here for the necessary components. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 577 | </para> |
| 578 | |
| 579 | <para> |
| 580 | Be careful when deleting files in this directory. |
| 581 | You can safely delete old images from this directory (e.g. |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 582 | <filename>core-image-*</filename>). |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 583 | However, the kernel (<filename>*zImage*</filename>, <filename>*uImage*</filename>, etc.), |
| 584 | bootloader and other supplementary files might be deployed here prior to building an |
| 585 | image. |
| 586 | Because these files are not directly produced from the image, if you |
| 587 | delete them they will not be automatically re-created when you build the image again. |
| 588 | </para> |
| 589 | |
| 590 | <para> |
| 591 | If you do accidentally delete files here, you will need to force them to be |
| 592 | re-created. |
| 593 | In order to do that, you will need to know the target that produced them. |
| 594 | For example, these commands rebuild and re-create the kernel files: |
| 595 | <literallayout class='monospaced'> |
| 596 | $ bitbake -c clean virtual/kernel |
| 597 | $ bitbake virtual/kernel |
| 598 | </literallayout> |
| 599 | </para> |
| 600 | </section> |
| 601 | |
| 602 | <section id='structure-build-tmp-deploy-sdk'> |
| 603 | <title><filename>build/tmp/deploy/sdk/</filename></title> |
| 604 | |
| 605 | <para> |
| 606 | The OpenEmbedded build system creates this directory to hold |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 607 | toolchain installer scripts which, when executed, install the |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 608 | sysroot that matches your target hardware. |
| 609 | You can find out more about these installers in the |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 610 | "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-building-an-sdk-installer'>Building an SDK Installer</ulink>" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 611 | section in the Yocto Project Application Development and the |
| 612 | Extensible Software Development Kit (eSDK) manual. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 613 | </para> |
| 614 | </section> |
| 615 | |
| 616 | <section id='structure-build-tmp-sstate-control'> |
| 617 | <title><filename>build/tmp/sstate-control/</filename></title> |
| 618 | |
| 619 | <para> |
| 620 | The OpenEmbedded build system uses this directory for the |
| 621 | shared state manifest files. |
| 622 | The shared state code uses these files to record the files |
| 623 | installed by each sstate task so that the files can be removed |
| 624 | when cleaning the recipe or when a newer version is about to |
| 625 | be installed. |
| 626 | The build system also uses the manifests to detect and produce |
| 627 | a warning when files from one task are overwriting those from |
| 628 | another. |
| 629 | </para> |
| 630 | </section> |
| 631 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 632 | <section id='structure-build-tmp-sysroots-components'> |
| 633 | <title><filename>build/tmp/sysroots-components/</filename></title> |
| 634 | |
| 635 | <para> |
| 636 | This directory is the location of the sysroot contents that the |
| 637 | task |
| 638 | <link linkend='ref-tasks-prepare_recipe_sysroot'><filename>do_prepare_recipe_sysroot</filename></link> |
| 639 | links or copies into the recipe-specific sysroot for each |
| 640 | recipe listed in |
| 641 | <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>. |
| 642 | Population of this directory is handled through shared state, while |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 643 | the path is specified by the |
| 644 | <link linkend='var-COMPONENTS_DIR'><filename>COMPONENTS_DIR</filename></link> |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 645 | variable. Apart from a few unusual circumstances, handling of the |
| 646 | <filename>sysroots-components</filename> directory should be |
| 647 | automatic, and recipes should not directly reference |
| 648 | <filename>build/tmp/sysroots-components</filename>. |
| 649 | </para> |
| 650 | </section> |
| 651 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 652 | <section id='structure-build-tmp-sysroots'> |
| 653 | <title><filename>build/tmp/sysroots/</filename></title> |
| 654 | |
| 655 | <para> |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 656 | Previous versions of the OpenEmbedded build system used to |
| 657 | create a global shared sysroot per machine along with a native |
| 658 | sysroot. |
| 659 | Beginning with the &DISTRO; version of the Yocto Project, |
| 660 | sysroots exist in recipe-specific |
| 661 | <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link> |
| 662 | directories. |
| 663 | Thus, the <filename>build/tmp/sysroots/</filename> directory |
| 664 | is unused. |
| 665 | <note> |
| 666 | The <filename>build/tmp/sysroots/</filename> directory |
| 667 | can still be populated using the |
| 668 | <filename>bitbake build-sysroots</filename> command and can |
| 669 | be used for compatibility in some cases. |
| 670 | However, in general it is not recommended to populate |
| 671 | this directory. |
| 672 | Individual recipe-specific sysroots should be used. |
| 673 | </note> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 674 | </para> |
| 675 | </section> |
| 676 | |
| 677 | <section id='structure-build-tmp-stamps'> |
| 678 | <title><filename>build/tmp/stamps/</filename></title> |
| 679 | |
| 680 | <para> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 681 | This directory holds information that BitBake uses for |
| 682 | accounting purposes to track what tasks have run and when they |
| 683 | have run. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 684 | The directory is sub-divided by architecture, package name, and |
| 685 | version. |
| 686 | Following is an example: |
| 687 | <literallayout class='monospaced'> |
| 688 | stamps/all-poky-linux/distcc-config/1.0-r0.do_build-2fdd....2do |
| 689 | </literallayout> |
| 690 | Although the files in the directory are empty of data, |
| 691 | BitBake uses the filenames and timestamps for tracking purposes. |
| 692 | </para> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 693 | |
| 694 | <para> |
| 695 | For information on how BitBake uses stamp files to determine if |
| 696 | a task should be rerun, see the |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 697 | "<ulink url='&YOCTO_DOCS_OM_URL;#stamp-files-and-the-rerunning-of-tasks'>Stamp Files and the Rerunning of Tasks</ulink>" |
| 698 | section in the Yocto Project Overview and Concepts Manual. |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 699 | </para> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 700 | </section> |
| 701 | |
| 702 | <section id='structure-build-tmp-log'> |
| 703 | <title><filename>build/tmp/log/</filename></title> |
| 704 | |
| 705 | <para> |
| 706 | This directory contains general logs that are not otherwise placed using the |
| 707 | package's <filename><link linkend='var-WORKDIR'>WORKDIR</link></filename>. |
| 708 | Examples of logs are the output from the |
| 709 | <filename>do_check_pkg</filename> or |
| 710 | <filename>do_distro_check</filename> tasks. |
| 711 | Running a build does not necessarily mean this directory is created. |
| 712 | </para> |
| 713 | </section> |
| 714 | |
| 715 | <section id='structure-build-tmp-work'> |
| 716 | <title><filename>build/tmp/work/</filename></title> |
| 717 | |
| 718 | <para> |
| 719 | This directory contains architecture-specific work sub-directories |
| 720 | for packages built by BitBake. |
| 721 | All tasks execute from the appropriate work directory. |
| 722 | For example, the source for a particular package is unpacked, |
| 723 | patched, configured and compiled all within its own work directory. |
| 724 | Within the work directory, organization is based on the package group |
| 725 | and version for which the source is being compiled |
| 726 | as defined by the |
| 727 | <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>. |
| 728 | </para> |
| 729 | |
| 730 | <para> |
| 731 | It is worth considering the structure of a typical work directory. |
| 732 | As an example, consider <filename>linux-yocto-kernel-3.0</filename> |
| 733 | on the machine <filename>qemux86</filename> |
| 734 | built within the Yocto Project. |
| 735 | For this package, a work directory of |
| 736 | <filename>tmp/work/qemux86-poky-linux/linux-yocto/3.0+git1+<.....></filename>, |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 737 | referred to as the <filename>WORKDIR</filename>, is created. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 738 | Within this directory, the source is unpacked to |
| 739 | <filename>linux-qemux86-standard-build</filename> and then patched by Quilt. |
| 740 | (See the |
| 741 | "<ulink url='&YOCTO_DOCS_DEV_URL;#using-a-quilt-workflow'>Using Quilt in Your Workflow</ulink>" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 742 | section in the Yocto Project Development Tasks Manual for more |
| 743 | information.) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 744 | Within the <filename>linux-qemux86-standard-build</filename> directory, |
| 745 | standard Quilt directories <filename>linux-3.0/patches</filename> |
| 746 | and <filename>linux-3.0/.pc</filename> are created, |
| 747 | and standard Quilt commands can be used. |
| 748 | </para> |
| 749 | |
| 750 | <para> |
| 751 | There are other directories generated within <filename>WORKDIR</filename>. |
| 752 | The most important directory is <filename>WORKDIR/temp/</filename>, |
| 753 | which has log files for each task (<filename>log.do_*.pid</filename>) |
| 754 | and contains the scripts BitBake runs for each task |
| 755 | (<filename>run.do_*.pid</filename>). |
| 756 | The <filename>WORKDIR/image/</filename> directory is where "make |
| 757 | install" places its output that is then split into sub-packages |
| 758 | within <filename>WORKDIR/packages-split/</filename>. |
| 759 | </para> |
| 760 | </section> |
| 761 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 762 | <section id='structure-build-tmp-work-tunearch-recipename-version'> |
| 763 | <title><filename>build/tmp/work/<replaceable>tunearch</replaceable>/<replaceable>recipename</replaceable>/<replaceable>version</replaceable>/</filename></title> |
| 764 | |
| 765 | <para> |
| 766 | The recipe work directory - <filename>${WORKDIR}</filename>. |
| 767 | </para> |
| 768 | |
| 769 | <para> |
| 770 | As described earlier in the |
| 771 | "<link linkend='structure-build-tmp-sysroots'><filename>build/tmp/sysroots/</filename></link>" |
| 772 | section, beginning with the &DISTRO; release of the Yocto |
| 773 | Project, the OpenEmbedded build system builds each recipe in its |
| 774 | own work directory (i.e. |
| 775 | <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>). |
| 776 | The path to the work directory is constructed using the |
| 777 | architecture of the given build (e.g. |
| 778 | <link linkend='var-TUNE_PKGARCH'><filename>TUNE_PKGARCH</filename></link>, |
| 779 | <link linkend='var-MACHINE_ARCH'><filename>MACHINE_ARCH</filename></link>, |
| 780 | or "allarch"), the recipe name, and the version of the recipe (i.e. |
| 781 | <link linkend='var-PE'><filename>PE</filename></link><filename>:</filename><link linkend='var-PV'><filename>PV</filename></link><filename>-</filename><link linkend='var-PR'><filename>PR</filename></link>). |
| 782 | </para> |
| 783 | |
| 784 | <para> |
| 785 | A number of key subdirectories exist within each recipe |
| 786 | work directory: |
| 787 | <itemizedlist> |
| 788 | <listitem><para> |
| 789 | <filename>${WORKDIR}/temp</filename>: |
| 790 | Contains the log files of each task executed for this |
| 791 | recipe, the "run" files for each executed task, which |
| 792 | contain the code run, and a |
| 793 | <filename>log.task_order</filename> file, which lists the |
| 794 | order in which tasks were executed. |
| 795 | </para></listitem> |
| 796 | <listitem><para> |
| 797 | <filename>${WORKDIR}/image</filename>: |
| 798 | Contains the output of the |
| 799 | <link linkend='ref-tasks-install'><filename>do_install</filename></link> |
| 800 | task, which corresponds to the |
| 801 | <filename>${</filename><link linkend='var-D'><filename>D</filename></link><filename>}</filename> |
| 802 | variable in that task. |
| 803 | </para></listitem> |
| 804 | <listitem><para> |
| 805 | <filename>${WORKDIR}/pseudo</filename>: |
| 806 | Contains the pseudo database and log for any tasks executed |
| 807 | under pseudo for the recipe. |
| 808 | </para></listitem> |
| 809 | <listitem><para> |
| 810 | <filename>${WORKDIR}/sysroot-destdir</filename>: |
| 811 | Contains the output of the |
| 812 | <link linkend='ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></link> |
| 813 | task. |
| 814 | </para></listitem> |
| 815 | <listitem><para> |
| 816 | <filename>${WORKDIR}/package</filename>: |
| 817 | Contains the output of the |
| 818 | <link linkend='ref-tasks-package'><filename>do_package</filename></link> |
| 819 | task before the output is split into individual packages. |
| 820 | </para></listitem> |
| 821 | <listitem><para> |
| 822 | <filename>${WORKDIR}/packages-split</filename>: |
| 823 | Contains the output of the <filename>do_package</filename> |
| 824 | task after the output has been split into individual |
| 825 | packages. |
| 826 | Subdirectories exist for each individual package created |
| 827 | by the recipe. |
| 828 | </para></listitem> |
| 829 | <listitem><para> |
| 830 | <filename>${WORKDIR}/recipe-sysroot</filename>: |
| 831 | A directory populated with the target dependencies of the |
| 832 | recipe. |
| 833 | This directory looks like the target filesystem and |
| 834 | contains libraries that the recipe might need to link |
| 835 | against (e.g. the C library). |
| 836 | </para></listitem> |
| 837 | <listitem><para> |
| 838 | <filename>${WORKDIR}/recipe-sysroot-native</filename>: |
| 839 | A directory populated with the native dependencies of the |
| 840 | recipe. |
| 841 | This directory contains the tools the recipe needs to build |
| 842 | (e.g. the compiler, Autoconf, libtool, and so forth). |
| 843 | </para></listitem> |
| 844 | <listitem><para> |
| 845 | <filename>${WORKDIR}/build</filename>: |
| 846 | This subdirectory applies only to recipes that support |
| 847 | builds where the source is separate from the |
| 848 | build artifacts. |
| 849 | The OpenEmbedded build system uses this directory as a |
| 850 | separate build directory (i.e. |
| 851 | <filename>${</filename><link linkend='var-B'><filename>B</filename></link><filename>}</filename>). |
| 852 | </para></listitem> |
| 853 | </itemizedlist> |
| 854 | </para> |
| 855 | </section> |
| 856 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 857 | <section id='structure-build-work-shared'> |
| 858 | <title><filename>build/tmp/work-shared/</filename></title> |
| 859 | |
| 860 | <para> |
| 861 | For efficiency, the OpenEmbedded build system creates and uses |
| 862 | this directory to hold recipes that share a work directory with |
| 863 | other recipes. |
| 864 | In practice, this is only used for <filename>gcc</filename> |
| 865 | and its variants (e.g. <filename>gcc-cross</filename>, |
| 866 | <filename>libgcc</filename>, <filename>gcc-runtime</filename>, |
| 867 | and so forth). |
| 868 | </para> |
| 869 | </section> |
| 870 | </section> |
| 871 | |
| 872 | <section id='structure-meta'> |
| 873 | <title>The Metadata - <filename>meta/</filename></title> |
| 874 | |
| 875 | <para> |
| 876 | As mentioned previously, |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 877 | <link linkend='metadata'>Metadata</link> is the core |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 878 | of the Yocto Project. |
| 879 | Metadata has several important subdivisions: |
| 880 | </para> |
| 881 | |
| 882 | <section id='structure-meta-classes'> |
| 883 | <title><filename>meta/classes/</filename></title> |
| 884 | |
| 885 | <para> |
| 886 | This directory contains the <filename>*.bbclass</filename> files. |
| 887 | Class files are used to abstract common code so it can be reused by multiple |
| 888 | packages. |
| 889 | Every package inherits the <filename>base.bbclass</filename> file. |
| 890 | Examples of other important classes are <filename>autotools.bbclass</filename>, which |
| 891 | in theory allows any Autotool-enabled package to work with the Yocto Project with minimal effort. |
| 892 | Another example is <filename>kernel.bbclass</filename> that contains common code and functions |
| 893 | for working with the Linux kernel. |
| 894 | Functions like image generation or packaging also have their specific class files |
| 895 | such as <filename>image.bbclass</filename>, <filename>rootfs_*.bbclass</filename> and |
| 896 | <filename>package*.bbclass</filename>. |
| 897 | </para> |
| 898 | |
| 899 | <para> |
| 900 | For reference information on classes, see the |
| 901 | "<link linkend='ref-classes'>Classes</link>" chapter. |
| 902 | </para> |
| 903 | </section> |
| 904 | |
| 905 | <section id='structure-meta-conf'> |
| 906 | <title><filename>meta/conf/</filename></title> |
| 907 | |
| 908 | <para> |
| 909 | This directory contains the core set of configuration files that start from |
| 910 | <filename>bitbake.conf</filename> and from which all other configuration |
| 911 | files are included. |
| 912 | See the include statements at the end of the |
| 913 | <filename>bitbake.conf</filename> file and you will note that even |
| 914 | <filename>local.conf</filename> is loaded from there. |
| 915 | While <filename>bitbake.conf</filename> sets up the defaults, you can often override |
| 916 | these by using the (<filename>local.conf</filename>) file, machine file or |
| 917 | the distribution configuration file. |
| 918 | </para> |
| 919 | </section> |
| 920 | |
| 921 | <section id='structure-meta-conf-machine'> |
| 922 | <title><filename>meta/conf/machine/</filename></title> |
| 923 | |
| 924 | <para> |
| 925 | This directory contains all the machine configuration files. |
| 926 | If you set <filename>MACHINE = "qemux86"</filename>, |
| 927 | the OpenEmbedded build system looks for a <filename>qemux86.conf</filename> file in this |
| 928 | directory. |
| 929 | The <filename>include</filename> directory contains various data common to multiple machines. |
| 930 | If you want to add support for a new machine to the Yocto Project, look in this directory. |
| 931 | </para> |
| 932 | </section> |
| 933 | |
| 934 | <section id='structure-meta-conf-distro'> |
| 935 | <title><filename>meta/conf/distro/</filename></title> |
| 936 | |
| 937 | <para> |
| 938 | The contents of this directory controls any distribution-specific |
| 939 | configurations. |
| 940 | For the Yocto Project, the <filename>defaultsetup.conf</filename> is the main file here. |
| 941 | This directory includes the versions and the |
| 942 | <filename>SRCDATE</filename> definitions for applications that are configured here. |
| 943 | An example of an alternative configuration might be <filename>poky-bleeding.conf</filename>. |
| 944 | Although this file mainly inherits its configuration from Poky. |
| 945 | </para> |
| 946 | </section> |
| 947 | |
| 948 | <section id='structure-meta-conf-machine-sdk'> |
| 949 | <title><filename>meta/conf/machine-sdk/</filename></title> |
| 950 | |
| 951 | <para> |
| 952 | The OpenEmbedded build system searches this directory for |
| 953 | configuration files that correspond to the value of |
| 954 | <link linkend='var-SDKMACHINE'><filename>SDKMACHINE</filename></link>. |
| 955 | By default, 32-bit and 64-bit x86 files ship with the Yocto |
| 956 | Project that support some SDK hosts. |
| 957 | However, it is possible to extend that support to other SDK hosts |
| 958 | by adding additional configuration files in this subdirectory |
| 959 | within another layer. |
| 960 | </para> |
| 961 | </section> |
| 962 | |
| 963 | <section id='structure-meta-files'> |
| 964 | <title><filename>meta/files/</filename></title> |
| 965 | |
| 966 | <para> |
| 967 | This directory contains common license files and several text files |
| 968 | used by the build system. |
| 969 | The text files contain minimal device information and |
| 970 | lists of files and directories with known permissions. |
| 971 | </para> |
| 972 | </section> |
| 973 | |
| 974 | <section id='structure-meta-lib'> |
| 975 | <title><filename>meta/lib/</filename></title> |
| 976 | |
| 977 | <para> |
| 978 | This directory contains OpenEmbedded Python library code |
| 979 | used during the build process. |
| 980 | </para> |
| 981 | </section> |
| 982 | |
| 983 | <section id='structure-meta-recipes-bsp'> |
| 984 | <title><filename>meta/recipes-bsp/</filename></title> |
| 985 | |
| 986 | <para> |
| 987 | This directory contains anything linking to specific hardware or hardware |
| 988 | configuration information such as "u-boot" and "grub". |
| 989 | </para> |
| 990 | </section> |
| 991 | |
| 992 | <section id='structure-meta-recipes-connectivity'> |
| 993 | <title><filename>meta/recipes-connectivity/</filename></title> |
| 994 | |
| 995 | <para> |
| 996 | This directory contains libraries and applications related to communication with other devices. |
| 997 | </para> |
| 998 | </section> |
| 999 | |
| 1000 | <section id='structure-meta-recipes-core'> |
| 1001 | <title><filename>meta/recipes-core/</filename></title> |
| 1002 | |
| 1003 | <para> |
| 1004 | This directory contains what is needed to build a basic working Linux image |
| 1005 | including commonly used dependencies. |
| 1006 | </para> |
| 1007 | </section> |
| 1008 | |
| 1009 | <section id='structure-meta-recipes-devtools'> |
| 1010 | <title><filename>meta/recipes-devtools/</filename></title> |
| 1011 | |
| 1012 | <para> |
| 1013 | This directory contains tools that are primarily used by the build system. |
| 1014 | The tools, however, can also be used on targets. |
| 1015 | </para> |
| 1016 | </section> |
| 1017 | |
| 1018 | <section id='structure-meta-recipes-extended'> |
| 1019 | <title><filename>meta/recipes-extended/</filename></title> |
| 1020 | |
| 1021 | <para> |
| 1022 | This directory contains non-essential applications that add features compared to the |
| 1023 | alternatives in core. |
| 1024 | You might need this directory for full tool functionality or for Linux Standard Base (LSB) |
| 1025 | compliance. |
| 1026 | </para> |
| 1027 | </section> |
| 1028 | |
| 1029 | <section id='structure-meta-recipes-gnome'> |
| 1030 | <title><filename>meta/recipes-gnome/</filename></title> |
| 1031 | |
| 1032 | <para> |
| 1033 | This directory contains all things related to the GTK+ application framework. |
| 1034 | </para> |
| 1035 | </section> |
| 1036 | |
| 1037 | <section id='structure-meta-recipes-graphics'> |
| 1038 | <title><filename>meta/recipes-graphics/</filename></title> |
| 1039 | |
| 1040 | <para> |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 1041 | This directory contains X and other graphically related system libraries. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1042 | </para> |
| 1043 | </section> |
| 1044 | |
| 1045 | <section id='structure-meta-recipes-kernel'> |
| 1046 | <title><filename>meta/recipes-kernel/</filename></title> |
| 1047 | |
| 1048 | <para> |
| 1049 | This directory contains the kernel and generic applications and libraries that |
| 1050 | have strong kernel dependencies. |
| 1051 | </para> |
| 1052 | </section> |
| 1053 | |
| 1054 | <section id='structure-meta-recipes-lsb4'> |
| 1055 | <title><filename>meta/recipes-lsb4/</filename></title> |
| 1056 | |
| 1057 | <para> |
| 1058 | This directory contains recipes specifically added to support |
| 1059 | the Linux Standard Base (LSB) version 4.x. |
| 1060 | </para> |
| 1061 | </section> |
| 1062 | |
| 1063 | <section id='structure-meta-recipes-multimedia'> |
| 1064 | <title><filename>meta/recipes-multimedia/</filename></title> |
| 1065 | |
| 1066 | <para> |
| 1067 | This directory contains codecs and support utilities for audio, images and video. |
| 1068 | </para> |
| 1069 | </section> |
| 1070 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1071 | <section id='structure-meta-recipes-rt'> |
| 1072 | <title><filename>meta/recipes-rt/</filename></title> |
| 1073 | |
| 1074 | <para> |
| 1075 | This directory contains package and image recipes for using and testing |
| 1076 | the <filename>PREEMPT_RT</filename> kernel. |
| 1077 | </para> |
| 1078 | </section> |
| 1079 | |
| 1080 | <section id='structure-meta-recipes-sato'> |
| 1081 | <title><filename>meta/recipes-sato/</filename></title> |
| 1082 | |
| 1083 | <para> |
| 1084 | This directory contains the Sato demo/reference UI/UX and its associated applications |
| 1085 | and configuration data. |
| 1086 | </para> |
| 1087 | </section> |
| 1088 | |
| 1089 | <section id='structure-meta-recipes-support'> |
| 1090 | <title><filename>meta/recipes-support/</filename></title> |
| 1091 | |
| 1092 | <para> |
| 1093 | This directory contains recipes used by other recipes, but that are |
| 1094 | not directly included in images (i.e. dependencies of other |
| 1095 | recipes). |
| 1096 | </para> |
| 1097 | </section> |
| 1098 | |
| 1099 | <section id='structure-meta-site'> |
| 1100 | <title><filename>meta/site/</filename></title> |
| 1101 | |
| 1102 | <para> |
| 1103 | This directory contains a list of cached results for various architectures. |
| 1104 | Because certain "autoconf" test results cannot be determined when cross-compiling due to |
| 1105 | the tests not able to run on a live system, the information in this directory is |
| 1106 | passed to "autoconf" for the various architectures. |
| 1107 | </para> |
| 1108 | </section> |
| 1109 | |
| 1110 | <section id='structure-meta-recipes-txt'> |
| 1111 | <title><filename>meta/recipes.txt</filename></title> |
| 1112 | |
| 1113 | <para> |
| 1114 | This file is a description of the contents of <filename>recipes-*</filename>. |
| 1115 | </para> |
| 1116 | </section> |
| 1117 | </section> |
| 1118 | |
| 1119 | </chapter> |
| 1120 | <!-- |
| 1121 | vim: expandtab tw=80 ts=4 |
| 1122 | --> |