2011-07-15 14:29:18 +00:00
|
|
|
|
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
2012-03-09 19:40:39 +00:00
|
|
|
|
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
|
|
|
|
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
2011-07-15 14:29:18 +00:00
|
|
|
|
|
|
|
|
|
<chapter id='dev-manual-start'>
|
|
|
|
|
|
|
|
|
|
<title>Getting Started with the Yocto Project</title>
|
|
|
|
|
|
2011-07-15 16:23:55 +00:00
|
|
|
|
<para>
|
2012-12-07 23:23:56 +00:00
|
|
|
|
This chapter introduces the Yocto Project and gives you an idea of what you need to get started.
|
|
|
|
|
You can find enough information to set up your development host and build or use images for
|
|
|
|
|
hardware supported by the Yocto Project by reading the
|
2012-08-22 01:26:02 +00:00
|
|
|
|
<ulink url='&YOCTO_DOCS_QS_URL;'>Yocto Project Quick Start</ulink>.
|
2011-07-15 16:23:55 +00:00
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
<para>
|
2012-12-07 23:23:56 +00:00
|
|
|
|
The remainder of this chapter summarizes what is in the Yocto Project Quick Start and provides
|
2011-09-19 17:16:24 +00:00
|
|
|
|
some higher-level concepts you might want to consider.
|
2011-07-15 16:23:55 +00:00
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
<section id='introducing-the-yocto-project'>
|
|
|
|
|
<title>Introducing the Yocto Project</title>
|
|
|
|
|
|
2011-07-15 14:29:18 +00:00
|
|
|
|
<para>
|
2012-12-07 23:23:56 +00:00
|
|
|
|
The Yocto Project is an open-source collaboration project focused on embedded Linux development.
|
2013-04-22 21:23:29 +00:00
|
|
|
|
The project currently provides a build system that is
|
2014-03-17 13:53:22 +00:00
|
|
|
|
referred to as the
|
|
|
|
|
<link linkend='build-system-term'>OpenEmbedded build system</link>
|
|
|
|
|
in the Yocto Project documentation.
|
2013-04-22 21:23:29 +00:00
|
|
|
|
The Yocto Project provides various ancillary tools for the embedded developer
|
2012-12-07 23:23:56 +00:00
|
|
|
|
and also features the Sato reference User Interface, which is optimized for
|
2011-08-16 16:17:55 +00:00
|
|
|
|
stylus driven, low-resolution screens.
|
2011-07-15 14:29:18 +00:00
|
|
|
|
</para>
|
2011-07-15 16:23:55 +00:00
|
|
|
|
|
2011-07-15 14:29:18 +00:00
|
|
|
|
<para>
|
2012-12-07 23:23:56 +00:00
|
|
|
|
You can use the OpenEmbedded build system, which uses
|
2014-03-17 14:02:28 +00:00
|
|
|
|
<link linkend='bitbake-term'>BitBake</link>, to develop complete Linux
|
2013-03-06 18:26:55 +00:00
|
|
|
|
images and associated user-space applications for architectures based
|
|
|
|
|
on ARM, MIPS, PowerPC, x86 and x86-64.
|
|
|
|
|
<note>
|
|
|
|
|
By default, using the Yocto Project creates a Poky distribution.
|
|
|
|
|
However, you can create your own distribution by providing key
|
|
|
|
|
<link linkend='metadata'>Metadata</link>.
|
|
|
|
|
See the "<link linkend='creating-your-own-distribution'>Creating Your Own Distribution</link>"
|
|
|
|
|
section for more information.
|
|
|
|
|
</note>
|
2011-09-13 17:10:19 +00:00
|
|
|
|
While the Yocto Project does not provide a strict testing framework,
|
2012-12-07 23:23:56 +00:00
|
|
|
|
it does provide or generate for you artifacts that let you perform target-level and
|
|
|
|
|
emulated testing and debugging.
|
2011-11-02 20:05:20 +00:00
|
|
|
|
Additionally, if you are an <trademark class='trade'>Eclipse</trademark>
|
2012-12-07 23:23:56 +00:00
|
|
|
|
IDE user, you can install an Eclipse Yocto Plug-in to allow you to
|
2011-07-15 16:23:55 +00:00
|
|
|
|
develop within that familiar environment.
|
2011-07-15 14:29:18 +00:00
|
|
|
|
</para>
|
2011-07-15 16:23:55 +00:00
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<section id='getting-setup'>
|
2011-11-10 21:28:32 +00:00
|
|
|
|
<title>Getting Set Up</title>
|
2011-07-15 16:23:55 +00:00
|
|
|
|
|
2011-07-15 14:29:18 +00:00
|
|
|
|
<para>
|
2013-11-11 18:26:00 +00:00
|
|
|
|
Here is what you need to use the Yocto Project:
|
2011-07-15 14:29:18 +00:00
|
|
|
|
<itemizedlist>
|
2012-12-07 23:23:56 +00:00
|
|
|
|
<listitem><para><emphasis>Host System:</emphasis> You should have a reasonably current
|
2011-08-16 16:17:55 +00:00
|
|
|
|
Linux-based host system.
|
2012-12-07 23:23:56 +00:00
|
|
|
|
You will have the best results with a recent release of Fedora,
|
2013-11-11 18:26:00 +00:00
|
|
|
|
openSUSE, Debian, Ubuntu, or CentOS as these releases are frequently tested against the Yocto Project
|
2012-12-07 23:23:56 +00:00
|
|
|
|
and officially supported.
|
2012-09-28 13:41:51 +00:00
|
|
|
|
For a list of the distributions under validation and their status, see the
|
2012-10-22 20:16:49 +00:00
|
|
|
|
"<ulink url='&YOCTO_DOCS_REF_URL;#detailed-supported-distros'>Supported Linux Distributions</ulink>" section
|
2012-12-07 23:23:56 +00:00
|
|
|
|
in the Yocto Project Reference Manual and the wiki page at
|
2012-10-22 20:16:49 +00:00
|
|
|
|
<ulink url='&YOCTO_WIKI_URL;/wiki/Distribution_Support'>Distribution Support</ulink>.</para>
|
2012-09-28 13:41:51 +00:00
|
|
|
|
<para>
|
2014-03-17 14:04:42 +00:00
|
|
|
|
You should also have about 50 Gbytes of free disk space for building images.
|
2011-08-11 20:55:07 +00:00
|
|
|
|
</para></listitem>
|
2012-07-02 16:59:11 +00:00
|
|
|
|
<listitem><para><emphasis>Packages:</emphasis> The OpenEmbedded build system
|
2013-11-11 18:26:00 +00:00
|
|
|
|
requires that certain packages exist on your development system (e.g. Python 2.6 or 2.7).
|
2012-12-07 23:23:56 +00:00
|
|
|
|
See "<ulink url='&YOCTO_DOCS_QS_URL;#packages'>The Packages</ulink>"
|
2013-07-01 05:22:24 +00:00
|
|
|
|
section in the Yocto Project Quick Start and the
|
2013-04-09 17:53:46 +00:00
|
|
|
|
"<ulink url='&YOCTO_DOCS_REF_URL;#required-packages-for-the-host-development-system'>Required Packages for the Host Development System</ulink>"
|
2013-07-01 05:22:24 +00:00
|
|
|
|
section in the Yocto Project Reference Manual for the exact
|
|
|
|
|
package requirements and the installation commands to install
|
2013-04-09 17:53:46 +00:00
|
|
|
|
them for the supported distributions.
|
|
|
|
|
</para></listitem>
|
2012-12-07 23:23:56 +00:00
|
|
|
|
<listitem id='local-yp-release'><para><emphasis>Yocto Project Release:</emphasis>
|
2014-03-17 14:45:10 +00:00
|
|
|
|
You need a release of the Yocto Project locally installed on
|
2013-10-29 14:37:31 +00:00
|
|
|
|
your development system.
|
2014-03-17 14:45:10 +00:00
|
|
|
|
The documentation refers to this set of locally installed files
|
|
|
|
|
as the <link linkend='source-directory'>Source Directory</link>.
|
|
|
|
|
You create your Source Directory by using
|
2013-10-29 14:37:31 +00:00
|
|
|
|
<link linkend='git'>Git</link> to clone a local copy
|
2013-11-11 18:26:00 +00:00
|
|
|
|
of the upstream <filename>poky</filename> repository,
|
2014-03-17 14:45:10 +00:00
|
|
|
|
or by downloading and unpacking a tarball of an official
|
|
|
|
|
Yocto Project release.</para>
|
2013-10-29 14:37:31 +00:00
|
|
|
|
<para>Working from a copy of the upstream repository allows you
|
|
|
|
|
to contribute back into the Yocto Project or simply work with
|
|
|
|
|
the latest software on a development branch.
|
|
|
|
|
Because Git maintains and creates an upstream repository with
|
|
|
|
|
a complete history of changes and you are working with a local
|
|
|
|
|
clone of that repository, you have access to all the Yocto
|
|
|
|
|
Project development branches and tag names used in the upstream
|
|
|
|
|
repository.</para>
|
|
|
|
|
<note>You can view the Yocto Project Source Repositories at
|
|
|
|
|
<ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>
|
2011-07-27 15:16:16 +00:00
|
|
|
|
</note>
|
2013-10-29 14:37:31 +00:00
|
|
|
|
<para>The following transcript shows how to clone the
|
|
|
|
|
<filename>poky</filename> Git repository into the current
|
|
|
|
|
working directory.
|
|
|
|
|
The command creates the local repository in a directory
|
|
|
|
|
named <filename>poky</filename>.
|
|
|
|
|
For information on Git used within the Yocto Project, see
|
|
|
|
|
the "<link linkend='git'>Git</link>" section.
|
|
|
|
|
<literallayout class='monospaced'>
|
2011-07-27 15:07:37 +00:00
|
|
|
|
$ git clone git://git.yoctoproject.org/poky
|
2013-04-09 17:53:46 +00:00
|
|
|
|
Cloning into 'poky'...
|
2014-03-17 14:45:10 +00:00
|
|
|
|
remote: Counting objects: 226790, done.
|
|
|
|
|
remote: Compressing objects: 100% (57465/57465), done.
|
|
|
|
|
remote: Total 226790 (delta 165212), reused 225887 (delta 164327)
|
|
|
|
|
Receiving objects: 100% (226790/226790), 100.98 MiB | 263 KiB/s, done.
|
|
|
|
|
Resolving deltas: 100% (165212/165212), done.
|
2013-10-29 14:37:31 +00:00
|
|
|
|
</literallayout></para>
|
|
|
|
|
<para>For another example of how to set up your own local Git
|
|
|
|
|
repositories, see this
|
|
|
|
|
<ulink url='&YOCTO_WIKI_URL;/wiki/Transcript:_from_git_checkout_to_meta-intel_BSP'>
|
2014-03-17 14:45:10 +00:00
|
|
|
|
wiki page</ulink>, which describes how to create local
|
|
|
|
|
Git repositories for both
|
|
|
|
|
<filename>poky</filename> and <filename>meta-intel</filename>.
|
|
|
|
|
</para></listitem>
|
2012-12-07 23:23:56 +00:00
|
|
|
|
<listitem id='local-kernel-files'><para><emphasis>Yocto Project Kernel:</emphasis>
|
|
|
|
|
If you are going to be making modifications to a supported Yocto Project kernel, you
|
2011-09-19 17:16:24 +00:00
|
|
|
|
need to establish local copies of the source.
|
2013-11-11 18:26:00 +00:00
|
|
|
|
You can find Git repositories of supported Yocto Project kernels organized under
|
2012-09-28 13:45:48 +00:00
|
|
|
|
"Yocto Linux Kernel" in the Yocto Project Source Repositories at
|
2012-03-09 19:40:39 +00:00
|
|
|
|
<ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>.</para>
|
2012-12-07 23:23:56 +00:00
|
|
|
|
<para>This setup can involve creating a bare clone of the Yocto Project kernel and then
|
2012-02-17 21:44:57 +00:00
|
|
|
|
copying that cloned repository.
|
2011-08-10 21:19:31 +00:00
|
|
|
|
You can create the bare clone and the copy of the bare clone anywhere you like.
|
2012-12-07 23:23:56 +00:00
|
|
|
|
For simplicity, it is recommended that you create these structures outside of the
|
2014-03-17 14:45:10 +00:00
|
|
|
|
Source Directory, which is usually named <filename>poky</filename>.</para>
|
2011-08-08 19:57:11 +00:00
|
|
|
|
<para>As an example, the following transcript shows how to create the bare clone
|
2013-09-23 20:23:00 +00:00
|
|
|
|
of the <filename>linux-yocto-3.10</filename> kernel and then create a copy of
|
2011-08-10 21:19:31 +00:00
|
|
|
|
that clone.
|
2012-12-07 23:23:56 +00:00
|
|
|
|
<note>When you have a local Yocto Project kernel Git repository, you can
|
|
|
|
|
reference that repository rather than the upstream Git repository as
|
2011-08-11 19:50:00 +00:00
|
|
|
|
part of the <filename>clone</filename> command.
|
2011-11-04 23:02:45 +00:00
|
|
|
|
Doing so can speed up the process.</note></para>
|
2012-12-07 23:23:56 +00:00
|
|
|
|
<para>In the following example, the bare clone is named
|
2013-09-23 20:23:00 +00:00
|
|
|
|
<filename>linux-yocto-3.10.git</filename>, while the
|
|
|
|
|
copy is named <filename>my-linux-yocto-3.10-work</filename>:
|
2011-08-02 19:58:44 +00:00
|
|
|
|
<literallayout class='monospaced'>
|
2013-09-23 20:23:00 +00:00
|
|
|
|
$ git clone --bare git://git.yoctoproject.org/linux-yocto-3.10 linux-yocto-3.10.git
|
|
|
|
|
Cloning into bare repository 'linux-yocto-3.10.git'...
|
|
|
|
|
remote: Counting objects: 3364487, done.
|
|
|
|
|
remote: Compressing objects: 100% (507178/507178), done.
|
|
|
|
|
remote: Total 3364487 (delta 2827715), reused 3364481 (delta 2827709)
|
|
|
|
|
Receiving objects: 100% (3364487/3364487), 722.95 MiB | 423 KiB/s, done.
|
|
|
|
|
Resolving deltas: 100% (2827715/2827715), done.
|
|
|
|
|
</literallayout></para>
|
2011-08-08 19:57:11 +00:00
|
|
|
|
<para>Now create a clone of the bare clone just created:
|
|
|
|
|
<literallayout class='monospaced'>
|
2013-09-23 20:23:00 +00:00
|
|
|
|
$ git clone linux-yocto-3.10.git my-linux-yocto-3.10-work
|
|
|
|
|
Cloning into 'my-linux-yocto-3.10-work'...
|
2012-10-04 17:13:42 +00:00
|
|
|
|
done.
|
2012-01-12 14:54:03 +00:00
|
|
|
|
</literallayout></para></listitem>
|
2013-07-01 05:22:24 +00:00
|
|
|
|
<listitem id='meta-yocto-kernel-extras-repo'><para><emphasis>
|
|
|
|
|
The <filename>meta-yocto-kernel-extras</filename> Git Repository</emphasis>:
|
|
|
|
|
The <filename>meta-yocto-kernel-extras</filename> Git repository contains Metadata needed
|
2011-11-10 21:28:32 +00:00
|
|
|
|
only if you are modifying and building the kernel image.
|
2012-03-13 22:01:43 +00:00
|
|
|
|
In particular, it contains the kernel BitBake append (<filename>.bbappend</filename>)
|
2012-12-07 23:23:56 +00:00
|
|
|
|
files that you
|
2011-09-19 17:16:24 +00:00
|
|
|
|
edit to point to your locally modified kernel source files and to build the kernel
|
2012-12-07 23:23:56 +00:00
|
|
|
|
image.
|
|
|
|
|
Pointing to these local files is much more efficient than requiring a download of the
|
2012-07-02 16:59:11 +00:00
|
|
|
|
kernel's source files from upstream each time you make changes to the kernel.</para>
|
2013-07-01 05:22:24 +00:00
|
|
|
|
<para>You can find the <filename>meta-yocto-kernel-extras</filename> Git Repository in the
|
2012-12-07 23:23:56 +00:00
|
|
|
|
"Yocto Metadata Layers" area of the Yocto Project Source Repositories at
|
2012-03-09 19:40:39 +00:00
|
|
|
|
<ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>.
|
2012-10-22 20:16:49 +00:00
|
|
|
|
It is good practice to create this Git repository inside the Source Directory.</para>
|
2013-07-01 05:22:24 +00:00
|
|
|
|
<para>Following is an example that creates the <filename>meta-yocto-kernel-extras</filename> Git
|
2012-12-07 23:23:56 +00:00
|
|
|
|
repository inside the Source Directory, which is named <filename>poky</filename>
|
2012-07-02 16:59:11 +00:00
|
|
|
|
in this case:
|
2011-08-08 19:57:11 +00:00
|
|
|
|
<literallayout class='monospaced'>
|
2012-09-28 13:51:00 +00:00
|
|
|
|
$ cd ~/poky
|
2013-07-01 05:22:24 +00:00
|
|
|
|
$ git clone git://git.yoctoproject.org/meta-yocto-kernel-extras meta-yocto-kernel-extras
|
|
|
|
|
Cloning into 'meta-yocto-kernel-extras'...
|
2013-09-23 20:23:00 +00:00
|
|
|
|
remote: Counting objects: 727, done.
|
|
|
|
|
remote: Compressing objects: 100% (452/452), done.
|
|
|
|
|
remote: Total 727 (delta 260), reused 719 (delta 252)
|
2014-03-17 14:45:10 +00:00
|
|
|
|
Receiving objects: 100% (727/727), 536.36 KiB | 240 KiB/s, done.
|
2013-09-23 20:23:00 +00:00
|
|
|
|
Resolving deltas: 100% (260/260), done.
|
|
|
|
|
</literallayout></para></listitem>
|
2014-03-24 23:17:43 +00:00
|
|
|
|
<listitem><para id='supported-board-support-packages-(bsps)'><emphasis>Supported Board Support Packages (BSPs):</emphasis>
|
2013-10-29 15:14:12 +00:00
|
|
|
|
The Yocto Project provides a layer called
|
|
|
|
|
<filename>meta-intel</filename> and it is maintained in its own
|
|
|
|
|
separate Git repository.
|
|
|
|
|
The <filename>meta-intel</filename> layer contains many
|
|
|
|
|
supported
|
|
|
|
|
<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>.
|
|
|
|
|
</para>
|
2014-03-24 23:17:43 +00:00
|
|
|
|
|
2013-10-29 15:14:12 +00:00
|
|
|
|
<para>The Yocto Project uses the following BSP layer naming
|
|
|
|
|
scheme:
|
2012-12-07 23:23:56 +00:00
|
|
|
|
<literallayout class='monospaced'>
|
|
|
|
|
meta-<BSP_name>
|
2011-07-27 16:00:46 +00:00
|
|
|
|
</literallayout>
|
2013-10-29 15:14:12 +00:00
|
|
|
|
where <filename><BSP_name></filename> is the recognized
|
|
|
|
|
BSP name.
|
2011-07-27 16:00:46 +00:00
|
|
|
|
Here are some examples:
|
|
|
|
|
<literallayout class='monospaced'>
|
2011-07-28 20:24:18 +00:00
|
|
|
|
meta-crownbay
|
|
|
|
|
meta-emenlow
|
|
|
|
|
meta-n450
|
2011-07-27 16:00:46 +00:00
|
|
|
|
</literallayout>
|
2012-02-17 22:06:41 +00:00
|
|
|
|
See the
|
2012-03-09 19:40:39 +00:00
|
|
|
|
"<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>"
|
2013-10-29 15:14:12 +00:00
|
|
|
|
section in the Yocto Project Board Support Package (BSP)
|
2014-03-24 23:17:43 +00:00
|
|
|
|
Developer's Guide for more information on BSP Layers.
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
<para>
|
|
|
|
|
You can locate the <filename>meta-intel</filename> Git
|
2013-10-29 15:14:12 +00:00
|
|
|
|
repository in the "Yocto Metadata Layers" area of the Yocto
|
|
|
|
|
Project Source Repositories at
|
2014-03-24 23:17:43 +00:00
|
|
|
|
<ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>.
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
<para>
|
|
|
|
|
Using
|
2013-10-29 15:14:12 +00:00
|
|
|
|
<link linkend='git'>Git</link> to create a local clone of the
|
2013-11-11 15:06:52 +00:00
|
|
|
|
upstream repository can be helpful if you are working with
|
|
|
|
|
BSPs.
|
2013-10-29 15:14:12 +00:00
|
|
|
|
Typically, you set up the <filename>meta-intel</filename>
|
|
|
|
|
Git repository inside the Source Directory.
|
|
|
|
|
For example, the following transcript shows the steps to clone
|
|
|
|
|
<filename>meta-intel</filename>.
|
2014-03-24 23:17:43 +00:00
|
|
|
|
<note>
|
|
|
|
|
Be sure to work in the <filename>meta-intel</filename>
|
|
|
|
|
branch that matches your
|
|
|
|
|
<link linkend='source-directory'>Source Directory</link>
|
|
|
|
|
(i.e. <filename>poky</filename>) branch.
|
|
|
|
|
For example, if you have checked out the "master" branch
|
|
|
|
|
of <filename>poky</filename> and you are going to use
|
|
|
|
|
<filename>meta-intel</filename>, be sure to checkout the
|
|
|
|
|
"master" branch of <filename>meta-intel</filename>.
|
|
|
|
|
</note>
|
2013-10-29 15:14:12 +00:00
|
|
|
|
<literallayout class='monospaced'>
|
2012-09-28 13:55:03 +00:00
|
|
|
|
$ cd ~/poky
|
2011-07-27 15:41:28 +00:00
|
|
|
|
$ git clone git://git.yoctoproject.org/meta-intel.git
|
2013-04-09 17:53:46 +00:00
|
|
|
|
Cloning into 'meta-intel'...
|
2014-03-17 14:45:10 +00:00
|
|
|
|
remote: Counting objects: 8844, done.
|
|
|
|
|
remote: Compressing objects: 100% (2864/2864), done.
|
|
|
|
|
remote: Total 8844 (delta 4931), reused 8780 (delta 4867)
|
|
|
|
|
Receiving objects: 100% (8844/8844), 2.48 MiB | 264 KiB/s, done.
|
|
|
|
|
Resolving deltas: 100% (4931/4931), done.
|
2014-03-24 23:17:43 +00:00
|
|
|
|
</literallayout>
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
<para>
|
|
|
|
|
The same
|
2013-10-29 15:14:12 +00:00
|
|
|
|
<ulink url='&YOCTO_WIKI_URL;/wiki/Transcript:_from_git_checkout_to_meta-intel_BSP'>wiki page</ulink>
|
|
|
|
|
referenced earlier covers how to set up the
|
|
|
|
|
<filename>meta-intel</filename> Git repository.
|
|
|
|
|
</para></listitem>
|
2012-12-07 23:23:56 +00:00
|
|
|
|
<listitem><para><emphasis>Eclipse Yocto Plug-in:</emphasis> If you are developing
|
2011-09-19 17:16:24 +00:00
|
|
|
|
applications using the Eclipse Integrated Development Environment (IDE),
|
2012-12-07 23:23:56 +00:00
|
|
|
|
you will need this plug-in.
|
|
|
|
|
See the
|
2012-07-23 17:15:04 +00:00
|
|
|
|
"<link linkend='setting-up-the-eclipse-ide'>Setting up the Eclipse IDE</link>"
|
|
|
|
|
section for more information.</para></listitem>
|
2011-07-15 14:29:18 +00:00
|
|
|
|
</itemizedlist>
|
|
|
|
|
</para>
|
|
|
|
|
</section>
|
|
|
|
|
|
2011-07-15 16:23:55 +00:00
|
|
|
|
<section id='building-images'>
|
|
|
|
|
<title>Building Images</title>
|
2011-07-15 14:29:18 +00:00
|
|
|
|
|
2011-07-15 16:23:55 +00:00
|
|
|
|
<para>
|
2012-12-07 23:23:56 +00:00
|
|
|
|
The build process creates an entire Linux distribution, including the toolchain, from source.
|
|
|
|
|
For more information on this topic, see the
|
2012-03-09 19:40:39 +00:00
|
|
|
|
"<ulink url='&YOCTO_DOCS_QS_URL;#building-image'>Building an Image</ulink>"
|
2011-09-19 17:16:24 +00:00
|
|
|
|
section in the Yocto Project Quick Start.
|
2011-07-15 16:23:55 +00:00
|
|
|
|
</para>
|
2011-07-15 14:29:18 +00:00
|
|
|
|
|
2011-07-15 16:23:55 +00:00
|
|
|
|
<para>
|
|
|
|
|
The build process is as follows:
|
|
|
|
|
<orderedlist>
|
2012-12-07 23:23:56 +00:00
|
|
|
|
<listitem><para>Make sure you have set up the Source Directory described in the
|
2011-07-15 16:23:55 +00:00
|
|
|
|
previous section.</para></listitem>
|
2014-03-17 14:45:10 +00:00
|
|
|
|
<listitem><para>Initialize the build environment by sourcing a build
|
|
|
|
|
environment script (i.e.
|
|
|
|
|
<ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
|
|
|
|
|
or
|
|
|
|
|
<ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>).
|
|
|
|
|
</para></listitem>
|
2012-06-19 14:08:59 +00:00
|
|
|
|
<listitem><para>Optionally ensure the <filename>conf/local.conf</filename> configuration file,
|
2012-12-07 23:23:56 +00:00
|
|
|
|
which is found in the
|
|
|
|
|
<link linkend='build-directory'>Build Directory</link>,
|
|
|
|
|
is set up how you want it.
|
|
|
|
|
This file defines many aspects of the build environment including
|
|
|
|
|
the target machine architecture through the
|
|
|
|
|
<filename><ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'>MACHINE</ulink></filename> variable,
|
|
|
|
|
the development machine's processor use through the
|
|
|
|
|
<filename><ulink url='&YOCTO_DOCS_REF_URL;#var-BB_NUMBER_THREADS'>BB_NUMBER_THREADS</ulink></filename> and
|
2012-03-09 19:40:39 +00:00
|
|
|
|
<filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PARALLEL_MAKE'>PARALLEL_MAKE</ulink></filename> variables, and
|
2012-12-07 23:23:56 +00:00
|
|
|
|
a centralized tarball download directory through the
|
2012-03-09 19:40:39 +00:00
|
|
|
|
<filename><ulink url='&YOCTO_DOCS_REF_URL;#var-DL_DIR'>DL_DIR</ulink></filename> variable.</para></listitem>
|
2014-03-17 14:45:10 +00:00
|
|
|
|
<listitem><para>
|
|
|
|
|
Build the image using the <filename>bitbake</filename> command.
|
|
|
|
|
If you want information on BitBake, see the
|
|
|
|
|
<ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>.
|
|
|
|
|
</para></listitem>
|
2012-12-07 23:23:56 +00:00
|
|
|
|
<listitem><para>Run the image either on the actual hardware or using the QEMU
|
2011-08-01 22:03:59 +00:00
|
|
|
|
emulator.</para></listitem>
|
2011-07-15 16:23:55 +00:00
|
|
|
|
</orderedlist>
|
|
|
|
|
</para>
|
|
|
|
|
</section>
|
2011-07-15 14:29:18 +00:00
|
|
|
|
|
2011-07-15 16:23:55 +00:00
|
|
|
|
<section id='using-pre-built-binaries-and-qemu'>
|
|
|
|
|
<title>Using Pre-Built Binaries and QEMU</title>
|
2011-07-15 14:29:18 +00:00
|
|
|
|
|
2011-07-15 16:23:55 +00:00
|
|
|
|
<para>
|
2012-12-07 23:23:56 +00:00
|
|
|
|
Another option you have to get started is to use pre-built binaries.
|
|
|
|
|
The Yocto Project provides many types of binaries with each release.
|
2012-10-22 20:16:49 +00:00
|
|
|
|
See the "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>"
|
2012-07-16 17:53:16 +00:00
|
|
|
|
chapter in the Yocto Project Reference Manual
|
|
|
|
|
for descriptions of the types of binaries that ship with a Yocto Project
|
2012-06-11 16:39:32 +00:00
|
|
|
|
release.
|
2011-07-15 16:23:55 +00:00
|
|
|
|
</para>
|
2011-07-15 14:29:18 +00:00
|
|
|
|
|
2011-07-15 16:23:55 +00:00
|
|
|
|
<para>
|
2012-12-07 23:23:56 +00:00
|
|
|
|
Using a pre-built binary is ideal for developing software applications to run on your
|
|
|
|
|
target hardware.
|
|
|
|
|
To do this, you need to be able to access the appropriate cross-toolchain tarball for
|
|
|
|
|
the architecture on which you are developing.
|
|
|
|
|
If you are using an SDK type image, the image ships with the complete toolchain native to
|
|
|
|
|
the architecture.
|
|
|
|
|
If you are not using an SDK type image, you need to separately download and
|
2012-06-11 16:39:32 +00:00
|
|
|
|
install the stand-alone Yocto Project cross-toolchain tarball.
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
<para>
|
2012-12-07 23:23:56 +00:00
|
|
|
|
Regardless of the type of image you are using, you need to download the pre-built kernel
|
|
|
|
|
that you will boot in the QEMU emulator and then download and extract the target root
|
2012-06-11 16:39:32 +00:00
|
|
|
|
filesystem for your target machine’s architecture.
|
2013-04-09 18:05:03 +00:00
|
|
|
|
You can get architecture-specific binaries and file systems from
|
2012-06-11 16:39:32 +00:00
|
|
|
|
<ulink url='&YOCTO_MACHINES_DL_URL;'>machines</ulink>.
|
2012-09-13 21:01:58 +00:00
|
|
|
|
You can get installation scripts for stand-alone toolchains from
|
2012-06-11 16:39:32 +00:00
|
|
|
|
<ulink url='&YOCTO_TOOLCHAIN_DL_URL;'>toolchains</ulink>.
|
2012-12-07 23:23:56 +00:00
|
|
|
|
Once you have all your files, you set up the environment to emulate the hardware
|
|
|
|
|
by sourcing an environment setup script.
|
2012-06-11 16:39:32 +00:00
|
|
|
|
Finally, you start the QEMU emulator.
|
2012-12-07 23:23:56 +00:00
|
|
|
|
You can find details on all these steps in the
|
2012-03-09 19:40:39 +00:00
|
|
|
|
"<ulink url='&YOCTO_DOCS_QS_URL;#using-pre-built'>Using Pre-Built Binaries and QEMU</ulink>"
|
2012-12-07 23:23:56 +00:00
|
|
|
|
section of the Yocto Project Quick Start.
|
2011-07-15 16:23:55 +00:00
|
|
|
|
</para>
|
2012-06-11 16:39:32 +00:00
|
|
|
|
|
2012-12-07 23:23:56 +00:00
|
|
|
|
<para>
|
2012-06-11 16:39:32 +00:00
|
|
|
|
Using QEMU to emulate your hardware can result in speed issues
|
|
|
|
|
depending on the target and host architecture mix.
|
2012-12-07 23:23:56 +00:00
|
|
|
|
For example, using the <filename>qemux86</filename> image in the emulator
|
|
|
|
|
on an Intel-based 32-bit (x86) host machine is fast because the target and
|
2012-06-11 16:39:32 +00:00
|
|
|
|
host architectures match.
|
|
|
|
|
On the other hand, using the <filename>qemuarm</filename> image on the same Intel-based
|
|
|
|
|
host can be slower.
|
2012-12-07 23:23:56 +00:00
|
|
|
|
But, you still achieve faithful emulation of ARM-specific issues.
|
2012-06-11 16:39:32 +00:00
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
<para>
|
|
|
|
|
To speed things up, the QEMU images support using <filename>distcc</filename>
|
2012-12-07 23:23:56 +00:00
|
|
|
|
to call a cross-compiler outside the emulated system.
|
2012-06-11 16:39:32 +00:00
|
|
|
|
If you used <filename>runqemu</filename> to start QEMU, and the
|
2012-12-07 23:23:56 +00:00
|
|
|
|
<filename>distccd</filename> application is present on the host system, any
|
2012-06-11 16:39:32 +00:00
|
|
|
|
BitBake cross-compiling toolchain available from the build system is automatically
|
|
|
|
|
used from within QEMU simply by calling <filename>distcc</filename>.
|
2012-12-07 23:23:56 +00:00
|
|
|
|
You can accomplish this by defining the cross-compiler variable
|
2012-06-11 16:39:32 +00:00
|
|
|
|
(e.g. <filename>export CC="distcc"</filename>).
|
|
|
|
|
Alternatively, if you are using a suitable SDK image or the appropriate
|
2013-04-09 18:03:31 +00:00
|
|
|
|
stand-alone toolchain is present,
|
2012-06-11 16:39:32 +00:00
|
|
|
|
the toolchain is also automatically used.
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
<note>
|
2012-12-07 23:23:56 +00:00
|
|
|
|
Several mechanisms exist that let you connect to the system running on the
|
2012-06-11 16:39:32 +00:00
|
|
|
|
QEMU emulator:
|
|
|
|
|
<itemizedlist>
|
2012-12-07 23:23:56 +00:00
|
|
|
|
<listitem><para>QEMU provides a framebuffer interface that makes standard
|
2012-06-11 16:39:32 +00:00
|
|
|
|
consoles available.</para></listitem>
|
|
|
|
|
<listitem><para>Generally, headless embedded devices have a serial port.
|
|
|
|
|
If so, you can configure the operating system of the running image
|
2012-12-07 23:23:56 +00:00
|
|
|
|
to use that port to run a console.
|
2012-06-11 16:39:32 +00:00
|
|
|
|
The connection uses standard IP networking.</para></listitem>
|
2014-03-20 14:55:38 +00:00
|
|
|
|
<listitem><para>
|
|
|
|
|
SSH servers exist in some QEMU images.
|
|
|
|
|
The <filename>core-image-sato</filename> QEMU image has a
|
|
|
|
|
Dropbear secure shell (SSH) server that runs with the root
|
|
|
|
|
password disabled.
|
|
|
|
|
The <filename>core-image-full-cmdline</filename> and
|
|
|
|
|
<filename>core-image-lsb</filename> QEMU images
|
2012-08-13 15:15:07 +00:00
|
|
|
|
have OpenSSH instead of Dropbear.
|
2014-03-20 14:55:38 +00:00
|
|
|
|
Including these SSH servers allow you to use standard
|
|
|
|
|
<filename>ssh</filename> and <filename>scp</filename> commands.
|
|
|
|
|
The <filename>core-image-minimal</filename> QEMU image,
|
|
|
|
|
however, contains no SSH server.
|
|
|
|
|
</para></listitem>
|
2012-12-07 23:23:56 +00:00
|
|
|
|
<listitem><para>You can use a provided, user-space NFS server to boot the QEMU session
|
2012-08-14 23:35:54 +00:00
|
|
|
|
using a local copy of the root filesystem on the host.
|
2012-12-07 23:23:56 +00:00
|
|
|
|
In order to make this connection, you must extract a root filesystem tarball by using the
|
2012-08-14 23:35:54 +00:00
|
|
|
|
<filename>runqemu-extract-sdk</filename> command.
|
|
|
|
|
After running the command, you must then point the <filename>runqemu</filename>
|
|
|
|
|
script to the extracted directory instead of a root filesystem image file.</para></listitem>
|
2012-06-11 16:39:32 +00:00
|
|
|
|
</itemizedlist>
|
|
|
|
|
</note>
|
2011-07-15 16:23:55 +00:00
|
|
|
|
</section>
|
2011-07-15 14:29:18 +00:00
|
|
|
|
</chapter>
|
|
|
|
|
<!--
|
|
|
|
|
vim: expandtab tw=80 ts=4
|
|
|
|
|
-->
|