blob: 3156f772585eebe670bc483b7b7aa843cc7567ae [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
2"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
3[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
4
5<appendix id='sdk-appendix-obtain'>
6
7<title>Obtaining the SDK</title>
8
9<section id='sdk-locating-pre-built-sdk-installers'>
10 <title>Locating Pre-Built SDK Installers</title>
11
12 <para>
13 You can use existing, pre-built toolchains by locating and running
14 an SDK installer script that ships with the Yocto Project.
15 Using this method, you select and download an architecture-specific
Patrick Williamsc0f7c042017-02-23 20:41:17 -060016 SDK installer and then run the script to hand-install the
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050017 toolchain.
18 </para>
19
20 <para>
21 You can find SDK installers here:
22 <itemizedlist>
Patrick Williamsc0f7c042017-02-23 20:41:17 -060023 <listitem><para><emphasis>Standard SDK Installers:</emphasis>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050024 Go to <ulink url='&YOCTO_TOOLCHAIN_DL_URL;'></ulink>
25 and find the folder that matches your host development system
26 (i.e. <filename>i686</filename> for 32-bit machines or
27 <filename>x86_64</filename> for 64-bit machines).</para>
28
Patrick Williamsc0f7c042017-02-23 20:41:17 -060029 <para>Go into that folder and download the SDK installer
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050030 whose name includes the appropriate target architecture.
31 The toolchains provided by the Yocto Project are based off of
32 the <filename>core-image-sato</filename> image and contain
33 libraries appropriate for developing against that image.
34 For example, if your host development system is a 64-bit x86
35 system and you are going to use your cross-toolchain for a
36 32-bit x86 target, go into the <filename>x86_64</filename>
37 folder and download the following installer:
38 <literallayout class='monospaced'>
39 poky-glibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh
40 </literallayout>
41 </para></listitem>
Patrick Williamsc0f7c042017-02-23 20:41:17 -060042 <listitem><para><emphasis>Extensible SDK Installers:</emphasis>
43 Installers for the extensible SDK are also located in
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050044 <ulink url='&YOCTO_TOOLCHAIN_DL_URL;'></ulink>.
Patrick Williamsc0f7c042017-02-23 20:41:17 -060045 These installers have the string
46 <filename>ext</filename> as part of their names:
47 <literallayout class='monospaced'>
48 poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-&DISTRO;.sh
49 </literallayout>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050050 </para></listitem>
51 </itemizedlist>
52 </para>
53</section>
54
55<section id='sdk-building-an-sdk-installer'>
56 <title>Building an SDK Installer</title>
57
58 <para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -060059 As an alternative to locating and downloading a SDK installer,
60 you can build the SDK installer assuming you have first sourced
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050061 the environment setup script.
62 See the
63 "<ulink url='&YOCTO_DOCS_QS_URL;#qs-building-images'>Building Images</ulink>"
64 section in the Yocto Project Quick Start for steps that show you
65 how to set up the Yocto Project environment.
66 In particular, you need to be sure the
67 <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
68 variable matches the architecture for which you are building and that
69 the
70 <ulink url='&YOCTO_DOCS_REF_URL;#var-SDKMACHINE'><filename>SDKMACHINE</filename></ulink>
71 variable is correctly set if you are building a toolchain designed to
72 run on an architecture that differs from your current development host
73 machine (i.e. the build machine).
74 </para>
75
76 <para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -060077 To build the SDK installer for a standard SDK and populate
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050078 the SDK image, use the following command:
79 <literallayout class='monospaced'>
80 $ bitbake <replaceable>image</replaceable> -c populate_sdk
81 </literallayout>
82 You can do the same for the extensible SDK using this command:
83 <literallayout class='monospaced'>
84 $ bitbake <replaceable>image</replaceable> -c populate_sdk_ext
85 </literallayout>
Patrick Williamsc0f7c042017-02-23 20:41:17 -060086 These commands result in a SDK installer that contains the sysroot
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050087 that matches your target root filesystem.
88 </para>
89
90 <para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -060091 When the <filename>bitbake</filename> command completes, the SDK
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050092 installer will be in
93 <filename>tmp/deploy/sdk</filename> in the Build Directory.
Patrick Williamsc0f7c042017-02-23 20:41:17 -060094 <note><title>Notes</title>
95 <itemizedlist>
96 <listitem><para>
97 By default, this toolchain does not build static binaries.
98 If you want to use the toolchain to build these types of
99 libraries, you need to be sure your image has the
100 appropriate static development libraries.
101 Use the
102 <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_INSTALL'><filename>IMAGE_INSTALL</filename></ulink>
103 variable inside your <filename>local.conf</filename> file
104 to install the appropriate library packages.
105 Following is an example using <filename>glibc</filename>
106 static development libraries:
107 <literallayout class='monospaced'>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500108 IMAGE_INSTALL_append = " glibc-staticdev"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600109 </literallayout>
110 </para></listitem>
111 <listitem><para>
112 For additional information on building the installer,
113 see the
114 <ulink url='https://wiki.yoctoproject.org/wiki/TipsAndTricks/RunningEclipseAgainstBuiltImage'>Cookbook guide to Making an Eclipse Debug Capable Image</ulink>
115 wiki page.
116 </para></listitem>
117 </itemizedlist>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500118 </note>
119 </para>
120</section>
121
122<section id='sdk-extracting-the-root-filesystem'>
123 <title>Extracting the Root Filesystem</title>
124
125 <para>
126 After installing the toolchain, for some use cases you
127 might need to separately extract a root filesystem:
128 <itemizedlist>
129 <listitem><para>You want to boot the image using NFS.
130 </para></listitem>
131 <listitem><para>You want to use the root filesystem as the
132 target sysroot.
133 For example, the Eclipse IDE environment with the Eclipse
134 Yocto Plug-in installed allows you to use QEMU to boot
135 under NFS.</para></listitem>
136 <listitem><para>You want to develop your target application
137 using the root filesystem as the target sysroot.
138 </para></listitem>
139 </itemizedlist>
140 </para>
141
142 <para>
143 To extract the root filesystem, first <filename>source</filename>
144 the cross-development environment setup script to establish
145 necessary environment variables.
146 If you built the toolchain in the Build Directory, you will find
147 the toolchain environment script in the
148 <filename>tmp</filename> directory.
149 If you installed the toolchain by hand, the environment setup
150 script is located in <filename>/opt/poky/&DISTRO;</filename>.
151 </para>
152
153 <para>
154 After sourcing the environment script, use the
155 <filename>runqemu-extract-sdk</filename> command and provide the
156 filesystem image.
157 </para>
158
159 <para>
160 Following is an example.
161 The second command sets up the environment.
162 In this case, the setup script is located in the
163 <filename>/opt/poky/&DISTRO;</filename> directory.
164 The third command extracts the root filesystem from a previously
165 built filesystem that is located in the
166 <filename>~/Downloads</filename> directory.
167 Furthermore, this command extracts the root filesystem into the
168 <filename>qemux86-sato</filename> directory:
169 <literallayout class='monospaced'>
170 $ cd ~
171 $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux
172 $ runqemu-extract-sdk \
173 ~/Downloads/core-image-sato-sdk-qemux86-2011091411831.rootfs.tar.bz2 \
174 $HOME/qemux86-sato
175 </literallayout>
176 You could now point to the target sysroot at
177 <filename>qemux86-sato</filename>.
178 </para>
179</section>
180
181<section id='sdk-installed-standard-sdk-directory-structure'>
182 <title>Installed Standard SDK Directory Structure</title>
183
184 <para>
185 The following figure shows the resulting directory structure after
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600186 you install the Standard SDK by running the <filename>*.sh</filename>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500187 SDK installation script:
188 </para>
189
190 <para>
191 <imagedata fileref="figures/sdk-installed-standard-sdk-directory.png" scale="60" align="center" />
192 </para>
193
194 <para>
195 The installed SDK consists of an environment setup script for the SDK,
196 a configuration file for the target, a version file for the target,
197 and the root filesystem (<filename>sysroots</filename>) needed to
198 develop objects for the target system.
199 </para>
200
201 <para>
202 Within the figure, italicized text is used to indicate replaceable
203 portions of the file or directory name.
204 For example,
205 <replaceable>install_dir</replaceable>/<replaceable>version</replaceable>
206 is the directory where the SDK is installed.
207 By default, this directory is <filename>/opt/poky/</filename>.
208 And, <replaceable>version</replaceable> represents the specific
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600209 snapshot of the SDK (e.g. <filename>&DISTRO;</filename>).
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500210 Furthermore, <replaceable>target</replaceable> represents the target
211 architecture (e.g. <filename>i586</filename>) and
212 <replaceable>host</replaceable> represents the development system's
213 architecture (e.g. <filename>x86_64</filename>).
214 Thus, the complete names of the two directories within the
215 <filename>sysroots</filename> could be
216 <filename>i586-poky-linux</filename> and
217 <filename>x86_64-pokysdk-linux</filename> for the target and host,
218 respectively.
219 </para>
220</section>
221
222<section id='sdk-installed-extensible-sdk-directory-structure'>
223 <title>Installed Extensible SDK Directory Structure</title>
224
225 <para>
226 The following figure shows the resulting directory structure after
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600227 you install the Extensible SDK by running the <filename>*.sh</filename>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500228 SDK installation script:
229 </para>
230
231 <para>
232 <imagedata fileref="figures/sdk-installed-extensible-sdk-directory.png" scale="60" align="center" />
233 </para>
234
235 <para>
236 The installed directory structure for the extensible SDK is quite
237 different than the installed structure for the standard SDK.
238 The extensible SDK does not separate host and target parts in the
239 same manner as does the standard SDK.
240 The extensible SDK uses an embedded copy of the OpenEmbedded
241 build system, which has its own sysroots.
242 </para>
243
244 <para>
245 Of note in the directory structure are an environment setup script
246 for the SDK, a configuration file for the target, a version file for
247 the target, and a log file for the OpenEmbedded build system
248 preparation script run by the installer.
249 </para>
250
251 <para>
252 Within the figure, italicized text is used to indicate replaceable
253 portions of the file or directory name.
254 For example,
255 <replaceable>install_dir</replaceable> is the directory where the SDK
256 is installed, which is <filename>poky_sdk</filename> by default.
257 <replaceable>target</replaceable> represents the target
258 architecture (e.g. <filename>i586</filename>) and
259 <replaceable>host</replaceable> represents the development system's
260 architecture (e.g. <filename>x86_64</filename>).
261 </para>
262</section>
263
264</appendix>
265<!--
266vim: expandtab tw=80 ts=4
267-->