Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 1 | <!DOCTYPE article 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 | <article id='brief-yocto-project-qs-intro'> |
| 6 | <articleinfo> |
| 7 | <title>Yocto Project Quick Build</title> |
| 8 | |
| 9 | <copyright> |
| 10 | <year>©RIGHT_YEAR;</year> |
| 11 | <holder>Linux Foundation</holder> |
| 12 | </copyright> |
| 13 | |
| 14 | <legalnotice> |
| 15 | <para> |
| 16 | Permission is granted to copy, distribute and/or modify this document under |
| 17 | the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-sa/2.0/uk/">Creative Commons Attribution-Share Alike 2.0 UK: England & Wales</ulink> as published by Creative Commons. |
| 18 | </para> |
| 19 | </legalnotice> |
| 20 | |
| 21 | |
| 22 | <abstract> |
| 23 | <imagedata fileref="figures/yocto-project-transp.png" |
| 24 | width="6in" depth="1in" |
| 25 | align="right" scale="25" /> |
| 26 | </abstract> |
| 27 | </articleinfo> |
| 28 | |
| 29 | <section id='brief-welcome'> |
| 30 | <title>Welcome!</title> |
| 31 | |
| 32 | <para> |
| 33 | Welcome! |
| 34 | This short document steps you through the process for a typical |
| 35 | image build using the Yocto Project. |
| 36 | The document also introduces how to configure a build for specific |
| 37 | hardware. |
| 38 | You will use Yocto Project to build a reference embedded OS |
| 39 | called Poky. |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 40 | <note><title>Notes</title> |
| 41 | <itemizedlist> |
| 42 | <listitem><para> |
| 43 | The examples in this paper assume you are using a |
| 44 | native Linux system running a recent Ubuntu Linux |
| 45 | distribution. |
| 46 | If the machine you want to use Yocto Project on to |
| 47 | build an image |
| 48 | (<ulink url='&YOCTO_DOCS_REF_URL;#hardware-build-system-term'>build host</ulink>) |
| 49 | is not a native Linux system, you can |
| 50 | still perform these steps by using CROss PlatformS |
| 51 | (CROPS) and setting up a Poky container. |
| 52 | See the |
| 53 | <ulink url='&YOCTO_DOCS_DEV_URL;#setting-up-to-use-crops'>Setting Up to Use CROss PlatformS (CROPS)</ulink>" |
| 54 | section in the Yocto Project Development Tasks Manual for more |
| 55 | information. |
| 56 | </para></listitem> |
| 57 | <listitem><para> |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 58 | You may use Windows Subsystem For Linux v2 to set up a build |
| 59 | host using Windows 10. |
| 60 | <note> |
| 61 | The Yocto Project is not compatible with WSLv1, it is |
| 62 | compatible but not officially supported nor validated |
| 63 | with WSLv2, if you still decide to use WSL please upgrade |
| 64 | to WSLv2. |
| 65 | </note> |
| 66 | See the |
| 67 | <ulink url='&YOCTO_DOCS_DEV_URL;#setting-up-to-use-wsl'>Setting Up to Use Windows Subsystem For Linux</ulink>" |
| 68 | section in the Yocto Project Development Tasks Manual for more |
| 69 | information. |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 70 | </para></listitem> |
| 71 | </itemizedlist> |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 72 | </note> |
| 73 | </para> |
| 74 | |
| 75 | <para> |
| 76 | If you want more conceptual or background information on the |
| 77 | Yocto Project, see the |
| 78 | <ulink url='&YOCTO_DOCS_OM_URL;'>Yocto Project Overview and Concepts Manual</ulink>. |
| 79 | </para> |
| 80 | </section> |
| 81 | |
| 82 | <section id='brief-compatible-distro'> |
| 83 | <title>Compatible Linux Distribution</title> |
| 84 | |
| 85 | <para> |
| 86 | Make sure your |
| 87 | <ulink url='&YOCTO_DOCS_REF_URL;#hardware-build-system-term'>build host</ulink> |
| 88 | meets the following requirements: |
| 89 | <itemizedlist> |
| 90 | <listitem><para> |
| 91 | 50 Gbytes of free disk space |
| 92 | </para></listitem> |
| 93 | <listitem><para> |
| 94 | Runs a supported Linux distribution (i.e. recent releases of |
| 95 | Fedora, openSUSE, CentOS, Debian, or Ubuntu). For a list of |
| 96 | Linux distributions that support the Yocto Project, see the |
| 97 | "<ulink url='&YOCTO_DOCS_REF_URL;#detailed-supported-distros'>Supported Linux Distributions</ulink>" |
| 98 | section in the Yocto Project Reference Manual. |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 99 | For detailed information on preparing your build host, see |
| 100 | the |
| 101 | "<ulink url='&YOCTO_DOCS_DEV_URL;#dev-preparing-the-build-host'>Preparing the Build Host</ulink>" |
| 102 | section in the Yocto Project Development Tasks Manual. |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 103 | </para></listitem> |
| 104 | <listitem><para> |
| 105 | <itemizedlist> |
| 106 | <listitem><para> |
| 107 | Git 1.8.3.1 or greater |
| 108 | </para></listitem> |
| 109 | <listitem><para> |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 110 | tar 1.28 or greater |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 111 | </para></listitem> |
| 112 | <listitem><para> |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 113 | Python 3.5.0 or greater. |
| 114 | </para></listitem> |
| 115 | <listitem><para> |
| 116 | gcc 5.0 or greater. |
| 117 | </para></listitem> |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 118 | </itemizedlist> |
| 119 | If your build host does not meet any of these three listed |
| 120 | version requirements, you can take steps to prepare the |
| 121 | system so that you can still use the Yocto Project. |
| 122 | See the |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 123 | "<ulink url='&YOCTO_DOCS_REF_URL;#required-git-tar-python-and-gcc-versions'>Required Git, tar, Python and gcc Versions</ulink>" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 124 | section in the Yocto Project Reference Manual for information. |
| 125 | </para></listitem> |
| 126 | </itemizedlist> |
| 127 | </para> |
| 128 | </section> |
| 129 | |
| 130 | <section id='brief-build-system-packages'> |
| 131 | <title>Build Host Packages</title> |
| 132 | |
| 133 | <para> |
| 134 | You must install essential host packages on your |
| 135 | build host. |
| 136 | The following command installs the host packages based on an |
| 137 | Ubuntu distribution: |
| 138 | <note> |
| 139 | For host package requirements on all supported Linux |
| 140 | distributions, see the |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 141 | "<ulink url='&YOCTO_DOCS_REF_URL;#required-packages-for-the-build-host'>Required Packages for the Build Host</ulink>" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 142 | section in the Yocto Project Reference Manual. |
| 143 | </note> |
| 144 | <literallayout class='monospaced'> |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 145 | $ sudo apt-get install &UBUNTU_HOST_PACKAGES_ESSENTIAL; |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 146 | </literallayout> |
| 147 | </para> |
| 148 | </section> |
| 149 | |
| 150 | <section id='brief-use-git-to-clone-poky'> |
| 151 | <title>Use Git to Clone Poky</title> |
| 152 | |
| 153 | <para> |
| 154 | Once you complete the setup instructions for your machine, |
| 155 | you need to get a copy of the Poky repository on your build |
| 156 | host. |
| 157 | Use the following commands to clone the Poky |
Scott Rifenbark | fa4cfe3 | 2019-01-11 11:55:06 -0800 | [diff] [blame] | 158 | repository. |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 159 | <literallayout class='monospaced'> |
| 160 | $ git clone git://git.yoctoproject.org/poky |
| 161 | Cloning into 'poky'... |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 162 | remote: Counting objects: 432160, done. |
| 163 | remote: Compressing objects: 100% (102056/102056), done. |
| 164 | remote: Total 432160 (delta 323116), reused 432037 (delta 323000) |
| 165 | Receiving objects: 100% (432160/432160), 153.81 MiB | 8.54 MiB/s, done. |
| 166 | Resolving deltas: 100% (323116/323116), done. |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 167 | Checking connectivity... done. |
Scott Rifenbark | fa4cfe3 | 2019-01-11 11:55:06 -0800 | [diff] [blame] | 168 | </literallayout> |
| 169 | Move to the <filename>poky</filename> directory and take a look |
| 170 | at the tags: |
| 171 | <literallayout class='monospaced'> |
| 172 | $ cd poky |
| 173 | $ git fetch --tags |
| 174 | $ git tag |
| 175 | 1.1_M1.final |
| 176 | 1.1_M1.rc1 |
| 177 | 1.1_M1.rc2 |
| 178 | 1.1_M2.final |
| 179 | 1.1_M2.rc1 |
| 180 | . |
| 181 | . |
| 182 | . |
| 183 | yocto-2.5 |
| 184 | yocto-2.5.1 |
| 185 | yocto-2.5.2 |
| 186 | yocto-2.6 |
Scott Rifenbark | b0466fb | 2019-01-22 10:21:44 -0800 | [diff] [blame] | 187 | yocto-2.6.1 |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 188 | yocto-2.6.2 |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 189 | yocto-2.7 |
Scott Rifenbark | fa4cfe3 | 2019-01-11 11:55:06 -0800 | [diff] [blame] | 190 | yocto_1.5_M5.rc8 |
| 191 | </literallayout> |
| 192 | For this example, check out the branch based on the |
| 193 | &DISTRO_REL_TAG; release: |
| 194 | <literallayout class='monospaced'> |
| 195 | $ git checkout tags/&DISTRO_REL_TAG; -b my-&DISTRO_REL_TAG; |
| 196 | Switched to a new branch 'my-&DISTRO_REL_TAG;' |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 197 | </literallayout> |
| 198 | The previous Git checkout command creates a local branch |
| 199 | named my-&DISTRO_REL_TAG;. The files available to you in that |
| 200 | branch exactly match the repository's files in the |
| 201 | "&DISTRO_NAME_NO_CAP;" development branch at the time of the |
Scott Rifenbark | fa4cfe3 | 2019-01-11 11:55:06 -0800 | [diff] [blame] | 202 | Yocto Project &DISTRO_REL_TAG; release. |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 203 | </para> |
| 204 | |
| 205 | <para> |
| 206 | For more options and information about accessing Yocto |
| 207 | Project related repositories, see the |
| 208 | "<ulink url='&YOCTO_DOCS_DEV_URL;#locating-yocto-project-source-files'>Locating Yocto Project Source Files</ulink>" |
| 209 | section in the Yocto Project Development Tasks Manual. |
| 210 | </para> |
| 211 | </section> |
| 212 | |
| 213 | <section id='brief-building-your-image'> |
| 214 | <title>Building Your Image</title> |
| 215 | |
| 216 | <para> |
| 217 | Use the following steps to build your image. |
| 218 | The build process creates an entire Linux distribution, including |
| 219 | the toolchain, from source. |
| 220 | <note> |
| 221 | <itemizedlist> |
| 222 | <listitem><para> |
| 223 | If you are working behind a firewall and your build |
| 224 | host is not set up for proxies, you could encounter |
| 225 | problems with the build process when fetching source |
| 226 | code (e.g. fetcher failures or Git failures). |
| 227 | </para></listitem> |
| 228 | <listitem><para> |
| 229 | If you do not know your proxy settings, consult your |
| 230 | local network infrastructure resources and get that |
| 231 | information. |
| 232 | A good starting point could also be to check your |
| 233 | web browser settings. |
| 234 | Finally, you can find more information on the |
| 235 | "<ulink url='https://wiki.yoctoproject.org/wiki/Working_Behind_a_Network_Proxy'>Working Behind a Network Proxy</ulink>" |
| 236 | page of the Yocto Project Wiki. |
| 237 | </para></listitem> |
| 238 | </itemizedlist> |
| 239 | </note> |
| 240 | </para> |
| 241 | |
| 242 | <para> |
| 243 | <orderedlist> |
| 244 | <listitem><para> |
| 245 | <emphasis>Initialize the Build Environment:</emphasis> |
Scott Rifenbark | fa4cfe3 | 2019-01-11 11:55:06 -0800 | [diff] [blame] | 246 | From within the <filename>poky</filename> directory, run the |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 247 | <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink> |
| 248 | environment setup script to define Yocto Project's |
| 249 | build environment on your build host. |
| 250 | <literallayout class='monospaced'> |
Scott Rifenbark | fa4cfe3 | 2019-01-11 11:55:06 -0800 | [diff] [blame] | 251 | $ cd ~/poky |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 252 | $ source &OE_INIT_FILE; |
Scott Rifenbark | fa4cfe3 | 2019-01-11 11:55:06 -0800 | [diff] [blame] | 253 | You had no conf/local.conf file. This configuration file has therefore been |
| 254 | created for you with some default values. You may wish to edit it to, for |
| 255 | example, select a different MACHINE (target hardware). See conf/local.conf |
| 256 | for more information as common configuration options are commented. |
| 257 | |
| 258 | You had no conf/bblayers.conf file. This configuration file has therefore been |
| 259 | created for you with some default values. To add additional metadata layers |
| 260 | into your configuration please add entries to conf/bblayers.conf. |
| 261 | |
| 262 | The Yocto Project has extensive documentation about OE including a reference |
| 263 | manual which can be found at: |
| 264 | http://yoctoproject.org/documentation |
| 265 | |
| 266 | For more information about OpenEmbedded see their website: |
| 267 | http://www.openembedded.org/ |
| 268 | |
| 269 | |
| 270 | ### Shell environment set up for builds. ### |
| 271 | |
| 272 | You can now run 'bitbake <target>' |
| 273 | |
| 274 | Common targets are: |
| 275 | core-image-minimal |
| 276 | core-image-sato |
| 277 | meta-toolchain |
| 278 | meta-ide-support |
| 279 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 280 | You can also run generated qemu images with a command like 'runqemu qemux86-64' |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 281 | </literallayout> |
| 282 | Among other things, the script creates the |
| 283 | <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>, |
| 284 | which is <filename>build</filename> in this case |
| 285 | and is located in the |
| 286 | <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>. |
| 287 | After the script runs, your current working directory |
| 288 | is set to the Build Directory. |
| 289 | Later, when the build completes, the Build Directory |
| 290 | contains all the files created during the build. |
| 291 | </para></listitem> |
| 292 | <listitem><para id='conf-file-step'> |
| 293 | <emphasis>Examine Your Local Configuration File:</emphasis> |
| 294 | When you set up the build environment, a local |
| 295 | configuration file named |
| 296 | <filename>local.conf</filename> becomes available in |
| 297 | a <filename>conf</filename> subdirectory of the |
| 298 | Build Directory. |
| 299 | For this example, the defaults are set to build |
| 300 | for a <filename>qemux86</filename> target, which is |
| 301 | suitable for emulation. |
| 302 | The package manager used is set to the RPM package |
| 303 | manager. |
| 304 | <tip> |
| 305 | You can significantly speed up your build and guard |
| 306 | against fetcher failures by using mirrors. |
| 307 | To use mirrors, add these lines to your |
| 308 | <filename>local.conf</filename> file in the Build |
| 309 | directory: |
| 310 | <literallayout class='monospaced'> |
| 311 | SSTATE_MIRRORS = "\ |
| 312 | file://.* http://sstate.yoctoproject.org/dev/PATH;downloadfilename=PATH \n \ |
| 313 | file://.* http://sstate.yoctoproject.org/&YOCTO_DOC_VERSION_MINUS_ONE;/PATH;downloadfilename=PATH \n \ |
| 314 | file://.* http://sstate.yoctoproject.org/&YOCTO_DOC_VERSION;/PATH;downloadfilename=PATH \n \ |
| 315 | " |
| 316 | </literallayout> |
| 317 | The previous examples showed how to add sstate |
| 318 | paths for Yocto Project &YOCTO_DOC_VERSION_MINUS_ONE;, |
| 319 | &YOCTO_DOC_VERSION;, and a development area. |
| 320 | For a complete index of sstate locations, see |
| 321 | <ulink url='http://sstate.yoctoproject.org/'></ulink>. |
| 322 | </tip> |
| 323 | </para></listitem> |
| 324 | <listitem><para> |
| 325 | <emphasis>Start the Build:</emphasis> |
| 326 | Continue with the following command to build an OS image |
| 327 | for the target, which is |
| 328 | <filename>core-image-sato</filename> in this example: |
| 329 | <literallayout class='monospaced'> |
| 330 | $ bitbake core-image-sato |
| 331 | </literallayout> |
| 332 | For information on using the |
| 333 | <filename>bitbake</filename> command, see the |
| 334 | "<ulink url='&YOCTO_DOCS_OM_URL;#usingpoky-components-bitbake'>BitBake</ulink>" |
| 335 | section in the Yocto Project Overview and Concepts Manual, |
| 336 | or see the |
| 337 | "<ulink url='&YOCTO_DOCS_BB_URL;#bitbake-user-manual-command'>BitBake Command</ulink>" |
| 338 | section in the BitBake User Manual. |
| 339 | </para></listitem> |
| 340 | <listitem><para> |
| 341 | <emphasis>Simulate Your Image Using QEMU:</emphasis> |
| 342 | Once this particular image is built, you can start |
| 343 | QEMU, which is a Quick EMUlator that ships with |
| 344 | the Yocto Project: |
| 345 | <literallayout class='monospaced'> |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 346 | $ runqemu qemux86-64 |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 347 | </literallayout> |
| 348 | If you want to learn more about running QEMU, see the |
| 349 | "<ulink url="&YOCTO_DOCS_DEV_URL;#dev-manual-qemu">Using the Quick EMUlator (QEMU)</ulink>" |
| 350 | chapter in the Yocto Project Development Tasks Manual. |
| 351 | </para></listitem> |
| 352 | <listitem><para> |
| 353 | <emphasis>Exit QEMU:</emphasis> |
| 354 | Exit QEMU by either clicking on the shutdown icon or by |
| 355 | typing <filename>Ctrl-C</filename> in the QEMU |
| 356 | transcript window from which you evoked QEMU. |
| 357 | </para></listitem> |
| 358 | </orderedlist> |
| 359 | </para> |
| 360 | </section> |
| 361 | |
| 362 | <section id='customizing-your-build-for-specific-hardware'> |
| 363 | <title>Customizing Your Build for Specific Hardware</title> |
| 364 | |
| 365 | <para> |
| 366 | So far, all you have done is quickly built an image suitable |
| 367 | for emulation only. |
| 368 | This section shows you how to customize your build for specific |
| 369 | hardware by adding a hardware layer into the Yocto Project |
| 370 | development environment. |
| 371 | </para> |
| 372 | |
| 373 | <para> |
| 374 | In general, layers are repositories that contain related sets of |
| 375 | instructions and configurations that tell the Yocto Project what |
| 376 | to do. |
| 377 | Isolating related metadata into functionally specific layers |
| 378 | facilitates modular development and makes it easier to reuse the |
| 379 | layer metadata. |
| 380 | <note> |
| 381 | By convention, layer names start with the string "meta-". |
| 382 | </note> |
| 383 | </para> |
| 384 | |
| 385 | <para> |
| 386 | Follow these steps to add a hardware layer: |
| 387 | <orderedlist> |
| 388 | <listitem><para> |
| 389 | <emphasis>Find a Layer:</emphasis> |
| 390 | Lots of hardware layers exist. |
| 391 | The Yocto Project |
| 392 | <ulink url='&YOCTO_GIT_URL;'>Source Repositories</ulink> |
| 393 | has many hardware layers. |
| 394 | This example adds the |
| 395 | <ulink url='https://github.com/kraj/meta-altera'>meta-altera</ulink> |
| 396 | hardware layer. |
| 397 | </para></listitem> |
| 398 | <listitem><para> |
| 399 | <emphasis>Clone the Layer</emphasis> |
| 400 | Use Git to make a local copy of the layer on your machine. |
| 401 | You can put the copy in the top level of the copy of the |
| 402 | Poky repository created earlier: |
| 403 | <literallayout class='monospaced'> |
| 404 | $ cd ~/poky |
| 405 | $ git clone https://github.com/kraj/meta-altera.git |
| 406 | Cloning into 'meta-altera'... |
| 407 | remote: Counting objects: 25170, done. |
| 408 | remote: Compressing objects: 100% (350/350), done. |
| 409 | remote: Total 25170 (delta 645), reused 719 (delta 538), pack-reused 24219 |
| 410 | Receiving objects: 100% (25170/25170), 41.02 MiB | 1.64 MiB/s, done. |
| 411 | Resolving deltas: 100% (13385/13385), done. |
| 412 | Checking connectivity... done. |
| 413 | </literallayout> |
| 414 | The hardware layer now exists with other layers inside |
| 415 | the Poky reference repository on your build host as |
| 416 | <filename>meta-altera</filename> and contains all the |
| 417 | metadata needed to support hardware from Altera, which |
| 418 | is owned by Intel. |
| 419 | </para></listitem> |
| 420 | <listitem><para> |
| 421 | <emphasis>Change the Configuration to Build for a Specific Machine:</emphasis> |
| 422 | The |
| 423 | <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink> |
| 424 | variable in the <filename>local.conf</filename> file |
| 425 | specifies the machine for the build. |
| 426 | For this example, set the <filename>MACHINE</filename> |
| 427 | variable to "cyclone5". |
| 428 | These configurations are used: |
| 429 | <ulink url='https://github.com/kraj/meta-altera/blob/master/conf/machine/cyclone5.conf'></ulink>. |
| 430 | <note> |
| 431 | See the |
| 432 | "<link linkend='conf-file-step'>Examine Your Local Configuration File</link>" |
| 433 | step earlier for more information on configuring the |
| 434 | build. |
| 435 | </note> |
| 436 | </para></listitem> |
| 437 | <listitem><para> |
| 438 | <emphasis>Add Your Layer to the Layer Configuration File:</emphasis> |
| 439 | Before you can use a layer during a build, you must add it |
| 440 | to your <filename>bblayers.conf</filename> file, which |
| 441 | is found in the |
| 442 | <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory's</ulink> |
| 443 | <filename>conf</filename> directory.</para> |
| 444 | |
| 445 | <para>Use the <filename>bitbake-layers add-layer</filename> |
| 446 | command to add the layer to the configuration file: |
| 447 | <literallayout class='monospaced'> |
| 448 | $ cd ~/poky/build |
| 449 | $ bitbake-layers add-layer ../meta-altera |
| 450 | NOTE: Starting bitbake server... |
| 451 | Parsing recipes: 100% |##################################################################| Time: 0:00:32 |
| 452 | Parsing of 918 .bb files complete (0 cached, 918 parsed). 1401 targets, 123 skipped, 0 masked, 0 errors. |
| 453 | </literallayout> |
| 454 | You can find more information on adding layers in the |
| 455 | "<ulink url='&YOCTO_DOCS_DEV_URL;#adding-a-layer-using-the-bitbake-layers-script'>Adding a Layer Using the <filename>bitbake-layers</filename> Script</ulink>" |
| 456 | section. |
| 457 | </para></listitem> |
| 458 | </orderedlist> |
| 459 | Completing these steps has added the |
| 460 | <filename>meta-altera</filename> layer to your Yocto Project |
| 461 | development environment and configured it to build for the |
| 462 | "cyclone5" machine. |
| 463 | <note> |
| 464 | The previous steps are for demonstration purposes only. |
| 465 | If you were to attempt to build an image for the |
| 466 | "cyclone5" build, you should read the Altera |
| 467 | <filename>README</filename>. |
| 468 | </note> |
| 469 | </para> |
| 470 | </section> |
| 471 | |
| 472 | <section id='creating-your-own-general-layer'> |
| 473 | <title>Creating Your Own General Layer</title> |
| 474 | |
| 475 | <para> |
| 476 | Maybe you have an application or specific set of behaviors you |
| 477 | need to isolate. |
| 478 | You can create your own general layer using the |
| 479 | <filename>bitbake-layers create-layer</filename> command. |
| 480 | The tool automates layer creation by setting up a |
| 481 | subdirectory with a <filename>layer.conf</filename> |
| 482 | configuration file, a <filename>recipes-example</filename> |
| 483 | subdirectory that contains an <filename>example.bb</filename> |
| 484 | recipe, a licensing file, and a <filename>README</filename>. |
| 485 | </para> |
| 486 | |
| 487 | <para> |
| 488 | The following commands run the tool to create a layer named |
| 489 | <filename>meta-mylayer</filename> in the |
| 490 | <filename>poky</filename> directory: |
| 491 | <literallayout class='monospaced'> |
| 492 | $ cd ~/poky |
| 493 | $ bitbake-layers create-layer meta-mylayer |
| 494 | NOTE: Starting bitbake server... |
| 495 | Add your new layer with 'bitbake-layers add-layer meta-mylayer' |
| 496 | </literallayout> |
| 497 | For more information on layers and how to create them, see the |
| 498 | "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-a-general-layer-using-the-bitbake-layers-script'>Creating a General Layer Using the <filename>bitbake-layers</filename> Script</ulink>" |
| 499 | section in the Yocto Project Development Tasks Manual. |
| 500 | </para> |
| 501 | </section> |
| 502 | |
| 503 | <section id='brief-where-to-go-next'> |
| 504 | <title>Where To Go Next</title> |
| 505 | |
| 506 | <para> |
| 507 | Now that you have experienced using the Yocto Project, you might |
| 508 | be asking yourself "What now?" |
| 509 | The Yocto Project has many sources of information including |
| 510 | the website, wiki pages, and user manuals: |
| 511 | <itemizedlist> |
| 512 | <listitem><para> |
| 513 | <emphasis>Website:</emphasis> |
| 514 | The |
| 515 | <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink> |
| 516 | provides background information, the latest builds, |
| 517 | breaking news, full development documentation, and |
| 518 | access to a rich Yocto Project Development Community |
| 519 | into which you can tap. |
| 520 | </para></listitem> |
| 521 | <listitem><para> |
| 522 | <emphasis>Developer Screencast:</emphasis> |
| 523 | The |
| 524 | <ulink url='http://vimeo.com/36450321'>Getting Started with the Yocto Project - New Developer Screencast Tutorial</ulink> |
| 525 | provides a 30-minute video created for users unfamiliar |
| 526 | with the Yocto Project but familiar with Linux build |
| 527 | hosts. |
| 528 | While this screencast is somewhat dated, the |
| 529 | introductory and fundamental concepts are useful for |
| 530 | the beginner. |
| 531 | </para></listitem> |
| 532 | <listitem><para> |
| 533 | <emphasis>Yocto Project Overview and Concepts Manual:</emphasis> |
| 534 | The |
| 535 | <ulink url='&YOCTO_DOCS_OM_URL;'>Yocto Project Overview and Concepts Manual</ulink> |
| 536 | is a great place to start to learn about the |
| 537 | Yocto Project. |
| 538 | This manual introduces you to the Yocto Project and its |
| 539 | development environment. |
| 540 | The manual also provides conceptual information for |
| 541 | various aspects of the Yocto Project. |
| 542 | </para></listitem> |
| 543 | <listitem><para> |
| 544 | <emphasis>Yocto Project Wiki:</emphasis> |
| 545 | The |
| 546 | <ulink url='&YOCTO_WIKI_URL;'>Yocto Project Wiki</ulink> |
| 547 | provides additional information on where to go next |
| 548 | when ramping up with the Yocto Project, release |
| 549 | information, project planning, and QA information. |
| 550 | </para></listitem> |
| 551 | <listitem><para> |
| 552 | <emphasis>Yocto Project Mailing Lists:</emphasis> |
| 553 | Related mailing lists provide a forum for discussion, |
| 554 | patch submission and announcements. |
| 555 | Several mailing lists exist and are grouped according |
| 556 | to areas of concern. |
| 557 | See the |
| 558 | "<ulink url='&YOCTO_DOCS_REF_URL;#resources-mailinglist'>Mailing lists</ulink>" |
| 559 | section in the Yocto Project Reference Manual for a |
| 560 | complete list of Yocto Project mailing lists. |
| 561 | </para></listitem> |
| 562 | <listitem><para> |
| 563 | <emphasis>Comprehensive List of Links and Other Documentation:</emphasis> |
| 564 | The |
| 565 | "<ulink url='&YOCTO_DOCS_REF_URL;#resources-links-and-related-documentation'>Links and Related Documentation</ulink>" |
| 566 | section in the Yocto Project Reference Manual provides a |
| 567 | comprehensive list of all related links and other |
| 568 | user documentation. |
| 569 | </para></listitem> |
| 570 | </itemizedlist> |
| 571 | </para> |
| 572 | </section> |
| 573 | </article> |
| 574 | <!-- |
| 575 | vim: expandtab tw=80 ts=4 |
| 576 | --> |