summaryrefslogtreecommitdiffstats
path: root/documentation/adt-manual
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/adt-manual')
-rw-r--r--documentation/adt-manual/adt-command.rst178
-rw-r--r--documentation/adt-manual/adt-intro.rst136
-rw-r--r--documentation/adt-manual/adt-manual-intro.rst22
-rw-r--r--documentation/adt-manual/adt-manual.rst13
-rw-r--r--documentation/adt-manual/adt-package.rst68
-rw-r--r--documentation/adt-manual/adt-prepare.rst753
6 files changed, 1170 insertions, 0 deletions
diff --git a/documentation/adt-manual/adt-command.rst b/documentation/adt-manual/adt-command.rst
new file mode 100644
index 0000000000..41bc41e149
--- /dev/null
+++ b/documentation/adt-manual/adt-command.rst
@@ -0,0 +1,178 @@
1**********************
2Using the Command Line
3**********************
4
5Recall that earlier the manual discussed how to use an existing
6toolchain tarball that had been installed into the default installation
7directory, ``/opt/poky/DISTRO``, which is outside of the `Build
8Directory <&YOCTO_DOCS_DEV_URL;#build-directory>`__ (see the section
9"`Using a Cross-Toolchain
10Tarball) <#using-an-existing-toolchain-tarball>`__". And, that sourcing
11your architecture-specific environment setup script initializes a
12suitable cross-toolchain development environment.
13
14During this setup, locations for the compiler, QEMU scripts, QEMU
15binary, a special version of ``pkgconfig`` and other useful utilities
16are added to the ``PATH`` variable. Also, variables to assist
17``pkgconfig`` and ``autotools`` are also defined so that, for example,
18``configure.sh`` can find pre-generated test results for tests that need
19target hardware on which to run. You can see the "`Setting Up the
20Cross-Development
21Environment <#setting-up-the-cross-development-environment>`__" section
22for the list of cross-toolchain environment variables established by the
23script.
24
25Collectively, these conditions allow you to easily use the toolchain
26outside of the OpenEmbedded build environment on both Autotools-based
27projects and Makefile-based projects. This chapter provides information
28for both these types of projects.
29
30Autotools-Based Projects
31========================
32
33Once you have a suitable cross-toolchain installed, it is very easy to
34develop a project outside of the OpenEmbedded build system. This section
35presents a simple "Helloworld" example that shows how to set up,
36compile, and run the project.
37
38Creating and Running a Project Based on GNU Autotools
39-----------------------------------------------------
40
41Follow these steps to create a simple Autotools-based project:
42
431. *Create your directory:* Create a clean directory for your project
44 and then make that directory your working location: $ mkdir
45 $HOME/helloworld $ cd $HOME/helloworld
46
472. *Populate the directory:* Create ``hello.c``, ``Makefile.am``, and
48 ``configure.in`` files as follows:
49
50 - For ``hello.c``, include these lines: #include <stdio.h> main() {
51 printf("Hello World!\n"); }
52
53 - For ``Makefile.am``, include these lines: bin_PROGRAMS = hello
54 hello_SOURCES = hello.c
55
56 - For ``configure.in``, include these lines: AC_INIT(hello.c)
57 AM_INIT_AUTOMAKE(hello,0.1) AC_PROG_CC AC_PROG_INSTALL
58 AC_OUTPUT(Makefile)
59
603. *Source the cross-toolchain environment setup file:* Installation of
61 the cross-toolchain creates a cross-toolchain environment setup
62 script in the directory that the ADT was installed. Before you can
63 use the tools to develop your project, you must source this setup
64 script. The script begins with the string "environment-setup" and
65 contains the machine architecture, which is followed by the string
66 "poky-linux". Here is an example that sources a script from the
67 default ADT installation directory that uses the 32-bit Intel x86
68 Architecture and the DISTRO_NAME Yocto Project release: $ source
69 /opt/poky/DISTRO/environment-setup-i586-poky-linux
70
714. *Generate the local aclocal.m4 files and create the configure
72 script:* The following GNU Autotools generate the local
73 ``aclocal.m4`` files and create the configure script: $ aclocal $
74 autoconf
75
765. *Generate files needed by GNU coding standards:* GNU coding
77 standards require certain files in order for the project to be
78 compliant. This command creates those files: $ touch NEWS README
79 AUTHORS ChangeLog
80
816. *Generate the configure file:* This command generates the
82 ``configure``: $ automake -a
83
847. *Cross-compile the project:* This command compiles the project using
85 the cross-compiler. The
86 ```CONFIGURE_FLAGS`` <&YOCTO_DOCS_REF_URL;#var-CONFIGURE_FLAGS>`__
87 environment variable provides the minimal arguments for GNU
88 configure: $ ./configure ${CONFIGURE_FLAGS}
89
908. *Make and install the project:* These two commands generate and
91 install the project into the destination directory: $ make $ make
92 install DESTDIR=./tmp
93
949. *Verify the installation:* This command is a simple way to verify
95 the installation of your project. Running the command prints the
96 architecture on which the binary file can run. This architecture
97 should be the same architecture that the installed cross-toolchain
98 supports. $ file ./tmp/usr/local/bin/hello
99
10010. *Execute your project:* To execute the project in the shell, simply
101 enter the name. You could also copy the binary to the actual target
102 hardware and run the project there as well: $ ./hello As expected,
103 the project displays the "Hello World!" message.
104
105Passing Host Options
106--------------------
107
108For an Autotools-based project, you can use the cross-toolchain by just
109passing the appropriate host option to ``configure.sh``. The host option
110you use is derived from the name of the environment setup script found
111in the directory in which you installed the cross-toolchain. For
112example, the host option for an ARM-based target that uses the GNU EABI
113is ``armv5te-poky-linux-gnueabi``. You will notice that the name of the
114script is ``environment-setup-armv5te-poky-linux-gnueabi``. Thus, the
115following command works to update your project and rebuild it using the
116appropriate cross-toolchain tools: $ ./configure
117--host=armv5te-poky-linux-gnueabi \\ --with-libtool-sysroot=sysroot_dir
118
119.. note::
120
121 If the
122 configure
123 script results in problems recognizing the
124 --with-libtool-sysroot=
125 sysroot-dir
126 option, regenerate the script to enable the support by doing the
127 following and then run the script again:
128 ::
129
130 $ libtoolize --automake
131 $ aclocal -I ${OECORE_NATIVE_SYSROOT}/usr/share/aclocal \
132 [-I dir_containing_your_project-specific_m4_macros]
133 $ autoconf
134 $ autoheader
135 $ automake -a
136
137
138Makefile-Based Projects
139=======================
140
141For Makefile-based projects, the cross-toolchain environment variables
142established by running the cross-toolchain environment setup script are
143subject to general ``make`` rules.
144
145To illustrate this, consider the following four cross-toolchain
146environment variables:
147`CC <&YOCTO_DOCS_REF_URL;#var-CC>`__\ =i586-poky-linux-gcc -m32
148-march=i586 --sysroot=/opt/poky/1.8/sysroots/i586-poky-linux
149`LD <&YOCTO_DOCS_REF_URL;#var-LD>`__\ =i586-poky-linux-ld
150--sysroot=/opt/poky/1.8/sysroots/i586-poky-linux
151`CFLAGS <&YOCTO_DOCS_REF_URL;#var-CFLAGS>`__\ =-O2 -pipe -g
152-feliminate-unused-debug-types
153`CXXFLAGS <&YOCTO_DOCS_REF_URL;#var-CXXFLAGS>`__\ =-O2 -pipe -g
154-feliminate-unused-debug-types Now, consider the following three cases:
155
156- *Case 1 - No Variables Set in the ``Makefile``:* Because these
157 variables are not specifically set in the ``Makefile``, the variables
158 retain their values based on the environment.
159
160- *Case 2 - Variables Set in the ``Makefile``:* Specifically setting
161 variables in the ``Makefile`` during the build results in the
162 environment settings of the variables being overwritten.
163
164- *Case 3 - Variables Set when the ``Makefile`` is Executed from the
165 Command Line:* Executing the ``Makefile`` from the command line
166 results in the variables being overwritten with command-line content
167 regardless of what is being set in the ``Makefile``. In this case,
168 environment variables are not considered unless you use the "-e" flag
169 during the build: $ make -e file If you use this flag, then the
170 environment values of the variables override any variables
171 specifically set in the ``Makefile``.
172
173.. note::
174
175 For the list of variables set up by the cross-toolchain environment
176 setup script, see the "
177 Setting Up the Cross-Development Environment
178 " section.
diff --git a/documentation/adt-manual/adt-intro.rst b/documentation/adt-manual/adt-intro.rst
new file mode 100644
index 0000000000..4e44afacbe
--- /dev/null
+++ b/documentation/adt-manual/adt-intro.rst
@@ -0,0 +1,136 @@
1*****************************************
2The Application Development Toolkit (ADT)
3*****************************************
4
5Part of the Yocto Project development solution is an Application
6Development Toolkit (ADT). The ADT provides you with a custom-built,
7cross-development platform suited for developing a user-targeted product
8application.
9
10Fundamentally, the ADT consists of the following:
11
12- An architecture-specific cross-toolchain and matching sysroot both
13 built by the `OpenEmbedded build
14 system <&YOCTO_DOCS_DEV_URL;#build-system-term>`__. The toolchain and
15 sysroot are based on a `Metadata <&YOCTO_DOCS_DEV_URL;#metadata>`__
16 configuration and extensions, which allows you to cross-develop on
17 the host machine for the target hardware.
18
19- The Eclipse IDE Yocto Plug-in.
20
21- The Quick EMUlator (QEMU), which lets you simulate target hardware.
22
23- Various user-space tools that greatly enhance your application
24 development experience.
25
26The Cross-Development Toolchain
27===============================
28
29The `Cross-Development
30Toolchain <&YOCTO_DOCS_DEV_URL;#cross-development-toolchain>`__ consists
31of a cross-compiler, cross-linker, and cross-debugger that are used to
32develop user-space applications for targeted hardware. This toolchain is
33created either by running the ADT Installer script, a toolchain
34installer script, or through a `Build
35Directory <&YOCTO_DOCS_DEV_URL;#build-directory>`__ that is based on
36your Metadata configuration or extension for your targeted device. The
37cross-toolchain works with a matching target sysroot.
38
39Sysroot
40=======
41
42The matching target sysroot contains needed headers and libraries for
43generating binaries that run on the target architecture. The sysroot is
44based on the target root filesystem image that is built by the
45OpenEmbedded build system and uses the same Metadata configuration used
46to build the cross-toolchain.
47
48.. _eclipse-overview:
49
50Eclipse Yocto Plug-in
51=====================
52
53The Eclipse IDE is a popular development environment and it fully
54supports development using the Yocto Project. When you install and
55configure the Eclipse Yocto Project Plug-in into the Eclipse IDE, you
56maximize your Yocto Project experience. Installing and configuring the
57Plug-in results in an environment that has extensions specifically
58designed to let you more easily develop software. These extensions allow
59for cross-compilation, deployment, and execution of your output into a
60QEMU emulation session. You can also perform cross-debugging and
61profiling. The environment also supports a suite of tools that allows
62you to perform remote profiling, tracing, collection of power data,
63collection of latency data, and collection of performance data.
64
65For information about the application development workflow that uses the
66Eclipse IDE and for a detailed example of how to install and configure
67the Eclipse Yocto Project Plug-in, see the "`Working Within
68Eclipse <&YOCTO_DOCS_DEV_URL;#adt-eclipse>`__" section of the Yocto
69Project Development Manual.
70
71The QEMU Emulator
72=================
73
74The QEMU emulator allows you to simulate your hardware while running
75your application or image. QEMU is made available a number of ways:
76
77- If you use the ADT Installer script to install ADT, you can specify
78 whether or not to install QEMU.
79
80- If you have cloned the ``poky`` Git repository to create a `Source
81 Directory <&YOCTO_DOCS_DEV_URL;#source-directory>`__ and you have
82 sourced the environment setup script, QEMU is installed and
83 automatically available.
84
85- If you have downloaded a Yocto Project release and unpacked it to
86 create a `Source Directory <&YOCTO_DOCS_DEV_URL;#source-directory>`__
87 and you have sourced the environment setup script, QEMU is installed
88 and automatically available.
89
90- If you have installed the cross-toolchain tarball and you have
91 sourced the toolchain's setup environment script, QEMU is also
92 installed and automatically available.
93
94User-Space Tools
95================
96
97User-space tools are included as part of the Yocto Project. You will
98find these tools helpful during development. The tools include
99LatencyTOP, PowerTOP, OProfile, Perf, SystemTap, and Lttng-ust. These
100tools are common development tools for the Linux platform.
101
102- *LatencyTOP:* LatencyTOP focuses on latency that causes skips in
103 audio, stutters in your desktop experience, or situations that
104 overload your server even when you have plenty of CPU power left.
105
106- *PowerTOP:* Helps you determine what software is using the most
107 power. You can find out more about PowerTOP at
108 ` <https://01.org/powertop/>`__.
109
110- *OProfile:* A system-wide profiler for Linux systems that is capable
111 of profiling all running code at low overhead. You can find out more
112 about OProfile at ` <http://oprofile.sourceforge.net/about/>`__. For
113 examples on how to setup and use this tool, see the
114 "`OProfile <&YOCTO_DOCS_PROF_URL;#profile-manual-oprofile>`__"
115 section in the Yocto Project Profiling and Tracing Manual.
116
117- *Perf:* Performance counters for Linux used to keep track of certain
118 types of hardware and software events. For more information on these
119 types of counters see ` <https://perf.wiki.kernel.org/>`__. For
120 examples on how to setup and use this tool, see the
121 "`perf <&YOCTO_DOCS_PROF_URL;#profile-manual-perf>`__" section in the
122 Yocto Project Profiling and Tracing Manual.
123
124- *SystemTap:* A free software infrastructure that simplifies
125 information gathering about a running Linux system. This information
126 helps you diagnose performance or functional problems. SystemTap is
127 not available as a user-space tool through the Eclipse IDE Yocto
128 Plug-in. See ` <http://sourceware.org/systemtap>`__ for more
129 information on SystemTap. For examples on how to setup and use this
130 tool, see the
131 "`SystemTap <&YOCTO_DOCS_PROF_URL;#profile-manual-systemtap>`__"
132 section in the Yocto Project Profiling and Tracing Manual.
133
134- *Lttng-ust:* A User-space Tracer designed to provide detailed
135 information on user-space activity. See ` <http://lttng.org/ust>`__
136 for more information on Lttng-ust.
diff --git a/documentation/adt-manual/adt-manual-intro.rst b/documentation/adt-manual/adt-manual-intro.rst
new file mode 100644
index 0000000000..6e914dc8ef
--- /dev/null
+++ b/documentation/adt-manual/adt-manual-intro.rst
@@ -0,0 +1,22 @@
1************
2Introduction
3************
4
5Welcome to the Yocto Project Application Developer's Guide. This manual
6provides information that lets you begin developing applications using
7the Yocto Project.
8
9The Yocto Project provides an application development environment based
10on an Application Development Toolkit (ADT) and the availability of
11stand-alone cross-development toolchains and other tools. This manual
12describes the ADT and how you can configure and install it, how to
13access and use the cross-development toolchains, how to customize the
14development packages installation, how to use command-line development
15for both Autotools-based and Makefile-based projects, and an
16introduction to the Eclipse IDE Yocto Plug-in.
17
18.. note::
19
20 The ADT is distribution-neutral and does not require the Yocto
21 Project reference distribution, which is called Poky. This manual,
22 however, uses examples that use the Poky distribution.
diff --git a/documentation/adt-manual/adt-manual.rst b/documentation/adt-manual/adt-manual.rst
new file mode 100644
index 0000000000..d53c38b550
--- /dev/null
+++ b/documentation/adt-manual/adt-manual.rst
@@ -0,0 +1,13 @@
1===========================================
2Yocto Project Application Developer's Guide
3===========================================
4
5.. toctree::
6 :caption: Table of Contents
7 :numbered:
8
9 adt-manual-intro
10 adt-intro
11 adt-prepare
12 adt-package
13 adt-command
diff --git a/documentation/adt-manual/adt-package.rst b/documentation/adt-manual/adt-package.rst
new file mode 100644
index 0000000000..6a6da1dd8f
--- /dev/null
+++ b/documentation/adt-manual/adt-package.rst
@@ -0,0 +1,68 @@
1************************************************************
2Optionally Customizing the Development Packages Installation
3************************************************************
4
5Because the Yocto Project is suited for embedded Linux development, it
6is likely that you will need to customize your development packages
7installation. For example, if you are developing a minimal image, then
8you might not need certain packages (e.g. graphics support packages).
9Thus, you would like to be able to remove those packages from your
10target sysroot.
11
12Package Management Systems
13==========================
14
15The OpenEmbedded build system supports the generation of sysroot files
16using three different Package Management Systems (PMS):
17
18- *OPKG:* A less well known PMS whose use originated in the
19 OpenEmbedded and OpenWrt embedded Linux projects. This PMS works with
20 files packaged in an ``.ipk`` format. See
21 ` <http://en.wikipedia.org/wiki/Opkg>`__ for more information about
22 OPKG.
23
24- *RPM:* A more widely known PMS intended for GNU/Linux distributions.
25 This PMS works with files packaged in an ``.rpm`` format. The build
26 system currently installs through this PMS by default. See
27 ` <http://en.wikipedia.org/wiki/RPM_Package_Manager>`__ for more
28 information about RPM.
29
30- *Debian:* The PMS for Debian-based systems is built on many PMS
31 tools. The lower-level PMS tool ``dpkg`` forms the base of the Debian
32 PMS. For information on dpkg see
33 ` <http://en.wikipedia.org/wiki/Dpkg>`__.
34
35Configuring the PMS
36===================
37
38Whichever PMS you are using, you need to be sure that the
39```PACKAGE_CLASSES`` <&YOCTO_DOCS_REF_URL;#var-PACKAGE_CLASSES>`__
40variable in the ``conf/local.conf`` file is set to reflect that system.
41The first value you choose for the variable specifies the package file
42format for the root filesystem at sysroot. Additional values specify
43additional formats for convenience or testing. See the
44``conf/local.conf`` configuration file for details.
45
46.. note::
47
48 For build performance information related to the PMS, see the "
49 package.bbclass
50 " section in the Yocto Project Reference Manual.
51
52As an example, consider a scenario where you are using OPKG and you want
53to add the ``libglade`` package to the target sysroot.
54
55First, you should generate the IPK file for the ``libglade`` package and
56add it into a working ``opkg`` repository. Use these commands: $ bitbake
57libglade $ bitbake package-index
58
59Next, source the cross-toolchain environment setup script found in the
60`Source Directory <&YOCTO_DOCS_DEV_URL;#source-directory>`__. Follow
61that by setting up the installation destination to point to your sysroot
62as sysroot_dir. Finally, have an OPKG configuration file conf_file that
63corresponds to the ``opkg`` repository you have just created. The
64following command forms should now work: $ opkg-cl –f conf_file -o
65sysroot_dir update $ opkg-cl –f cconf_file -o sysroot_dir \\
66--force-overwrite install libglade $ opkg-cl –f cconf_file -o
67sysroot_dir \\ --force-overwrite install libglade-dbg $ opkg-cl –f
68conf_file> -osysroot_dir> \\ --force-overwrite install libglade-dev
diff --git a/documentation/adt-manual/adt-prepare.rst b/documentation/adt-manual/adt-prepare.rst
new file mode 100644
index 0000000000..fa7657c616
--- /dev/null
+++ b/documentation/adt-manual/adt-prepare.rst
@@ -0,0 +1,753 @@
1*************************************
2Preparing for Application Development
3*************************************
4
5In order to develop applications, you need set up your host development
6system. Several ways exist that allow you to install cross-development
7tools, QEMU, the Eclipse Yocto Plug-in, and other tools. This chapter
8describes how to prepare for application development.
9
10.. _installing-the-adt:
11
12Installing the ADT and Toolchains
13=================================
14
15The following list describes installation methods that set up varying
16degrees of tool availability on your system. Regardless of the
17installation method you choose, you must ``source`` the cross-toolchain
18environment setup script, which establishes several key environment
19variables, before you use a toolchain. See the "`Setting Up the
20Cross-Development
21Environment <#setting-up-the-cross-development-environment>`__" section
22for more information.
23
24.. note::
25
26 Avoid mixing installation methods when installing toolchains for
27 different architectures. For example, avoid using the ADT Installer
28 to install some toolchains and then hand-installing cross-development
29 toolchains by running the toolchain installer for different
30 architectures. Mixing installation methods can result in situations
31 where the ADT Installer becomes unreliable and might not install the
32 toolchain.
33
34 If you must mix installation methods, you might avoid problems by
35 deleting ``/var/lib/opkg``, thus purging the ``opkg`` package
36 metadata.
37
38- *Use the ADT installer script:* This method is the recommended way to
39 install the ADT because it automates much of the process for you. For
40 example, you can configure the installation to install the QEMU
41 emulator and the user-space NFS, specify which root filesystem
42 profiles to download, and define the target sysroot location.
43
44- *Use an existing toolchain:* Using this method, you select and
45 download an architecture-specific toolchain installer and then run
46 the script to hand-install the toolchain. If you use this method, you
47 just get the cross-toolchain and QEMU - you do not get any of the
48 other mentioned benefits had you run the ADT Installer script.
49
50- *Use the toolchain from within the Build Directory:* If you already
51 have a `Build Directory <&YOCTO_DOCS_DEV_URL;#build-directory>`__,
52 you can build the cross-toolchain within the directory. However, like
53 the previous method mentioned, you only get the cross-toolchain and
54 QEMU - you do not get any of the other benefits without taking
55 separate steps.
56
57Using the ADT Installer
58-----------------------
59
60To run the ADT Installer, you need to get the ADT Installer tarball, be
61sure you have the necessary host development packages that support the
62ADT Installer, and then run the ADT Installer Script.
63
64For a list of the host packages needed to support ADT installation and
65use, see the "ADT Installer Extras" lists in the "`Required Packages for
66the Host Development
67System <&YOCTO_DOCS_REF_URL;#required-packages-for-the-host-development-system>`__"
68section of the Yocto Project Reference Manual.
69
70Getting the ADT Installer Tarball
71~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72
73The ADT Installer is contained in the ADT Installer tarball. You can get
74the tarball using either of these methods:
75
76- *Download the Tarball:* You can download the tarball from
77 ` <&YOCTO_ADTINSTALLER_DL_URL;>`__ into any directory.
78
79- *Build the Tarball:* You can use
80 `BitBake <&YOCTO_DOCS_DEV_URL;#bitbake-term>`__ to generate the
81 tarball inside an existing `Build
82 Directory <&YOCTO_DOCS_DEV_URL;#build-directory>`__.
83
84 If you use BitBake to generate the ADT Installer tarball, you must
85 ``source`` the environment setup script
86 (````` <&YOCTO_DOCS_REF_URL;#structure-core-script>`__ or
87 ```oe-init-build-env-memres`` <&YOCTO_DOCS_REF_URL;#structure-memres-core-script>`__)
88 located in the Source Directory before running the ``bitbake``
89 command that creates the tarball.
90
91 The following example commands establish the `Source
92 Directory <&YOCTO_DOCS_DEV_URL;#source-directory>`__, check out the
93 current release branch, set up the build environment while also
94 creating the default Build Directory, and run the ``bitbake`` command
95 that results in the tarball
96 ``poky/build/tmp/deploy/sdk/adt_installer.tar.bz2``:
97
98 .. note::
99
100 Before using BitBake to build the ADT tarball, be sure to make
101 sure your
102 local.conf
103 file is properly configured. See the "
104 User Configuration
105 " section in the Yocto Project Reference Manual for general
106 configuration information.
107
108 $ cd ~ $ git clone git://git.yoctoproject.org/poky $ cd poky $ git
109 checkout -b DISTRO_NAME origin/DISTRO_NAME $ source OE_INIT_FILE $
110 bitbake adt-installer
111
112Configuring and Running the ADT Installer Script
113~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
114
115Before running the ADT Installer script, you need to unpack the tarball.
116You can unpack the tarball in any directory you wish. For example, this
117command copies the ADT Installer tarball from where it was built into
118the home directory and then unpacks the tarball into a top-level
119directory named ``adt-installer``: $ cd ~ $ cp
120poky/build/tmp/deploy/sdk/adt_installer.tar.bz2 $HOME $ tar -xjf
121adt_installer.tar.bz2 Unpacking it creates the directory
122``adt-installer``, which contains the ADT Installer script
123(``adt_installer``) and its configuration file (``adt_installer.conf``).
124
125Before you run the script, however, you should examine the ADT Installer
126configuration file and be sure you are going to get what you want. Your
127configurations determine which kernel and filesystem image are
128downloaded.
129
130The following list describes the configurations you can define for the
131ADT Installer. For configuration values and restrictions, see the
132comments in the ``adt-installer.conf`` file:
133
134- ``YOCTOADT_REPO``: This area includes the IPKG-based packages and the
135 root filesystem upon which the installation is based. If you want to
136 set up your own IPKG repository pointed to by ``YOCTOADT_REPO``, you
137 need to be sure that the directory structure follows the same layout
138 as the reference directory set up at
139 ` <http://adtrepo.yoctoproject.org>`__. Also, your repository needs
140 to be accessible through HTTP.
141
142- ``YOCTOADT_TARGETS``: The machine target architectures for which you
143 want to set up cross-development environments.
144
145- ``YOCTOADT_QEMU``: Indicates whether or not to install the emulator
146 QEMU.
147
148- ``YOCTOADT_NFS_UTIL``: Indicates whether or not to install user-mode
149 NFS. If you plan to use the Eclipse IDE Yocto plug-in against QEMU,
150 you should install NFS.
151
152 .. note::
153
154 To boot QEMU images using our userspace NFS server, you need to be
155 running
156 portmap
157 or
158 rpcbind
159 . If you are running
160 rpcbind
161 , you will also need to add the
162 -i
163 option when
164 rpcbind
165 starts up. Please make sure you understand the security
166 implications of doing this. You might also have to modify your
167 firewall settings to allow NFS booting to work.
168
169- ``YOCTOADT_ROOTFS_``\ arch: The root filesystem images you want to
170 download from the ``YOCTOADT_IPKG_REPO`` repository.
171
172- ``YOCTOADT_TARGET_SYSROOT_IMAGE_``\ arch: The particular root
173 filesystem used to extract and create the target sysroot. The value
174 of this variable must have been specified with
175 ``YOCTOADT_ROOTFS_``\ arch. For example, if you downloaded both
176 ``minimal`` and ``sato-sdk`` images by setting
177 ``YOCTOADT_ROOTFS_``\ arch to "minimal sato-sdk", then
178 ``YOCTOADT_ROOTFS_``\ arch must be set to either "minimal" or
179 "sato-sdk".
180
181- ``YOCTOADT_TARGET_SYSROOT_LOC_``\ arch: The location on the
182 development host where the target sysroot is created.
183
184After you have configured the ``adt_installer.conf`` file, run the
185installer using the following command: $ cd adt-installer $
186./adt_installer Once the installer begins to run, you are asked to enter
187the location for cross-toolchain installation. The default location is
188``/opt/poky/``\ release. After either accepting the default location or
189selecting your own location, you are prompted to run the installation
190script interactively or in silent mode. If you want to closely monitor
191the installation, choose “I” for interactive mode rather than “S” for
192silent mode. Follow the prompts from the script to complete the
193installation.
194
195Once the installation completes, the ADT, which includes the
196cross-toolchain, is installed in the selected installation directory.
197You will notice environment setup files for the cross-toolchain in the
198installation directory, and image tarballs in the ``adt-installer``
199directory according to your installer configurations, and the target
200sysroot located according to the ``YOCTOADT_TARGET_SYSROOT_LOC_``\ arch
201variable also in your configuration file.
202
203.. _using-an-existing-toolchain-tarball:
204
205Using a Cross-Toolchain Tarball
206-------------------------------
207
208If you want to simply install a cross-toolchain by hand, you can do so
209by running the toolchain installer. The installer includes the pre-built
210cross-toolchain, the ``runqemu`` script, and support files. If you use
211this method to install the cross-toolchain, you might still need to
212install the target sysroot by installing and extracting it separately.
213For information on how to install the sysroot, see the "`Extracting the
214Root Filesystem <#extracting-the-root-filesystem>`__" section.
215
216Follow these steps:
217
2181. *Get your toolchain installer using one of the following methods:*
219
220 - Go to ` <&YOCTO_TOOLCHAIN_DL_URL;>`__ and find the folder that
221 matches your host development system (i.e. ``i686`` for 32-bit
222 machines or ``x86_64`` for 64-bit machines).
223
224 Go into that folder and download the toolchain installer whose
225 name includes the appropriate target architecture. The toolchains
226 provided by the Yocto Project are based off of the
227 ``core-image-sato`` image and contain libraries appropriate for
228 developing against that image. For example, if your host
229 development system is a 64-bit x86 system and you are going to use
230 your cross-toolchain for a 32-bit x86 target, go into the
231 ``x86_64`` folder and download the following installer:
232 poky-glibc-x86_64-core-image-sato-i586-toolchain-DISTRO.sh
233
234 - Build your own toolchain installer. For cases where you cannot use
235 an installer from the download area, you can build your own as
236 described in the "`Optionally Building a Toolchain
237 Installer <#optionally-building-a-toolchain-installer>`__"
238 section.
239
2402. *Once you have the installer, run it to install the toolchain:*
241
242 .. note::
243
244 You must change the permissions on the toolchain installer script
245 so that it is executable.
246
247 The following command shows how to run the installer given a
248 toolchain tarball for a 64-bit x86 development host system and a
249 32-bit x86 target architecture. The example assumes the toolchain
250 installer is located in ``~/Downloads/``. $
251 ~/Downloads/poky-glibc-x86_64-core-image-sato-i586-toolchain-DISTRO.sh
252 The first thing the installer prompts you for is the directory into
253 which you want to install the toolchain. The default directory used
254 is ``/opt/poky/DISTRO``. If you do not have write permissions for the
255 directory into which you are installing the toolchain, the toolchain
256 installer notifies you and exits. Be sure you have write permissions
257 in the directory and run the installer again.
258
259 When the script finishes, the cross-toolchain is installed. You will
260 notice environment setup files for the cross-toolchain in the
261 installation directory.
262
263.. _using-the-toolchain-from-within-the-build-tree:
264
265Using BitBake and the Build Directory
266-------------------------------------
267
268A final way of making the cross-toolchain available is to use BitBake to
269generate the toolchain within an existing `Build
270Directory <&YOCTO_DOCS_DEV_URL;#build-directory>`__. This method does
271not install the toolchain into the default ``/opt`` directory. As with
272the previous method, if you need to install the target sysroot, you must
273do that separately as well.
274
275Follow these steps to generate the toolchain into the Build Directory:
276
2771. *Set up the Build Environment:* Source the OpenEmbedded build
278 environment setup script (i.e.
279 ````` <&YOCTO_DOCS_REF_URL;#structure-core-script>`__ or
280 ```oe-init-build-env-memres`` <&YOCTO_DOCS_REF_URL;#structure-memres-core-script>`__)
281 located in the `Source
282 Directory <&YOCTO_DOCS_DEV_URL;#source-directory>`__.
283
2842. *Check your Local Configuration File:* At this point, you should be
285 sure that the ```MACHINE`` <&YOCTO_DOCS_REF_URL;#var-MACHINE>`__
286 variable in the ``local.conf`` file found in the ``conf`` directory
287 of the Build Directory is set for the target architecture. Comments
288 within the ``local.conf`` file list the values you can use for the
289 ``MACHINE`` variable. If you do not change the ``MACHINE`` variable,
290 the OpenEmbedded build system uses ``qemux86`` as the default target
291 machine when building the cross-toolchain.
292
293 .. note::
294
295 You can populate the Build Directory with the cross-toolchains for
296 more than a single architecture. You just need to edit the
297 MACHINE
298 variable in the
299 local.conf
300 file and re-run the
301 bitbake
302 command.
303
3043. *Make Sure Your Layers are Enabled:* Examine the
305 ``conf/bblayers.conf`` file and make sure that you have enabled all
306 the compatible layers for your target machine. The OpenEmbedded build
307 system needs to be aware of each layer you want included when
308 building images and cross-toolchains. For information on how to
309 enable a layer, see the "`Enabling Your
310 Layer <&YOCTO_DOCS_DEV_URL;#enabling-your-layer>`__" section in the
311 Yocto Project Development Manual.
312
3134. *Generate the Cross-Toolchain:* Run ``bitbake meta-ide-support`` to
314 complete the cross-toolchain generation. Once the ``bitbake`` command
315 finishes, the cross-toolchain is generated and populated within the
316 Build Directory. You will notice environment setup files for the
317 cross-toolchain that contain the string "``environment-setup``" in
318 the Build Directory's ``tmp`` folder.
319
320 Be aware that when you use this method to install the toolchain, you
321 still need to separately extract and install the sysroot filesystem.
322 For information on how to do this, see the "`Extracting the Root
323 Filesystem <#extracting-the-root-filesystem>`__" section.
324
325Setting Up the Cross-Development Environment
326============================================
327
328Before you can develop using the cross-toolchain, you need to set up the
329cross-development environment by sourcing the toolchain's environment
330setup script. If you used the ADT Installer or hand-installed
331cross-toolchain, then you can find this script in the directory you
332chose for installation. For this release, the default installation
333directory is ````. If you installed the toolchain in the `Build
334Directory <&YOCTO_DOCS_DEV_URL;#build-directory>`__, you can find the
335environment setup script for the toolchain in the Build Directory's
336``tmp`` directory.
337
338Be sure to run the environment setup script that matches the
339architecture for which you are developing. Environment setup scripts
340begin with the string "``environment-setup``" and include as part of
341their name the architecture. For example, the toolchain environment
342setup script for a 64-bit IA-based architecture installed in the default
343installation directory would be the following:
344YOCTO_ADTPATH_DIR/environment-setup-x86_64-poky-linux When you run the
345setup script, many environment variables are defined:
346```SDKTARGETSYSROOT`` <&YOCTO_DOCS_REF_URL;#var-SDKTARGETSYSROOT>`__ -
347The path to the sysroot used for cross-compilation
348```PKG_CONFIG_PATH`` <&YOCTO_DOCS_REF_URL;#var-PKG_CONFIG_PATH>`__ - The
349path to the target pkg-config files
350```CONFIG_SITE`` <&YOCTO_DOCS_REF_URL;#var-CONFIG_SITE>`__ - A GNU
351autoconf site file preconfigured for the target
352```CC`` <&YOCTO_DOCS_REF_URL;#var-CC>`__ - The minimal command and
353arguments to run the C compiler
354```CXX`` <&YOCTO_DOCS_REF_URL;#var-CXX>`__ - The minimal command and
355arguments to run the C++ compiler
356```CPP`` <&YOCTO_DOCS_REF_URL;#var-CPP>`__ - The minimal command and
357arguments to run the C preprocessor
358```AS`` <&YOCTO_DOCS_REF_URL;#var-AS>`__ - The minimal command and
359arguments to run the assembler ```LD`` <&YOCTO_DOCS_REF_URL;#var-LD>`__
360- The minimal command and arguments to run the linker
361```GDB`` <&YOCTO_DOCS_REF_URL;#var-GDB>`__ - The minimal command and
362arguments to run the GNU Debugger
363```STRIP`` <&YOCTO_DOCS_REF_URL;#var-STRIP>`__ - The minimal command and
364arguments to run 'strip', which strips symbols
365```RANLIB`` <&YOCTO_DOCS_REF_URL;#var-RANLIB>`__ - The minimal command
366and arguments to run 'ranlib'
367```OBJCOPY`` <&YOCTO_DOCS_REF_URL;#var-OBJCOPY>`__ - The minimal command
368and arguments to run 'objcopy'
369```OBJDUMP`` <&YOCTO_DOCS_REF_URL;#var-OBJDUMP>`__ - The minimal command
370and arguments to run 'objdump' ```AR`` <&YOCTO_DOCS_REF_URL;#var-AR>`__
371- The minimal command and arguments to run 'ar'
372```NM`` <&YOCTO_DOCS_REF_URL;#var-NM>`__ - The minimal command and
373arguments to run 'nm'
374```TARGET_PREFIX`` <&YOCTO_DOCS_REF_URL;#var-TARGET_PREFIX>`__ - The
375toolchain binary prefix for the target tools
376```CROSS_COMPILE`` <&YOCTO_DOCS_REF_URL;#var-CROSS_COMPILE>`__ - The
377toolchain binary prefix for the target tools
378```CONFIGURE_FLAGS`` <&YOCTO_DOCS_REF_URL;#var-CONFIGURE_FLAGS>`__ - The
379minimal arguments for GNU configure
380```CFLAGS`` <&YOCTO_DOCS_REF_URL;#var-CFLAGS>`__ - Suggested C flags
381```CXXFLAGS`` <&YOCTO_DOCS_REF_URL;#var-CXXFLAGS>`__ - Suggested C++
382flags ```LDFLAGS`` <&YOCTO_DOCS_REF_URL;#var-LDFLAGS>`__ - Suggested
383linker flags when you use CC to link
384```CPPFLAGS`` <&YOCTO_DOCS_REF_URL;#var-CPPFLAGS>`__ - Suggested
385preprocessor flags
386
387Securing Kernel and Filesystem Images
388=====================================
389
390You will need to have a kernel and filesystem image to boot using your
391hardware or the QEMU emulator. Furthermore, if you plan on booting your
392image using NFS or you want to use the root filesystem as the target
393sysroot, you need to extract the root filesystem.
394
395Getting the Images
396------------------
397
398To get the kernel and filesystem images, you either have to build them
399or download pre-built versions. For an example of how to build these
400images, see the "`Buiding
401Images <&YOCTO_DOCS_QS_URL;#qs-buiding-images>`__" section of the Yocto
402Project Quick Start. For an example of downloading pre-build versions,
403see the "`Example Using Pre-Built Binaries and
404QEMU <#using-pre-built>`__" section.
405
406The Yocto Project ships basic kernel and filesystem images for several
407architectures (``x86``, ``x86-64``, ``mips``, ``powerpc``, and ``arm``)
408that you can use unaltered in the QEMU emulator. These kernel images
409reside in the release area - ` <&YOCTO_MACHINES_DL_URL;>`__ and are
410ideal for experimentation using Yocto Project. For information on the
411image types you can build using the OpenEmbedded build system, see the
412"`Images <&YOCTO_DOCS_REF_URL;#ref-images>`__" chapter in the Yocto
413Project Reference Manual.
414
415If you are planning on developing against your image and you are not
416building or using one of the Yocto Project development images (e.g.
417``core-image-*-dev``), you must be sure to include the development
418packages as part of your image recipe.
419
420If you plan on remotely deploying and debugging your application from
421within the Eclipse IDE, you must have an image that contains the Yocto
422Target Communication Framework (TCF) agent (``tcf-agent``). You can do
423this by including the ``eclipse-debug`` image feature.
424
425.. note::
426
427 See the "
428 Image Features
429 " section in the Yocto Project Reference Manual for information on
430 image features.
431
432To include the ``eclipse-debug`` image feature, modify your
433``local.conf`` file in the `Build
434Directory <&YOCTO_DOCS_DEV_URL;#build-directory>`__ so that the
435```EXTRA_IMAGE_FEATURES`` <&YOCTO_DOCS_REF_URL;#var-EXTRA_IMAGE_FEATURES>`__
436variable includes the "eclipse-debug" feature. After modifying the
437configuration file, you can rebuild the image. Once the image is
438rebuilt, the ``tcf-agent`` will be included in the image and is launched
439automatically after the boot.
440
441Extracting the Root Filesystem
442------------------------------
443
444If you install your toolchain by hand or build it using BitBake and you
445need a root filesystem, you need to extract it separately. If you use
446the ADT Installer to install the ADT, the root filesystem is
447automatically extracted and installed.
448
449Here are some cases where you need to extract the root filesystem:
450
451- You want to boot the image using NFS.
452
453- You want to use the root filesystem as the target sysroot. For
454 example, the Eclipse IDE environment with the Eclipse Yocto Plug-in
455 installed allows you to use QEMU to boot under NFS.
456
457- You want to develop your target application using the root filesystem
458 as the target sysroot.
459
460To extract the root filesystem, first ``source`` the cross-development
461environment setup script to establish necessary environment variables.
462If you built the toolchain in the Build Directory, you will find the
463toolchain environment script in the ``tmp`` directory. If you installed
464the toolchain by hand, the environment setup script is located in
465``/opt/poky/DISTRO``.
466
467After sourcing the environment script, use the ``runqemu-extract-sdk``
468command and provide the filesystem image.
469
470Following is an example. The second command sets up the environment. In
471this case, the setup script is located in the ``/opt/poky/DISTRO``
472directory. The third command extracts the root filesystem from a
473previously built filesystem that is located in the ``~/Downloads``
474directory. Furthermore, this command extracts the root filesystem into
475the ``qemux86-sato`` directory: $ cd ~ $ source
476/opt/poky/DISTRO/environment-setup-i586-poky-linux $ runqemu-extract-sdk
477\\ ~/Downloads/core-image-sato-sdk-qemux86-2011091411831.rootfs.tar.bz2
478\\ $HOME/qemux86-sato You could now point to the target sysroot at
479``qemux86-sato``.
480
481Optionally Building a Toolchain Installer
482=========================================
483
484As an alternative to locating and downloading a toolchain installer, you
485can build the toolchain installer if you have a `Build
486Directory <&YOCTO_DOCS_DEV_URL;#build-directory>`__.
487
488.. note::
489
490 Although not the preferred method, it is also possible to use
491 bitbake meta-toolchain
492 to build the toolchain installer. If you do use this method, you must
493 separately install and extract the target sysroot. For information on
494 how to install the sysroot, see the "
495 Extracting the Root Filesystem
496 " section.
497
498To build the toolchain installer and populate the SDK image, use the
499following command: $ bitbake image -c populate_sdk The command results
500in a toolchain installer that contains the sysroot that matches your
501target root filesystem.
502
503Another powerful feature is that the toolchain is completely
504self-contained. The binaries are linked against their own copy of
505``libc``, which results in no dependencies on the target system. To
506achieve this, the pointer to the dynamic loader is configured at install
507time since that path cannot be dynamically altered. This is the reason
508for a wrapper around the ``populate_sdk`` archive.
509
510Another feature is that only one set of cross-canadian toolchain
511binaries are produced per architecture. This feature takes advantage of
512the fact that the target hardware can be passed to ``gcc`` as a set of
513compiler options. Those options are set up by the environment script and
514contained in variables such as ```CC`` <&YOCTO_DOCS_REF_URL;#var-CC>`__
515and ```LD`` <&YOCTO_DOCS_REF_URL;#var-LD>`__. This reduces the space
516needed for the tools. Understand, however, that a sysroot is still
517needed for every target since those binaries are target-specific.
518
519Remember, before using any BitBake command, you must source the build
520environment setup script (i.e.
521````` <&YOCTO_DOCS_REF_URL;#structure-core-script>`__ or
522```oe-init-build-env-memres`` <&YOCTO_DOCS_REF_URL;#structure-memres-core-script>`__)
523located in the Source Directory and you must make sure your
524``conf/local.conf`` variables are correct. In particular, you need to be
525sure the ```MACHINE`` <&YOCTO_DOCS_REF_URL;#var-MACHINE>`__ variable
526matches the architecture for which you are building and that the
527```SDKMACHINE`` <&YOCTO_DOCS_REF_URL;#var-SDKMACHINE>`__ variable is
528correctly set if you are building a toolchain designed to run on an
529architecture that differs from your current development host machine
530(i.e. the build machine).
531
532When the ``bitbake`` command completes, the toolchain installer will be
533in ``tmp/deploy/sdk`` in the Build Directory.
534
535.. note::
536
537 By default, this toolchain does not build static binaries. If you
538 want to use the toolchain to build these types of libraries, you need
539 to be sure your image has the appropriate static development
540 libraries. Use the
541 IMAGE_INSTALL
542 variable inside your
543 local.conf
544 file to install the appropriate library packages. Following is an
545 example using
546 glibc
547 static development libraries:
548 ::
549
550 IMAGE_INSTALL_append = " glibc-staticdev"
551
552
553Optionally Using an External Toolchain
554======================================
555
556You might want to use an external toolchain as part of your development.
557If this is the case, the fundamental steps you need to accomplish are as
558follows:
559
560- Understand where the installed toolchain resides. For cases where you
561 need to build the external toolchain, you would need to take separate
562 steps to build and install the toolchain.
563
564- Make sure you add the layer that contains the toolchain to your
565 ``bblayers.conf`` file through the
566 ```BBLAYERS`` <&YOCTO_DOCS_REF_URL;#var-BBLAYERS>`__ variable.
567
568- Set the
569 ```EXTERNAL_TOOLCHAIN`` <&YOCTO_DOCS_REF_URL;#var-EXTERNAL_TOOLCHAIN>`__
570 variable in your ``local.conf`` file to the location in which you
571 installed the toolchain.
572
573A good example of an external toolchain used with the Yocto Project is
574Mentor Graphics Sourcery G++ Toolchain. You can see information on how
575to use that particular layer in the ``README`` file at
576` <http://github.com/MentorEmbedded/meta-sourcery/>`__. You can find
577further information by reading about the
578```TCMODE`` <&YOCTO_DOCS_REF_URL;#var-TCMODE>`__ variable in the Yocto
579Project Reference Manual's variable glossary.
580
581.. _using-pre-built:
582
583Example Using Pre-Built Binaries and QEMU
584=========================================
585
586If hardware, libraries and services are stable, you can get started by
587using a pre-built binary of the filesystem image, kernel, and toolchain
588and run it using the QEMU emulator. This scenario is useful for
589developing application software.
590
591|Using a Pre-Built Image|
592
593For this scenario, you need to do several things:
594
595- Install the appropriate stand-alone toolchain tarball.
596
597- Download the pre-built image that will boot with QEMU. You need to be
598 sure to get the QEMU image that matches your target machine’s
599 architecture (e.g. x86, ARM, etc.).
600
601- Download the filesystem image for your target machine's architecture.
602
603- Set up the environment to emulate the hardware and then start the
604 QEMU emulator.
605
606Installing the Toolchain
607------------------------
608
609You can download a tarball installer, which includes the pre-built
610toolchain, the ``runqemu`` script, and support files from the
611appropriate directory under ` <&YOCTO_TOOLCHAIN_DL_URL;>`__. Toolchains
612are available for 32-bit and 64-bit x86 development systems from the
613``i686`` and ``x86_64`` directories, respectively. The toolchains the
614Yocto Project provides are based off the ``core-image-sato`` image and
615contain libraries appropriate for developing against that image. Each
616type of development system supports five or more target architectures.
617
618The names of the tarball installer scripts are such that a string
619representing the host system appears first in the filename and then is
620immediately followed by a string representing the target architecture.
621
622::
623
624 poky-glibc-host_system-image_type-arch-toolchain-release_version.sh
625
626 Where:
627 host_system is a string representing your development system:
628
629 i686 or x86_64.
630
631 image_type is a string representing the image you wish to
632 develop a Software Development Toolkit (SDK) for use against.
633 The Yocto Project builds toolchain installers using the
634 following BitBake command:
635
636 bitbake core-image-sato -c populate_sdk
637
638 arch is a string representing the tuned target architecture:
639
640 i586, x86_64, powerpc, mips, armv7a or armv5te
641
642 release_version is a string representing the release number of the
643 Yocto Project:
644
645 DISTRO, DISTRO+snapshot
646
647
648For example, the following toolchain installer is for a 64-bit
649development host system and a i586-tuned target architecture based off
650the SDK for ``core-image-sato``:
651poky-glibc-x86_64-core-image-sato-i586-toolchain-DISTRO.sh
652
653Toolchains are self-contained and by default are installed into
654``/opt/poky``. However, when you run the toolchain installer, you can
655choose an installation directory.
656
657The following command shows how to run the installer given a toolchain
658tarball for a 64-bit x86 development host system and a 32-bit x86 target
659architecture. You must change the permissions on the toolchain installer
660script so that it is executable.
661
662The example assumes the toolchain installer is located in
663``~/Downloads/``.
664
665.. note::
666
667 If you do not have write permissions for the directory into which you
668 are installing the toolchain, the toolchain installer notifies you
669 and exits. Be sure you have write permissions in the directory and
670 run the installer again.
671
672$ ~/Downloads/poky-glibc-x86_64-core-image-sato-i586-toolchain-DISTRO.sh
673
674For more information on how to install tarballs, see the "`Using a
675Cross-Toolchain
676Tarball <&YOCTO_DOCS_ADT_URL;#using-an-existing-toolchain-tarball>`__"
677and "`Using BitBake and the Build
678Directory <&YOCTO_DOCS_ADT_URL;#using-the-toolchain-from-within-the-build-tree>`__"
679sections in the Yocto Project Application Developer's Guide.
680
681Downloading the Pre-Built Linux Kernel
682--------------------------------------
683
684You can download the pre-built Linux kernel suitable for running in the
685QEMU emulator from ` <&YOCTO_QEMU_DL_URL;>`__. Be sure to use the kernel
686that matches the architecture you want to simulate. Download areas exist
687for the five supported machine architectures: ``qemuarm``, ``qemumips``,
688``qemuppc``, ``qemux86``, and ``qemux86-64``.
689
690Most kernel files have one of the following forms: \*zImage-qemuarch.bin
691vmlinux-qemuarch.bin Where: arch is a string representing the target
692architecture: x86, x86-64, ppc, mips, or arm.
693
694You can learn more about downloading a Yocto Project kernel in the
695"`Yocto Project Kernel <&YOCTO_DOCS_DEV_URL;#local-kernel-files>`__"
696bulleted item in the Yocto Project Development Manual.
697
698Downloading the Filesystem
699--------------------------
700
701You can also download the filesystem image suitable for your target
702architecture from ` <&YOCTO_QEMU_DL_URL;>`__. Again, be sure to use the
703filesystem that matches the architecture you want to simulate.
704
705The filesystem image has two tarball forms: ``ext3`` and ``tar``. You
706must use the ``ext3`` form when booting an image using the QEMU
707emulator. The ``tar`` form can be flattened out in your host development
708system and used for build purposes with the Yocto Project.
709core-image-profile-qemuarch.ext3 core-image-profile-qemuarch.tar.bz2
710Where: profile is the filesystem image's profile: lsb, lsb-dev, lsb-sdk,
711lsb-qt3, minimal, minimal-dev, sato, sato-dev, or sato-sdk. For
712information on these types of image profiles, see the
713"`Images <&YOCTO_DOCS_REF_URL;#ref-images>`__" chapter in the Yocto
714Project Reference Manual. arch is a string representing the target
715architecture: x86, x86-64, ppc, mips, or arm.
716
717Setting Up the Environment and Starting the QEMU Emulator
718---------------------------------------------------------
719
720Before you start the QEMU emulator, you need to set up the emulation
721environment. The following command form sets up the emulation
722environment. $ source
723YOCTO_ADTPATH_DIR/environment-setup-arch-poky-linux-if Where: arch is a
724string representing the target architecture: i586, x86_64, ppc603e,
725mips, or armv5te. if is a string representing an embedded application
726binary interface. Not all setup scripts include this string.
727
728Finally, this command form invokes the QEMU emulator $ runqemu qemuarch
729kernel-image filesystem-image Where: qemuarch is a string representing
730the target architecture: qemux86, qemux86-64, qemuppc, qemumips, or
731qemuarm. kernel-image is the architecture-specific kernel image.
732filesystem-image is the .ext3 filesystem image.
733
734Continuing with the example, the following two commands setup the
735emulation environment and launch QEMU. This example assumes the root
736filesystem (``.ext3`` file) and the pre-built kernel image file both
737reside in your home directory. The kernel and filesystem are for a
73832-bit target architecture. $ cd $HOME $ source
739YOCTO_ADTPATH_DIR/environment-setup-i586-poky-linux $ runqemu qemux86
740bzImage-qemux86.bin \\ core-image-sato-qemux86.ext3
741
742The environment in which QEMU launches varies depending on the
743filesystem image and on the target architecture. For example, if you
744source the environment for the ARM target architecture and then boot the
745minimal QEMU image, the emulator comes up in a new shell in command-line
746mode. However, if you boot the SDK image, QEMU comes up with a GUI.
747
748.. note::
749
750 Booting the PPC image results in QEMU launching in the same shell in
751 command-line mode.
752
753.. |Using a Pre-Built Image| image:: figures/using-a-pre-built-image.png