summaryrefslogtreecommitdiffstats
path: root/documentation/dev-manual/dev-manual-start.xml
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/dev-manual/dev-manual-start.xml')
-rw-r--r--documentation/dev-manual/dev-manual-start.xml418
1 files changed, 418 insertions, 0 deletions
diff --git a/documentation/dev-manual/dev-manual-start.xml b/documentation/dev-manual/dev-manual-start.xml
new file mode 100644
index 0000000000..61434ff72c
--- /dev/null
+++ b/documentation/dev-manual/dev-manual-start.xml
@@ -0,0 +1,418 @@
1<!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<chapter id='dev-manual-start'>
6
7<title>Getting Started with the Yocto Project</title>
8
9<para>
10 This chapter introduces the Yocto Project and gives you an idea of what you need to get started.
11 You can find enough information to set up your development host and build or use images for
12 hardware supported by the Yocto Project by reading the
13 <ulink url='&YOCTO_DOCS_QS_URL;'>Yocto Project Quick Start</ulink>.
14</para>
15
16<para>
17 The remainder of this chapter summarizes what is in the Yocto Project Quick Start and provides
18 some higher-level concepts you might want to consider.
19</para>
20
21<section id='introducing-the-yocto-project'>
22 <title>Introducing the Yocto Project</title>
23
24 <para>
25 The Yocto Project is an open-source collaboration project focused on embedded Linux development.
26 The project currently provides a build system that is
27 referred to as the
28 <link linkend='build-system-term'>OpenEmbedded build system</link>
29 in the Yocto Project documentation.
30 The Yocto Project provides various ancillary tools for the embedded developer
31 and also features the Sato reference User Interface, which is optimized for
32 stylus driven, low-resolution screens.
33 </para>
34
35 <para>
36 You can use the OpenEmbedded build system, which uses
37 <link linkend='bitbake-term'>BitBake</link>, to develop complete Linux
38 images and associated user-space applications for architectures based
39 on ARM, MIPS, PowerPC, x86 and x86-64.
40 <note>
41 By default, using the Yocto Project creates a Poky distribution.
42 However, you can create your own distribution by providing key
43 <link linkend='metadata'>Metadata</link>.
44 See the "<link linkend='creating-your-own-distribution'>Creating Your Own Distribution</link>"
45 section for more information.
46 </note>
47 While the Yocto Project does not provide a strict testing framework,
48 it does provide or generate for you artifacts that let you perform target-level and
49 emulated testing and debugging.
50 Additionally, if you are an <trademark class='trade'>Eclipse</trademark>
51 IDE user, you can install an Eclipse Yocto Plug-in to allow you to
52 develop within that familiar environment.
53 </para>
54</section>
55
56<section id='getting-setup'>
57 <title>Getting Set Up</title>
58
59 <para>
60 Here is what you need to use the Yocto Project:
61 <itemizedlist>
62 <listitem><para><emphasis>Host System:</emphasis> You should have a reasonably current
63 Linux-based host system.
64 You will have the best results with a recent release of Fedora,
65 openSUSE, Debian, Ubuntu, or CentOS as these releases are frequently tested against the Yocto Project
66 and officially supported.
67 For a list of the distributions under validation and their status, see the
68 "<ulink url='&YOCTO_DOCS_REF_URL;#detailed-supported-distros'>Supported Linux Distributions</ulink>" section
69 in the Yocto Project Reference Manual and the wiki page at
70 <ulink url='&YOCTO_WIKI_URL;/wiki/Distribution_Support'>Distribution Support</ulink>.</para>
71 <para>
72 You should also have about 50 Gbytes of free disk space for building images.
73 </para></listitem>
74 <listitem><para><emphasis>Packages:</emphasis> The OpenEmbedded build system
75 requires that certain packages exist on your development system (e.g. Python 2.6 or 2.7).
76 See "<ulink url='&YOCTO_DOCS_QS_URL;#packages'>The Packages</ulink>"
77 section in the Yocto Project Quick Start and the
78 "<ulink url='&YOCTO_DOCS_REF_URL;#required-packages-for-the-host-development-system'>Required Packages for the Host Development System</ulink>"
79 section in the Yocto Project Reference Manual for the exact
80 package requirements and the installation commands to install
81 them for the supported distributions.
82 </para></listitem>
83 <listitem id='local-yp-release'><para><emphasis>Yocto Project Release:</emphasis>
84 You need a release of the Yocto Project locally installed on
85 your development system.
86 The documentation refers to this set of locally installed files
87 as the <link linkend='source-directory'>Source Directory</link>.
88 You create your Source Directory by using
89 <link linkend='git'>Git</link> to clone a local copy
90 of the upstream <filename>poky</filename> repository,
91 or by downloading and unpacking a tarball of an official
92 Yocto Project release.
93 The preferred method is to create a clone of the repository.
94 </para>
95 <para>Working from a copy of the upstream repository allows you
96 to contribute back into the Yocto Project or simply work with
97 the latest software on a development branch.
98 Because Git maintains and creates an upstream repository with
99 a complete history of changes and you are working with a local
100 clone of that repository, you have access to all the Yocto
101 Project development branches and tag names used in the upstream
102 repository.</para>
103 <note>You can view the Yocto Project Source Repositories at
104 <ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>
105 </note>
106 <para>The following transcript shows how to clone the
107 <filename>poky</filename> Git repository into the current
108 working directory.
109 The command creates the local repository in a directory
110 named <filename>poky</filename>.
111 For information on Git used within the Yocto Project, see
112 the "<link linkend='git'>Git</link>" section.
113 <literallayout class='monospaced'>
114 $ git clone git://git.yoctoproject.org/poky
115 Cloning into 'poky'...
116 remote: Counting objects: 226790, done.
117 remote: Compressing objects: 100% (57465/57465), done.
118 remote: Total 226790 (delta 165212), reused 225887 (delta 164327)
119 Receiving objects: 100% (226790/226790), 100.98 MiB | 263 KiB/s, done.
120 Resolving deltas: 100% (165212/165212), done.
121 </literallayout></para>
122 <para>For another example of how to set up your own local Git
123 repositories, see this
124 <ulink url='&YOCTO_WIKI_URL;/wiki/Transcript:_from_git_checkout_to_meta-intel_BSP'>
125 wiki page</ulink>, which describes how to create local
126 Git repositories for both
127 <filename>poky</filename> and <filename>meta-intel</filename>.
128 </para></listitem>
129 <listitem id='local-kernel-files'><para><emphasis>Yocto Project Kernel:</emphasis>
130 If you are going to be making modifications to a supported Yocto Project kernel, you
131 need to establish local copies of the source.
132 You can find Git repositories of supported Yocto Project kernels organized under
133 "Yocto Linux Kernel" in the Yocto Project Source Repositories at
134 <ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>.</para>
135 <para>This setup can involve creating a bare clone of the Yocto Project kernel and then
136 copying that cloned repository.
137 You can create the bare clone and the copy of the bare clone anywhere you like.
138 For simplicity, it is recommended that you create these structures outside of the
139 Source Directory, which is usually named <filename>poky</filename>.</para>
140 <para>As an example, the following transcript shows how to create the bare clone
141 of the <filename>linux-yocto-3.10</filename> kernel and then create a copy of
142 that clone.
143 <note>When you have a local Yocto Project kernel Git repository, you can
144 reference that repository rather than the upstream Git repository as
145 part of the <filename>clone</filename> command.
146 Doing so can speed up the process.</note></para>
147 <para>In the following example, the bare clone is named
148 <filename>linux-yocto-3.10.git</filename>, while the
149 copy is named <filename>my-linux-yocto-3.10-work</filename>:
150 <literallayout class='monospaced'>
151 $ git clone --bare git://git.yoctoproject.org/linux-yocto-3.10 linux-yocto-3.10.git
152 Cloning into bare repository 'linux-yocto-3.10.git'...
153 remote: Counting objects: 3364487, done.
154 remote: Compressing objects: 100% (507178/507178), done.
155 remote: Total 3364487 (delta 2827715), reused 3364481 (delta 2827709)
156 Receiving objects: 100% (3364487/3364487), 722.95 MiB | 423 KiB/s, done.
157 Resolving deltas: 100% (2827715/2827715), done.
158 </literallayout></para>
159 <para>Now create a clone of the bare clone just created:
160 <literallayout class='monospaced'>
161 $ git clone linux-yocto-3.10.git my-linux-yocto-3.10-work
162 Cloning into 'my-linux-yocto-3.10-work'...
163 done.
164 </literallayout></para></listitem>
165 <listitem id='meta-yocto-kernel-extras-repo'><para><emphasis>
166 The <filename>meta-yocto-kernel-extras</filename> Git Repository</emphasis>:
167 The <filename>meta-yocto-kernel-extras</filename> Git repository contains Metadata needed
168 only if you are modifying and building the kernel image.
169 In particular, it contains the kernel BitBake append (<filename>.bbappend</filename>)
170 files that you
171 edit to point to your locally modified kernel source files and to build the kernel
172 image.
173 Pointing to these local files is much more efficient than requiring a download of the
174 kernel's source files from upstream each time you make changes to the kernel.</para>
175 <para>You can find the <filename>meta-yocto-kernel-extras</filename> Git Repository in the
176 "Yocto Metadata Layers" area of the Yocto Project Source Repositories at
177 <ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>.
178 It is good practice to create this Git repository inside the Source Directory.</para>
179 <para>Following is an example that creates the <filename>meta-yocto-kernel-extras</filename> Git
180 repository inside the Source Directory, which is named <filename>poky</filename>
181 in this case:
182 <literallayout class='monospaced'>
183 $ cd ~/poky
184 $ git clone git://git.yoctoproject.org/meta-yocto-kernel-extras meta-yocto-kernel-extras
185 Cloning into 'meta-yocto-kernel-extras'...
186 remote: Counting objects: 727, done.
187 remote: Compressing objects: 100% (452/452), done.
188 remote: Total 727 (delta 260), reused 719 (delta 252)
189 Receiving objects: 100% (727/727), 536.36 KiB | 240 KiB/s, done.
190 Resolving deltas: 100% (260/260), done.
191 </literallayout></para></listitem>
192 <listitem><para id='supported-board-support-packages-(bsps)'><emphasis>Supported Board Support Packages (BSPs):</emphasis>
193 The Yocto Project supports many BSPs, which are maintained in
194 their own layers or in layers designed to contain several
195 BSPs.
196 To get an idea of machine support through BSP layers, you can
197 look at the
198 <ulink url='&YOCTO_RELEASE_DL_URL;/machines'>index of machines</ulink>
199 for the release.</para>
200
201 <para>The Yocto Project uses the following BSP layer naming
202 scheme:
203 <literallayout class='monospaced'>
204 meta-<replaceable>bsp_name</replaceable>
205 </literallayout>
206 where <replaceable>bsp_name</replaceable> is the recognized
207 BSP name.
208 Here are some examples:
209 <literallayout class='monospaced'>
210 meta-crownbay
211 meta-emenlow
212 meta-n450
213 </literallayout>
214 See the
215 "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>"
216 section in the Yocto Project Board Support Package (BSP)
217 Developer's Guide for more information on BSP Layers.</para>
218
219 <para>A useful Git repository released with the Yocto
220 Project is <filename>meta-intel</filename>, which is a
221 parent layer that contains many supported
222 <ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>.
223 You can locate the <filename>meta-intel</filename> Git
224 repository in the "Yocto Metadata Layers" area of the Yocto
225 Project Source Repositories at
226 <ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>.</para>
227
228 <para>Using
229 <link linkend='git'>Git</link> to create a local clone of the
230 upstream repository can be helpful if you are working with
231 BSPs.
232 Typically, you set up the <filename>meta-intel</filename>
233 Git repository inside the Source Directory.
234 For example, the following transcript shows the steps to clone
235 <filename>meta-intel</filename>.
236 <note>
237 Be sure to work in the <filename>meta-intel</filename>
238 branch that matches your
239 <link linkend='source-directory'>Source Directory</link>
240 (i.e. <filename>poky</filename>) branch.
241 For example, if you have checked out the "master" branch
242 of <filename>poky</filename> and you are going to use
243 <filename>meta-intel</filename>, be sure to checkout the
244 "master" branch of <filename>meta-intel</filename>.
245 </note>
246 <literallayout class='monospaced'>
247 $ cd ~/poky
248 $ git clone git://git.yoctoproject.org/meta-intel.git
249 Cloning into 'meta-intel'...
250 remote: Counting objects: 8844, done.
251 remote: Compressing objects: 100% (2864/2864), done.
252 remote: Total 8844 (delta 4931), reused 8780 (delta 4867)
253 Receiving objects: 100% (8844/8844), 2.48 MiB | 264 KiB/s, done.
254 Resolving deltas: 100% (4931/4931), done.
255 </literallayout></para>
256
257 <para>The same
258 <ulink url='&YOCTO_WIKI_URL;/wiki/Transcript:_from_git_checkout_to_meta-intel_BSP'>wiki page</ulink>
259 referenced earlier covers how to set up the
260 <filename>meta-intel</filename> Git repository.
261 </para></listitem>
262 <listitem><para><emphasis>Eclipse Yocto Plug-in:</emphasis> If you are developing
263 applications using the Eclipse Integrated Development Environment (IDE),
264 you will need this plug-in.
265 See the
266 "<link linkend='setting-up-the-eclipse-ide'>Setting up the Eclipse IDE</link>"
267 section for more information.</para></listitem>
268 </itemizedlist>
269 </para>
270</section>
271
272<section id='building-images'>
273 <title>Building Images</title>
274
275 <para>
276 The build process creates an entire Linux distribution, including the toolchain, from source.
277 For more information on this topic, see the
278 "<ulink url='&YOCTO_DOCS_QS_URL;#building-image'>Building an Image</ulink>"
279 section in the Yocto Project Quick Start.
280 </para>
281
282 <para>
283 The build process is as follows:
284 <orderedlist>
285 <listitem><para>Make sure you have set up the Source Directory described in the
286 previous section.</para></listitem>
287 <listitem><para>Initialize the build environment by sourcing a build
288 environment script (i.e.
289 <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
290 or
291 <ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>).
292 </para></listitem>
293 <listitem><para>Optionally ensure the <filename>conf/local.conf</filename> configuration file,
294 which is found in the
295 <link linkend='build-directory'>Build Directory</link>,
296 is set up how you want it.
297 This file defines many aspects of the build environment including
298 the target machine architecture through the
299 <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'>MACHINE</ulink></filename> variable,
300 the development machine's processor use through the
301 <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-BB_NUMBER_THREADS'>BB_NUMBER_THREADS</ulink></filename> and
302 <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PARALLEL_MAKE'>PARALLEL_MAKE</ulink></filename> variables, and
303 a centralized tarball download directory through the
304 <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-DL_DIR'>DL_DIR</ulink></filename> variable.</para></listitem>
305 <listitem><para>
306 Build the image using the <filename>bitbake</filename> command.
307 If you want information on BitBake, see the
308 <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>.
309 </para></listitem>
310 <listitem><para>Run the image either on the actual hardware or using the QEMU
311 emulator.</para></listitem>
312 </orderedlist>
313 </para>
314</section>
315
316<section id='using-pre-built-binaries-and-qemu'>
317 <title>Using Pre-Built Binaries and QEMU</title>
318
319 <para>
320 Another option you have to get started is to use pre-built binaries.
321 The Yocto Project provides many types of binaries with each release.
322 See the "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>"
323 chapter in the Yocto Project Reference Manual
324 for descriptions of the types of binaries that ship with a Yocto Project
325 release.
326 </para>
327
328 <para>
329 Using a pre-built binary is ideal for developing software applications to run on your
330 target hardware.
331 To do this, you need to be able to access the appropriate cross-toolchain tarball for
332 the architecture on which you are developing.
333 If you are using an SDK type image, the image ships with the complete toolchain native to
334 the architecture.
335 If you are not using an SDK type image, you need to separately download and
336 install the stand-alone Yocto Project cross-toolchain tarball.
337 </para>
338
339 <para>
340 Regardless of the type of image you are using, you need to download the pre-built kernel
341 that you will boot in the QEMU emulator and then download and extract the target root
342 filesystem for your target machine’s architecture.
343 You can get architecture-specific binaries and file systems from
344 <ulink url='&YOCTO_MACHINES_DL_URL;'>machines</ulink>.
345 You can get installation scripts for stand-alone toolchains from
346 <ulink url='&YOCTO_TOOLCHAIN_DL_URL;'>toolchains</ulink>.
347 Once you have all your files, you set up the environment to emulate the hardware
348 by sourcing an environment setup script.
349 Finally, you start the QEMU emulator.
350 You can find details on all these steps in the
351 "<ulink url='&YOCTO_DOCS_QS_URL;#using-pre-built'>Using Pre-Built Binaries and QEMU</ulink>"
352 section of the Yocto Project Quick Start.
353 You can learn more about using QEMU with the Yocto Project in the
354 "<link linkend='dev-manual-qemu'>Using the Quick EMUlator (QEMU)</link>"
355 section.
356 </para>
357
358 <para>
359 Using QEMU to emulate your hardware can result in speed issues
360 depending on the target and host architecture mix.
361 For example, using the <filename>qemux86</filename> image in the emulator
362 on an Intel-based 32-bit (x86) host machine is fast because the target and
363 host architectures match.
364 On the other hand, using the <filename>qemuarm</filename> image on the same Intel-based
365 host can be slower.
366 But, you still achieve faithful emulation of ARM-specific issues.
367 </para>
368
369 <para>
370 To speed things up, the QEMU images support using <filename>distcc</filename>
371 to call a cross-compiler outside the emulated system.
372 If you used <filename>runqemu</filename> to start QEMU, and the
373 <filename>distccd</filename> application is present on the host system, any
374 BitBake cross-compiling toolchain available from the build system is automatically
375 used from within QEMU simply by calling <filename>distcc</filename>.
376 You can accomplish this by defining the cross-compiler variable
377 (e.g. <filename>export CC="distcc"</filename>).
378 Alternatively, if you are using a suitable SDK image or the appropriate
379 stand-alone toolchain is present,
380 the toolchain is also automatically used.
381 </para>
382
383 <note>
384 Several mechanisms exist that let you connect to the system running on the
385 QEMU emulator:
386 <itemizedlist>
387 <listitem><para>QEMU provides a framebuffer interface that makes standard
388 consoles available.</para></listitem>
389 <listitem><para>Generally, headless embedded devices have a serial port.
390 If so, you can configure the operating system of the running image
391 to use that port to run a console.
392 The connection uses standard IP networking.</para></listitem>
393 <listitem><para>
394 SSH servers exist in some QEMU images.
395 The <filename>core-image-sato</filename> QEMU image has a
396 Dropbear secure shell (SSH) server that runs with the root
397 password disabled.
398 The <filename>core-image-full-cmdline</filename> and
399 <filename>core-image-lsb</filename> QEMU images
400 have OpenSSH instead of Dropbear.
401 Including these SSH servers allow you to use standard
402 <filename>ssh</filename> and <filename>scp</filename> commands.
403 The <filename>core-image-minimal</filename> QEMU image,
404 however, contains no SSH server.
405 </para></listitem>
406 <listitem><para>You can use a provided, user-space NFS server to boot the QEMU session
407 using a local copy of the root filesystem on the host.
408 In order to make this connection, you must extract a root filesystem tarball by using the
409 <filename>runqemu-extract-sdk</filename> command.
410 After running the command, you must then point the <filename>runqemu</filename>
411 script to the extracted directory instead of a root filesystem image file.</para></listitem>
412 </itemizedlist>
413 </note>
414</section>
415</chapter>
416<!--
417vim: expandtab tw=80 ts=4
418-->