Lines Matching full:the
4 Using the Extensible SDK
7 This chapter describes the extensible SDK and how to install it.
8 Information covers the pieces of the SDK, how to install it, and
9 presents a look at using the ``devtool`` functionality. The extensible
11 modify the source for an existing component, test changes on the target
12 hardware, and ease integration into the rest of the
18 extensible SDK as compared to a standard SDK, see the
21 In addition to the functionality available through ``devtool``, you can
22 alternatively make use of the toolchain directly, for example from
23 Makefile and Autotools. See the
24 ":ref:`sdk-manual/working-projects:using the sdk toolchain directly`" chapter
27 Why use the Extensible SDK and What is in It?
30 The extensible SDK provides a cross-development toolchain and libraries
31 tailored to the contents of a specific image. You would use the
32 Extensible SDK if you want a toolchain experience supplemented with the
33 powerful set of ``devtool`` commands tailored for the Yocto Project
36 The installed extensible SDK consists of several files and directories.
38 configuration files, an internal build system, and the ``devtool``
41 Installing the Extensible SDK
44 The first thing you need to do is install the SDK on your :term:`Build
45 Host` by running the ``*.sh`` installation script.
47 You can download a tarball installer, which includes the pre-built
48 toolchain, the ``runqemu`` script, the internal build system,
49 ``devtool``, and support files from the appropriate
50 :yocto_dl:`toolchain </releases/yocto/yocto-&DISTRO;/toolchain/>` directory within the Index of
52 architectures with the ``x86_64`` directories, respectively. The
53 toolchains the Yocto Project provides are based off the
57 The names of the tarball installer scripts are such that a string
58 representing the host system appears first in the filename and then is
59 immediately followed by a string representing the target architecture.
60 An extensible SDK has the string "-ext" as part of the name. Following
61 is the general form::
70 image_type is the image for which the SDK was built:
74 arch is a string representing the tuned target architecture:
78 release_version is a string representing the release number of the Yocto Project:
82 For example, the following SDK installer is for a 64-bit
84 the SDK for ``core-image-sato`` and using the current &DISTRO; snapshot::
90 As an alternative to downloading an SDK, you can build the SDK
91 installer. For information on building the installer, see the
95 The SDK and toolchains are self-contained and by default are installed
96 into the ``poky_sdk`` folder in your home directory. You can choose to
97 install the extensible SDK in any location when you run the installer.
99 the normal course of operation, the location you choose for installation
100 must be writable for whichever users need to use the SDK.
102 The following command shows how to run the installer given a toolchain
104 architecture. The example assumes the SDK installer is located in
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
120 You are about to install the SDK to "/home/scottrif/poky_sdk". Proceed [Y/n]? Y
132 …Each time you wish to use the SDK in a new shell session, you need to source the environment setup…
135 Running the Extensible SDK Environment Setup Script
138 Once you have the SDK installed, you must run the SDK environment setup
139 script before you can actually use the SDK. This setup script resides in
140 the directory you chose when you installed the SDK, which is either the
141 default ``poky_sdk`` directory or the directory you chose during
144 Before running the script, be sure it is the one that matches the
146 begin with the string "``environment-setup``" and include as part of
147 their name the tuned target architecture. As an example, the following
148 commands set the working directory to where the SDK was installed and
149 then source the environment setup script. In this example, the setup
157 Running the setup script defines many environment variables needed in
158 order to use the SDK (e.g. ``PATH``,
161 see all the environment variables the script exports, examine the
167 The cornerstone of the extensible SDK is a command-line tool called
169 build, test and package software within the extensible SDK, and
170 optionally integrate it into an image built by the OpenEmbedded build
175 The use of
177 is not limited to the extensible SDK. You can use
180 part of an image built using the build system.
182 The ``devtool`` command line is organized similarly to
185 all the commands.
189 See the "
192 " in the Yocto Project Reference Manual for a
202 the source of an existing component.
207 As with the build system, "recipes" represent software packages within
209 created. When you use ``devtool modify``, the specified existing recipe
210 is used in order to determine where to get the source code and how to
212 the recipe a source tree that is under your control is used in order to
213 allow you to make changes to the source as desired. By default, new
214 recipes and the source go into a "workspace" directory under the SDK.
216 The remainder of this section presents the ``devtool add``,
222 The ``devtool add`` command generates a new recipe based on existing
223 source code. This command takes advantage of the
224 :ref:`devtool-the-workspace-layer-structure`
225 layer that many ``devtool`` commands use. The command is flexible enough
226 to allow you to extract source code into both the workspace or a
230 Depending on your particular scenario, the arguments and options you use
231 with ``devtool add`` form different combinations. The following diagram
232 shows common development flows you would use with the ``devtool add``
238 1. *Generating the New Recipe*: The top part of the flow shows three
245 part of your development within the Yocto Project. All you need is
246 access to the code, a recipe, and a controlled area in which to do
249 Within the diagram, three possible scenarios feed into the
252 - *Left*: The left scenario in the figure represents a common
253 situation where the source code does not exist locally and needs
254 to be extracted. In this situation, the source code is extracted
255 to the default workspace - you do not want the files in some
256 specific location outside of the workspace. Thus, everything you
257 need will be located in the workspace::
261 With this command, ``devtool`` extracts the upstream
262 source files into a local Git repository within the ``sources``
263 folder. The command then creates a recipe named recipe and a
264 corresponding append file in the workspace. If you do not provide
265 recipe, the command makes an attempt to determine the recipe name.
267 - *Middle*: The middle scenario in the figure also represents a
268 situation where the source code does not exist locally. In this
269 case, the code is again upstream and needs to be extracted to some
270 local area - this time outside of the default workspace.
276 always creates a Git repository locally during the extraction.
278 Furthermore, the first positional argument ``srctree`` in this case
279 identifies where the ``devtool add`` command will locate the
280 extracted code outside of the workspace. You need to specify an
286 the source code is pulled from fetchuri and extracted into the
292 - *Right*: The right scenario in the figure represents a situation
293 where the ``srctree`` has been previously prepared outside of the
296 The following command provides a new recipe name and identifies
297 the existing source tree location::
301 The command examines the source code and creates a recipe named
302 recipe for the code and places the recipe into the workspace.
304 Because the extracted source code already exists, ``devtool`` does
305 not try to relocate the source code into the workspace - only the
306 new recipe is placed in the workspace.
308 Aside from a recipe folder, the command also creates an associated
311 2. *Edit the Recipe*: You can use ``devtool edit-recipe`` to open up the
312 editor as defined by the ``$EDITOR`` environment variable and modify
313 the file::
317 From within the editor, you
318 can make modifications to the recipe that take effect when you build
321 3. *Build the Recipe or Rebuild the Image*: The next step you take
322 depends on what you are going to do with the new code.
324 If you need to eventually move the build output to the target
325 hardware, use the following ``devtool`` command:
330 On the other hand, if you want an image to contain the recipe's
331 packages from the workspace for immediate deployment onto a device
332 (e.g. for testing purposes), you can use the ``devtool build-image``
337 4. *Deploy the Build Output*: When you use the ``devtool build`` command
338 to build out your recipe, you probably want to see if the resulting
339 build output works as expected on the target hardware.
345 Also, it is assumed that for deployment of the image to the
346 target, SSH is installed in the image and, if the image is running
350 You can deploy your build output to that target hardware by using the
352 target The target is a live target machine running as an SSH server.
354 You can, of course, also deploy the image you build to actual
355 hardware by using the ``devtool build-image`` command. However,
357 deploy the image to actual hardware.
359 5. *Finish Your Work With the Recipe*: The ``devtool finish`` command
360 creates any patches corresponding to commits in the local Git
361 repository, moves the new recipe to a more permanent layer, and then
362 resets the recipe so that the recipe is built normally rather than
363 from the workspace.
370 Any changes you want to turn into patches must be committed to the
371 Git repository in the source tree.
373 As mentioned, the ``devtool finish`` command moves the final recipe
376 As a final process of the ``devtool finish`` command, the state of
377 the standard layers and the upstream source is restored so that you
378 can build the recipe from those areas rather than the workspace.
382 You can use the
386 the source tree is preserved.
388 Use ``devtool modify`` to Modify the Source of an Existing Component
391 The ``devtool modify`` command prepares the way to work on existing code
392 that already has a local recipe in place that is used to build the
393 software. The command is flexible enough to allow you to extract code
394 from an upstream source, specify the existing recipe, and keep track of
396 with the code.
398 Depending on your particular scenario, the arguments and options you use
399 with ``devtool modify`` form different combinations. The following
400 diagram shows common development flows for the ``devtool modify``
406 1. *Preparing to Modify the Code*: The top part of the flow shows three
408 work on source files. Each scenario assumes the following:
410 - The recipe exists locally in a layer external to the ``devtool``
413 - The source files exist either upstream in an un-extracted state or
416 The typical situation is where another developer has created a layer
417 for use with the Yocto Project and their recipe already resides in
421 - *Left*: The left scenario in the figure represents a common
422 situation where the source code does not exist locally and it
424 the source is extracted into the default ``devtool`` workspace
425 location. The recipe, in this scenario, is in its own layer
426 outside the workspace (i.e. ``meta-``\ layername).
428 The following command identifies the recipe and, by default,
429 extracts the source files::
434 ``devtool``\ locates the recipe, ``devtool`` uses the recipe's
436 locate the source code and any local patch files from other
439 With this scenario, there is no ``srctree`` argument. Consequently, the
440 default behavior of the ``devtool modify`` command is to extract
441 the source files pointed to by the :term:`SRC_URI` statements into a
442 local Git structure. Furthermore, the location for the extracted
443 source is the default area within the ``devtool`` workspace. The
444 result is that the command sets up both the source code and an
445 append file within the workspace while the recipe remains in its
451 an ``oe-local-files`` folder under the newly created source tree.
452 Copying the files here gives you a convenient area from which you
453 can modify the files. Any changes or additions you make to those
454 files are incorporated into the build the next time you build the
455 software just as are other changes you might have made to the
458 - *Middle*: The middle scenario in the figure represents a situation
459 where the source code also does not exist locally. In this case,
460 the code is again upstream and needs to be extracted to some local
461 area as a Git repository. The recipe, in this scenario, is again
462 local and in its own layer outside the workspace.
464 The following command tells ``devtool`` the recipe with which to
465 work and, in this case, identifies a local area for the extracted
466 source files that exists outside of the default ``devtool``
475 using the
479 As with all extractions, the command uses the recipe's :term:`SRC_URI`
480 statements to locate the source files and any associated patch
482 under the newly created source tree.
484 Once the files are located, the command by default extracts them
487 Within workspace, ``devtool`` creates an append file for the
488 recipe. The recipe remains in its original location but the source
489 files are extracted to the location you provide with ``srctree``.
491 - *Right*: The right scenario in the figure represents a situation
492 where the source tree (``srctree``) already exists locally as a
493 previously extracted Git structure outside of the ``devtool``
494 workspace. In this example, the recipe also exists elsewhere
497 The following command tells ``devtool`` the recipe with which to
498 work, uses the "-n" option to indicate source does not need to be
499 extracted, and uses ``srctree`` to point to the previously extracted
505 contains non-patch files, the files are used. However, if the
506 subdirectory does not exist and you run the ``devtool finish``
507 command, any non-patch files that might exist next to the recipe
511 Once the ``devtool modify`` command finishes, it creates only an
512 append file for the recipe in the ``devtool`` workspace. The
513 recipe and the source code remain in their original locations.
515 2. *Edit the Source*: Once you have used the ``devtool modify`` command,
516 you are free to make changes to the source files. You can use any
519 3. *Build the Recipe or Rebuild the Image*: The next step you take
520 depends on what you are going to do with the new code.
522 If you need to eventually move the build output to the target
523 hardware, use the following ``devtool`` command::
527 On the other hand, if you want an image to contain the recipe's
528 packages from the workspace for immediate deployment onto a device
529 (e.g. for testing purposes), you can use the ``devtool build-image``
532 4. *Deploy the Build Output*: When you use the ``devtool build`` command
533 to build out your recipe, you probably want to see if the resulting
540 Also, it is assumed that for deployment of the image to the
541 target, SSH is installed in the image and if the image is running
545 You can deploy your build output to that target hardware by using the
550 The target is a live target machine running as an SSH server.
552 You can, of course, use other methods to deploy the image you built
553 using the ``devtool build-image`` command to actual hardware.
554 ``devtool`` does not provide a specific command to deploy the image
557 5. *Finish Your Work With the Recipe*: The ``devtool finish`` command
558 creates any patches corresponding to commits in the local Git
559 repository, updates the recipe to point to them (or creates a
560 ``.bbappend`` file to do so, depending on the specified destination
561 layer), and then resets the recipe so that the recipe is built
562 normally rather than from the workspace.
570 committed within the local Git repository before you use the
574 Because there is no need to move the recipe, ``devtool finish``
575 either updates the original recipe in the original layer or the
577 by layer. Any work you did in the ``oe-local-files`` directory is
578 preserved in the original files next to the recipe during the
581 As a final process of the ``devtool finish`` command, the state of
582 the standard layers and the upstream source is restored so that you
583 can build the recipe from those areas rather than from the workspace.
587 You can use the
591 the source tree is preserved.
593 Use ``devtool upgrade`` to Create a Version of the Recipe that Supports a Newer Version of the Soft…
596 The ``devtool upgrade`` command upgrades an existing recipe to that of a
597 more up-to-date version found upstream. Throughout the life of software,
599 publishers. You can use the ``devtool upgrade`` workflow to make sure
607 happens to be one. You can read about all the methods by which you
608 can upgrade recipes in the
610 of the Yocto Project Development Tasks Manual.
612 The ``devtool upgrade`` command is flexible enough to allow you to
614 or out of the ``devtool``
615 :ref:`devtool-the-workspace-layer-structure`,
616 and work with any source file forms that the
619 The following diagram shows the common development flow used with the
625 1. *Initiate the Upgrade*: The top part of the flow shows the typical
626 scenario by which you use the ``devtool upgrade`` command. The
629 - The recipe exists in a local layer external to the ``devtool``
632 - The source files for the new release exist in the same location
634 in the recipe (e.g. a tarball with the new version number in the
635 name, or as a different revision in the upstream Git repository).
638 revision so that it has been upgraded. The recipe you have access to
639 is likely in your own layer. Thus, you need to upgrade the recipe to
640 use the newer version of the software::
644 By default, the ``devtool upgrade`` command extracts source
645 code into the ``sources`` directory in the
646 :ref:`devtool-the-workspace-layer-structure`.
647 If you want the code extracted to any other location, you need to
648 provide the ``srctree`` positional argument with the command as follows::
654 In this example, the "-V" option specifies the new version. If you
655 don't use "-V", the command upgrades the recipe to the latest
658 If the source files pointed to by the :term:`SRC_URI` statement in the
659 recipe are in a Git repository, you must provide the "-S" option and
660 specify a revision for the software.
662 Once ``devtool`` locates the recipe, it uses the :term:`SRC_URI` variable
663 to locate the source code and any local patch files from other
664 developers. The result is that the command sets up the source code,
665 the new version of the recipe, and an append file all within the
671 ``oe-local-files`` folder under the newly created source tree.
672 Copying the files here gives you a convenient area from which you can
673 modify the files. Any changes or additions you make to those files
674 are incorporated into the build the next time you build the software
675 just as are other changes you might have made to the source.
677 2. *Resolve any Conflicts created by the Upgrade*: Conflicts could happen
678 after upgrading the software to a new version. Conflicts occur
680 conflict with changes made in the new version of the software. For
681 such cases, you need to resolve the conflicts by editing the source
682 and following the normal ``git rebase`` conflict resolution process.
684 Before moving onto the next step, be sure to resolve any such
685 conflicts created through use of a newer or different version of the
688 3. *Build the Recipe or Rebuild the Image*: The next step you take
689 depends on what you are going to do with the new code.
691 If you need to eventually move the build output to the target
692 hardware, use the following ``devtool`` command::
696 On the other hand, if you want an image to contain the recipe's
697 packages from the workspace for immediate deployment onto a device
698 (e.g. for testing purposes), you can use the ``devtool build-image``
703 4. *Deploy the Build Output*: When you use the ``devtool build`` command
704 or ``bitbake`` to build your recipe, you probably want to see if the
711 Also, it is assumed that for deployment of the image to the
712 target, SSH is installed in the image and if the image is running
716 You can deploy your build output to that target hardware by using the
718 target The target is a live target machine running as an SSH server.
720 You can, of course, also deploy the image you build using the
725 5. *Finish Your Work With the Recipe*: The ``devtool finish`` command
726 creates any patches corresponding to commits in the local Git
727 repository, moves the new recipe to a more permanent layer, and then
728 resets the recipe so that the recipe is built normally rather than
729 from the workspace.
731 Any work you did in the ``oe-local-files`` directory is preserved in
732 the original files next to the recipe during the ``devtool finish``
735 If you specify a destination layer that is the same as the original
736 source, then the old version of the recipe and associated files are
737 removed prior to adding the new version.
744 Any changes you want to turn into patches must be committed to the
745 Git repository in the source tree.
747 As a final process of the ``devtool finish`` command, the state of
748 the standard layers and the upstream source is restored so that you
749 can build the recipe from those areas rather than the workspace.
753 You can use the
757 the source tree is preserved.
762 The ``devtool add`` command automatically creates a recipe based on the
763 source tree you provide with the command. Currently, the command has
764 support for the following:
784 Apart from binary packages, the determination of how a source tree
785 should be treated is automatic based on the files present within that
787 the source tree is assumed to be using CMake and is treated accordingly.
791 In most cases, you need to edit the automatically generated recipe in
793 several edit and build cycles until the recipe successfully builds.
794 Once the recipe builds, you could use possible further iterations to
795 test the recipe on the target device.
797 The remainder of this section covers specifics regarding how parts of
798 the recipe are generated.
803 If you do not specify a name and version on the command line,
804 ``devtool add`` uses various metadata within the source tree in an
805 attempt to determine the name and version of the software being built.
806 Based on what the tool determines, ``devtool`` sets the name of the
809 If ``devtool`` cannot determine the name and version, the command prints
810 an error. For such cases, you must re-run the command and provide the
811 name and version, just the name, or just the version as part of the
814 Sometimes the name or version determined from the source tree might be
815 incorrect. For such a case, you must reset the recipe::
819 After running the ``devtool reset`` command, you need to
820 run ``devtool add`` again and provide the name or the version.
825 The ``devtool add`` command attempts to detect build-time dependencies
826 and map them to other recipes in the system. During this mapping, the
827 command fills in the names of those recipes as part of the
828 :term:`DEPENDS` variable within the
830 in the recipe indicating such. The inability to map a dependency can
831 result from naming not being recognized or because the dependency simply
832 is not available. For cases where the dependency is not available, you
833 must use the ``devtool add`` command to add an additional recipe that
834 satisfies the dependency. Once you add that recipe, you need to update
835 the :term:`DEPENDS` variable in the original recipe to include the new
838 If you need to add runtime dependencies, you can do so by adding the
845 The
848 dependencies. Consequently, some of the detected dependencies might
849 in fact be optional. When in doubt, consult the documentation or the
850 configure script for the software the recipe is building for further
851 details. In some cases, you might find you can substitute the
852 dependency with an option that disables the associated functionality
853 passed to the configure script.
858 The ``devtool add`` command attempts to determine if the software you
860 license. If so, the command sets the
862 You should double-check the value added by the command against the
863 documentation or source files for the software you are building and, if
866 The ``devtool add`` command also sets the
869 that license statements often appear in comments at the top of source
870 files or within the documentation. In such cases, the command does not
872 amend the :term:`LIC_FILES_CHKSUM` variable to point to one or more of those
874 important for third-party software. The mechanism attempts to ensure
875 correct licensing should you upgrade the recipe to a newer upstream
877 an error prompting you to check the license text again.
879 If the ``devtool add`` command cannot determine licensing information,
880 ``devtool`` sets the :term:`LICENSE` value to "CLOSED" and leaves the
882 with development even though the settings are unlikely to be correct in
883 all cases. You should check the documentation or source files for the
884 software you are building to determine the actual license.
889 The use of Make by itself is very common in both proprietary and
893 common, for example, to explicitly call ``gcc`` instead of using the
895 cross-compilation environment, ``gcc`` is the compiler for the build
896 host and the cross-compiler is named something similar to
898 point to the associated sysroot for the target machine).
900 When writing a recipe for Makefile-only software, keep the following in
903 - You probably need to patch the Makefile to use variables instead of
904 hardcoding tools within the toolchain such as ``gcc`` and ``g++``.
906 - The environment in which Make runs is set up with various standard
908 similar manner to the environment set up by the SDK's environment
909 setup script. One easy way to see these variables is to run the
910 ``devtool build`` command on the recipe and then look in
911 ``oe-logs/run.do_compile``. Towards the top of this file, there is
913 advantage of these variables within the Makefile.
915 - If the Makefile sets a default for a variable using "=", that default
916 overrides the value set in the environment, which is usually not
917 desirable. For this case, you can either patch the Makefile so it
918 sets the default using the "?=" operator, or you can alternatively
919 force the value on the ``make`` command line. To force the value on
920 the command line, add the variable setting to
923 within the recipe. Here is an example using :term:`EXTRA_OEMAKE`::
927 In the above example,
928 single quotes are used around the variable settings as the values are
930 to the compiler.
934 those hardcoded paths often point to locations on the build host and
936 the cross-compilation because they are specific to the build host
937 rather than the target. Patching the Makefile to use prefix variables
938 or other path variables is usually the way to handle this situation.
942 remove these commands from the Makefile.
947 Often, you need to build additional tools that run on the :term:`Build
949 the target. You should indicate this requirement by using one of the
952 - Specify the name of the recipe such that it ends with "-native".
953 Specifying the name like this produces a recipe that only builds for
954 the build host.
956 - Specify the "--also-native" option with the ``devtool add``
958 builds for the target but also creates a variant with a "-native"
959 suffix that builds for the build host.
964 that builds code for the target, you can typically accomplish this by
965 building the native and target parts separately rather than within
966 the same compilation process. Realize though that with the
967 "--also-native" option, you can add the tool using just one
973 You can use the ``devtool add`` command two different ways to add
977 Use the following form to add Node.js modules through ``npm``::
981 The name and
983 generated and pointed to by the recipe in order to freeze the version
984 that is fetched for the dependencies according to the first time. This
986 these behaviors ensure the reproducibility and integrity of the build.
990 - You must use quotes around the URL. The ``devtool add`` does not
991 require the quotes, but the shell considers ";" as a splitter
992 between multiple commands. Thus, without the quotes,
993 ``devtool add`` does not receive the other parts, which results in
1001 ``devtool add`` in the following form::
1006 fetches the specified Git repository, detects the code as Node.js code,
1013 When building a recipe using the ``devtool build`` command, the typical
1016 1. Fetch the source
1018 2. Unpack the source
1020 3. Configure the source
1022 4. Compile the source
1024 5. Install the build output
1026 6. Package the installed output
1028 For recipes in the workspace, fetching and unpacking is disabled as the
1036 If you look at the contents of a recipe, you will see that the recipe
1037 does not include complete instructions for building the software.
1039 the ``inherit`` directive. This technique leaves the recipe to describe
1040 just the things that are specific to the software being built. There is
1042 is implicitly inherited by all recipes and provides the functionality
1045 The remainder of this section presents information useful when working
1051 After the first run of the ``devtool build`` command, recipes that were
1052 previously created using the ``devtool add`` command or whose sources
1053 were modified using the ``devtool modify`` command contain symbolic
1054 links created within the source tree:
1056 - ``oe-logs``: This link points to the directory in which log files and
1059 - ``oe-workdir``: This link points to the temporary work area for the
1060 recipe. The following locations under ``oe-workdir`` are particularly
1063 - ``image/``: Contains all of the files installed during the
1065 Within a recipe, this directory is referred to by the expression
1069 ``do_install`` that have been put into the shared sysroot. For
1070 more information, see the
1074 produced by the recipe. For more information, see the
1083 If the software your recipe is building uses GNU autoconf, then a fixed
1088 set within the recipe. If you wish to pass additional options, add them
1093 for Scons, and so forth). If you need to pass anything on the ``make``
1094 command line, you can use :term:`EXTRA_OEMAKE` or the
1098 You can use the ``devtool configure-help`` command to help you set the
1099 arguments listed in the previous paragraph. The command determines the
1102 :term:`PACKAGECONFIG_CONFARGS`. If applicable, the command also shows you
1103 the output of the configure script's "--help" option as a
1109 Recipes often need to use files provided by other recipes on the
1111 an application linking to a common library needs access to the library
1112 itself and its associated headers. The way this access is accomplished
1113 within the extensible SDK is through the sysroot. There is one sysroot per
1114 "machine" for which the SDK is being built. In practical terms, this
1115 means there is a sysroot for the target machine, and a sysroot for
1116 the build host.
1118 Recipes should never write files directly into the sysroot. Instead,
1119 files should be installed into standard locations during the
1121 the ``${``\ :term:`D`\ ``}`` directory. A
1122 subset of these files automatically goes into the sysroot. The reason
1123 for this limitation is that almost all files that go into the sysroot
1125 when a recipe is modified or removed. Thus, the sysroot is able to
1131 Packaging is not always particularly relevant within the extensible SDK.
1132 However, if you examine how build output gets into the final image on
1133 the target device, it is important to understand packaging because the
1134 contents of the image are expressed in terms of packages and not
1137 During the :ref:`ref-tasks-package`
1138 task, files installed during the
1140 split into one main package, which is almost always named the same as
1141 the recipe, and into several other packages. This separation exists
1143 example, you probably do not need any of the documentation installed in
1144 a production image. Consequently, for each recipe the documentation
1150 the ``oe-workdir/packages-split`` directory, which contains a
1151 subdirectory for each package. Apart from some advanced cases, the
1154 splitting. The :term:`PACKAGES` variable lists all of the packages to be
1155 produced, while the :term:`FILES` variable specifies which files to include
1156 in each package by using an override to specify the package. For
1157 example, ``FILES:${PN}`` specifies the files to go into the main package
1158 (i.e. the main package has the same name as the recipe and
1159 ``${``\ :term:`PN`\ ``}`` evaluates to the
1160 recipe name). The order of the :term:`PACKAGES` value is significant. For
1161 each installed file, the first package whose :term:`FILES` value matches the
1162 file is the package into which the file goes. Both the :term:`PACKAGES` and
1164 you do not even need to set these variables in your recipe unless the
1165 software the recipe is building installs files into non-standard
1168 Restoring the Target Device to its Original State
1171 If you use the ``devtool deploy-target`` command to write a recipe's
1172 build output to the target, and you are working on an existing component
1173 of the system, then you might find yourself in a situation where you
1174 need to restore the original files that existed prior to running the
1175 ``devtool deploy-target`` command. Because the ``devtool deploy-target``
1176 command backs up any files it overwrites, you can use the
1178 any other files the recipe deployed. Consider the following example::
1183 multiple applications, you can remove them all using the "-a" option
1184 thus restoring the target device to its original state::
1189 the target as well as any backed up files are stored on the target
1190 itself. This storage, of course, requires some additional space on the
1195 The
1200 on the target device (e.g. RPM or OPKG). Consequently, you should not
1203 and package manager operations on the target device. Doing so could
1206 Installing Additional Items Into the Extensible SDK
1209 Out of the box the extensible SDK typically only comes with a small
1212 into the SDK. If you need these extra items, you can first search for
1213 the items using the ``devtool search`` command. For example, suppose you
1215 You can use the following command to find out::
1219 A free implementation of the OpenGL API Once you know the recipe
1224 By default, the ``devtool sdk-install`` command assumes
1225 the item is available in pre-built form from your SDK provider. If the
1226 item is not available and it is acceptable to build the item from
1227 source, you can add the "-s" option as follows::
1231 It is important to remember that building the item from source
1232 takes significantly longer than installing the pre-built artifact. Also,
1233 if there is no recipe for the item you want to add to the SDK, you must
1234 instead add the item using the ``devtool add`` command.
1241 manually "pull down" the updates into the installed SDK.
1247 The previous command assumes your SDK provider has set the
1248 default update URL for you through the :term:`SDK_UPDATE_URL`
1249 variable as described in the
1250 ":ref:`sdk-manual/appendix-customizing:Providing Updates to the Extensible SDK After Installation`"
1251 section. If the SDK provider has not set that default URL, you need to
1252 specify it yourself in the command as follows: $ devtool sdk-update
1257 The URL needs to point specifically to a published SDK and not to an
1267 you can produce a derivative SDK based on the currently installed SDK
1273 2. Source the environment script for the SDK.
1275 3. Add the extra libraries or other components you want by using the
1278 4. Run the ``devtool build-sdk`` command.
1280 The previous steps take the recipes added to the workspace and construct
1281 a new SDK installer that contains those recipes and the resulting binary
1282 artifacts. The recipes go into their own separate layer in the
1283 constructed derivative SDK, which leaves the workspace clean and ready