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
|
2012-07-02 16:59:11 +00:00
|
|
|
|
referred to as the OpenEmbedded build system 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
|
2013-10-04 15:56:22 +00:00
|
|
|
|
BitBake, 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>
|
2013-11-12 19:22:10 +00:00
|
|
|
|
<listitem><para><emphasis>Host System:</emphasis>
|
|
|
|
|
You should have a reasonably current 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>
|
2011-08-11 20:55:07 +00:00
|
|
|
|
You should also have about 100 gigabytes of free disk space for building images.
|
|
|
|
|
</para></listitem>
|
2013-11-12 19:22:10 +00:00
|
|
|
|
<listitem><para><emphasis>Packages:</emphasis>
|
|
|
|
|
The OpenEmbedded build system 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-11-12 19:22:10 +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>
|
2013-11-11 18:26:00 +00:00
|
|
|
|
You need a release of the Yocto Project installed locally on
|
|
|
|
|
your development system.
|
|
|
|
|
This local area is referred to as the
|
|
|
|
|
<link linkend='source-directory'>Source Directory</link>
|
|
|
|
|
and is created when you use
|
|
|
|
|
<link linkend='git'>Git</link> to clone a local copy
|
|
|
|
|
of the upstream <filename>poky</filename> repository,
|
2013-11-12 19:22:10 +00:00
|
|
|
|
or when you download an official release of the corresponding
|
|
|
|
|
tarball.</para>
|
2013-11-11 18:26:00 +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
|
2013-11-12 19:22:10 +00:00
|
|
|
|
repository.
|
2013-11-11 18:26:00 +00:00
|
|
|
|
<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>
|
2011-07-15 16:23:55 +00:00
|
|
|
|
<itemizedlist>
|
2013-07-01 05:22:24 +00:00
|
|
|
|
<listitem><para><emphasis>Tarball Extraction:</emphasis>
|
|
|
|
|
If you are not going to contribute back into the Yocto
|
|
|
|
|
Project, you can simply go to the
|
|
|
|
|
<ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>,
|
2013-04-09 17:53:46 +00:00
|
|
|
|
select the "Downloads" tab, and choose what you want.
|
2013-07-01 05:22:24 +00:00
|
|
|
|
Once you have the tarball, just extract it into a
|
2013-04-09 17:53:46 +00:00
|
|
|
|
directory of your choice.</para>
|
2013-07-01 05:22:24 +00:00
|
|
|
|
<para>For example, the following command extracts the
|
2013-04-09 17:53:46 +00:00
|
|
|
|
Yocto Project &DISTRO; release tarball
|
2013-11-12 19:22:10 +00:00
|
|
|
|
into the current working directory and sets up the local
|
|
|
|
|
Source Directory
|
|
|
|
|
with a top-level folder named
|
|
|
|
|
<filename>&YOCTO_POKY;</filename>:
|
2011-09-19 17:16:24 +00:00
|
|
|
|
<literallayout class='monospaced'>
|
2012-03-09 19:40:39 +00:00
|
|
|
|
$ tar xfj &YOCTO_POKY_TARBALL;
|
2011-09-19 17:16:24 +00:00
|
|
|
|
</literallayout></para>
|
2013-11-12 19:22:10 +00:00
|
|
|
|
<para>This method does not produce a local Git
|
|
|
|
|
repository.
|
|
|
|
|
Instead, you simply end up with a snapshot of the
|
|
|
|
|
release.</para></listitem>
|
|
|
|
|
<listitem><para><emphasis>Git Repository Method:</emphasis>
|
|
|
|
|
If you are going to be contributing back into the Yocto
|
|
|
|
|
Project or you simply want to keep up with the latest
|
|
|
|
|
developments, you should use Git commands to set up a
|
|
|
|
|
local Git repository of the upstream
|
|
|
|
|
<filename>poky</filename> source repository.
|
|
|
|
|
Doing so creates a repository with a complete history
|
|
|
|
|
of changes and allows you to easily submit your changes
|
|
|
|
|
upstream to the project.
|
|
|
|
|
Because you clone the repository, you have access to all
|
|
|
|
|
the Yocto Project development branches and tag names
|
|
|
|
|
used in the upstream repository.
|
|
|
|
|
<note>You can view the Yocto Project Source Repositories
|
|
|
|
|
at
|
|
|
|
|
<ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>
|
|
|
|
|
</note></para>
|
|
|
|
|
<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
|
2012-02-17 21:36:02 +00:00
|
|
|
|
"<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'...
|
2013-09-23 20:23:00 +00:00
|
|
|
|
remote: Counting objects: 203728, done.
|
|
|
|
|
remote: Compressing objects: 100% (52371/52371), done.
|
|
|
|
|
remote: Total 203728 (delta 147444), reused 202891 (delta 146614)
|
|
|
|
|
Receiving objects: 100% (203728/203728), 95.54 MiB | 308 KiB/s, done.
|
|
|
|
|
Resolving deltas: 100% (147444/147444), done.
|
2013-11-12 19:22:10 +00:00
|
|
|
|
</literallayout>
|
|
|
|
|
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'>wiki page</ulink>,
|
|
|
|
|
which describes how to create both
|
|
|
|
|
<filename>poky</filename> and
|
|
|
|
|
<filename>meta-intel</filename> Git repositories.
|
|
|
|
|
</para></listitem>
|
2011-07-15 16:23:55 +00:00
|
|
|
|
</itemizedlist></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
|
2012-10-22 20:16:49 +00:00
|
|
|
|
Source Directory (usually <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-11-12 19:22:10 +00:00
|
|
|
|
$ git clone ‐‐bare git://git.yoctoproject.org/linux-yocto-3.10 linux-yocto-3.10.git
|
2013-09-23 20:23:00 +00:00
|
|
|
|
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)
|
|
|
|
|
Receiving objects: 100% (727/727), 536.36 KiB | 102 KiB/s, done.
|
|
|
|
|
Resolving deltas: 100% (260/260), done.
|
|
|
|
|
</literallayout></para></listitem>
|
2012-12-07 23:23:56 +00:00
|
|
|
|
<listitem><para id='supported-board-support-packages-(bsps)'><emphasis>Supported Board
|
|
|
|
|
Support Packages (BSPs):</emphasis>
|
|
|
|
|
The Yocto Project provides a layer called <filename>meta-intel</filename> and
|
2012-03-08 16:31:52 +00:00
|
|
|
|
it is maintained in its own separate Git repository.
|
2012-12-07 23:23:56 +00:00
|
|
|
|
The <filename>meta-intel</filename> layer contains many supported
|
2012-03-09 19:40:39 +00:00
|
|
|
|
<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>.</para>
|
2012-03-08 16:31:52 +00:00
|
|
|
|
<para>Similar considerations exist for setting up the <filename>meta-intel</filename>
|
2012-12-07 23:23:56 +00:00
|
|
|
|
layer.
|
2011-07-27 16:00:46 +00:00
|
|
|
|
You can get set up for BSP development one of two ways: tarball extraction or
|
|
|
|
|
with a local Git repository.
|
2012-10-22 20:16:49 +00:00
|
|
|
|
It is a good idea to use the same method that you used to set up the Source Directory.
|
2012-12-07 23:23:56 +00:00
|
|
|
|
Regardless of the method you use, the Yocto Project uses the following BSP layer
|
2011-07-27 16:00:46 +00:00
|
|
|
|
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>
|
2012-09-28 13:53:21 +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-11-11 15:06:52 +00:00
|
|
|
|
section in the Yocto Project Board Support Package (BSP)
|
2013-11-12 19:22:10 +00:00
|
|
|
|
Developer's Guide for more information on BSP Layers.
|
|
|
|
|
<itemizedlist>
|
|
|
|
|
<listitem><para><emphasis>Tarball Extraction:</emphasis>
|
|
|
|
|
You can download any released BSP tarball from the same
|
|
|
|
|
"Downloads" page of the Yocto Project
|
|
|
|
|
<ulink url='https://www.yoctoproject.org/downloads'>Website</ulink>
|
|
|
|
|
to get the Yocto Project release.
|
|
|
|
|
Once on the "Download" page, look to the right of the
|
|
|
|
|
page and scroll down to find the BSP tarballs.</para>
|
|
|
|
|
<para>Once you have the tarball, just extract it into a
|
|
|
|
|
directory of your choice.
|
|
|
|
|
Again, this method just produces a snapshot of the BSP
|
|
|
|
|
layer in the form of a hierarchical directory
|
|
|
|
|
structure.</para></listitem>
|
|
|
|
|
<listitem><para><emphasis>Git Repository Method:</emphasis>
|
|
|
|
|
If you are working with a local Git repository for your
|
|
|
|
|
Source Directory, you should also use this method to
|
|
|
|
|
set up the <filename>meta-intel</filename> Git
|
|
|
|
|
repository.
|
|
|
|
|
You can locate the <filename>meta-intel</filename> Git
|
|
|
|
|
repository in the "Yocto Metadata Layers" area of the
|
|
|
|
|
Yocto Project Source Repositories at
|
|
|
|
|
<ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>.</para>
|
|
|
|
|
<para>Using
|
|
|
|
|
<link linkend='git'>Git</link> to create a local clone
|
|
|
|
|
of the upstream repository can be helpful if you are
|
|
|
|
|
working with BSPs.
|
|
|
|
|
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>.
|
|
|
|
|
<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'...
|
2013-09-23 20:23:00 +00:00
|
|
|
|
remote: Counting objects: 7366, done.
|
|
|
|
|
remote: Compressing objects: 100% (2491/2491), done.
|
|
|
|
|
remote: Total 7366 (delta 3997), reused 7299 (delta 3930)
|
|
|
|
|
Receiving objects: 100% (7366/7366), 2.31 MiB | 95 KiB/s, done.
|
|
|
|
|
Resolving deltas: 100% (3997/3997), done.
|
2013-11-12 19:22:10 +00:00
|
|
|
|
</literallayout>
|
|
|
|
|
The same
|
2013-09-23 20:23:00 +00:00
|
|
|
|
<ulink url='&YOCTO_WIKI_URL;/wiki/Transcript:_from_git_checkout_to_meta-intel_BSP'>wiki page</ulink>
|
|
|
|
|
referenced earlier covers how to
|
2013-11-12 19:22:10 +00:00
|
|
|
|
set up the <filename>meta-intel</filename> Git
|
|
|
|
|
repository.</para></listitem>
|
2011-07-15 16:23:55 +00:00
|
|
|
|
</itemizedlist></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>
|
2012-12-07 23:23:56 +00:00
|
|
|
|
<listitem><para>Initialize the build environment by sourcing a build environment
|
2011-07-15 16:23:55 +00:00
|
|
|
|
script.</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>
|
2012-02-17 22:09:23 +00:00
|
|
|
|
<listitem><para>Build the image using the <filename>bitbake</filename> command.
|
2013-04-09 18:05:03 +00:00
|
|
|
|
If you want information on BitBake, see the user manual included in the
|
2012-12-07 23:23:56 +00:00
|
|
|
|
<filename>bitbake/doc/manual</filename> directory of the
|
2012-09-04 19:05:21 +00:00
|
|
|
|
<link linkend='source-directory'>Source Directory</link>.</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>
|
2012-08-13 15:15:07 +00:00
|
|
|
|
<listitem><para>SSH servers exist in some QEMU images.
|
2012-12-07 23:23:56 +00:00
|
|
|
|
The <filename>core-image-sato</filename> QEMU image has a Dropbear secure
|
2013-04-09 18:03:31 +00:00
|
|
|
|
shell (SSH) server that runs with the root password disabled.
|
2012-12-07 23:23:56 +00:00
|
|
|
|
The <filename>core-image-basic</filename> and <filename>core-image-lsb</filename> QEMU images
|
2012-08-13 15:15:07 +00:00
|
|
|
|
have OpenSSH instead of Dropbear.
|
2012-12-07 23:23:56 +00:00
|
|
|
|
Including these SSH servers allow you to use standard <filename>ssh</filename> and
|
2012-08-13 15:15:07 +00:00
|
|
|
|
<filename>scp</filename> commands.
|
2013-04-09 18:03:31 +00:00
|
|
|
|
The <filename>core-image-minimal</filename> QEMU image, however, contains no SSH
|
2012-08-13 15:15:07 +00:00
|
|
|
|
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
|
|
|
|
|
-->
|