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