summaryrefslogtreecommitdiffstats
path: root/documentation/sdk-manual
diff options
context:
space:
mode:
authorNicolas Dechesne <nicolas.dechesne@linaro.org>2020-11-20 20:17:33 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-01-04 10:55:00 +0000
commitfa0cb4d34b1073f215fa3c680f2316208739d53d (patch)
treeba89c1f4289fd6456af4409a6a19caf6548dfb9c /documentation/sdk-manual
parenta038e58f3cd82c56102444bdc5ac76c9f1550a0d (diff)
downloadpoky-fa0cb4d34b1073f215fa3c680f2316208739d53d.tar.gz
sphinx: import docs
The Yocto Project docs was migrated from Docbook to Sphinx in YP 3.2. This 3.1 is an LTS release, and since 3.1 docs are 'close to' the docs in 3.2, we agreed to backport sphinx docs onto 3.1. This first patch brings all changes done in 3.2 until: 7f64574f7 README: include detailed information about sphinx There are other changes after this commit, but they will be selectively backported in individual patches. This patch was generated with the following command: git cherry-pick -n \ $(git log --reverse --oneline \ ac352ad7f95db7eeacb53c2778caa31800bd7c26..7f64574f7 \ | cut -f1 -d' ') The following commits were applies in the dunfell docs, but not in master, so they were first reverted (and squashed into this change). A commit will reintroduce the content from these patches in the Sphinx files in a followup patch. 069c27574 Documenation: Prepared for the 3.1.1 release bd140f0f9 Documentation: Add 3.1.1 version updates missing from previous commit 17cc71a8f Documenation: Prepared for the 3.1.2 release 1a69e2c02 Documenation: Prepared for the 3.1.3 release 8910ac1c7 Documenation: Prepared for the 3.1.4 release (From yocto-docs rev: c25fe058b88b893b0d146f3ed27320b47cdec236) Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/sdk-manual')
-rw-r--r--documentation/sdk-manual/history.rst40
-rw-r--r--documentation/sdk-manual/sdk-appendix-customizing-standard.rst34
-rw-r--r--documentation/sdk-manual/sdk-appendix-customizing-standard.xml1
-rw-r--r--documentation/sdk-manual/sdk-appendix-customizing.rst377
-rw-r--r--documentation/sdk-manual/sdk-appendix-customizing.xml1
-rw-r--r--documentation/sdk-manual/sdk-appendix-obtain.rst321
-rw-r--r--documentation/sdk-manual/sdk-appendix-obtain.xml1
-rw-r--r--documentation/sdk-manual/sdk-extensible.rst1356
-rw-r--r--documentation/sdk-manual/sdk-extensible.xml1
-rw-r--r--documentation/sdk-manual/sdk-intro.rst231
-rw-r--r--documentation/sdk-manual/sdk-intro.xml1
-rw-r--r--documentation/sdk-manual/sdk-manual-customization.xsl2
-rw-r--r--documentation/sdk-manual/sdk-manual.rst22
-rwxr-xr-xdocumentation/sdk-manual/sdk-manual.xml23
-rw-r--r--documentation/sdk-manual/sdk-style.css3
-rw-r--r--documentation/sdk-manual/sdk-using.rst159
-rw-r--r--documentation/sdk-manual/sdk-using.xml1
-rw-r--r--documentation/sdk-manual/sdk-working-projects.rst423
-rw-r--r--documentation/sdk-manual/sdk-working-projects.xml1
19 files changed, 2977 insertions, 21 deletions
diff --git a/documentation/sdk-manual/history.rst b/documentation/sdk-manual/history.rst
new file mode 100644
index 0000000000..af027c97f8
--- /dev/null
+++ b/documentation/sdk-manual/history.rst
@@ -0,0 +1,40 @@
1.. SPDX-License-Identifier: CC-BY-2.0-UK
2
3***********************
4Manual Revision History
5***********************
6
7.. list-table::
8 :widths: 10 15 40
9 :header-rows: 1
10
11 * - Revision
12 - Date
13 - Note
14 * - 2.1
15 - April 2016
16 - The initial document released with the Yocto Project 2.1 Release
17 * - 2.2
18 - October 2016
19 - Released with the Yocto Project 2.2 Release.
20 * - 2.3
21 - May 2017
22 - Released with the Yocto Project 2.3 Release.
23 * - 2.4
24 - October 2017
25 - Released with the Yocto Project 2.4 Release.
26 * - 2.5
27 - May 2018
28 - Released with the Yocto Project 2.5 Release.
29 * - 2.6
30 - November 2018
31 - Released with the Yocto Project 2.6 Release.
32 * - 2.7
33 - May 2019
34 - Released with the Yocto Project 2.7 Release.
35 * - 3.0
36 - October 2019
37 - Released with the Yocto Project 3.0 Release.
38 * - 3.1
39 - April 2020
40 - Released with the Yocto Project 3.1 Release.
diff --git a/documentation/sdk-manual/sdk-appendix-customizing-standard.rst b/documentation/sdk-manual/sdk-appendix-customizing-standard.rst
new file mode 100644
index 0000000000..f6f2b6640f
--- /dev/null
+++ b/documentation/sdk-manual/sdk-appendix-customizing-standard.rst
@@ -0,0 +1,34 @@
1.. SPDX-License-Identifier: CC-BY-2.0-UK
2
3****************************
4Customizing the Standard SDK
5****************************
6
7This appendix presents customizations you can apply to the standard SDK.
8
9Adding Individual Packages to the Standard SDK
10==============================================
11
12When you build a standard SDK using the ``bitbake -c populate_sdk``, a
13default set of packages is included in the resulting SDK. The
14:term:`TOOLCHAIN_HOST_TASK`
15and
16:term:`TOOLCHAIN_TARGET_TASK`
17variables control the set of packages adding to the SDK.
18
19If you want to add individual packages to the toolchain that runs on the
20host, simply add those packages to the ``TOOLCHAIN_HOST_TASK`` variable.
21Similarly, if you want to add packages to the default set that is part
22of the toolchain that runs on the target, add the packages to the
23``TOOLCHAIN_TARGET_TASK`` variable.
24
25Adding API Documentation to the Standard SDK
26============================================
27
28You can include API documentation as well as any other documentation
29provided by recipes with the standard SDK by adding "api-documentation"
30to the
31:term:`DISTRO_FEATURES`
32variable: DISTRO_FEATURES_append = " api-documentation" Setting this
33variable as shown here causes the OpenEmbedded build system to build the
34documentation and then include it in the standard SDK.
diff --git a/documentation/sdk-manual/sdk-appendix-customizing-standard.xml b/documentation/sdk-manual/sdk-appendix-customizing-standard.xml
index f20891c80d..3a6b4c8d82 100644
--- a/documentation/sdk-manual/sdk-appendix-customizing-standard.xml
+++ b/documentation/sdk-manual/sdk-appendix-customizing-standard.xml
@@ -1,6 +1,7 @@
1<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" 1<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
2"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" 2"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
3[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] > 3[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
4<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
4 5
5<appendix id='sdk-appendix-customizing-standard'> 6<appendix id='sdk-appendix-customizing-standard'>
6 7
diff --git a/documentation/sdk-manual/sdk-appendix-customizing.rst b/documentation/sdk-manual/sdk-appendix-customizing.rst
new file mode 100644
index 0000000000..7743e3c004
--- /dev/null
+++ b/documentation/sdk-manual/sdk-appendix-customizing.rst
@@ -0,0 +1,377 @@
1.. SPDX-License-Identifier: CC-BY-2.0-UK
2
3******************************
4Customizing the Extensible SDK
5******************************
6
7This appendix describes customizations you can apply to the extensible
8SDK.
9
10Configuring the Extensible SDK
11==============================
12
13The extensible SDK primarily consists of a pre-configured copy of the
14OpenEmbedded build system from which it was produced. Thus, the SDK's
15configuration is derived using that build system and the filters shown
16in the following list. When these filters are present, the OpenEmbedded
17build system applies them against ``local.conf`` and ``auto.conf``:
18
19- Variables whose values start with "/" are excluded since the
20 assumption is that those values are paths that are likely to be
21 specific to the :term:`Build Host`.
22
23- Variables listed in
24 :term:`SDK_LOCAL_CONF_BLACKLIST`
25 are excluded. These variables are not allowed through from the
26 OpenEmbedded build system configuration into the extensible SDK
27 configuration. Typically, these variables are specific to the machine
28 on which the build system is running and could be problematic as part
29 of the extensible SDK configuration.
30
31 For a list of the variables excluded by default, see the
32 :term:`SDK_LOCAL_CONF_BLACKLIST`
33 in the glossary of the Yocto Project Reference Manual.
34
35- Variables listed in
36 :term:`SDK_LOCAL_CONF_WHITELIST`
37 are included. Including a variable in the value of
38 ``SDK_LOCAL_CONF_WHITELIST`` overrides either of the previous two
39 filters. The default value is blank.
40
41- Classes inherited globally with
42 :term:`INHERIT` that are listed in
43 :term:`SDK_INHERIT_BLACKLIST`
44 are disabled. Using ``SDK_INHERIT_BLACKLIST`` to disable these
45 classes is the typical method to disable classes that are problematic
46 or unnecessary in the SDK context. The default value blacklists the
47 :ref:`buildhistory <ref-classes-buildhistory>`
48 and :ref:`icecc <ref-classes-icecc>` classes.
49
50Additionally, the contents of ``conf/sdk-extra.conf``, when present, are
51appended to the end of ``conf/local.conf`` within the produced SDK,
52without any filtering. The ``sdk-extra.conf`` file is particularly
53useful if you want to set a variable value just for the SDK and not the
54OpenEmbedded build system used to create the SDK.
55
56Adjusting the Extensible SDK to Suit Your Build Host's Setup
57============================================================
58
59In most cases, the extensible SDK defaults should work with your :term:`Build
60Host`'s setup.
61However, some cases exist for which you might consider making
62adjustments:
63
64- If your SDK configuration inherits additional classes using the
65 :term:`INHERIT` variable and you
66 do not need or want those classes enabled in the SDK, you can
67 blacklist them by adding them to the
68 :term:`SDK_INHERIT_BLACKLIST`
69 variable as described in the fourth bullet of the previous section.
70
71 .. note::
72
73 The default value of
74 SDK_INHERIT_BLACKLIST
75 is set using the "?=" operator. Consequently, you will need to
76 either define the entire list by using the "=" operator, or you
77 will need to append a value using either "_append" or the "+="
78 operator. You can learn more about these operators in the "
79 Basic Syntax
80 " section of the BitBake User Manual.
81
82 .
83
84- If you have classes or recipes that add additional tasks to the
85 standard build flow (i.e. the tasks execute as the recipe builds as
86 opposed to being called explicitly), then you need to do one of the
87 following:
88
89 - After ensuring the tasks are :ref:`shared
90 state <overview-manual/overview-manual-concepts:shared state cache>` tasks (i.e. the
91 output of the task is saved to and can be restored from the shared
92 state cache) or ensuring the tasks are able to be produced quickly
93 from a task that is a shared state task, add the task name to the
94 value of
95 :term:`SDK_RECRDEP_TASKS`.
96
97 - Disable the tasks if they are added by a class and you do not need
98 the functionality the class provides in the extensible SDK. To
99 disable the tasks, add the class to the ``SDK_INHERIT_BLACKLIST``
100 variable as described in the previous section.
101
102- Generally, you want to have a shared state mirror set up so users of
103 the SDK can add additional items to the SDK after installation
104 without needing to build the items from source. See the "`Providing
105 Additional Installable Extensible SDK
106 Content <#sdk-providing-additional-installable-extensible-sdk-content>`__"
107 section for information.
108
109- If you want users of the SDK to be able to easily update the SDK, you
110 need to set the
111 :term:`SDK_UPDATE_URL`
112 variable. For more information, see the "`Providing Updates to the
113 Extensible SDK After
114 Installation <#sdk-providing-updates-to-the-extensible-sdk-after-installation>`__"
115 section.
116
117- If you have adjusted the list of files and directories that appear in
118 :term:`COREBASE` (other than
119 layers that are enabled through ``bblayers.conf``), then you must
120 list these files in
121 :term:`COREBASE_FILES` so
122 that the files are copied into the SDK.
123
124- If your OpenEmbedded build system setup uses a different environment
125 setup script other than
126 :ref:`structure-core-script`, then you must
127 set
128 :term:`OE_INIT_ENV_SCRIPT`
129 to point to the environment setup script you use.
130
131 .. note::
132
133 You must also reflect this change in the value used for the
134 COREBASE_FILES
135 variable as previously described.
136
137Changing the Extensible SDK Installer Title
138===========================================
139
140You can change the displayed title for the SDK installer by setting the
141:term:`SDK_TITLE` variable and then
142rebuilding the the SDK installer. For information on how to build an SDK
143installer, see the "`Building an SDK
144Installer <#sdk-building-an-sdk-installer>`__" section.
145
146By default, this title is derived from
147:term:`DISTRO_NAME` when it is
148set. If the ``DISTRO_NAME`` variable is not set, the title is derived
149from the :term:`DISTRO` variable.
150
151The
152:ref:`populate_sdk_base <ref-classes-populate-sdk-*>`
153class defines the default value of the ``SDK_TITLE`` variable as
154follows:
155::
156
157 SDK_TITLE ??= "${@d.getVar('DISTRO_NAME') or d.getVar('DISTRO')} SDK"
158
159While several ways exist to change this variable, an efficient method is
160to set the variable in your distribution's configuration file. Doing so
161creates an SDK installer title that applies across your distribution. As
162an example, assume you have your own layer for your distribution named
163"meta-mydistro" and you are using the same type of file hierarchy as
164does the default "poky" distribution. If so, you could update the
165``SDK_TITLE`` variable in the
166``~/meta-mydistro/conf/distro/mydistro.conf`` file using the following
167form:
168::
169
170 SDK_TITLE = "your_title"
171
172Providing Updates to the Extensible SDK After Installation
173==========================================================
174
175When you make changes to your configuration or to the metadata and if
176you want those changes to be reflected in installed SDKs, you need to
177perform additional steps. These steps make it possible for anyone using
178the installed SDKs to update the installed SDKs by using the
179``devtool sdk-update`` command:
180
1811. Create a directory that can be shared over HTTP or HTTPS. You can do
182 this by setting up a web server such as an `Apache HTTP
183 Server <https://en.wikipedia.org/wiki/Apache_HTTP_Server>`__ or
184 `Nginx <https://en.wikipedia.org/wiki/Nginx>`__ server in the cloud
185 to host the directory. This directory must contain the published SDK.
186
1872. Set the
188 :term:`SDK_UPDATE_URL`
189 variable to point to the corresponding HTTP or HTTPS URL. Setting
190 this variable causes any SDK built to default to that URL and thus,
191 the user does not have to pass the URL to the ``devtool sdk-update``
192 command as described in the "`Applying Updates to an Installed
193 Extensible
194 SDK <#sdk-applying-updates-to-an-installed-extensible-sdk>`__"
195 section.
196
1973. Build the extensible SDK normally (i.e., use the
198 ``bitbake -c populate_sdk_ext`` imagename command).
199
2004. Publish the SDK using the following command:
201 ::
202
203 $ oe-publish-sdk some_path/sdk-installer.sh path_to_shared_http_directory
204
205 You must
206 repeat this step each time you rebuild the SDK with changes that you
207 want to make available through the update mechanism.
208
209Completing the above steps allows users of the existing installed SDKs
210to simply run ``devtool sdk-update`` to retrieve and apply the latest
211updates. See the "`Applying Updates to an Installed Extensible
212SDK <#sdk-applying-updates-to-an-installed-extensible-sdk>`__" section
213for further information.
214
215Changing the Default SDK Installation Directory
216===============================================
217
218When you build the installer for the Extensible SDK, the default
219installation directory for the SDK is based on the
220:term:`DISTRO` and
221:term:`SDKEXTPATH` variables from
222within the
223:ref:`populate_sdk_base <ref-classes-populate-sdk-*>`
224class as follows:
225::
226
227 SDKEXTPATH ??= "~/${@d.getVar('DISTRO')}_sdk"
228
229You can
230change this default installation directory by specifically setting the
231``SDKEXTPATH`` variable.
232
233While a number of ways exist through which you can set this variable,
234the method that makes the most sense is to set the variable in your
235distribution's configuration file. Doing so creates an SDK installer
236default directory that applies across your distribution. As an example,
237assume you have your own layer for your distribution named
238"meta-mydistro" and you are using the same type of file hierarchy as
239does the default "poky" distribution. If so, you could update the
240``SDKEXTPATH`` variable in the
241``~/meta-mydistro/conf/distro/mydistro.conf`` file using the following
242form:
243::
244
245 SDKEXTPATH = "some_path_for_your_installed_sdk"
246
247After building your installer, running it prompts the user for
248acceptance of the some_path_for_your_installed_sdk directory as the
249default location to install the Extensible SDK.
250
251Providing Additional Installable Extensible SDK Content
252=======================================================
253
254If you want the users of an extensible SDK you build to be able to add
255items to the SDK without requiring the users to build the items from
256source, you need to do a number of things:
257
2581. Ensure the additional items you want the user to be able to install
259 are already built:
260
261 - Build the items explicitly. You could use one or more "meta"
262 recipes that depend on lists of other recipes.
263
264 - Build the "world" target and set
265 ``EXCLUDE_FROM_WORLD_pn-``\ recipename for the recipes you do not
266 want built. See the
267 :term:`EXCLUDE_FROM_WORLD`
268 variable for additional information.
269
2702. Expose the ``sstate-cache`` directory produced by the build.
271 Typically, you expose this directory by making it available through
272 an `Apache HTTP
273 Server <https://en.wikipedia.org/wiki/Apache_HTTP_Server>`__ or
274 `Nginx <https://en.wikipedia.org/wiki/Nginx>`__ server.
275
2763. Set the appropriate configuration so that the produced SDK knows how
277 to find the configuration. The variable you need to set is
278 :term:`SSTATE_MIRRORS`:
279 ::
280
281 SSTATE_MIRRORS = "file://.* http://example.com/some_path/sstate-cache/PATH"
282
283 You can set the
284 ``SSTATE_MIRRORS`` variable in two different places:
285
286 - If the mirror value you are setting is appropriate to be set for
287 both the OpenEmbedded build system that is actually building the
288 SDK and the SDK itself (i.e. the mirror is accessible in both
289 places or it will fail quickly on the OpenEmbedded build system
290 side, and its contents will not interfere with the build), then
291 you can set the variable in your ``local.conf`` or custom distro
292 configuration file. You can then "whitelist" the variable through
293 to the SDK by adding the following:
294 ::
295
296 SDK_LOCAL_CONF_WHITELIST = "SSTATE_MIRRORS"
297
298 - Alternatively, if you just want to set the ``SSTATE_MIRRORS``
299 variable's value for the SDK alone, create a
300 ``conf/sdk-extra.conf`` file either in your
301 :term:`Build Directory` or within any
302 layer and put your ``SSTATE_MIRRORS`` setting within that file.
303
304 .. note::
305
306 This second option is the safest option should you have any
307 doubts as to which method to use when setting
308 SSTATE_MIRRORS
309 .
310
311Minimizing the Size of the Extensible SDK Installer Download
312============================================================
313
314By default, the extensible SDK bundles the shared state artifacts for
315everything needed to reconstruct the image for which the SDK was built.
316This bundling can lead to an SDK installer file that is a Gigabyte or
317more in size. If the size of this file causes a problem, you can build
318an SDK that has just enough in it to install and provide access to the
319``devtool command`` by setting the following in your configuration:
320::
321
322 SDK_EXT_TYPE = "minimal"
323
324Setting
325:term:`SDK_EXT_TYPE` to
326"minimal" produces an SDK installer that is around 35 Mbytes in size,
327which downloads and installs quickly. You need to realize, though, that
328the minimal installer does not install any libraries or tools out of the
329box. These libraries and tools must be installed either "on the fly" or
330through actions you perform using ``devtool`` or explicitly with the
331``devtool sdk-install`` command.
332
333In most cases, when building a minimal SDK you need to also enable
334bringing in the information on a wider range of packages produced by the
335system. Requiring this wider range of information is particularly true
336so that ``devtool add`` is able to effectively map dependencies it
337discovers in a source tree to the appropriate recipes. Additionally, the
338information enables the ``devtool search`` command to return useful
339results.
340
341To facilitate this wider range of information, you would need to set the
342following:
343::
344
345 SDK_INCLUDE_PKGDATA = "1"
346
347See the :term:`SDK_INCLUDE_PKGDATA` variable for additional information.
348
349Setting the ``SDK_INCLUDE_PKGDATA`` variable as shown causes the "world"
350target to be built so that information for all of the recipes included
351within it are available. Having these recipes available increases build
352time significantly and increases the size of the SDK installer by 30-80
353Mbytes depending on how many recipes are included in your configuration.
354
355You can use ``EXCLUDE_FROM_WORLD_pn-``\ recipename for recipes you want
356to exclude. However, it is assumed that you would need to be building
357the "world" target if you want to provide additional items to the SDK.
358Consequently, building for "world" should not represent undue overhead
359in most cases.
360
361.. note::
362
363 If you set
364 SDK_EXT_TYPE
365 to "minimal", then providing a shared state mirror is mandatory so
366 that items can be installed as needed. See the "
367 Providing Additional Installable Extensible SDK Content
368 " section for more information.
369
370You can explicitly control whether or not to include the toolchain when
371you build an SDK by setting the
372:term:`SDK_INCLUDE_TOOLCHAIN`
373variable to "1". In particular, it is useful to include the toolchain
374when you have set ``SDK_EXT_TYPE`` to "minimal", which by default,
375excludes the toolchain. Also, it is helpful if you are building a small
376SDK for use with an IDE or some other tool where you do not want to take
377extra steps to install a toolchain.
diff --git a/documentation/sdk-manual/sdk-appendix-customizing.xml b/documentation/sdk-manual/sdk-appendix-customizing.xml
index 911658f914..08054f8b79 100644
--- a/documentation/sdk-manual/sdk-appendix-customizing.xml
+++ b/documentation/sdk-manual/sdk-appendix-customizing.xml
@@ -1,6 +1,7 @@
1<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" 1<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
2"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" 2"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
3[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] > 3[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
4<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
4 5
5<appendix id='sdk-appendix-customizing'> 6<appendix id='sdk-appendix-customizing'>
6 7
diff --git a/documentation/sdk-manual/sdk-appendix-obtain.rst b/documentation/sdk-manual/sdk-appendix-obtain.rst
new file mode 100644
index 0000000000..97ab9169ea
--- /dev/null
+++ b/documentation/sdk-manual/sdk-appendix-obtain.rst
@@ -0,0 +1,321 @@
1.. SPDX-License-Identifier: CC-BY-2.0-UK
2
3*****************
4Obtaining the SDK
5*****************
6
7.. _sdk-locating-pre-built-sdk-installers:
8
9Locating Pre-Built SDK Installers
10=================================
11
12You can use existing, pre-built toolchains by locating and running an
13SDK installer script that ships with the Yocto Project. Using this
14method, you select and download an architecture-specific SDK installer
15and then run the script to hand-install the toolchain.
16
17Follow these steps to locate and hand-install the toolchain:
18
191. *Go to the Installers Directory:* Go to
20 :yocto_dl:`/releases/yocto/yocto-3.1.2/toolchain/`
21
222. *Open the Folder for Your Build Host:* Open the folder that matches
23 your :term:`Build Host` (i.e.
24 ``i686`` for 32-bit machines or ``x86_64`` for 64-bit machines).
25
263. *Locate and Download the SDK Installer:* You need to find and
27 download the installer appropriate for your build host, target
28 hardware, and image type.
29
30 The installer files (``*.sh``) follow this naming convention:
31 ::
32
33 poky-glibc-host_system-core-image-type-arch-toolchain[-ext]-release.sh
34
35 Where:
36 host_system is a string representing your development system:
37 "i686" or "x86_64"
38
39 type is a string representing the image:
40 "sato" or "minimal"
41
42 arch is a string representing the target architecture:
43 "aarch64", "armv5e", "core2-64", "coretexa8hf-neon", "i586", "mips32r2",
44 "mips64", or "ppc7400"
45
46 release is the version of Yocto Project.
47
48 NOTE:
49 The standard SDK installer does not have the "-ext" string as
50 part of the filename.
51
52
53 The toolchains provided by the Yocto
54 Project are based off of the ``core-image-sato`` and
55 ``core-image-minimal`` images and contain libraries appropriate for
56 developing against those images.
57
58 For example, if your build host is a 64-bit x86 system and you need
59 an extended SDK for a 64-bit core2 target, go into the ``x86_64``
60 folder and download the following installer:
61 ::
62
63 poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-DISTRO.sh
64
654. *Run the Installer:* Be sure you have execution privileges and run
66 the installer. Following is an example from the ``Downloads``
67 directory:
68 ::
69
70 $ ~/Downloads/poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-DISTRO.sh
71
72 During execution of the script, you choose the root location for the
73 toolchain. See the "`Installed Standard SDK Directory
74 Structure <#sdk-installed-standard-sdk-directory-structure>`__"
75 section and the "`Installed Extensible SDK Directory
76 Structure <#sdk-installed-extensible-sdk-directory-structure>`__"
77 section for more information.
78
79Building an SDK Installer
80=========================
81
82As an alternative to locating and downloading an SDK installer, you can
83build the SDK installer. Follow these steps:
84
851. *Set Up the Build Environment:* Be sure you are set up to use BitBake
86 in a shell. See the ":ref:`dev-manual/dev-manual-start:preparing the build host`" section
87 in the Yocto Project Development Tasks Manual for information on how
88 to get a build host ready that is either a native Linux machine or a
89 machine that uses CROPS.
90
912. *Clone the ``poky`` Repository:* You need to have a local copy of the
92 Yocto Project :term:`Source Directory`
93 (i.e. a local
94 ``poky`` repository). See the ":ref:`dev-manual/dev-manual-start:cloning the \`\`poky\`\` repository`" and
95 possibly the ":ref:`dev-manual/dev-manual-start:checking out by branch in poky`" and
96 ":ref:`checkout-out-by-tag-in-poky`" sections
97 all in the Yocto Project Development Tasks Manual for information on
98 how to clone the ``poky`` repository and check out the appropriate
99 branch for your work.
100
1013. *Initialize the Build Environment:* While in the root directory of
102 the Source Directory (i.e. ``poky``), run the
103 :ref:`structure-core-script` environment
104 setup script to define the OpenEmbedded build environment on your
105 build host.
106 ::
107
108 $ source oe-init-build-env
109
110 Among other things, the script
111 creates the :term:`Build Directory`,
112 which is
113 ``build`` in this case and is located in the Source Directory. After
114 the script runs, your current working directory is set to the
115 ``build`` directory.
116
1174. *Make Sure You Are Building an Installer for the Correct Machine:*
118 Check to be sure that your
119 :term:`MACHINE` variable in the
120 ``local.conf`` file in your Build Directory matches the architecture
121 for which you are building.
122
1235. *Make Sure Your SDK Machine is Correctly Set:* If you are building a
124 toolchain designed to run on an architecture that differs from your
125 current development host machine (i.e. the build host), be sure that
126 the :term:`SDKMACHINE` variable
127 in the ``local.conf`` file in your Build Directory is correctly set.
128
129 .. note::
130
131 If you are building an SDK installer for the Extensible SDK, the
132 SDKMACHINE
133 value must be set for the architecture of the machine you are
134 using to build the installer. If
135 SDKMACHINE
136 is not set appropriately, the build fails and provides an error
137 message similar to the following:
138 ::
139
140 The extensible SDK can currently only be built for the same architecture as the machine being built on - SDK_ARCH is
141 set to i686 (likely via setting SDKMACHINE) which is different from the architecture of the build machine (x86_64).
142 Unable to continue.
143
144
1456. *Build the SDK Installer:* To build the SDK installer for a standard
146 SDK and populate the SDK image, use the following command form. Be
147 sure to replace image with an image (e.g. "core-image-sato"): $
148 bitbake image -c populate_sdk You can do the same for the extensible
149 SDK using this command form:
150 ::
151
152 $ bitbake image -c populate_sdk_ext
153
154 These commands produce an SDK installer that contains the sysroot
155 that matches your target root filesystem.
156
157 When the ``bitbake`` command completes, the SDK installer will be in
158 ``tmp/deploy/sdk`` in the Build Directory.
159
160 .. note::
161
162 - By default, the previous BitBake command does not build static
163 binaries. If you want to use the toolchain to build these types
164 of libraries, you need to be sure your SDK has the appropriate
165 static development libraries. Use the
166 :term:`TOOLCHAIN_TARGET_TASK`
167 variable inside your ``local.conf`` file before building the
168 SDK installer. Doing so ensures that the eventual SDK
169 installation process installs the appropriate library packages
170 as part of the SDK. Following is an example using ``libc``
171 static development libraries: TOOLCHAIN_TARGET_TASK_append = "
172 libc-staticdev"
173
1747. *Run the Installer:* You can now run the SDK installer from
175 ``tmp/deploy/sdk`` in the Build Directory. Following is an example:
176 ::
177
178 $ cd ~/poky/build/tmp/deploy/sdk
179 $ ./poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-DISTRO.sh
180
181 During execution of the script, you choose the root location for the
182 toolchain. See the "`Installed Standard SDK Directory
183 Structure <#sdk-installed-standard-sdk-directory-structure>`__"
184 section and the "`Installed Extensible SDK Directory
185 Structure <#sdk-installed-extensible-sdk-directory-structure>`__"
186 section for more information.
187
188Extracting the Root Filesystem
189==============================
190
191After installing the toolchain, for some use cases you might need to
192separately extract a root filesystem:
193
194- You want to boot the image using NFS.
195
196- You want to use the root filesystem as the target sysroot.
197
198- You want to develop your target application using the root filesystem
199 as the target sysroot.
200
201Follow these steps to extract the root filesystem:
202
2031. *Locate and Download the Tarball for the Pre-Built Root Filesystem
204 Image File:* You need to find and download the root filesystem image
205 file that is appropriate for your target system. These files are kept
206 in machine-specific folders in the
207 :yocto_dl:`Index of Releases </releases/yocto/yocto-3.1.2/machines/>`
208 in the "machines" directory.
209
210 The machine-specific folders of the "machines" directory contain
211 tarballs (``*.tar.bz2``) for supported machines. These directories
212 also contain flattened root filesystem image files (``*.ext4``),
213 which you can use with QEMU directly.
214
215 The pre-built root filesystem image files follow these naming
216 conventions:
217 ::
218
219 core-image-profile-arch.tar.bz2
220
221 Where:
222 profile is the filesystem image's profile:
223 lsb, lsb-dev, lsb-sdk, minimal, minimal-dev, minimal-initramfs,
224 sato, sato-dev, sato-sdk, sato-sdk-ptest. For information on
225 these types of image profiles, see the "Images" chapter in
226 the Yocto Project Reference Manual.
227
228 arch is a string representing the target architecture:
229 beaglebone-yocto, beaglebone-yocto-lsb, edgerouter, edgerouter-lsb,
230 genericx86, genericx86-64, genericx86-64-lsb, genericx86-lsb and qemu*.
231
232 The root filesystems
233 provided by the Yocto Project are based off of the
234 ``core-image-sato`` and ``core-image-minimal`` images.
235
236 For example, if you plan on using a BeagleBone device as your target
237 hardware and your image is a ``core-image-sato-sdk`` image, you can
238 download the following file:
239 ::
240
241 core-image-sato-sdk-beaglebone-yocto.tar.bz2
242
2432. *Initialize the Cross-Development Environment:* You must ``source``
244 the cross-development environment setup script to establish necessary
245 environment variables.
246
247 This script is located in the top-level directory in which you
248 installed the toolchain (e.g. ``poky_sdk``).
249
250 Following is an example based on the toolchain installed in the
251 ":ref:`sdk-locating-pre-built-sdk-installers`" section:
252 ::
253
254 $ source ~/poky_sdk/environment-setup-core2-64-poky-linux
255
2563. *Extract the Root Filesystem:* Use the ``runqemu-extract-sdk``
257 command and provide the root filesystem image.
258
259 Following is an example command that extracts the root filesystem
260 from a previously built root filesystem image that was downloaded
261 from the :yocto_dl:`Index of Releases </releases/yocto/yocto-3.1.2/machines/>`.
262 This command extracts the root filesystem into the ``core2-64-sato``
263 directory:
264 ::
265
266 $ runqemu-extract-sdk ~/Downloads/core-image-sato-sdk-beaglebone-yocto.tar.bz2 ~/beaglebone-sato
267
268 You could now point to the target sysroot at ``beablebone-sato``.
269
270Installed Standard SDK Directory Structure
271==========================================
272
273The following figure shows the resulting directory structure after you
274install the Standard SDK by running the ``*.sh`` SDK installation
275script:
276
277.. image:: figures/sdk-installed-standard-sdk-directory.png
278 :scale: 80%
279 :align: center
280
281The installed SDK consists of an environment setup script for the SDK, a
282configuration file for the target, a version file for the target, and
283the root filesystem (``sysroots``) needed to develop objects for the
284target system.
285
286Within the figure, italicized text is used to indicate replaceable
287portions of the file or directory name. For example, install_dir/version
288is the directory where the SDK is installed. By default, this directory
289is ``/opt/poky/``. And, version represents the specific snapshot of the
290SDK (e.g. 3.1.2). Furthermore, target represents the target architecture
291(e.g. ``i586``) and host represents the development system's
292architecture (e.g. ``x86_64``). Thus, the complete names of the two
293directories within the ``sysroots`` could be ``i586-poky-linux`` and
294``x86_64-pokysdk-linux`` for the target and host, respectively.
295
296Installed Extensible SDK Directory Structure
297============================================
298
299The following figure shows the resulting directory structure after you
300install the Extensible SDK by running the ``*.sh`` SDK installation
301script:
302
303.. image:: figures/sdk-installed-extensible-sdk-directory.png
304 :scale: 80%
305 :align: center
306
307The installed directory structure for the extensible SDK is quite
308different than the installed structure for the standard SDK. The
309extensible SDK does not separate host and target parts in the same
310manner as does the standard SDK. The extensible SDK uses an embedded
311copy of the OpenEmbedded build system, which has its own sysroots.
312
313Of note in the directory structure are an environment setup script for
314the SDK, a configuration file for the target, a version file for the
315target, and log files for the OpenEmbedded build system preparation
316script run by the installer and BitBake.
317
318Within the figure, italicized text is used to indicate replaceable
319portions of the file or directory name. For example, install_dir is the
320directory where the SDK is installed, which is ``poky_sdk`` by default,
321and target represents the target architecture (e.g. ``i586``).
diff --git a/documentation/sdk-manual/sdk-appendix-obtain.xml b/documentation/sdk-manual/sdk-appendix-obtain.xml
index 86b6d7dd07..de7f75e2bb 100644
--- a/documentation/sdk-manual/sdk-appendix-obtain.xml
+++ b/documentation/sdk-manual/sdk-appendix-obtain.xml
@@ -1,6 +1,7 @@
1<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" 1<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
2"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" 2"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
3[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] > 3[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
4<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
4 5
5<appendix id='sdk-appendix-obtain'> 6<appendix id='sdk-appendix-obtain'>
6 7
diff --git a/documentation/sdk-manual/sdk-extensible.rst b/documentation/sdk-manual/sdk-extensible.rst
new file mode 100644
index 0000000000..0f92ac9f0c
--- /dev/null
+++ b/documentation/sdk-manual/sdk-extensible.rst
@@ -0,0 +1,1356 @@
1.. SPDX-License-Identifier: CC-BY-2.0-UK
2
3************************
4Using the Extensible SDK
5************************
6
7This chapter describes the extensible SDK and how to install it.
8Information covers the pieces of the SDK, how to install it, and
9presents a look at using the ``devtool`` functionality. The extensible
10SDK makes it easy to add new applications and libraries to an image,
11modify the source for an existing component, test changes on the target
12hardware, and ease integration into the rest of the
13:term:`OpenEmbedded Build System`.
14
15.. note::
16
17 For a side-by-side comparison of main features supported for an
18 extensible SDK as compared to a standard SDK, see the "
19 Introduction
20 " section.
21
22In addition to the functionality available through ``devtool``, you can
23alternatively make use of the toolchain directly, for example from
24Makefile and Autotools. See the "`Using the SDK Toolchain
25Directly <#sdk-working-projects>`__" chapter for more information.
26
27.. _sdk-extensible-sdk-intro:
28
29Why use the Extensible SDK and What is in It?
30=============================================
31
32The extensible SDK provides a cross-development toolchain and libraries
33tailored to the contents of a specific image. You would use the
34Extensible SDK if you want a toolchain experience supplemented with the
35powerful set of ``devtool`` commands tailored for the Yocto Project
36environment.
37
38The installed extensible SDK consists of several files and directories.
39Basically, it contains an SDK environment setup script, some
40configuration files, an internal build system, and the ``devtool``
41functionality.
42
43.. _sdk-installing-the-extensible-sdk:
44
45Installing the Extensible SDK
46=============================
47
48The first thing you need to do is install the SDK on your :term:`Build
49Host` by running the ``*.sh`` installation script.
50
51You can download a tarball installer, which includes the pre-built
52toolchain, the ``runqemu`` script, the internal build system,
53``devtool``, and support files from the appropriate
54:yocto_dl:`toolchain </releases/yocto/yocto-3.1.2/toolchain/>` directory within the Index of
55Releases. Toolchains are available for several 32-bit and 64-bit
56architectures with the ``x86_64`` directories, respectively. The
57toolchains the Yocto Project provides are based off the
58``core-image-sato`` and ``core-image-minimal`` images and contain
59libraries appropriate for developing against that image.
60
61The names of the tarball installer scripts are such that a string
62representing the host system appears first in the filename and then is
63immediately followed by a string representing the target architecture.
64An extensible SDK has the string "-ext" as part of the name. Following
65is the general form:
66::
67
68 poky-glibc-host_system-image_type-arch-toolchain-ext-release_version.sh
69
70 Where:
71 host_system is a string representing your development system:
72
73 i686 or x86_64.
74
75 image_type is the image for which the SDK was built:
76
77 core-image-sato or core-image-minimal
78
79 arch is a string representing the tuned target architecture:
80
81 aarch64, armv5e, core2-64, i586, mips32r2, mips64, ppc7400, or cortexa8hf-neon
82
83 release_version is a string representing the release number of the Yocto Project:
84
85 3.1.2, 3.1.2+snapshot
86
87For example, the following SDK installer is for a 64-bit
88development host system and a i586-tuned target architecture based off
89the SDK for ``core-image-sato`` and using the current DISTRO snapshot:
90::
91
92 poky-glibc-x86_64-core-image-sato-i586-toolchain-ext-DISTRO.sh
93
94.. note::
95
96 As an alternative to downloading an SDK, you can build the SDK
97 installer. For information on building the installer, see the "
98 Building an SDK Installer
99 " section.
100
101The SDK and toolchains are self-contained and by default are installed
102into the ``poky_sdk`` folder in your home directory. You can choose to
103install the extensible SDK in any location when you run the installer.
104However, because files need to be written under that directory during
105the normal course of operation, the location you choose for installation
106must be writable for whichever users need to use the SDK.
107
108The following command shows how to run the installer given a toolchain
109tarball for a 64-bit x86 development host system and a 64-bit x86 target
110architecture. The example assumes the SDK installer is located in
111``~/Downloads/`` and has execution rights.
112
113.. note::
114
115 If you do not have write permissions for the directory into which you
116 are installing the SDK, the installer notifies you and exits. For
117 that case, set up the proper permissions in the directory and run the
118 installer again.
119
120::
121
122 $ ./Downloads/poky-glibc-x86_64-core-image-minimal-core2-64-toolchain-ext-2.5.sh
123 Poky (Yocto Project Reference Distro) Extensible SDK installer version 2.5
124 ==========================================================================
125 Enter target directory for SDK (default: ~/poky_sdk):
126 You are about to install the SDK to "/home/scottrif/poky_sdk". Proceed [Y/n]? Y
127 Extracting SDK..............done
128 Setting it up...
129 Extracting buildtools...
130 Preparing build system...
131 Parsing recipes: 100% |##################################################################| Time: 0:00:52
132 Initialising tasks: 100% |###############################################################| Time: 0:00:00
133 Checking sstate mirror object availability: 100% |#######################################| Time: 0:00:00
134 Loading cache: 100% |####################################################################| Time: 0:00:00
135 Initialising tasks: 100% |###############################################################| Time: 0:00:00
136 done
137 SDK has been successfully set up and is ready to be used.
138 Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
139 $ . /home/scottrif/poky_sdk/environment-setup-core2-64-poky-linux
140
141.. _sdk-running-the-extensible-sdk-environment-setup-script:
142
143Running the Extensible SDK Environment Setup Script
144===================================================
145
146Once you have the SDK installed, you must run the SDK environment setup
147script before you can actually use the SDK. This setup script resides in
148the directory you chose when you installed the SDK, which is either the
149default ``poky_sdk`` directory or the directory you chose during
150installation.
151
152Before running the script, be sure it is the one that matches the
153architecture for which you are developing. Environment setup scripts
154begin with the string "``environment-setup``" and include as part of
155their name the tuned target architecture. As an example, the following
156commands set the working directory to where the SDK was installed and
157then source the environment setup script. In this example, the setup
158script is for an IA-based target machine using i586 tuning:
159::
160
161 $ cd /home/scottrif/poky_sdk
162 $ source environment-setup-core2-64-poky-linux
163 SDK environment now set up; additionally you may now run devtool to perform development tasks.
164 Run devtool --help for further details.
165
166Running the setup script defines many environment variables needed in
167order to use the SDK (e.g. ``PATH``,
168:term:`CC`,
169:term:`LD`, and so forth). If you want to
170see all the environment variables the script exports, examine the
171installation file itself.
172
173Using ``devtool`` in Your SDK Workflow
174======================================
175
176The cornerstone of the extensible SDK is a command-line tool called
177``devtool``. This tool provides a number of features that help you
178build, test and package software within the extensible SDK, and
179optionally integrate it into an image built by the OpenEmbedded build
180system.
181
182.. note::
183
184 The use of
185 devtool
186 is not limited to the extensible SDK. You can use
187 devtool
188 to help you easily develop any project whose build output must be
189 part of an image built using the build system.
190
191The ``devtool`` command line is organized similarly to
192:ref:`overview-manual/overview-manual-development-environment:git` in that it has a number of
193sub-commands for each function. You can run ``devtool --help`` to see
194all the commands.
195
196.. note::
197
198 See the "
199 devtool
200  Quick Reference
201 " in the Yocto Project Reference Manual for a
202 devtool
203 quick reference.
204
205Three ``devtool`` subcommands exist that provide entry-points into
206development:
207
208- *devtool add*: Assists in adding new software to be built.
209
210- *devtool modify*: Sets up an environment to enable you to modify
211 the source of an existing component.
212
213- *devtool upgrade*: Updates an existing recipe so that you can
214 build it for an updated set of source files.
215
216As with the build system, "recipes" represent software packages within
217``devtool``. When you use ``devtool add``, a recipe is automatically
218created. When you use ``devtool modify``, the specified existing recipe
219is used in order to determine where to get the source code and how to
220patch it. In both cases, an environment is set up so that when you build
221the recipe a source tree that is under your control is used in order to
222allow you to make changes to the source as desired. By default, new
223recipes and the source go into a "workspace" directory under the SDK.
224
225The remainder of this section presents the ``devtool add``,
226``devtool modify``, and ``devtool upgrade`` workflows.
227
228.. _sdk-use-devtool-to-add-an-application:
229
230Use ``devtool add`` to Add an Application
231-----------------------------------------
232
233The ``devtool add`` command generates a new recipe based on existing
234source code. This command takes advantage of the
235:ref:`devtool-the-workspace-layer-structure`
236layer that many ``devtool`` commands use. The command is flexible enough
237to allow you to extract source code into both the workspace or a
238separate local Git repository and to use existing code that does not
239need to be extracted.
240
241Depending on your particular scenario, the arguments and options you use
242with ``devtool add`` form different combinations. The following diagram
243shows common development flows you would use with the ``devtool add``
244command:
245
246.. image:: figures/sdk-devtool-add-flow.png
247 :align: center
248
2491. *Generating the New Recipe*: The top part of the flow shows three
250 scenarios by which you could use ``devtool add`` to generate a recipe
251 based on existing source code.
252
253 In a shared development environment, it is typical for other
254 developers to be responsible for various areas of source code. As a
255 developer, you are probably interested in using that source code as
256 part of your development within the Yocto Project. All you need is
257 access to the code, a recipe, and a controlled area in which to do
258 your work.
259
260 Within the diagram, three possible scenarios feed into the
261 ``devtool add`` workflow:
262
263 - *Left*: The left scenario in the figure represents a common
264 situation where the source code does not exist locally and needs
265 to be extracted. In this situation, the source code is extracted
266 to the default workspace - you do not want the files in some
267 specific location outside of the workspace. Thus, everything you
268 need will be located in the workspace:
269 ::
270
271 $ devtool add recipe fetchuri
272
273 With this command, ``devtool`` extracts the upstream
274 source files into a local Git repository within the ``sources``
275 folder. The command then creates a recipe named recipe and a
276 corresponding append file in the workspace. If you do not provide
277 recipe, the command makes an attempt to determine the recipe name.
278
279 - *Middle*: The middle scenario in the figure also represents a
280 situation where the source code does not exist locally. In this
281 case, the code is again upstream and needs to be extracted to some
282 local area - this time outside of the default workspace.
283
284 .. note::
285
286 If required,
287 devtool
288 always creates a Git repository locally during the extraction.
289
290 Furthermore, the first positional argument srctree in this case
291 identifies where the ``devtool add`` command will locate the
292 extracted code outside of the workspace. You need to specify an
293 empty directory:
294 ::
295
296 $ devtool add recipe srctree fetchuri
297
298 In summary,
299 the source code is pulled from fetchuri and extracted into the
300 location defined by srctree as a local Git repository.
301
302 Within workspace, ``devtool`` creates a recipe named recipe along
303 with an associated append file.
304
305 - *Right*: The right scenario in the figure represents a situation
306 where the srctree has been previously prepared outside of the
307 ``devtool`` workspace.
308
309 The following command provides a new recipe name and identifies
310 the existing source tree location:
311 ::
312
313 $ devtool add recipe srctree
314
315 The command examines the source code and creates a recipe named
316 recipe for the code and places the recipe into the workspace.
317
318 Because the extracted source code already exists, ``devtool`` does
319 not try to relocate the source code into the workspace - only the
320 new recipe is placed in the workspace.
321
322 Aside from a recipe folder, the command also creates an associated
323 append folder and places an initial ``*.bbappend`` file within.
324
3252. *Edit the Recipe*: You can use ``devtool edit-recipe`` to open up the
326 editor as defined by the ``$EDITOR`` environment variable and modify
327 the file:
328 ::
329
330 $ devtool edit-recipe recipe
331
332 From within the editor, you
333 can make modifications to the recipe that take affect when you build
334 it later.
335
3363. *Build the Recipe or Rebuild the Image*: The next step you take
337 depends on what you are going to do with the new code.
338
339 If you need to eventually move the build output to the target
340 hardware, use the following ``devtool`` command:
341 :;
342
343 $ devtool build recipe
344
345 On the other hand, if you want an image to contain the recipe's
346 packages from the workspace for immediate deployment onto a device
347 (e.g. for testing purposes), you can use the ``devtool build-image``
348 command:
349 ::
350
351 $ devtool build-image image
352
3534. *Deploy the Build Output*: When you use the ``devtool build`` command
354 to build out your recipe, you probably want to see if the resulting
355 build output works as expected on the target hardware.
356
357 .. note::
358
359 This step assumes you have a previously built image that is
360 already either running in QEMU or is running on actual hardware.
361 Also, it is assumed that for deployment of the image to the
362 target, SSH is installed in the image and, if the image is running
363 on real hardware, you have network access to and from your
364 development machine.
365
366 You can deploy your build output to that target hardware by using the
367 ``devtool deploy-target`` command: $ devtool deploy-target recipe
368 target The target is a live target machine running as an SSH server.
369
370 You can, of course, also deploy the image you build to actual
371 hardware by using the ``devtool build-image`` command. However,
372 ``devtool`` does not provide a specific command that allows you to
373 deploy the image to actual hardware.
374
3755. *Finish Your Work With the Recipe*: The ``devtool finish`` command
376 creates any patches corresponding to commits in the local Git
377 repository, moves the new recipe to a more permanent layer, and then
378 resets the recipe so that the recipe is built normally rather than
379 from the workspace.
380 ::
381
382 $ devtool finish recipe layer
383
384 .. note::
385
386 Any changes you want to turn into patches must be committed to the
387 Git repository in the source tree.
388
389 As mentioned, the ``devtool finish`` command moves the final recipe
390 to its permanent layer.
391
392 As a final process of the ``devtool finish`` command, the state of
393 the standard layers and the upstream source is restored so that you
394 can build the recipe from those areas rather than the workspace.
395
396 .. note::
397
398 You can use the
399 devtool reset
400 command to put things back should you decide you do not want to
401 proceed with your work. If you do use this command, realize that
402 the source tree is preserved.
403
404.. _sdk-devtool-use-devtool-modify-to-modify-the-source-of-an-existing-component:
405
406Use ``devtool modify`` to Modify the Source of an Existing Component
407--------------------------------------------------------------------
408
409The ``devtool modify`` command prepares the way to work on existing code
410that already has a local recipe in place that is used to build the
411software. The command is flexible enough to allow you to extract code
412from an upstream source, specify the existing recipe, and keep track of
413and gather any patch files from other developers that are associated
414with the code.
415
416Depending on your particular scenario, the arguments and options you use
417with ``devtool modify`` form different combinations. The following
418diagram shows common development flows for the ``devtool modify``
419command:
420
421.. image:: figures/sdk-devtool-modify-flow.png
422 :align: center
423
4241. *Preparing to Modify the Code*: The top part of the flow shows three
425 scenarios by which you could use ``devtool modify`` to prepare to
426 work on source files. Each scenario assumes the following:
427
428 - The recipe exists locally in a layer external to the ``devtool``
429 workspace.
430
431 - The source files exist either upstream in an un-extracted state or
432 locally in a previously extracted state.
433
434 The typical situation is where another developer has created a layer
435 for use with the Yocto Project and their recipe already resides in
436 that layer. Furthermore, their source code is readily available
437 either upstream or locally.
438
439 - *Left*: The left scenario in the figure represents a common
440 situation where the source code does not exist locally and it
441 needs to be extracted from an upstream source. In this situation,
442 the source is extracted into the default ``devtool`` workspace
443 location. The recipe, in this scenario, is in its own layer
444 outside the workspace (i.e. ``meta-``\ layername).
445
446 The following command identifies the recipe and, by default,
447 extracts the source files:
448 ::
449
450 $ devtool modify recipe
451
452 Once
453 ``devtool``\ locates the recipe, ``devtool`` uses the recipe's
454 :term:`SRC_URI` statements to
455 locate the source code and any local patch files from other
456 developers.
457
458 With this scenario, no srctree argument exists. Consequently, the
459 default behavior of the ``devtool modify`` command is to extract
460 the source files pointed to by the ``SRC_URI`` statements into a
461 local Git structure. Furthermore, the location for the extracted
462 source is the default area within the ``devtool`` workspace. The
463 result is that the command sets up both the source code and an
464 append file within the workspace while the recipe remains in its
465 original location.
466
467 Additionally, if you have any non-patch local files (i.e. files
468 referred to with ``file://`` entries in ``SRC_URI`` statement
469 excluding ``*.patch/`` or ``*.diff``), these files are copied to
470 an ``oe-local-files`` folder under the newly created source tree.
471 Copying the files here gives you a convenient area from which you
472 can modify the files. Any changes or additions you make to those
473 files are incorporated into the build the next time you build the
474 software just as are other changes you might have made to the
475 source.
476
477 - *Middle*: The middle scenario in the figure represents a situation
478 where the source code also does not exist locally. In this case,
479 the code is again upstream and needs to be extracted to some local
480 area as a Git repository. The recipe, in this scenario, is again
481 local and in its own layer outside the workspace.
482
483 The following command tells ``devtool`` the recipe with which to
484 work and, in this case, identifies a local area for the extracted
485 source files that exists outside of the default ``devtool``
486 workspace:
487 ::
488
489 $ devtool modify recipe srctree
490
491 .. note::
492
493 You cannot provide a URL for
494 srctree
495 using the
496 devtool
497 command.
498
499 As with all extractions, the command uses the recipe's ``SRC_URI``
500 statements to locate the source files and any associated patch
501 files. Non-patch files are copied to an ``oe-local-files`` folder
502 under the newly created source tree.
503
504 Once the files are located, the command by default extracts them
505 into srctree.
506
507 Within workspace, ``devtool`` creates an append file for the
508 recipe. The recipe remains in its original location but the source
509 files are extracted to the location you provide with srctree.
510
511 - *Right*: The right scenario in the figure represents a situation
512 where the source tree (srctree) already exists locally as a
513 previously extracted Git structure outside of the ``devtool``
514 workspace. In this example, the recipe also exists elsewhere
515 locally in its own layer.
516
517 The following command tells ``devtool`` the recipe with which to
518 work, uses the "-n" option to indicate source does not need to be
519 extracted, and uses srctree to point to the previously extracted
520 source files:
521 ::
522
523 $ devtool modify -n recipe srctree
524
525 If an ``oe-local-files`` subdirectory happens to exist and it
526 contains non-patch files, the files are used. However, if the
527 subdirectory does not exist and you run the ``devtool finish``
528 command, any non-patch files that might exist next to the recipe
529 are removed because it appears to ``devtool`` that you have
530 deleted those files.
531
532 Once the ``devtool modify`` command finishes, it creates only an
533 append file for the recipe in the ``devtool`` workspace. The
534 recipe and the source code remain in their original locations.
535
5362. *Edit the Source*: Once you have used the ``devtool modify`` command,
537 you are free to make changes to the source files. You can use any
538 editor you like to make and save your source code modifications.
539
5403. *Build the Recipe or Rebuild the Image*: The next step you take
541 depends on what you are going to do with the new code.
542
543 If you need to eventually move the build output to the target
544 hardware, use the following ``devtool`` command:
545 ::
546
547 $ devtool build recipe
548
549 On the other hand, if you want an image to contain the recipe's
550 packages from the workspace for immediate deployment onto a device
551 (e.g. for testing purposes), you can use the ``devtool build-image``
552 command: $ devtool build-image image
553
5544. *Deploy the Build Output*: When you use the ``devtool build`` command
555 to build out your recipe, you probably want to see if the resulting
556 build output works as expected on target hardware.
557
558 .. note::
559
560 This step assumes you have a previously built image that is
561 already either running in QEMU or running on actual hardware.
562 Also, it is assumed that for deployment of the image to the
563 target, SSH is installed in the image and if the image is running
564 on real hardware that you have network access to and from your
565 development machine.
566
567 You can deploy your build output to that target hardware by using the
568 ``devtool deploy-target`` command:
569 ::
570
571 $ devtool deploy-target recipe target
572
573 The target is a live target machine running as an SSH server.
574
575 You can, of course, use other methods to deploy the image you built
576 using the ``devtool build-image`` command to actual hardware.
577 ``devtool`` does not provide a specific command to deploy the image
578 to actual hardware.
579
5805. *Finish Your Work With the Recipe*: The ``devtool finish`` command
581 creates any patches corresponding to commits in the local Git
582 repository, updates the recipe to point to them (or creates a
583 ``.bbappend`` file to do so, depending on the specified destination
584 layer), and then resets the recipe so that the recipe is built
585 normally rather than from the workspace.
586 ::
587
588 $ devtool finish recipe layer
589
590 .. note::
591
592 Any changes you want to turn into patches must be staged and
593 committed within the local Git repository before you use the
594 devtool finish
595 command.
596
597 Because there is no need to move the recipe, ``devtool finish``
598 either updates the original recipe in the original layer or the
599 command creates a ``.bbappend`` file in a different layer as provided
600 by layer. Any work you did in the ``oe-local-files`` directory is
601 preserved in the original files next to the recipe during the
602 ``devtool finish`` command.
603
604 As a final process of the ``devtool finish`` command, the state of
605 the standard layers and the upstream source is restored so that you
606 can build the recipe from those areas rather than from the workspace.
607
608 .. note::
609
610 You can use the
611 devtool reset
612 command to put things back should you decide you do not want to
613 proceed with your work. If you do use this command, realize that
614 the source tree is preserved.
615
616.. _sdk-devtool-use-devtool-upgrade-to-create-a-version-of-the-recipe-that-supports-a-newer-version-of-the-software:
617
618Use ``devtool upgrade`` to Create a Version of the Recipe that Supports a Newer Version of the Software
619-------------------------------------------------------------------------------------------------------
620
621The ``devtool upgrade`` command upgrades an existing recipe to that of a
622more up-to-date version found upstream. Throughout the life of software,
623recipes continually undergo version upgrades by their upstream
624publishers. You can use the ``devtool upgrade`` workflow to make sure
625your recipes you are using for builds are up-to-date with their upstream
626counterparts.
627
628.. note::
629
630 Several methods exist by which you can upgrade recipes -
631 devtool upgrade
632 happens to be one. You can read about all the methods by which you
633 can upgrade recipes in the "
634 Upgrading Recipes
635 " section of the Yocto Project Development Tasks Manual.
636
637The ``devtool upgrade`` command is flexible enough to allow you to
638specify source code revision and versioning schemes, extract code into
639or out of the ``devtool``
640:ref:`devtool-the-workspace-layer-structure`,
641and work with any source file forms that the
642:ref:`fetchers <bitbake:bb-fetchers>` support.
643
644The following diagram shows the common development flow used with the
645``devtool upgrade`` command:
646
647.. image:: figures/sdk-devtool-upgrade-flow.png
648 :align: center
649
6501. *Initiate the Upgrade*: The top part of the flow shows the typical
651 scenario by which you use the ``devtool upgrade`` command. The
652 following conditions exist:
653
654 - The recipe exists in a local layer external to the ``devtool``
655 workspace.
656
657 - The source files for the new release exist in the same location
658 pointed to by :term:`SRC_URI`
659 in the recipe (e.g. a tarball with the new version number in the
660 name, or as a different revision in the upstream Git repository).
661
662 A common situation is where third-party software has undergone a
663 revision so that it has been upgraded. The recipe you have access to
664 is likely in your own layer. Thus, you need to upgrade the recipe to
665 use the newer version of the software:
666 ::
667
668 $ devtool upgrade -V version recipe
669
670 By default, the ``devtool upgrade`` command extracts source
671 code into the ``sources`` directory in the
672 :ref:`devtool-the-workspace-layer-structure`.
673 If you want the code extracted to any other location, you need to
674 provide the srctree positional argument with the command as follows:
675 $ devtool upgrade -V version recipe srctree
676
677 .. note::
678
679 In this example, the "-V" option specifies the new version. If you
680 don't use "-V", the command upgrades the recipe to the latest
681 version.
682
683 If the source files pointed to by the ``SRC_URI`` statement in the
684 recipe are in a Git repository, you must provide the "-S" option and
685 specify a revision for the software.
686
687 Once ``devtool`` locates the recipe, it uses the ``SRC_URI`` variable
688 to locate the source code and any local patch files from other
689 developers. The result is that the command sets up the source code,
690 the new version of the recipe, and an append file all within the
691 workspace.
692
693 Additionally, if you have any non-patch local files (i.e. files
694 referred to with ``file://`` entries in ``SRC_URI`` statement
695 excluding ``*.patch/`` or ``*.diff``), these files are copied to an
696 ``oe-local-files`` folder under the newly created source tree.
697 Copying the files here gives you a convenient area from which you can
698 modify the files. Any changes or additions you make to those files
699 are incorporated into the build the next time you build the software
700 just as are other changes you might have made to the source.
701
7022. *Resolve any Conflicts created by the Upgrade*: Conflicts could exist
703 due to the software being upgraded to a new version. Conflicts occur
704 if your recipe specifies some patch files in ``SRC_URI`` that
705 conflict with changes made in the new version of the software. For
706 such cases, you need to resolve the conflicts by editing the source
707 and following the normal ``git rebase`` conflict resolution process.
708
709 Before moving onto the next step, be sure to resolve any such
710 conflicts created through use of a newer or different version of the
711 software.
712
7133. *Build the Recipe or Rebuild the Image*: The next step you take
714 depends on what you are going to do with the new code.
715
716 If you need to eventually move the build output to the target
717 hardware, use the following ``devtool`` command:
718 ::
719
720 $ devtool build recipe
721
722 On the other hand, if you want an image to contain the recipe's
723 packages from the workspace for immediate deployment onto a device
724 (e.g. for testing purposes), you can use the ``devtool build-image``
725 command:
726 ::
727
728 $ devtool build-image image
729
7304. *Deploy the Build Output*: When you use the ``devtool build`` command
731 or ``bitbake`` to build your recipe, you probably want to see if the
732 resulting build output works as expected on target hardware.
733
734 .. note::
735
736 This step assumes you have a previously built image that is
737 already either running in QEMU or running on actual hardware.
738 Also, it is assumed that for deployment of the image to the
739 target, SSH is installed in the image and if the image is running
740 on real hardware that you have network access to and from your
741 development machine.
742
743 You can deploy your build output to that target hardware by using the
744 ``devtool deploy-target`` command: $ devtool deploy-target recipe
745 target The target is a live target machine running as an SSH server.
746
747 You can, of course, also deploy the image you build using the
748 ``devtool build-image`` command to actual hardware. However,
749 ``devtool`` does not provide a specific command that allows you to do
750 this.
751
7525. *Finish Your Work With the Recipe*: The ``devtool finish`` command
753 creates any patches corresponding to commits in the local Git
754 repository, moves the new recipe to a more permanent layer, and then
755 resets the recipe so that the recipe is built normally rather than
756 from the workspace.
757
758 Any work you did in the ``oe-local-files`` directory is preserved in
759 the original files next to the recipe during the ``devtool finish``
760 command.
761
762 If you specify a destination layer that is the same as the original
763 source, then the old version of the recipe and associated files are
764 removed prior to adding the new version.
765 ::
766
767 $ devtool finish recipe layer
768
769 .. note::
770
771 Any changes you want to turn into patches must be committed to the
772 Git repository in the source tree.
773
774 As a final process of the ``devtool finish`` command, the state of
775 the standard layers and the upstream source is restored so that you
776 can build the recipe from those areas rather than the workspace.
777
778 .. note::
779
780 You can use the
781 devtool reset
782 command to put things back should you decide you do not want to
783 proceed with your work. If you do use this command, realize that
784 the source tree is preserved.
785
786.. _sdk-a-closer-look-at-devtool-add:
787
788A Closer Look at ``devtool add``
789================================
790
791The ``devtool add`` command automatically creates a recipe based on the
792source tree you provide with the command. Currently, the command has
793support for the following:
794
795- Autotools (``autoconf`` and ``automake``)
796
797- CMake
798
799- Scons
800
801- ``qmake``
802
803- Plain ``Makefile``
804
805- Out-of-tree kernel module
806
807- Binary package (i.e. "-b" option)
808
809- Node.js module
810
811- Python modules that use ``setuptools`` or ``distutils``
812
813Apart from binary packages, the determination of how a source tree
814should be treated is automatic based on the files present within that
815source tree. For example, if a ``CMakeLists.txt`` file is found, then
816the source tree is assumed to be using CMake and is treated accordingly.
817
818.. note::
819
820 In most cases, you need to edit the automatically generated recipe in
821 order to make it build properly. Typically, you would go through
822 several edit and build cycles until the recipe successfully builds.
823 Once the recipe builds, you could use possible further iterations to
824 test the recipe on the target device.
825
826The remainder of this section covers specifics regarding how parts of
827the recipe are generated.
828
829.. _sdk-name-and-version:
830
831Name and Version
832----------------
833
834If you do not specify a name and version on the command line,
835``devtool add`` uses various metadata within the source tree in an
836attempt to determine the name and version of the software being built.
837Based on what the tool determines, ``devtool`` sets the name of the
838created recipe file accordingly.
839
840If ``devtool`` cannot determine the name and version, the command prints
841an error. For such cases, you must re-run the command and provide the
842name and version, just the name, or just the version as part of the
843command line.
844
845Sometimes the name or version determined from the source tree might be
846incorrect. For such a case, you must reset the recipe:
847::
848
849 $ devtool reset -n recipename
850
851After running the ``devtool reset`` command, you need to
852run ``devtool add`` again and provide the name or the version.
853
854.. _sdk-dependency-detection-and-mapping:
855
856Dependency Detection and Mapping
857--------------------------------
858
859The ``devtool add`` command attempts to detect build-time dependencies
860and map them to other recipes in the system. During this mapping, the
861command fills in the names of those recipes as part of the
862:term:`DEPENDS` variable within the
863recipe. If a dependency cannot be mapped, ``devtool`` places a comment
864in the recipe indicating such. The inability to map a dependency can
865result from naming not being recognized or because the dependency simply
866is not available. For cases where the dependency is not available, you
867must use the ``devtool add`` command to add an additional recipe that
868satisfies the dependency. Once you add that recipe, you need to update
869the ``DEPENDS`` variable in the original recipe to include the new
870recipe.
871
872If you need to add runtime dependencies, you can do so by adding the
873following to your recipe:
874::
875
876 RDEPENDS_${PN} += "dependency1 dependency2 ..."
877
878.. note::
879
880 The
881 devtool add
882 command often cannot distinguish between mandatory and optional
883 dependencies. Consequently, some of the detected dependencies might
884 in fact be optional. When in doubt, consult the documentation or the
885 configure script for the software the recipe is building for further
886 details. In some cases, you might find you can substitute the
887 dependency with an option that disables the associated functionality
888 passed to the configure script.
889
890.. _sdk-license-detection:
891
892License Detection
893-----------------
894
895The ``devtool add`` command attempts to determine if the software you
896are adding is able to be distributed under a common, open-source
897license. If so, the command sets the
898:term:`LICENSE` value accordingly.
899You should double-check the value added by the command against the
900documentation or source files for the software you are building and, if
901necessary, update that ``LICENSE`` value.
902
903The ``devtool add`` command also sets the
904:term:`LIC_FILES_CHKSUM`
905value to point to all files that appear to be license-related. Realize
906that license statements often appear in comments at the top of source
907files or within the documentation. In such cases, the command does not
908recognize those license statements. Consequently, you might need to
909amend the ``LIC_FILES_CHKSUM`` variable to point to one or more of those
910comments if present. Setting ``LIC_FILES_CHKSUM`` is particularly
911important for third-party software. The mechanism attempts to ensure
912correct licensing should you upgrade the recipe to a newer upstream
913version in future. Any change in licensing is detected and you receive
914an error prompting you to check the license text again.
915
916If the ``devtool add`` command cannot determine licensing information,
917``devtool`` sets the ``LICENSE`` value to "CLOSED" and leaves the
918``LIC_FILES_CHKSUM`` value unset. This behavior allows you to continue
919with development even though the settings are unlikely to be correct in
920all cases. You should check the documentation or source files for the
921software you are building to determine the actual license.
922
923.. _sdk-adding-makefile-only-software:
924
925Adding Makefile-Only Software
926-----------------------------
927
928The use of Make by itself is very common in both proprietary and
929open-source software. Unfortunately, Makefiles are often not written
930with cross-compilation in mind. Thus, ``devtool add`` often cannot do
931very much to ensure that these Makefiles build correctly. It is very
932common, for example, to explicitly call ``gcc`` instead of using the
933:term:`CC` variable. Usually, in a
934cross-compilation environment, ``gcc`` is the compiler for the build
935host and the cross-compiler is named something similar to
936``arm-poky-linux-gnueabi-gcc`` and might require arguments (e.g. to
937point to the associated sysroot for the target machine).
938
939When writing a recipe for Makefile-only software, keep the following in
940mind:
941
942- You probably need to patch the Makefile to use variables instead of
943 hardcoding tools within the toolchain such as ``gcc`` and ``g++``.
944
945- The environment in which Make runs is set up with various standard
946 variables for compilation (e.g. ``CC``, ``CXX``, and so forth) in a
947 similar manner to the environment set up by the SDK's environment
948 setup script. One easy way to see these variables is to run the
949 ``devtool build`` command on the recipe and then look in
950 ``oe-logs/run.do_compile``. Towards the top of this file, a list of
951 environment variables exists that are being set. You can take
952 advantage of these variables within the Makefile.
953
954- If the Makefile sets a default for a variable using "=", that default
955 overrides the value set in the environment, which is usually not
956 desirable. For this case, you can either patch the Makefile so it
957 sets the default using the "?=" operator, or you can alternatively
958 force the value on the ``make`` command line. To force the value on
959 the command line, add the variable setting to
960 :term:`EXTRA_OEMAKE` or
961 :term:`PACKAGECONFIG_CONFARGS`
962 within the recipe. Here is an example using ``EXTRA_OEMAKE``:
963 ::
964
965 EXTRA_OEMAKE += "'CC=${CC}' 'CXX=${CXX}'"
966
967 In the above example,
968 single quotes are used around the variable settings as the values are
969 likely to contain spaces because required default options are passed
970 to the compiler.
971
972- Hardcoding paths inside Makefiles is often problematic in a
973 cross-compilation environment. This is particularly true because
974 those hardcoded paths often point to locations on the build host and
975 thus will either be read-only or will introduce contamination into
976 the cross-compilation because they are specific to the build host
977 rather than the target. Patching the Makefile to use prefix variables
978 or other path variables is usually the way to handle this situation.
979
980- Sometimes a Makefile runs target-specific commands such as
981 ``ldconfig``. For such cases, you might be able to apply patches that
982 remove these commands from the Makefile.
983
984.. _sdk-adding-native-tools:
985
986Adding Native Tools
987-------------------
988
989Often, you need to build additional tools that run on the :term:`Build
990Host` as opposed to
991the target. You should indicate this requirement by using one of the
992following methods when you run ``devtool add``:
993
994- Specify the name of the recipe such that it ends with "-native".
995 Specifying the name like this produces a recipe that only builds for
996 the build host.
997
998- Specify the "DASHDASHalso-native" option with the ``devtool add``
999 command. Specifying this option creates a recipe file that still
1000 builds for the target but also creates a variant with a "-native"
1001 suffix that builds for the build host.
1002
1003.. note::
1004
1005 If you need to add a tool that is shipped as part of a source tree
1006 that builds code for the target, you can typically accomplish this by
1007 building the native and target parts separately rather than within
1008 the same compilation process. Realize though that with the
1009 "DASHDASHalso-native" option, you can add the tool using just one
1010 recipe file.
1011
1012.. _sdk-adding-node-js-modules:
1013
1014Adding Node.js Modules
1015----------------------
1016
1017You can use the ``devtool add`` command two different ways to add
1018Node.js modules: 1) Through ``npm`` and, 2) from a repository or local
1019source.
1020
1021Use the following form to add Node.js modules through ``npm``:
1022::
1023
1024 $ devtool add "npm://registry.npmjs.org;name=forever;version=0.15.1"
1025
1026The name and
1027version parameters are mandatory. Lockdown and shrinkwrap files are
1028generated and pointed to by the recipe in order to freeze the version
1029that is fetched for the dependencies according to the first time. This
1030also saves checksums that are verified on future fetches. Together,
1031these behaviors ensure the reproducibility and integrity of the build.
1032
1033.. note::
1034
1035 - You must use quotes around the URL. The ``devtool add`` does not
1036 require the quotes, but the shell considers ";" as a splitter
1037 between multiple commands. Thus, without the quotes,
1038 ``devtool add`` does not receive the other parts, which results in
1039 several "command not found" errors.
1040
1041 - In order to support adding Node.js modules, a ``nodejs`` recipe
1042 must be part of your SDK.
1043
1044As mentioned earlier, you can also add Node.js modules directly from a
1045repository or local source tree. To add modules this way, use
1046``devtool add`` in the following form:
1047::
1048
1049 $ devtool add https://github.com/diversario/node-ssdp
1050
1051In this example, ``devtool``
1052fetches the specified Git repository, detects the code as Node.js code,
1053fetches dependencies using ``npm``, and sets
1054:term:`SRC_URI` accordingly.
1055
1056.. _sdk-working-with-recipes:
1057
1058Working With Recipes
1059====================
1060
1061When building a recipe using the ``devtool build`` command, the typical
1062build progresses as follows:
1063
10641. Fetch the source
1065
10662. Unpack the source
1067
10683. Configure the source
1069
10704. Compile the source
1071
10725. Install the build output
1073
10746. Package the installed output
1075
1076For recipes in the workspace, fetching and unpacking is disabled as the
1077source tree has already been prepared and is persistent. Each of these
1078build steps is defined as a function (task), usually with a "do\_" prefix
1079(e.g. :ref:`ref-tasks-fetch`,
1080:ref:`ref-tasks-unpack`, and so
1081forth). These functions are typically shell scripts but can instead be
1082written in Python.
1083
1084If you look at the contents of a recipe, you will see that the recipe
1085does not include complete instructions for building the software.
1086Instead, common functionality is encapsulated in classes inherited with
1087the ``inherit`` directive. This technique leaves the recipe to describe
1088just the things that are specific to the software being built. A
1089:ref:`base <ref-classes-base>` class exists that
1090is implicitly inherited by all recipes and provides the functionality
1091that most recipes typically need.
1092
1093The remainder of this section presents information useful when working
1094with recipes.
1095
1096.. _sdk-finding-logs-and-work-files:
1097
1098Finding Logs and Work Files
1099---------------------------
1100
1101After the first run of the ``devtool build`` command, recipes that were
1102previously created using the ``devtool add`` command or whose sources
1103were modified using the ``devtool modify`` command contain symbolic
1104links created within the source tree:
1105
1106- ``oe-logs``: This link points to the directory in which log files and
1107 run scripts for each build step are created.
1108
1109- ``oe-workdir``: This link points to the temporary work area for the
1110 recipe. The following locations under ``oe-workdir`` are particularly
1111 useful:
1112
1113 - ``image/``: Contains all of the files installed during the
1114 :ref:`ref-tasks-install` stage.
1115 Within a recipe, this directory is referred to by the expression
1116 ``${``\ :term:`D`\ ``}``.
1117
1118 - ``sysroot-destdir/``: Contains a subset of files installed within
1119 ``do_install`` that have been put into the shared sysroot. For
1120 more information, see the "`Sharing Files Between
1121 Recipes <#sdk-sharing-files-between-recipes>`__" section.
1122
1123 - ``packages-split/``: Contains subdirectories for each package
1124 produced by the recipe. For more information, see the
1125 "`Packaging <#sdk-packaging>`__" section.
1126
1127You can use these links to get more information on what is happening at
1128each build step.
1129
1130.. _sdk-setting-configure-arguments:
1131
1132Setting Configure Arguments
1133---------------------------
1134
1135If the software your recipe is building uses GNU autoconf, then a fixed
1136set of arguments is passed to it to enable cross-compilation plus any
1137extras specified by
1138:term:`EXTRA_OECONF` or
1139:term:`PACKAGECONFIG_CONFARGS`
1140set within the recipe. If you wish to pass additional options, add them
1141to ``EXTRA_OECONF`` or ``PACKAGECONFIG_CONFARGS``. Other supported build
1142tools have similar variables (e.g.
1143:term:`EXTRA_OECMAKE` for
1144CMake, :term:`EXTRA_OESCONS`
1145for Scons, and so forth). If you need to pass anything on the ``make``
1146command line, you can use ``EXTRA_OEMAKE`` or the
1147:term:`PACKAGECONFIG_CONFARGS`
1148variables to do so.
1149
1150You can use the ``devtool configure-help`` command to help you set the
1151arguments listed in the previous paragraph. The command determines the
1152exact options being passed, and shows them to you along with any custom
1153arguments specified through ``EXTRA_OECONF`` or
1154``PACKAGECONFIG_CONFARGS``. If applicable, the command also shows you
1155the output of the configure script's "DASHDASHhelp" option as a
1156reference.
1157
1158.. _sdk-sharing-files-between-recipes:
1159
1160Sharing Files Between Recipes
1161-----------------------------
1162
1163Recipes often need to use files provided by other recipes on the
1164:term:`Build Host`. For example,
1165an application linking to a common library needs access to the library
1166itself and its associated headers. The way this access is accomplished
1167within the extensible SDK is through the sysroot. One sysroot exists per
1168"machine" for which the SDK is being built. In practical terms, this
1169means a sysroot exists for the target machine, and a sysroot exists for
1170the build host.
1171
1172Recipes should never write files directly into the sysroot. Instead,
1173files should be installed into standard locations during the
1174:ref:`ref-tasks-install` task within
1175the ``${``\ :term:`D`\ ``}`` directory. A
1176subset of these files automatically goes into the sysroot. The reason
1177for this limitation is that almost all files that go into the sysroot
1178are cataloged in manifests in order to ensure they can be removed later
1179when a recipe is modified or removed. Thus, the sysroot is able to
1180remain free from stale files.
1181
1182.. _sdk-packaging:
1183
1184Packaging
1185---------
1186
1187Packaging is not always particularly relevant within the extensible SDK.
1188However, if you examine how build output gets into the final image on
1189the target device, it is important to understand packaging because the
1190contents of the image are expressed in terms of packages and not
1191recipes.
1192
1193During the :ref:`ref-tasks-package`
1194task, files installed during the
1195:ref:`ref-tasks-install` task are
1196split into one main package, which is almost always named the same as
1197the recipe, and into several other packages. This separation exists
1198because not all of those installed files are useful in every image. For
1199example, you probably do not need any of the documentation installed in
1200a production image. Consequently, for each recipe the documentation
1201files are separated into a ``-doc`` package. Recipes that package
1202software containing optional modules or plugins might undergo additional
1203package splitting as well.
1204
1205After building a recipe, you can see where files have gone by looking in
1206the ``oe-workdir/packages-split`` directory, which contains a
1207subdirectory for each package. Apart from some advanced cases, the
1208:term:`PACKAGES` and
1209:term:`FILES` variables controls
1210splitting. The ``PACKAGES`` variable lists all of the packages to be
1211produced, while the ``FILES`` variable specifies which files to include
1212in each package by using an override to specify the package. For
1213example, ``FILES_${PN}`` specifies the files to go into the main package
1214(i.e. the main package has the same name as the recipe and
1215``${``\ :term:`PN`\ ``}`` evaluates to the
1216recipe name). The order of the ``PACKAGES`` value is significant. For
1217each installed file, the first package whose ``FILES`` value matches the
1218file is the package into which the file goes. Defaults exist for both
1219the ``PACKAGES`` and ``FILES`` variables. Consequently, you might find
1220you do not even need to set these variables in your recipe unless the
1221software the recipe is building installs files into non-standard
1222locations.
1223
1224.. _sdk-restoring-the-target-device-to-its-original-state:
1225
1226Restoring the Target Device to its Original State
1227=================================================
1228
1229If you use the ``devtool deploy-target`` command to write a recipe's
1230build output to the target, and you are working on an existing component
1231of the system, then you might find yourself in a situation where you
1232need to restore the original files that existed prior to running the
1233``devtool deploy-target`` command. Because the ``devtool deploy-target``
1234command backs up any files it overwrites, you can use the
1235``devtool undeploy-target`` command to restore those files and remove
1236any other files the recipe deployed. Consider the following example:
1237::
1238
1239 $ devtool undeploy-target lighttpd root@192.168.7.2
1240
1241If you have deployed
1242multiple applications, you can remove them all using the "-a" option
1243thus restoring the target device to its original state:
1244::
1245
1246 $ devtool undeploy-target -a root@192.168.7.2
1247
1248Information about files deployed to
1249the target as well as any backed up files are stored on the target
1250itself. This storage, of course, requires some additional space on the
1251target machine.
1252
1253.. note::
1254
1255 The
1256 devtool deploy-target
1257 and
1258 devtool undeploy-target
1259 commands do not currently interact with any package management system
1260 on the target device (e.g. RPM or OPKG). Consequently, you should not
1261 intermingle
1262 devtool deploy-target
1263 and package manager operations on the target device. Doing so could
1264 result in a conflicting set of files.
1265
1266.. _sdk-installing-additional-items-into-the-extensible-sdk:
1267
1268Installing Additional Items Into the Extensible SDK
1269===================================================
1270
1271Out of the box the extensible SDK typically only comes with a small
1272number of tools and libraries. A minimal SDK starts mostly empty and is
1273populated on-demand. Sometimes you must explicitly install extra items
1274into the SDK. If you need these extra items, you can first search for
1275the items using the ``devtool search`` command. For example, suppose you
1276need to link to libGL but you are not sure which recipe provides libGL.
1277You can use the following command to find out:
1278::
1279
1280 $ devtool search libGL mesa
1281
1282A free implementation of the OpenGL API Once you know the recipe
1283(i.e. ``mesa`` in this example), you can install it:
1284::
1285
1286 $ devtool sdk-install mesa
1287
1288By default, the ``devtool sdk-install`` command assumes
1289the item is available in pre-built form from your SDK provider. If the
1290item is not available and it is acceptable to build the item from
1291source, you can add the "-s" option as follows:
1292::
1293
1294 $ devtool sdk-install -s mesa
1295
1296It is important to remember that building the item from source
1297takes significantly longer than installing the pre-built artifact. Also,
1298if no recipe exists for the item you want to add to the SDK, you must
1299instead add the item using the ``devtool add`` command.
1300
1301.. _sdk-applying-updates-to-an-installed-extensible-sdk:
1302
1303Applying Updates to an Installed Extensible SDK
1304===============================================
1305
1306If you are working with an installed extensible SDK that gets
1307occasionally updated (e.g. a third-party SDK), then you will need to
1308manually "pull down" the updates into the installed SDK.
1309
1310To update your installed SDK, use ``devtool`` as follows:
1311::
1312
1313 $ devtool sdk-update
1314
1315The previous command assumes your SDK provider has set the
1316default update URL for you through the
1317:term:`SDK_UPDATE_URL`
1318variable as described in the "`Providing Updates to the Extensible SDK
1319After
1320Installation <#sdk-providing-updates-to-the-extensible-sdk-after-installation>`__"
1321section. If the SDK provider has not set that default URL, you need to
1322specify it yourself in the command as follows: $ devtool sdk-update
1323path_to_update_directory
1324
1325.. note::
1326
1327 The URL needs to point specifically to a published SDK and not to an
1328 SDK installer that you would download and install.
1329
1330.. _sdk-creating-a-derivative-sdk-with-additional-components:
1331
1332Creating a Derivative SDK With Additional Components
1333====================================================
1334
1335You might need to produce an SDK that contains your own custom
1336libraries. A good example would be if you were a vendor with customers
1337that use your SDK to build their own platform-specific software and
1338those customers need an SDK that has custom libraries. In such a case,
1339you can produce a derivative SDK based on the currently installed SDK
1340fairly easily by following these steps:
1341
13421. If necessary, install an extensible SDK that you want to use as a
1343 base for your derivative SDK.
1344
13452. Source the environment script for the SDK.
1346
13473. Add the extra libraries or other components you want by using the
1348 ``devtool add`` command.
1349
13504. Run the ``devtool build-sdk`` command.
1351
1352The previous steps take the recipes added to the workspace and construct
1353a new SDK installer that contains those recipes and the resulting binary
1354artifacts. The recipes go into their own separate layer in the
1355constructed derivative SDK, which leaves the workspace clean and ready
1356for users to add their own recipes.
diff --git a/documentation/sdk-manual/sdk-extensible.xml b/documentation/sdk-manual/sdk-extensible.xml
index 94d2a241fe..a73a07a7b9 100644
--- a/documentation/sdk-manual/sdk-extensible.xml
+++ b/documentation/sdk-manual/sdk-extensible.xml
@@ -1,6 +1,7 @@
1<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" 1<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
2"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" 2"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
3[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] > 3[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
4<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
4 5
5<chapter id='sdk-extensible'> 6<chapter id='sdk-extensible'>
6 7
diff --git a/documentation/sdk-manual/sdk-intro.rst b/documentation/sdk-manual/sdk-intro.rst
new file mode 100644
index 0000000000..82b7bcf3cf
--- /dev/null
+++ b/documentation/sdk-manual/sdk-intro.rst
@@ -0,0 +1,231 @@
1.. SPDX-License-Identifier: CC-BY-2.0-UK
2
3************
4Introduction
5************
6
7.. _sdk-manual-intro:
8
9eSDK Introduction
10=================
11
12Welcome to the Yocto Project Application Development and the Extensible
13Software Development Kit (eSDK) manual. This manual provides information
14that explains how to use both the Yocto Project extensible and standard
15SDKs to develop applications and images.
16
17.. note::
18
19 Prior to the 2.0 Release of the Yocto Project, application
20 development was primarily accomplished through the use of the
21 Application Development Toolkit (ADT) and the availability of
22 stand-alone cross-development toolchains and other tools. With the
23 2.1 Release of the Yocto Project, application development has
24 transitioned to within a tool-rich extensible SDK and the more
25 traditional standard SDK.
26
27All SDKs consist of the following:
28
29- *Cross-Development Toolchain*: This toolchain contains a compiler,
30 debugger, and various miscellaneous tools.
31
32- *Libraries, Headers, and Symbols*: The libraries, headers, and
33 symbols are specific to the image (i.e. they match the image).
34
35- *Environment Setup Script*: This ``*.sh`` file, once run, sets up the
36 cross-development environment by defining variables and preparing for
37 SDK use.
38
39Additionally, an extensible SDK has tools that allow you to easily add
40new applications and libraries to an image, modify the source of an
41existing component, test changes on the target hardware, and easily
42integrate an application into the :term:`OpenEmbedded Build System`.
43
44You can use an SDK to independently develop and test code that is
45destined to run on some target machine. SDKs are completely
46self-contained. The binaries are linked against their own copy of
47``libc``, which results in no dependencies on the target system. To
48achieve this, the pointer to the dynamic loader is configured at install
49time since that path cannot be dynamically altered. This is the reason
50for a wrapper around the ``populate_sdk`` and ``populate_sdk_ext``
51archives.
52
53Another feature for the SDKs is that only one set of cross-compiler
54toolchain binaries are produced for any given architecture. This feature
55takes advantage of the fact that the target hardware can be passed to
56``gcc`` as a set of compiler options. Those options are set up by the
57environment script and contained in variables such as
58:term:`CC` and
59:term:`LD`. This reduces the space needed
60for the tools. Understand, however, that every target still needs a
61sysroot because those binaries are target-specific.
62
63The SDK development environment consists of the following:
64
65- The self-contained SDK, which is an architecture-specific
66 cross-toolchain and matching sysroots (target and native) all built
67 by the OpenEmbedded build system (e.g. the SDK). The toolchain and
68 sysroots are based on a :term:`Metadata`
69 configuration and extensions, which allows you to cross-develop on
70 the host machine for the target hardware. Additionally, the
71 extensible SDK contains the ``devtool`` functionality.
72
73- The Quick EMUlator (QEMU), which lets you simulate target hardware.
74 QEMU is not literally part of the SDK. You must build and include
75 this emulator separately. However, QEMU plays an important role in
76 the development process that revolves around use of the SDK.
77
78In summary, the extensible and standard SDK share many features.
79However, the extensible SDK has powerful development tools to help you
80more quickly develop applications. Following is a table that summarizes
81the primary differences between the standard and extensible SDK types
82when considering which to build:
83
84+-----------------------+-----------------------+-----------------------+
85| *Feature* | *Standard SDK* | *Extensible SDK* |
86+=======================+=======================+=======================+
87| Toolchain | Yes | Yes\* |
88+-----------------------+-----------------------+-----------------------+
89| Debugger | Yes | Yes\* |
90+-----------------------+-----------------------+-----------------------+
91| Size | 100+ MBytes | 1+ GBytes (or 300+ |
92| | | MBytes for minimal |
93| | | w/toolchain) |
94+-----------------------+-----------------------+-----------------------+
95| ``devtool`` | No | Yes |
96+-----------------------+-----------------------+-----------------------+
97| Build Images | No | Yes |
98+-----------------------+-----------------------+-----------------------+
99| Updateable | No | Yes |
100+-----------------------+-----------------------+-----------------------+
101| Managed Sysroot*\* | No | Yes |
102+-----------------------+-----------------------+-----------------------+
103| Installed Packages | No**\* | Yes***\* |
104+-----------------------+-----------------------+-----------------------+
105| Construction | Packages | Shared State |
106+-----------------------+-----------------------+-----------------------+
107
108\* Extensible SDK contains the toolchain and debugger if
109:term:`SDK_EXT_TYPE` is "full"
110or
111:term:`SDK_INCLUDE_TOOLCHAIN`
112is "1", which is the default.
113
114\*\* Sysroot is managed through the use of
115``devtool``. Thus, it is less likely that you will corrupt your SDK
116sysroot when you try to add additional libraries.
117
118\*\*\* You can add
119runtime package management to the standard SDK but it is not supported
120by default.
121
122\*\*\*\* You must build and make the shared state available to
123extensible SDK users for "packages" you want to enable users to install.
124
125The Cross-Development Toolchain
126-------------------------------
127
128The :term:`Cross-Development Toolchain` consists
129of a cross-compiler, cross-linker, and cross-debugger that are used to
130develop user-space applications for targeted hardware. Additionally, for
131an extensible SDK, the toolchain also has built-in ``devtool``
132functionality. This toolchain is created by running a SDK installer
133script or through a :term:`Build Directory` that is based on
134your metadata configuration or extension for your targeted device. The
135cross-toolchain works with a matching target sysroot.
136
137.. _sysroot:
138
139Sysroots
140--------
141
142The native and target sysroots contain needed headers and libraries for
143generating binaries that run on the target architecture. The target
144sysroot is based on the target root filesystem image that is built by
145the OpenEmbedded build system and uses the same metadata configuration
146used to build the cross-toolchain.
147
148The QEMU Emulator
149-----------------
150
151The QEMU emulator allows you to simulate your hardware while running
152your application or image. QEMU is not part of the SDK but is made
153available a number of different ways:
154
155- If you have cloned the ``poky`` Git repository to create a
156 :term:`Source Directory` and you have
157 sourced the environment setup script, QEMU is installed and
158 automatically available.
159
160- If you have downloaded a Yocto Project release and unpacked it to
161 create a Source Directory and you have sourced the environment setup
162 script, QEMU is installed and automatically available.
163
164- If you have installed the cross-toolchain tarball and you have
165 sourced the toolchain's setup environment script, QEMU is also
166 installed and automatically available.
167
168SDK Development Model
169=====================
170
171Fundamentally, the SDK fits into the development process as follows:
172
173.. image:: figures/sdk-environment.png
174 :align: center
175
176The SDK is installed on any machine and can be used to develop applications,
177images, and kernels. An SDK can even be used by a QA Engineer or Release
178Engineer. The fundamental concept is that the machine that has the SDK
179installed does not have to be associated with the machine that has the
180Yocto Project installed. A developer can independently compile and test
181an object on their machine and then, when the object is ready for
182integration into an image, they can simply make it available to the
183machine that has the Yocto Project. Once the object is available, the
184image can be rebuilt using the Yocto Project to produce the modified
185image.
186
187You just need to follow these general steps:
188
1891. *Install the SDK for your target hardware:* For information on how to
190 install the SDK, see the "`Installing the
191 SDK <#sdk-installing-the-sdk>`__" section.
192
1932. *Download or Build the Target Image:* The Yocto Project supports
194 several target architectures and has many pre-built kernel images and
195 root filesystem images.
196
197 If you are going to develop your application on hardware, go to the
198 :yocto_dl:`machines </releases/yocto/yocto-3.1.2/machines/>` download area and choose a
199 target machine area from which to download the kernel image and root
200 filesystem. This download area could have several files in it that
201 support development using actual hardware. For example, the area
202 might contain ``.hddimg`` files that combine the kernel image with
203 the filesystem, boot loaders, and so forth. Be sure to get the files
204 you need for your particular development process.
205
206 If you are going to develop your application and then run and test it
207 using the QEMU emulator, go to the
208 :yocto_dl:`machines/qemu </releases/yocto/yocto-3.1.2/machines/qemu>` download area. From this
209 area, go down into the directory for your target architecture (e.g.
210 ``qemux86_64`` for an Intel-based 64-bit architecture). Download the
211 kernel, root filesystem, and any other files you need for your
212 process.
213
214 .. note::
215
216 To use the root filesystem in QEMU, you need to extract it. See
217 the "
218 Extracting the Root Filesystem
219 " section for information on how to extract the root filesystem.
220
2213. *Develop and Test your Application:* At this point, you have the
222 tools to develop your application. If you need to separately install
223 and use the QEMU emulator, you can go to `QEMU Home
224 Page <http://wiki.qemu.org/Main_Page>`__ to download and learn about
225 the emulator. See the ":doc:`../dev-manual/dev-manual-qemu`" chapter in the
226 Yocto Project Development Tasks Manual for information on using QEMU
227 within the Yocto Project.
228
229The remainder of this manual describes how to use the extensible and
230standard SDKs. Information also exists in appendix form that describes
231how you can build, install, and modify an SDK.
diff --git a/documentation/sdk-manual/sdk-intro.xml b/documentation/sdk-manual/sdk-intro.xml
index 9169fe9c05..f42670ea6e 100644
--- a/documentation/sdk-manual/sdk-intro.xml
+++ b/documentation/sdk-manual/sdk-intro.xml
@@ -1,6 +1,7 @@
1<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" 1<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
2"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" 2"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
3[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] > 3[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
4<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
4 5
5<chapter id='sdk-intro'> 6<chapter id='sdk-intro'>
6<title>Introduction</title> 7<title>Introduction</title>
diff --git a/documentation/sdk-manual/sdk-manual-customization.xsl b/documentation/sdk-manual/sdk-manual-customization.xsl
index efa8a84bbb..4f8816f950 100644
--- a/documentation/sdk-manual/sdk-manual-customization.xsl
+++ b/documentation/sdk-manual/sdk-manual-customization.xsl
@@ -1,4 +1,6 @@
1<?xml version='1.0'?> 1<?xml version='1.0'?>
2<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
3
2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> 4<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
3 5
4 <xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/xhtml/docbook.xsl" /> 6 <xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
diff --git a/documentation/sdk-manual/sdk-manual.rst b/documentation/sdk-manual/sdk-manual.rst
new file mode 100644
index 0000000000..d7776b7c40
--- /dev/null
+++ b/documentation/sdk-manual/sdk-manual.rst
@@ -0,0 +1,22 @@
1.. SPDX-License-Identifier: CC-BY-2.0-UK
2
3========================================================================================
4Yocto Project Application Development and the Extensible Software Development Kit (eSDK)
5========================================================================================
6
7|
8
9.. toctree::
10 :caption: Table of Contents
11 :numbered:
12
13 sdk-intro
14 sdk-extensible
15 sdk-using
16 sdk-working-projects
17 sdk-appendix-obtain
18 sdk-appendix-customizing
19 sdk-appendix-customizing-standard
20 history
21
22.. include:: /boilerplate.rst
diff --git a/documentation/sdk-manual/sdk-manual.xml b/documentation/sdk-manual/sdk-manual.xml
index 1bcc0c853f..6344478fb0 100755
--- a/documentation/sdk-manual/sdk-manual.xml
+++ b/documentation/sdk-manual/sdk-manual.xml
@@ -1,6 +1,7 @@
1<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" 1<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
2"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" 2"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
3[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] > 3[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
4<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
4 5
5<book id='sdk-manual' lang='en' 6<book id='sdk-manual' lang='en'
6 xmlns:xi="http://www.w3.org/2003/XInclude" 7 xmlns:xi="http://www.w3.org/2003/XInclude"
@@ -72,28 +73,8 @@
72 </revision> 73 </revision>
73 <revision> 74 <revision>
74 <revnumber>3.1</revnumber> 75 <revnumber>3.1</revnumber>
75 <date>April 2020</date>
76 <revremark>Released with the Yocto Project 3.1 Release.</revremark>
77 </revision>
78 <revision>
79 <revnumber>3.1.1</revnumber>
80 <date>June 2020</date>
81 <revremark>Released with the Yocto Project 3.1.1 Release.</revremark>
82 </revision>
83 <revision>
84 <revnumber>3.1.2</revnumber>
85 <date>August 2020</date>
86 <revremark>Released with the Yocto Project 3.1.2 Release.</revremark>
87 </revision>
88 <revision>
89 <revnumber>3.1.3</revnumber>
90 <date>October 2020</date>
91 <revremark>Released with the Yocto Project 3.1.3 Release.</revremark>
92 </revision>
93 <revision>
94 <revnumber>3.1.4</revnumber>
95 <date>&REL_MONTH_YEAR;</date> 76 <date>&REL_MONTH_YEAR;</date>
96 <revremark>Released with the Yocto Project 3.1.4 Release.</revremark> 77 <revremark>Released with the Yocto Project 3.1 Release.</revremark>
97 </revision> 78 </revision>
98 </revhistory> 79 </revhistory>
99 80
diff --git a/documentation/sdk-manual/sdk-style.css b/documentation/sdk-manual/sdk-style.css
index 52518964ca..e0c4416a15 100644
--- a/documentation/sdk-manual/sdk-style.css
+++ b/documentation/sdk-manual/sdk-style.css
@@ -1,4 +1,7 @@
1/* 1/*
2
3 SPDX-License-Identifier: CC-BY-2.0-UK
4
2 Generic XHTML / DocBook XHTML CSS Stylesheet. 5 Generic XHTML / DocBook XHTML CSS Stylesheet.
3 6
4 Browser wrangling and typographic design by 7 Browser wrangling and typographic design by
diff --git a/documentation/sdk-manual/sdk-using.rst b/documentation/sdk-manual/sdk-using.rst
new file mode 100644
index 0000000000..09a194cab5
--- /dev/null
+++ b/documentation/sdk-manual/sdk-using.rst
@@ -0,0 +1,159 @@
1.. SPDX-License-Identifier: CC-BY-2.0-UK
2
3**********************
4Using the Standard SDK
5**********************
6
7This chapter describes the standard SDK and how to install it.
8Information includes unique installation and setup aspects for the
9standard SDK.
10
11.. note::
12
13 For a side-by-side comparison of main features supported for a
14 standard SDK as compared to an extensible SDK, see the "
15 Introduction
16 " section.
17
18You can use a standard SDK to work on Makefile and Autotools-based
19projects. See the "`Using the SDK Toolchain
20Directly <#sdk-working-projects>`__" chapter for more information.
21
22.. _sdk-standard-sdk-intro:
23
24Why use the Standard SDK and What is in It?
25===========================================
26
27The Standard SDK provides a cross-development toolchain and libraries
28tailored to the contents of a specific image. You would use the Standard
29SDK if you want a more traditional toolchain experience as compared to
30the extensible SDK, which provides an internal build system and the
31``devtool`` functionality.
32
33The installed Standard SDK consists of several files and directories.
34Basically, it contains an SDK environment setup script, some
35configuration files, and host and target root filesystems to support
36usage. You can see the directory structure in the "`Installed Standard
37SDK Directory
38Structure <#sdk-installed-standard-sdk-directory-structure>`__" section.
39
40.. _sdk-installing-the-sdk:
41
42Installing the SDK
43==================
44
45The first thing you need to do is install the SDK on your :term:`Build
46Host` by running the ``*.sh`` installation script.
47
48You can download a tarball installer, which includes the pre-built
49toolchain, the ``runqemu`` script, and support files from the
50appropriate :yocto_dl:`toolchain </releases/yocto/yocto-3.1.2/toolchain/>` directory within
51the Index of Releases. Toolchains are available for several 32-bit and
5264-bit architectures with the ``x86_64`` directories, respectively. The
53toolchains the Yocto Project provides are based off the
54``core-image-sato`` and ``core-image-minimal`` images and contain
55libraries appropriate for developing against that image.
56
57The names of the tarball installer scripts are such that a string
58representing the host system appears first in the filename and then is
59immediately followed by a string representing the target architecture.
60::
61
62 poky-glibc-host_system-image_type-arch-toolchain-release_version.sh
63
64 Where:
65 host_system is a string representing your development system:
66
67 i686 or x86_64.
68
69 image_type is the image for which the SDK was built:
70
71 core-image-minimal or core-image-sato.
72
73 arch is a string representing the tuned target architecture:
74
75 aarch64, armv5e, core2-64, i586, mips32r2, mips64, ppc7400, or cortexa8hf-neon.
76
77 release_version is a string representing the release number of the Yocto Project:
78
79 3.1.2, 3.1.2+snapshot
80
81For example, the following SDK installer is for a 64-bit
82development host system and a i586-tuned target architecture based off
83the SDK for ``core-image-sato`` and using the current DISTRO snapshot:
84::
85
86 poky-glibc-x86_64-core-image-sato-i586-toolchain-DISTRO.sh
87
88.. note::
89
90 As an alternative to downloading an SDK, you can build the SDK
91 installer. For information on building the installer, see the "
92 Building an SDK Installer
93 " section.
94
95The SDK and toolchains are self-contained and by default are installed
96into the ``poky_sdk`` folder in your home directory. You can choose to
97install the extensible SDK in any location when you run the installer.
98However, because files need to be written under that directory during
99the normal course of operation, the location you choose for installation
100must be writable for whichever users need to use the SDK.
101
102The following command shows how to run the installer given a toolchain
103tarball for a 64-bit x86 development host system and a 64-bit x86 target
104architecture. The example assumes the SDK installer is located in
105``~/Downloads/`` and has execution rights.
106
107.. note::
108
109 If you do not have write permissions for the directory into which you
110 are installing the SDK, the installer notifies you and exits. For
111 that case, set up the proper permissions in the directory and run the
112 installer again.
113
114::
115
116 $ ./Downloads/poky-glibc-x86_64-core-image-sato-i586-toolchain-3.1.2.sh
117 Poky (Yocto Project Reference Distro) SDK installer version 3.1.2
118 ===============================================================
119 Enter target directory for SDK (default: /opt/poky/3.1.2):
120 You are about to install the SDK to "/opt/poky/3.1.2". Proceed [Y/n]? Y
121 Extracting SDK........................................ ..............................done
122 Setting it up...done
123 SDK has been successfully set up and is ready to be used.
124 Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
125 $ . /opt/poky/3.1.2/environment-setup-i586-poky-linux
126
127Again, reference the "`Installed Standard SDK Directory
128Structure <#sdk-installed-standard-sdk-directory-structure>`__" section
129for more details on the resulting directory structure of the installed
130SDK.
131
132.. _sdk-running-the-sdk-environment-setup-script:
133
134Running the SDK Environment Setup Script
135========================================
136
137Once you have the SDK installed, you must run the SDK environment setup
138script before you can actually use the SDK. This setup script resides in
139the directory you chose when you installed the SDK, which is either the
140default ``/opt/poky/3.1.2`` directory or the directory you chose during
141installation.
142
143Before running the script, be sure it is the one that matches the
144architecture for which you are developing. Environment setup scripts
145begin with the string "``environment-setup``" and include as part of
146their name the tuned target architecture. As an example, the following
147commands set the working directory to where the SDK was installed and
148then source the environment setup script. In this example, the setup
149script is for an IA-based target machine using i586 tuning:
150::
151
152 $ source /opt/poky/3.1.2/environment-setup-i586-poky-linux
153
154When you run the
155setup script, the same environment variables are defined as are when you
156run the setup script for an extensible SDK. See the "`Running the
157Extensible SDK Environment Setup
158Script <#sdk-running-the-extensible-sdk-environment-setup-script>`__"
159section for more information.
diff --git a/documentation/sdk-manual/sdk-using.xml b/documentation/sdk-manual/sdk-using.xml
index 66b15cd6ce..28ee50d0b7 100644
--- a/documentation/sdk-manual/sdk-using.xml
+++ b/documentation/sdk-manual/sdk-using.xml
@@ -1,6 +1,7 @@
1<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" 1<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
2"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" 2"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
3[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] > 3[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
4<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
4 5
5<chapter id='sdk-using-the-standard-sdk'> 6<chapter id='sdk-using-the-standard-sdk'>
6 <title>Using the Standard SDK</title> 7 <title>Using the Standard SDK</title>
diff --git a/documentation/sdk-manual/sdk-working-projects.rst b/documentation/sdk-manual/sdk-working-projects.rst
new file mode 100644
index 0000000000..2c20a1ec57
--- /dev/null
+++ b/documentation/sdk-manual/sdk-working-projects.rst
@@ -0,0 +1,423 @@
1.. SPDX-License-Identifier: CC-BY-2.0-UK
2
3********************************
4Using the SDK Toolchain Directly
5********************************
6
7You can use the SDK toolchain directly with Makefile and Autotools-based
8projects.
9
10Autotools-Based Projects
11========================
12
13Once you have a suitable :ref:`sdk-manual/sdk-intro:the cross-development toolchain`
14installed, it is very easy to develop a project using the `GNU
15Autotools-based <https://en.wikipedia.org/wiki/GNU_Build_System>`__
16workflow, which is outside of the :term:`OpenEmbedded Build System`.
17
18The following figure presents a simple Autotools workflow.
19
20.. image:: figures/sdk-autotools-flow.png
21 :align: center
22
23Follow these steps to create a simple Autotools-based "Hello World"
24project:
25
26.. note::
27
28 For more information on the GNU Autotools workflow, see the same
29 example on the
30 GNOME Developer
31 site.
32
331. *Create a Working Directory and Populate It:* Create a clean
34 directory for your project and then make that directory your working
35 location.
36 ::
37
38 $ mkdir $HOME/helloworld
39 $ cd $HOME/helloworld
40
41 After setting up the directory, populate it with files needed for the flow.
42 You need a project source file, a file to help with configuration,
43 and a file to help create the Makefile, and a README file:
44 ``hello.c``, ``configure.ac``, ``Makefile.am``, and ``README``,
45 respectively.
46
47 Use the following command to create an empty README file, which is
48 required by GNU Coding Standards:
49 ::
50
51 $ touch README
52
53 Create the remaining
54 three files as follows:
55
56 - ``hello.c``:
57 ::
58
59 #include <stdio.h>
60
61 main()
62 {
63 printf("Hello World!\n");
64 }
65
66 - ``configure.ac``:
67 ::
68
69 AC_INIT(hello,0.1)
70 AM_INIT_AUTOMAKE([foreign])
71 AC_PROG_CC
72 AC_CONFIG_FILES(Makefile)
73 AC_OUTPUT
74
75 - ``Makefile.am``:
76 ::
77
78 bin_PROGRAMS = hello
79 hello_SOURCES = hello.c
80
812. *Source the Cross-Toolchain Environment Setup File:* As described
82 earlier in the manual, installing the cross-toolchain creates a
83 cross-toolchain environment setup script in the directory that the
84 SDK was installed. Before you can use the tools to develop your
85 project, you must source this setup script. The script begins with
86 the string "environment-setup" and contains the machine architecture,
87 which is followed by the string "poky-linux". For this example, the
88 command sources a script from the default SDK installation directory
89 that uses the 32-bit Intel x86 Architecture and the 3.1.2 Yocto
90 Project release:
91 ::
92
93 $ source /opt/poky/3.1.2/environment-setup-i586-poky-linux
94
953. *Create the configure Script:* Use the ``autoreconf`` command to
96 generate the ``configure`` script.
97 ::
98
99 $ autoreconf
100
101 The ``autoreconf``
102 tool takes care of running the other Autotools such as ``aclocal``,
103 ``autoconf``, and ``automake``.
104
105 .. note::
106
107 If you get errors from
108 configure.ac
109 , which
110 autoreconf
111 runs, that indicate missing files, you can use the "-i" option,
112 which ensures missing auxiliary files are copied to the build
113 host.
114
1154. *Cross-Compile the Project:* This command compiles the project using
116 the cross-compiler. The
117 :term:`CONFIGURE_FLAGS`
118 environment variable provides the minimal arguments for GNU
119 configure:
120 ::
121
122 $ ./configure ${CONFIGURE_FLAGS}
123
124 For an Autotools-based
125 project, you can use the cross-toolchain by just passing the
126 appropriate host option to ``configure.sh``. The host option you use
127 is derived from the name of the environment setup script found in the
128 directory in which you installed the cross-toolchain. For example,
129 the host option for an ARM-based target that uses the GNU EABI is
130 ``armv5te-poky-linux-gnueabi``. You will notice that the name of the
131 script is ``environment-setup-armv5te-poky-linux-gnueabi``. Thus, the
132 following command works to update your project and rebuild it using
133 the appropriate cross-toolchain tools:
134 ::
135
136 $ ./configure --host=armv5te-poky-linux-gnueabi --with-libtool-sysroot=sysroot_dir
137
1385. *Make and Install the Project:* These two commands generate and
139 install the project into the destination directory:
140 ::
141
142 $ make
143 $ make install DESTDIR=./tmp
144
145 .. note::
146
147 To learn about environment variables established when you run the
148 cross-toolchain environment setup script and how they are used or
149 overridden when the Makefile, see the "
150 Makefile-Based Projects
151 " section.
152
153 This next command is a simple way to verify the installation of your
154 project. Running the command prints the architecture on which the
155 binary file can run. This architecture should be the same
156 architecture that the installed cross-toolchain supports.
157 ::
158
159 $ file ./tmp/usr/local/bin/hello
160
1616. *Execute Your Project:* To execute the project, you would need to run
162 it on your target hardware. If your target hardware happens to be
163 your build host, you could run the project as follows:
164 ::
165
166 $ ./tmp/usr/local/bin/hello
167
168 As expected, the project displays the "Hello World!" message.
169
170Makefile-Based Projects
171=======================
172
173Simple Makefile-based projects use and interact with the cross-toolchain
174environment variables established when you run the cross-toolchain
175environment setup script. The environment variables are subject to
176general ``make`` rules.
177
178This section presents a simple Makefile development flow and provides an
179example that lets you see how you can use cross-toolchain environment
180variables and Makefile variables during development.
181
182.. image:: figures/sdk-makefile-flow.png
183 :align: center
184
185The main point of this section is to explain the following three cases
186regarding variable behavior:
187
188- *Case 1 - No Variables Set in the Makefile Map to Equivalent
189 Environment Variables Set in the SDK Setup Script:* Because matching
190 variables are not specifically set in the ``Makefile``, the variables
191 retain their values based on the environment setup script.
192
193- *Case 2 - Variables Are Set in the Makefile that Map to Equivalent
194 Environment Variables from the SDK Setup Script:* Specifically
195 setting matching variables in the ``Makefile`` during the build
196 results in the environment settings of the variables being
197 overwritten. In this case, the variables you set in the ``Makefile``
198 are used.
199
200- *Case 3 - Variables Are Set Using the Command Line that Map to
201 Equivalent Environment Variables from the SDK Setup Script:*
202 Executing the ``Makefile`` from the command line results in the
203 environment variables being overwritten. In this case, the
204 command-line content is used.
205
206.. note::
207
208 Regardless of how you set your variables, if you use the "-e" option
209 with
210 make
211 , the variables from the SDK setup script take precedence:
212 ::
213
214 $ make -e target
215
216
217The remainder of this section presents a simple Makefile example that
218demonstrates these variable behaviors.
219
220In a new shell environment variables are not established for the SDK
221until you run the setup script. For example, the following commands show
222a null value for the compiler variable (i.e.
223:term:`CC`).
224::
225
226 $ echo ${CC}
227
228 $
229
230Running the
231SDK setup script for a 64-bit build host and an i586-tuned target
232architecture for a ``core-image-sato`` image using the current 3.1.2
233Yocto Project release and then echoing that variable shows the value
234established through the script:
235::
236
237 $ source /opt/poky/3.1.2/environment-setup-i586-poky-linux
238 $ echo ${CC}
239 i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/3.1.2/sysroots/i586-poky-linux
240
241To illustrate variable use, work through this simple "Hello World!"
242example:
243
2441. *Create a Working Directory and Populate It:* Create a clean
245 directory for your project and then make that directory your working
246 location.
247 ::
248
249 $ mkdir $HOME/helloworld
250 $ cd $HOME/helloworld
251
252 After
253 setting up the directory, populate it with files needed for the flow.
254 You need a ``main.c`` file from which you call your function, a
255 ``module.h`` file to contain headers, and a ``module.c`` that defines
256 your function.
257
258 Create the three files as follows:
259
260 - ``main.c``:
261 ::
262
263 #include "module.h"
264 void sample_func();
265 int main()
266 {
267 sample_func();
268 return 0;
269 }
270
271 - ``module.h``:
272 ::
273
274 #include <stdio.h>
275 void sample_func();
276
277 - ``module.c``:
278 ::
279
280 #include "module.h"
281 void sample_func()
282 {
283 printf("Hello World!");
284 printf("\n");
285 }
286
2872. *Source the Cross-Toolchain Environment Setup File:* As described
288 earlier in the manual, installing the cross-toolchain creates a
289 cross-toolchain environment setup script in the directory that the
290 SDK was installed. Before you can use the tools to develop your
291 project, you must source this setup script. The script begins with
292 the string "environment-setup" and contains the machine architecture,
293 which is followed by the string "poky-linux". For this example, the
294 command sources a script from the default SDK installation directory
295 that uses the 32-bit Intel x86 Architecture and the DISTRO_NAME Yocto
296 Project release:
297 ::
298
299 $ source /opt/poky/DISTRO/environment-setup-i586-poky-linux
300
3013. *Create the Makefile:* For this example, the Makefile contains
302 two lines that can be used to set the ``CC`` variable. One line is
303 identical to the value that is set when you run the SDK environment
304 setup script, and the other line sets ``CC`` to "gcc", the default
305 GNU compiler on the build host:
306 ::
307
308 # CC=i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux
309 # CC="gcc"
310 all: main.o module.o
311 ${CC} main.o module.o -o target_bin
312 main.o: main.c module.h
313 ${CC} -I . -c main.c
314 module.o: module.c
315 module.h ${CC} -I . -c module.c
316 clean:
317 rm -rf *.o
318 rm target_bin
319
3204. *Make the Project:* Use the ``make`` command to create the binary
321 output file. Because variables are commented out in the Makefile, the
322 value used for ``CC`` is the value set when the SDK environment setup
323 file was run:
324 ::
325
326 $ make
327 i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux -I . -c main.c
328 i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux -I . -c module.c
329 i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux main.o module.o -o target_bin
330
331 From the results of the previous command, you can see that
332 the compiler used was the compiler established through the ``CC``
333 variable defined in the setup script.
334
335 You can override the ``CC`` environment variable with the same
336 variable as set from the Makefile by uncommenting the line in the
337 Makefile and running ``make`` again.
338 ::
339
340 $ make clean
341 rm -rf *.o
342 rm target_bin
343 #
344 # Edit the Makefile by uncommenting the line that sets CC to "gcc"
345 #
346 $ make
347 gcc -I . -c main.c
348 gcc -I . -c module.c
349 gcc main.o module.o -o target_bin
350
351 As shown in the previous example, the
352 cross-toolchain compiler is not used. Rather, the default compiler is
353 used.
354
355 This next case shows how to override a variable by providing the
356 variable as part of the command line. Go into the Makefile and
357 re-insert the comment character so that running ``make`` uses the
358 established SDK compiler. However, when you run ``make``, use a
359 command-line argument to set ``CC`` to "gcc":
360 ::
361
362 $ make clean
363 rm -rf *.o
364 rm target_bin
365 #
366 # Edit the Makefile to comment out the line setting CC to "gcc"
367 #
368 $ make
369 i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux -I . -c main.c
370 i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux -I . -c module.c
371 i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux main.o module.o -o target_bin
372 $ make clean
373 rm -rf *.o
374 rm target_bin
375 $ make CC="gcc"
376 gcc -I . -c main.c
377 gcc -I . -c module.c
378 gcc main.o module.o -o target_bin
379
380 In the previous case, the command-line argument overrides the SDK
381 environment variable.
382
383 In this last case, edit Makefile again to use the "gcc" compiler but
384 then use the "-e" option on the ``make`` command line:
385 ::
386
387 $ make clean
388 rm -rf *.o
389 rm target_bin
390 #
391 # Edit the Makefile to use "gcc"
392 #
393 $ make
394 gcc -I . -c main.c
395 gcc -I . -c module.c
396 gcc main.o module.o -o target_bin
397 $ make clean
398 rm -rf *.o
399 rm target_bin
400 $ make -e
401 i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux -I . -c main.c
402 i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux -I . -c module.c
403 i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux main.o module.o -o target_bin
404
405 In the previous case, the "-e" option forces ``make`` to
406 use the SDK environment variables regardless of the values in the
407 Makefile.
408
4095. *Execute Your Project:* To execute the project (i.e. ``target_bin``),
410 use the following command:
411 ::
412
413 $ ./target_bin
414 Hello World!
415
416 .. note::
417
418 If you used the cross-toolchain compiler to build
419 target_bin
420 and your build host differs in architecture from that of the
421 target machine, you need to run your project on the target device.
422
423 As expected, the project displays the "Hello World!" message.
diff --git a/documentation/sdk-manual/sdk-working-projects.xml b/documentation/sdk-manual/sdk-working-projects.xml
index 521271d54c..070d903c73 100644
--- a/documentation/sdk-manual/sdk-working-projects.xml
+++ b/documentation/sdk-manual/sdk-working-projects.xml
@@ -1,6 +1,7 @@
1<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" 1<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
2"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" 2"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
3[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] > 3[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
4<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
4 5
5<chapter id='sdk-working-projects'> 6<chapter id='sdk-working-projects'>
6 7