Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [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='yocto-project-qs-intro'> |
| 6 | <articleinfo> |
| 7 | <title>Yocto Project Quick Start</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 | <note> |
| 20 | For the latest version of this manual associated with this |
| 21 | Yocto Project release, see the |
| 22 | <ulink url='&YOCTO_DOCS_QS_URL;'>Yocto Project Quick Start</ulink> |
| 23 | from the Yocto Project website. |
| 24 | </note> |
| 25 | </legalnotice> |
| 26 | |
| 27 | |
| 28 | <abstract> |
| 29 | <imagedata fileref="figures/yocto-project-transp.png" |
| 30 | width="6in" depth="1in" |
| 31 | align="right" scale="25" /> |
| 32 | </abstract> |
| 33 | </articleinfo> |
| 34 | |
| 35 | <section id='welcome'> |
| 36 | <title>Welcome!</title> |
| 37 | <para> |
| 38 | Welcome to the Yocto Project! |
| 39 | The Yocto Project is an open-source collaboration project whose |
| 40 | focus is developers of embedded Linux systems. |
| 41 | Among other things, the Yocto Project uses a build host based |
| 42 | on the OpenEmbedded (OE) project, which uses the |
| 43 | <ulink url='&YOCTO_DOCS_DEV_URL;#bitbake-term'>BitBake</ulink> |
| 44 | tool, to construct complete Linux images. |
| 45 | The BitBake and OE components are combined together to form |
| 46 | a reference build host, historically known as |
| 47 | <ulink url='&YOCTO_DOCS_DEV_URL;#poky'>Poky</ulink>. |
| 48 | </para> |
| 49 | |
| 50 | <para> |
| 51 | If you do not have a system that runs Linux and you want to give |
| 52 | the Yocto Project a test run, you might consider using the Yocto |
| 53 | Project Build Appliance. |
| 54 | The Build Appliance allows you to build and boot a custom embedded |
| 55 | Linux image with the Yocto Project using a non-Linux development |
| 56 | system. |
| 57 | See the |
| 58 | <ulink url='https://www.yoctoproject.org/tools-resources/projects/build-appliance'>Yocto Project Build Appliance</ulink> |
| 59 | for more information. |
| 60 | </para> |
| 61 | |
| 62 | <para> |
| 63 | This quick start is written so that you can quickly get a host |
| 64 | build host set up to use the Yocto Project and then build some |
| 65 | Linux images. |
| 66 | Rather than go into great detail about the Yocto Project and its |
| 67 | many capabilities, this quick start provides the minimal |
| 68 | information you need to try out the Yocto Project using a |
| 69 | supported Linux build host. |
| 70 | Reading and using the quick start should result in you having a |
| 71 | basic understanding of what the Yocto Project is and how to use |
| 72 | some of its core components. |
| 73 | You will also have worked through steps to produce two images: |
| 74 | one suitable for emulation and one that can be used on actual |
| 75 | hardware. |
| 76 | The examples highlight the ease with which you can use the |
| 77 | Yocto Project to create images for multiple types of hardware. |
| 78 | </para> |
| 79 | |
| 80 | <para> |
| 81 | For more detailed information on the Yocto Project, you can |
| 82 | reference these resources: |
| 83 | <itemizedlist> |
| 84 | <listitem><para><emphasis>Website:</emphasis> |
| 85 | The |
| 86 | <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink> |
| 87 | provides the latest builds, breaking news, full development |
| 88 | documentation, and access to a rich Yocto Project |
| 89 | Development Community into which you can tap. |
| 90 | </para></listitem> |
| 91 | <listitem><para><emphasis>FAQs:</emphasis> |
| 92 | Lists commonly asked Yocto Project questions and answers. |
| 93 | You can find two FAQs: |
| 94 | <ulink url='&YOCTO_WIKI_URL;/wiki/FAQ'>Yocto Project FAQ</ulink> |
| 95 | on a wiki, and the |
| 96 | "<ulink url='&YOCTO_DOCS_REF_URL;#faq'>FAQ</ulink>" |
| 97 | chapter in the Yocto Project Reference Manual. |
| 98 | </para></listitem> |
| 99 | <listitem><para><emphasis>Developer Screencast:</emphasis> |
| 100 | The |
| 101 | <ulink url='http://vimeo.com/36450321'>Getting Started with the Yocto Project - New Developer Screencast Tutorial</ulink> |
| 102 | provides a 30-minute video created for users unfamiliar |
| 103 | with the Yocto Project but familiar with Linux build |
| 104 | hosts. |
| 105 | While this screencast is somewhat dated, the introductory |
| 106 | and fundamental concepts are useful for the beginner. |
| 107 | </para></listitem> |
| 108 | </itemizedlist> |
| 109 | </para> |
| 110 | </section> |
| 111 | |
| 112 | <section id='yp-intro'> |
| 113 | <title>Introducing the Yocto Project Development Environment</title> |
| 114 | |
| 115 | <para> |
| 116 | The Yocto Project through the OpenEmbedded build system provides an |
| 117 | open source development environment targeting the ARM, MIPS, |
| 118 | PowerPC, and x86 architectures for a variety of platforms |
| 119 | including x86-64 and emulated ones. |
| 120 | You can use components from the Yocto Project to design, develop, |
| 121 | build, debug, simulate, and test the complete software stack using |
| 122 | Linux, the X Window System, GTK+ frameworks, and Qt frameworks. |
| 123 | </para> |
| 124 | |
| 125 | <mediaobject> |
| 126 | <imageobject> |
| 127 | <imagedata fileref="figures/yocto-environment.png" |
| 128 | format="PNG" align='center' scalefit='1' width="100%"/> |
| 129 | </imageobject> |
| 130 | <caption> |
| 131 | <para>The Yocto Project Development Environment</para> |
| 132 | </caption> |
| 133 | </mediaobject> |
| 134 | |
| 135 | <para> |
| 136 | Here are some highlights for the Yocto Project: |
| 137 | </para> |
| 138 | |
| 139 | <itemizedlist> |
| 140 | <listitem><para> |
| 141 | Provides a recent Linux kernel along with a set of system |
| 142 | commands and libraries suitable for the embedded |
| 143 | environment. |
| 144 | </para></listitem> |
| 145 | <listitem><para> |
| 146 | Makes available system components such as X11, GTK+, Qt, |
| 147 | Clutter, and SDL (among others) so you can create a rich user |
| 148 | experience on devices that have display hardware. |
| 149 | For devices that do not have a display or where you wish to |
| 150 | use alternative UI frameworks, these components need not be |
| 151 | installed. |
| 152 | </para></listitem> |
| 153 | <listitem><para> |
| 154 | Creates a focused and stable core compatible with the |
| 155 | OpenEmbedded project with which you can easily and reliably |
| 156 | build and develop. |
| 157 | </para></listitem> |
| 158 | <listitem><para> |
| 159 | Fully supports a wide range of hardware and device emulation |
| 160 | through the Quick EMUlator (QEMU). |
| 161 | </para></listitem> |
| 162 | <listitem><para> |
| 163 | Provides a layer mechanism that allows you to easily extend |
| 164 | the system, make customizations, and keep them organized. |
| 165 | </para></listitem> |
| 166 | </itemizedlist> |
| 167 | |
| 168 | <para> |
| 169 | You can use the Yocto Project to generate images for many kinds |
| 170 | of devices. |
| 171 | As mentioned earlier, the Yocto Project supports creation of |
| 172 | reference images that you can boot within and emulate using QEMU. |
| 173 | The standard example machines target QEMU full-system |
| 174 | emulation for 32-bit and 64-bit variants of x86, ARM, MIPS, and |
| 175 | PowerPC architectures. |
| 176 | Beyond emulation, you can use the layer mechanism to extend |
| 177 | support to just about any platform that Linux can run on and that |
| 178 | a toolchain can target. |
| 179 | </para> |
| 180 | |
| 181 | <para> |
| 182 | Another Yocto Project feature is the Sato reference User |
| 183 | Interface. |
| 184 | This optional UI that is based on GTK+ is intended for devices with |
| 185 | restricted screen sizes and is included as part of the |
| 186 | OpenEmbedded Core layer so that developers can test parts of the |
| 187 | software stack. |
| 188 | </para> |
| 189 | </section> |
| 190 | |
| 191 | <section id='yp-resources'> |
| 192 | <title>Setting Up to Use the Yocto Project</title> |
| 193 | |
| 194 | <para> |
| 195 | The following list shows what you need in order to use a |
| 196 | Linux-based build host to use the Yocto Project to build images: |
| 197 | </para> |
| 198 | |
| 199 | <itemizedlist> |
| 200 | <listitem><para><emphasis>Build Host</emphasis> |
| 201 | A build host with a minimum of 50 Gbytes of free disk |
| 202 | space that is running a supported Linux distribution (i.e. |
| 203 | recent releases of Fedora, openSUSE, CentOS, Debian, or |
| 204 | Ubuntu). |
| 205 | </para></listitem> |
| 206 | <listitem><para><emphasis>Build Host Packages</emphasis> |
| 207 | Appropriate packages installed on the build host. |
| 208 | </para></listitem> |
| 209 | <listitem><para><emphasis>The Yocto Project</emphasis> |
| 210 | A release of the Yocto Project. |
| 211 | </para></listitem> |
| 212 | </itemizedlist> |
| 213 | |
| 214 | <section id='the-linux-distro'> |
| 215 | <title>The Linux Distribution</title> |
| 216 | |
| 217 | <para> |
| 218 | The Yocto Project team verifies each release against recent |
| 219 | versions of the most popular Linux distributions that |
| 220 | provide stable releases. |
| 221 | In general, if you have the current release minus one of the |
| 222 | following distributions, you should have no problems. |
| 223 | <itemizedlist> |
| 224 | <listitem><para> |
| 225 | Ubuntu |
| 226 | </para></listitem> |
| 227 | <listitem><para> |
| 228 | Fedora |
| 229 | </para></listitem> |
| 230 | <listitem><para> |
| 231 | openSUSE |
| 232 | </para></listitem> |
| 233 | <listitem><para> |
| 234 | CentOS |
| 235 | </para></listitem> |
| 236 | <listitem><para> |
| 237 | Debian |
| 238 | </para></listitem> |
| 239 | </itemizedlist> |
| 240 | For a more detailed list of distributions that support the |
| 241 | Yocto Project, see the |
| 242 | "<ulink url='&YOCTO_DOCS_REF_URL;#detailed-supported-distros'>Supported Linux Distributions</ulink>" |
| 243 | section in the Yocto Project Reference Manual. |
| 244 | </para> |
| 245 | |
| 246 | <para> |
| 247 | The OpenEmbedded build system should be able to run on any |
| 248 | modern distribution that has the following versions for |
| 249 | Git, tar, and Python. |
| 250 | <itemizedlist> |
| 251 | <listitem><para> |
| 252 | Git 1.7.8 or greater |
| 253 | </para></listitem> |
| 254 | <listitem><para> |
| 255 | tar 1.24 or greater |
| 256 | </para></listitem> |
| 257 | <listitem><para> |
| 258 | Python 2.7.3 or greater excluding Python |
| 259 | 3.x, which is not supported. |
| 260 | </para></listitem> |
| 261 | </itemizedlist> |
| 262 | If your build host does not meet any of these three listed |
| 263 | version requirements, you can take steps to prepare the |
| 264 | system so that you can still use the Yocto Project. |
| 265 | See the |
| 266 | "<ulink url='&YOCTO_DOCS_REF_URL;#required-git-tar-and-python-versions'>Required Git, tar, and Python Versions</ulink>" |
| 267 | section in the Yocto Project Reference Manual for information. |
| 268 | </para> |
| 269 | </section> |
| 270 | |
| 271 | <section id='packages'> |
| 272 | <title>The Build Host Packages</title> |
| 273 | |
| 274 | <para> |
| 275 | Required build host packages vary depending on your |
| 276 | build machine and what you want to do with the Yocto Project. |
| 277 | For example, if you want to build an image that can run |
| 278 | on QEMU in graphical mode (a minimal, basic build |
| 279 | requirement), then the build host package requirements |
| 280 | are different than if you want to build an image on a headless |
| 281 | system or build out the Yocto Project documentation set. |
| 282 | </para> |
| 283 | |
| 284 | <para> |
| 285 | Collectively, the number of required packages is large |
| 286 | if you want to be able to cover all cases. |
| 287 | <note> |
| 288 | In general, you need to have root access and then install |
| 289 | the required packages. |
| 290 | Thus, the commands in the following section may or may |
| 291 | not work depending on whether or not your Linux |
| 292 | distribution has <filename>sudo</filename> installed. |
| 293 | </note> |
| 294 | </para> |
| 295 | |
| 296 | <para> |
| 297 | The following list shows the required packages needed to build |
| 298 | an image that runs on QEMU in graphical mode (e.g. essential |
| 299 | plus graphics support). |
| 300 | For lists of required packages for other scenarios, see the |
| 301 | "<ulink url='&YOCTO_DOCS_REF_URL;#required-packages-for-the-host-development-system'>Required Packages for the Host Development System</ulink>" |
| 302 | section in the Yocto Project Reference Manual. |
| 303 | <itemizedlist> |
| 304 | <listitem><para><emphasis>Ubuntu and Debian</emphasis> |
| 305 | <literallayout class='monospaced'> |
| 306 | $ sudo apt-get install &UBUNTU_HOST_PACKAGES_ESSENTIAL; libsdl1.2-dev xterm |
| 307 | </literallayout> |
| 308 | </para></listitem> |
| 309 | <listitem><para><emphasis>Fedora</emphasis> |
| 310 | <literallayout class='monospaced'> |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 311 | $ sudo dnf install &FEDORA_HOST_PACKAGES_ESSENTIAL; SDL-devel xterm |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 312 | </literallayout> |
| 313 | </para></listitem> |
| 314 | <listitem><para><emphasis>OpenSUSE</emphasis> |
| 315 | <literallayout class='monospaced'> |
| 316 | $ sudo zypper install &OPENSUSE_HOST_PACKAGES_ESSENTIAL; libSDL-devel xterm |
| 317 | </literallayout> |
| 318 | </para></listitem> |
| 319 | <listitem><para><emphasis>CentOS</emphasis> |
| 320 | <literallayout class='monospaced'> |
| 321 | $ sudo yum install &CENTOS_HOST_PACKAGES_ESSENTIAL; SDL-devel xterm |
| 322 | </literallayout> |
| 323 | <note> |
| 324 | CentOS 6.x users need to ensure that the required |
| 325 | versions of Git, tar and Python are available. |
| 326 | For details, See the |
| 327 | "<ulink url='&YOCTO_DOCS_REF_URL;#required-git-tar-and-python-versions'>Required Git, tar, and Python Versions</ulink>" |
| 328 | section in the Yocto Project Reference Manual for |
| 329 | information. |
| 330 | </note> |
| 331 | </para></listitem> |
| 332 | </itemizedlist> |
| 333 | </para> |
| 334 | </section> |
| 335 | |
| 336 | <section id='releases'> |
| 337 | <title>Yocto Project Release</title> |
| 338 | |
| 339 | <para> |
| 340 | The last requirement you need to meet before using the |
| 341 | Yocto Project is getting a Yocto Project release. |
| 342 | It is recommended that you get the latest Yocto Project release |
| 343 | by setting up (cloning in |
| 344 | <ulink url='&YOCTO_DOCS_DEV_URL;#git'>Git</ulink> terms) a |
| 345 | local copy of the <filename>poky</filename> Git repository on |
| 346 | your build host and then checking out the latest release. |
| 347 | Doing so allows you to easily update to newer Yocto Project |
| 348 | releases as well as contribute back to the Yocto Project. |
| 349 | </para> |
| 350 | |
| 351 | <para> |
| 352 | Here is an example from an Ubuntu build host that clones the |
| 353 | <filename>poky</filename> repository and then checks out the |
| 354 | latest Yocto Project Release (i.e. &DISTRO;): |
| 355 | <literallayout class='monospaced'> |
| 356 | $ git clone git://git.yoctoproject.org/poky |
| 357 | Cloning into 'poky'... |
| 358 | remote: Counting objects: 226790, done. |
| 359 | remote: Compressing objects: 100% (57465/57465), done. |
| 360 | remote: Total 226790 (delta 165212), reused 225887 (delta 164327) |
| 361 | Receiving objects: 100% (226790/226790), 100.98 MiB | 263 KiB/s, done. |
| 362 | Resolving deltas: 100% (165212/165212), done. |
| 363 | $ git checkout &DISTRO_NAME; |
| 364 | </literallayout> |
| 365 | You can also get the Yocto Project Files by downloading |
| 366 | Yocto Project releases from the |
| 367 | <ulink url="&YOCTO_HOME_URL;">Yocto Project website</ulink>. |
| 368 | </para> |
| 369 | |
| 370 | <para> |
| 371 | For more information on getting set up with the Yocto Project |
| 372 | release, see the |
| 373 | "<ulink url='&YOCTO_DOCS_DEV_URL;#local-yp-release'>Yocto Project Release</ulink>" |
| 374 | item in the Yocto Project Development Manual. |
| 375 | </para> |
| 376 | </section> |
| 377 | </section> |
| 378 | |
| 379 | <section id='qs-building-images'> |
| 380 | <title>Building Images</title> |
| 381 | |
| 382 | <para> |
| 383 | Now that you have your system requirements in order, you can give |
| 384 | the Yocto Project a try. |
| 385 | This section presents steps that let you do the following: |
| 386 | <itemizedlist> |
| 387 | <listitem><para> |
| 388 | Build a <filename>qemux86</filename> reference image |
| 389 | and run it in the QEMU emulator. |
| 390 | </para></listitem> |
| 391 | <listitem><para> |
| 392 | Easily change configurations so that you can quickly |
| 393 | create a second image, which would be for MinnowBoard |
| 394 | MAX-compatible boards. |
| 395 | </para></listitem> |
| 396 | </itemizedlist> |
| 397 | <note> |
| 398 | The steps in this section do not provide detail, but rather |
| 399 | provide minimal, working commands and examples designed to |
| 400 | just get you started. |
| 401 | For more details, see the appropriate manuals in the |
| 402 | <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project manual set</ulink>. |
| 403 | </note> |
| 404 | </para> |
| 405 | |
| 406 | <para> |
| 407 | Use the following commands to build your image. |
| 408 | The OpenEmbedded build system creates an entire Linux |
| 409 | distribution, including the toolchain, from source. |
| 410 | <note><title>Note about Network Proxies</title> |
| 411 | <para> |
| 412 | By default, the build process searches for source code |
| 413 | using a pre-determined order through a set of |
| 414 | locations. |
| 415 | If you are working behind a firewall and your build |
| 416 | host is not set up for proxies, you could encounter |
| 417 | problems with the build process when fetching source |
| 418 | code (e.g. fetcher failures or Git failures). |
| 419 | </para> |
| 420 | |
| 421 | <para> |
| 422 | If you do not know your proxy settings, consult your |
| 423 | local network infrastructure resources and get that |
| 424 | information. |
| 425 | A good starting point could also be to check your web |
| 426 | browser settings. |
| 427 | Finally, you can find more information on using the |
| 428 | Yocto Project behind a firewall in the Yocto Project |
| 429 | Reference Manual |
| 430 | <ulink url='&YOCTO_DOCS_REF_URL;#how-does-the-yocto-project-obtain-source-code-and-will-it-work-behind-my-firewall-or-proxy-server'>FAQ</ulink> |
| 431 | and on the |
| 432 | "<ulink url='https://wiki.yoctoproject.org/wiki/Working_Behind_a_Network_Proxy'>Working Behind a Network Proxy</ulink>" |
| 433 | wiki page. |
| 434 | </para> |
| 435 | </note> |
| 436 | </para> |
| 437 | |
| 438 | <para> |
| 439 | <orderedlist> |
| 440 | <listitem><para><emphasis>Be Sure Your Build Host is Set Up:</emphasis> |
| 441 | The steps to build an image in this section depend on |
| 442 | your build host being properly set up. |
| 443 | Be sure you have worked through the requirements |
| 444 | described in the |
| 445 | "<link linkend='yp-resources'>Setting Up to Use the Yocto Project</link>" |
| 446 | section. |
| 447 | </para></listitem> |
| 448 | <listitem><para><emphasis>Check Out Your Branch:</emphasis> |
| 449 | Be sure you are in the |
| 450 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink> |
| 451 | (e.g. <filename>poky</filename>) and then check out |
| 452 | the branch associated with the latest Yocto Project |
| 453 | Release: |
| 454 | <literallayout class='monospaced'> |
| 455 | $ cd ~/poky |
| 456 | $ git checkout -b &DISTRO_NAME; origin/&DISTRO_NAME; |
| 457 | </literallayout> |
| 458 | Git's <filename>checkout</filename> command checks out |
| 459 | the current Yocto Project release into a local branch |
| 460 | whose name matches the release (i.e. |
| 461 | <filename>&DISTRO_NAME;</filename>). |
| 462 | The local branch tracks the upstream branch of the |
| 463 | same name. |
| 464 | Creating your own branch based on the released |
| 465 | branch ensures you are using the latest files for |
| 466 | that release. |
| 467 | </para></listitem> |
| 468 | <listitem><para><emphasis>Initialize the Build Environment:</emphasis> |
| 469 | Run the |
| 470 | <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink> |
| 471 | environment setup script to define the OpenEmbedded |
| 472 | build environment on your build host. |
| 473 | <literallayout class='monospaced'> |
| 474 | $ source &OE_INIT_FILE; |
| 475 | </literallayout> |
| 476 | Among other things, the script creates the |
| 477 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>, |
| 478 | which is <filename>build</filename> in this case |
| 479 | and is located in the |
| 480 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. |
| 481 | After the script runs, your current working directory |
| 482 | is set to the Build Directory. |
| 483 | Later, when the build completes, the Build Directory |
| 484 | contains all the files created during the build. |
| 485 | <note> |
| 486 | For information on running a memory-resident |
| 487 | <ulink url='&YOCTO_DOCS_REF_URL;#usingpoky-components-bitbake'>BitBake</ulink>, |
| 488 | see the |
| 489 | <ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink> |
| 490 | setup script. |
| 491 | </note> |
| 492 | </para></listitem> |
| 493 | <listitem><para><emphasis>Examine Your Local Configuration File:</emphasis> |
| 494 | When you set up the build environment, a local |
| 495 | configuration file named |
| 496 | <filename>local.conf</filename> becomes available in |
| 497 | a <filename>conf</filename> subdirectory of the |
| 498 | Build Directory. |
| 499 | Before using BitBake to start the build, you can |
| 500 | look at this file and be sure your general |
| 501 | configurations are how you want them: |
| 502 | <itemizedlist> |
| 503 | <listitem><para> |
| 504 | To help conserve disk space during builds, |
| 505 | you can add the following statement to your |
| 506 | project's configuration file, which for this |
| 507 | example is |
| 508 | <filename>poky/build/conf/local.conf</filename>. |
| 509 | Adding this statement deletes the work |
| 510 | directory used for building a recipe once the |
| 511 | recipe is built. |
| 512 | <literallayout class='monospaced'> |
| 513 | INHERIT += "rm_work" |
| 514 | </literallayout> |
| 515 | </para></listitem> |
| 516 | <listitem><para> |
| 517 | By default, the target machine for the build is |
| 518 | <filename>qemux86</filename>, |
| 519 | which produces an image that can be used in |
| 520 | the QEMU emulator and is targeted at an |
| 521 | <trademark class='registered'>Intel</trademark> |
| 522 | 32-bit based architecture. |
| 523 | Further on in this example, this default is |
| 524 | easily changed through the |
| 525 | <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink> |
| 526 | variable so that you can quickly |
| 527 | build an image for a different machine. |
| 528 | </para></listitem> |
| 529 | <listitem><para> |
| 530 | Another consideration before you build is the |
| 531 | package manager used when creating the image. |
| 532 | The default <filename>local.conf</filename> |
| 533 | file selects the RPM package manager. |
| 534 | You can control this configuration by using the |
| 535 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></ulink></filename> |
| 536 | variable.</para> |
| 537 | <para>Selection of the package manager is separate |
| 538 | from whether package management is used at runtime |
| 539 | in the target image.</para> |
| 540 | <para>For additional package manager selection |
| 541 | information, see the |
| 542 | "<ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-package'><filename>package*.bbclass</filename></ulink>" |
| 543 | section in the Yocto Project Reference Manual. |
| 544 | </para></listitem> |
| 545 | </itemizedlist> |
| 546 | </para></listitem> |
| 547 | <listitem><para><emphasis>Start the Build:</emphasis> |
| 548 | Continue with the following command to build an OS image |
| 549 | for the target, which is |
| 550 | <filename>core-image-sato</filename> in this example: |
| 551 | <note> |
| 552 | Depending on the number of processors and cores, the |
| 553 | amount of RAM, the speed of your Internet connection |
| 554 | and other factors, the build process could take several |
| 555 | hours the first time you run it. |
| 556 | Subsequent builds run much faster since parts of the |
| 557 | build are cached. |
| 558 | </note> |
| 559 | <literallayout class='monospaced'> |
| 560 | $ bitbake core-image-sato |
| 561 | </literallayout> |
| 562 | For information on using the |
| 563 | <filename>bitbake</filename> command, see the |
| 564 | "<ulink url='&YOCTO_DOCS_REF_URL;#usingpoky-components-bitbake'>BitBake</ulink>" |
| 565 | section in the Yocto Project Reference Manual, or see the |
| 566 | "<ulink url='&YOCTO_DOCS_BB_URL;#bitbake-user-manual-command'>BitBake Command</ulink>" |
| 567 | section in the BitBake User Manual. |
| 568 | For information on other targets, see the |
| 569 | "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>" |
| 570 | chapter in the Yocto Project Reference Manual. |
| 571 | </para></listitem> |
| 572 | <listitem><para><emphasis>Simulate Your Image Using QEMU:</emphasis> |
| 573 | Once this particular image is built, you can start QEMU |
| 574 | and run the image: |
| 575 | <literallayout class='monospaced'> |
| 576 | $ runqemu qemux86 |
| 577 | </literallayout> |
| 578 | If you want to learn more about running QEMU, see the |
| 579 | "<ulink url="&YOCTO_DOCS_DEV_URL;#dev-manual-qemu">Using the Quick EMUlator (QEMU)</ulink>" |
| 580 | chapter in the Yocto Project Development Manual. |
| 581 | </para></listitem> |
| 582 | <listitem><para><emphasis>Exit QEMU:</emphasis> |
| 583 | Exit QEMU by either clicking on the shutdown icon or by |
| 584 | opening a terminal, typing |
| 585 | <filename>poweroff</filename>, and then pressing "Enter". |
| 586 | </para></listitem> |
| 587 | </orderedlist> |
| 588 | </para> |
| 589 | |
| 590 | <para> |
| 591 | The following steps show how easy it is to set up to build an |
| 592 | image for a new machine. |
| 593 | These steps build an image for the MinnowBoard MAX, which is |
| 594 | supported by the Yocto Project and the |
| 595 | <filename>meta-intel</filename> <filename>intel-corei7-64</filename> |
| 596 | and <filename>intel-core2-32</filename> Board Support Packages |
| 597 | (BSPs). |
| 598 | <note> |
| 599 | The MinnowBoard MAX ships with 64-bit firmware. |
| 600 | If you want to use the board in 32-bit mode, you must |
| 601 | download the |
| 602 | <ulink url='http://firmware.intel.com/projects/minnowboard-max'>32-bit firmware</ulink>. |
| 603 | </note> |
| 604 | </para> |
| 605 | |
| 606 | <para> |
| 607 | <orderedlist> |
| 608 | <listitem><para><emphasis>Create a Local Copy of the |
| 609 | <filename>meta-intel</filename> Repository:</emphasis> |
| 610 | Building an image for the MinnowBoard MAX requires the |
| 611 | <filename>meta-intel</filename> layer. |
| 612 | Use the <filename>git clone</filename> command to create |
| 613 | a local copy of the repository: |
| 614 | <literallayout class='monospaced'> |
| 615 | $ git clone git://git.yoctoproject.org/meta-intel |
| 616 | Cloning into 'meta-intel'... |
| 617 | remote: Counting objects: 10824, done. |
| 618 | remote: Compressing objects: 100% (3508/3508), done. |
| 619 | remote: Total 10824 (delta 6219), reused 10580 (delta 5975) |
| 620 | Receiving objects: 100% (10824/10824), 2.72 MiB | 482.00 KiB/s, done. |
| 621 | Resolving deltas: 100% (6219/6219), done. |
| 622 | Checking connectivity... done. |
| 623 | </literallayout> |
| 624 | </para></listitem> |
| 625 | <listitem><para><emphasis>Configure the Build:</emphasis> |
| 626 | To configure the build, you edit the |
| 627 | <filename>bblayers.conf</filename> and |
| 628 | <filename>local.conf</filename> files, both of which are |
| 629 | located in the <filename>build/conf</filename> directory. |
| 630 | </para> |
| 631 | |
| 632 | <para>Here is a quick way to make the edits. |
| 633 | The first command uses the |
| 634 | <filename>bitbake-layers add-layer</filename> command |
| 635 | to add the <filename>meta-intel</filename> |
| 636 | layer, which contains the <filename>intel-core*</filename> |
| 637 | BSPs to the build. |
| 638 | The second command selects the BSP by setting the |
| 639 | <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink> |
| 640 | variable. |
| 641 | <literallayout class='monospaced'> |
| 642 | $ bitbake-layers add-layer "$HOME/source/poky/meta-intel" |
| 643 | $ echo 'MACHINE = "intel-corei7-64"' >> conf/local.conf |
| 644 | </literallayout> |
| 645 | <note><title>Notes</title> |
| 646 | <para> |
| 647 | If you want a 64-bit build, use the following: |
| 648 | <literallayout class='monospaced'> |
| 649 | $ echo 'MACHINE = "intel-corei7-64"' >> conf/local.conf |
| 650 | </literallayout> |
| 651 | </para> |
| 652 | |
| 653 | <para> |
| 654 | If you want 32-bit images, use the following: |
| 655 | <literallayout class='monospaced'> |
| 656 | $ echo 'MACHINE = "intel-core2-32"' >> conf/local.conf |
| 657 | </literallayout> |
| 658 | </para> |
| 659 | </note> |
| 660 | </para></listitem> |
| 661 | <listitem><para><emphasis>Build a Minimal Image for MinnowBoard MAX:</emphasis> |
| 662 | Use the following command to build the minimal image for |
| 663 | MinnowBoard MAX. |
| 664 | Because configuration changes are minimal to set up for |
| 665 | this second build, the OpenEmbedded build system can |
| 666 | re-use files from previous builds as much as possible. |
| 667 | Re-using files means this second build will be much faster |
| 668 | than an initial build. |
| 669 | <literallayout class='monospaced'> |
| 670 | $ bitbake core-image-minimal |
| 671 | </literallayout> |
| 672 | Once the build completes, the resulting basic console image |
| 673 | is located in the Build Directory here: |
| 674 | <literallayout class='monospaced'> |
| 675 | tmp/deploy/images/intel-corei7-64/core-image-minimal-intel-corei7-64.hddimg |
| 676 | </literallayout> |
| 677 | </para></listitem> |
| 678 | <listitem><para><emphasis>Write the Image:</emphasis> |
| 679 | You can write the image to a USB key, SATA drive, or SD |
| 680 | card by using the <filename>mkefidisk.sh</filename> script, |
| 681 | which is included in the <filename>poky</filename> |
| 682 | repository at |
| 683 | <filename>scripts/contrib/mkefidisk.sh</filename>: |
| 684 | <literallayout class='monospaced'> |
| 685 | $ sudo $HOME/source/poky/scripts/contrib/mkefidisk.sh <replaceable>HOST_DEVICE</replaceable> \ |
| 686 | tmp/deploy/images/intel-corei7-64/core-image-minimal-intel-corei7-64.hddimg <replaceable>TARGET_DEVICE</replaceable> |
| 687 | </literallayout> |
| 688 | In the previous command, |
| 689 | <replaceable>HOST_DEVICE</replaceable> is the device node |
| 690 | on the build host (e.g. <filename>/dev/sdc</filename> or |
| 691 | <filename>/dev/mmcblk0</filename>). |
| 692 | <replaceable>TARGET_DEVICE</replaceable> is the name of the |
| 693 | device as the MinnowBoard MAX sees it (e.g. |
| 694 | <filename>/dev/sda</filename> or |
| 695 | <filename>/dev/mmcblk0</filename>). |
| 696 | </para></listitem> |
| 697 | <listitem><para><emphasis>Boot the Hardware:</emphasis> |
| 698 | With the boot device provisioned, you can insert the |
| 699 | media into the MinnowBoard MAX and boot the hardware. |
| 700 | The board should automatically detect the media and boot to |
| 701 | the bootloader and subsequently the operating system. |
| 702 | </para> |
| 703 | |
| 704 | <para>If the board does not boot automatically, you can |
| 705 | boot it manually from the EFI shell as follows: |
| 706 | <literallayout class='monospaced'> |
| 707 | Shell> connect -r |
| 708 | Shell> map -r |
| 709 | Shell> fs0: |
| 710 | Shell> bootx64 |
| 711 | </literallayout> |
| 712 | <note> |
| 713 | For a 32-bit image use the following: |
| 714 | <literallayout class='monospaced'> |
| 715 | Shell> bootia32 |
| 716 | </literallayout> |
| 717 | </note> |
| 718 | </para></listitem> |
| 719 | </orderedlist> |
| 720 | </para> |
| 721 | </section> |
| 722 | |
| 723 | <section id='qs-next-steps'> |
| 724 | <title>Next Steps</title> |
| 725 | |
| 726 | <para> |
| 727 | If you completed all the steps in the previous section then |
| 728 | congratulations to you! |
| 729 | What now? |
| 730 | </para> |
| 731 | |
| 732 | <para> |
| 733 | Depending on what you primary interests are with the Yocto Project, |
| 734 | you could consider any of the following: |
| 735 | <itemizedlist> |
| 736 | <listitem><para><emphasis>Visit the Yocto Project Web Site:</emphasis> |
| 737 | The official |
| 738 | <ulink url='&YOCTO_HOME_URL;'>Yocto Project</ulink> |
| 739 | web site contains information on the entire project. |
| 740 | Visiting this site is a good way to familiarize yourself |
| 741 | with the overall project. |
| 742 | </para></listitem> |
| 743 | <listitem><para><emphasis>Explore Development Models:</emphasis> |
| 744 | You can see the |
| 745 | "<ulink url='&YOCTO_DOCS_DEV_URL;#dev-manual-model'>Common Development Models</ulink>" |
| 746 | section in the Yocto Project Development Manual |
| 747 | to get an overview of the various ways by which |
| 748 | you can use the Yocto Project to develop projects. |
| 749 | </para></listitem> |
| 750 | <listitem><para><emphasis>Learn Some Open Source Basics:</emphasis> |
| 751 | If you are new to the open source environment, you might |
| 752 | read the |
| 753 | "<ulink url='&YOCTO_DOCS_DEV_URL;#dev-manual-newbie'>The Yocto Project Open Source Development Environment</ulink>" |
| 754 | chapter of the Yocto Project Development Manual. |
| 755 | This chapter presents overview material for open source |
| 756 | development in the context of the Yocto Project. |
| 757 | </para></listitem> |
| 758 | <listitem><para><emphasis>Learn About Application Development:</emphasis> |
| 759 | If your primary interests lie in developing applications, |
| 760 | you can reference the |
| 761 | <ulink url='&YOCTO_DOCS_ADT_URL;#adt-manual-intro'>Yocto Project Application Developer's Guide</ulink>. |
| 762 | </para></listitem> |
| 763 | <listitem><para><emphasis>Learn About Board Support Packages (BSPs):</emphasis> |
| 764 | If you want to learn about BSPs, see the |
| 765 | <ulink url='&YOCTO_DOCS_BSP_URL;#bsp'>Yocto Project Board Support Packages (BSP) Developer's Guide</ulink>. |
| 766 | </para></listitem> |
| 767 | <listitem><para><emphasis>Learn About Using Eclipse With the Yocto Project:</emphasis> |
| 768 | If you are an Eclipse user, you can learn about using the |
| 769 | Yocto Project in that development environment by reading |
| 770 | the |
| 771 | "<ulink url='&YOCTO_DOCS_DEV_URL;#workflow-using-the-adt-and-eclipse'>Workflow Using the ADT and Eclipseâ„¢</ulink>" |
| 772 | section in the Yocto Project Development Manual. |
| 773 | </para></listitem> |
| 774 | <listitem><para><emphasis>Learn About Toaster:</emphasis> |
| 775 | Toaster is a web interface to the Yocto Project's |
| 776 | OpenEmbedded build system. |
| 777 | If you are interested in using this type of interface to |
| 778 | create images, see the |
| 779 | <ulink url='&YOCTO_DOCS_TOAST_URL;#toaster-manual-intro'>Toaster User Manual</ulink>. |
| 780 | </para></listitem> |
| 781 | <listitem><para><emphasis>Explore Yocto Project Common Tasks and Technical Details:</emphasis> |
| 782 | If you are interested in a mix of common tasks that have to |
| 783 | do with project develop using the Yocto Project, see the |
| 784 | "<ulink url='&YOCTO_DOCS_DEV_URL;#extendpoky'>Common Tasks</ulink>" |
| 785 | section of the Yocto Project Development Manual. |
| 786 | If you want more detail, see the |
| 787 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-manual-intro'>Yocto Project Reference Manual</ulink>. |
| 788 | </para></listitem> |
| 789 | </itemizedlist> |
| 790 | </para> |
| 791 | </section> |
| 792 | </article> |
| 793 | <!-- |
| 794 | vim: expandtab tw=80 ts=4 |
| 795 | --> |