diff options
Diffstat (limited to 'poky/documentation/sdk-manual')
-rw-r--r-- | poky/documentation/sdk-manual/appendix-customizing-standard.rst | 4 | ||||
-rw-r--r-- | poky/documentation/sdk-manual/appendix-customizing.rst | 81 | ||||
-rw-r--r-- | poky/documentation/sdk-manual/appendix-obtain.rst | 38 | ||||
-rw-r--r-- | poky/documentation/sdk-manual/extensible.rst | 195 | ||||
-rw-r--r-- | poky/documentation/sdk-manual/intro.rst | 50 | ||||
-rw-r--r-- | poky/documentation/sdk-manual/using.rst | 19 | ||||
-rw-r--r-- | poky/documentation/sdk-manual/working-projects.rst | 75 |
7 files changed, 193 insertions, 269 deletions
diff --git a/poky/documentation/sdk-manual/appendix-customizing-standard.rst b/poky/documentation/sdk-manual/appendix-customizing-standard.rst index 90b634529..9bc70cf55 100644 --- a/poky/documentation/sdk-manual/appendix-customizing-standard.rst +++ b/poky/documentation/sdk-manual/appendix-customizing-standard.rst @@ -17,10 +17,10 @@ and variables control the set of packages adding to the SDK. If you want to add individual packages to the toolchain that runs on the -host, simply add those packages to the ``TOOLCHAIN_HOST_TASK`` variable. +host, simply add those packages to the :term:`TOOLCHAIN_HOST_TASK` variable. Similarly, if you want to add packages to the default set that is part of the toolchain that runs on the target, add the packages to the -``TOOLCHAIN_TARGET_TASK`` variable. +:term:`TOOLCHAIN_TARGET_TASK` variable. Adding API Documentation to the Standard SDK ============================================ diff --git a/poky/documentation/sdk-manual/appendix-customizing.rst b/poky/documentation/sdk-manual/appendix-customizing.rst index 8e7115046..44f4334c2 100644 --- a/poky/documentation/sdk-manual/appendix-customizing.rst +++ b/poky/documentation/sdk-manual/appendix-customizing.rst @@ -35,13 +35,13 @@ build system applies them against ``local.conf`` and ``auto.conf``: - Variables listed in :term:`SDK_LOCAL_CONF_WHITELIST` are included. Including a variable in the value of - ``SDK_LOCAL_CONF_WHITELIST`` overrides either of the previous two + :term:`SDK_LOCAL_CONF_WHITELIST` overrides either of the previous two filters. The default value is blank. - Classes inherited globally with :term:`INHERIT` that are listed in :term:`SDK_INHERIT_BLACKLIST` - are disabled. Using ``SDK_INHERIT_BLACKLIST`` to disable these + are disabled. Using :term:`SDK_INHERIT_BLACKLIST` to disable these classes is the typical method to disable classes that are problematic or unnecessary in the SDK context. The default value blacklists the :ref:`buildhistory <ref-classes-buildhistory>` @@ -57,8 +57,7 @@ Adjusting the Extensible SDK to Suit Your Build Host's Setup ============================================================ In most cases, the extensible SDK defaults should work with your :term:`Build -Host`'s setup. -However, some cases exist for which you might consider making +Host`'s setup. However, there are cases when you might consider making adjustments: - If your SDK configuration inherits additional classes using the @@ -75,11 +74,9 @@ adjustments: is set using the "?=" operator. Consequently, you will need to either define the entire list by using the "=" operator, or you will need to append a value using either "_append" or the "+=" - operator. You can learn more about these operators in the " - Basic Syntax - " section of the BitBake User Manual. - - . + operator. You can learn more about these operators in the + ":ref:`bitbake:bitbake-user-manual/bitbake-user-manual-metadata:basic syntax`" + section of the BitBake User Manual. - If you have classes or recipes that add additional tasks to the standard build flow (i.e. the tasks execute as the recipe builds as @@ -96,7 +93,7 @@ adjustments: - Disable the tasks if they are added by a class and you do not need the functionality the class provides in the extensible SDK. To - disable the tasks, add the class to the ``SDK_INHERIT_BLACKLIST`` + disable the tasks, add the class to the :term:`SDK_INHERIT_BLACKLIST` variable as described in the previous section. - Generally, you want to have a shared state mirror set up so users of @@ -129,8 +126,7 @@ adjustments: .. note:: You must also reflect this change in the value used for the - COREBASE_FILES - variable as previously described. + :term:`COREBASE_FILES` variable as previously described. Changing the Extensible SDK Installer Title =========================================== @@ -143,27 +139,25 @@ section. By default, this title is derived from :term:`DISTRO_NAME` when it is -set. If the ``DISTRO_NAME`` variable is not set, the title is derived +set. If the :term:`DISTRO_NAME` variable is not set, the title is derived from the :term:`DISTRO` variable. The :ref:`populate_sdk_base <ref-classes-populate-sdk-*>` -class defines the default value of the ``SDK_TITLE`` variable as -follows: -:: +class defines the default value of the :term:`SDK_TITLE` variable as +follows:: SDK_TITLE ??= "${@d.getVar('DISTRO_NAME') or d.getVar('DISTRO')} SDK" -While several ways exist to change this variable, an efficient method is +While there are several ways of changing this variable, an efficient method is to set the variable in your distribution's configuration file. Doing so creates an SDK installer title that applies across your distribution. As an example, assume you have your own layer for your distribution named "meta-mydistro" and you are using the same type of file hierarchy as does the default "poky" distribution. If so, you could update the -``SDK_TITLE`` variable in the +:term:`SDK_TITLE` variable in the ``~/meta-mydistro/conf/distro/mydistro.conf`` file using the following -form: -:: +form:: SDK_TITLE = "your_title" @@ -194,8 +188,7 @@ the installed SDKs to update the installed SDKs by using the 3. Build the extensible SDK normally (i.e., use the ``bitbake -c populate_sdk_ext`` imagename command). -4. Publish the SDK using the following command: - :: +4. Publish the SDK using the following command:: $ oe-publish-sdk some_path/sdk-installer.sh path_to_shared_http_directory @@ -218,26 +211,24 @@ installation directory for the SDK is based on the :term:`SDKEXTPATH` variables from within the :ref:`populate_sdk_base <ref-classes-populate-sdk-*>` -class as follows: -:: +class as follows:: SDKEXTPATH ??= "~/${@d.getVar('DISTRO')}_sdk" You can change this default installation directory by specifically setting the -``SDKEXTPATH`` variable. +:term:`SDKEXTPATH` variable. -While a number of ways exist through which you can set this variable, +While there are several ways of setting this variable, the method that makes the most sense is to set the variable in your distribution's configuration file. Doing so creates an SDK installer default directory that applies across your distribution. As an example, assume you have your own layer for your distribution named "meta-mydistro" and you are using the same type of file hierarchy as does the default "poky" distribution. If so, you could update the -``SDKEXTPATH`` variable in the +:term:`SDKEXTPATH` variable in the ``~/meta-mydistro/conf/distro/mydistro.conf`` file using the following -form: -:: +form:: SDKEXTPATH = "some_path_for_your_installed_sdk" @@ -272,13 +263,11 @@ source, you need to do a number of things: 3. Set the appropriate configuration so that the produced SDK knows how to find the configuration. The variable you need to set is - :term:`SSTATE_MIRRORS`: - :: + :term:`SSTATE_MIRRORS`:: SSTATE_MIRRORS = "file://.* http://example.com/some_path/sstate-cache/PATH" - You can set the - ``SSTATE_MIRRORS`` variable in two different places: + You can set the :term:`SSTATE_MIRRORS` variable in two different places: - If the mirror value you are setting is appropriate to be set for both the OpenEmbedded build system that is actually building the @@ -287,23 +276,21 @@ source, you need to do a number of things: side, and its contents will not interfere with the build), then you can set the variable in your ``local.conf`` or custom distro configuration file. You can then "whitelist" the variable through - to the SDK by adding the following: - :: + to the SDK by adding the following:: SDK_LOCAL_CONF_WHITELIST = "SSTATE_MIRRORS" - - Alternatively, if you just want to set the ``SSTATE_MIRRORS`` + - Alternatively, if you just want to set the :term:`SSTATE_MIRRORS` variable's value for the SDK alone, create a ``conf/sdk-extra.conf`` file either in your :term:`Build Directory` or within any - layer and put your ``SSTATE_MIRRORS`` setting within that file. + layer and put your :term:`SSTATE_MIRRORS` setting within that file. .. note:: This second option is the safest option should you have any doubts as to which method to use when setting - SSTATE_MIRRORS - . + :term:`SSTATE_MIRRORS` Minimizing the Size of the Extensible SDK Installer Download ============================================================ @@ -313,8 +300,7 @@ everything needed to reconstruct the image for which the SDK was built. This bundling can lead to an SDK installer file that is a Gigabyte or more in size. If the size of this file causes a problem, you can build an SDK that has just enough in it to install and provide access to the -``devtool command`` by setting the following in your configuration: -:: +``devtool command`` by setting the following in your configuration:: SDK_EXT_TYPE = "minimal" @@ -336,14 +322,13 @@ information enables the ``devtool search`` command to return useful results. To facilitate this wider range of information, you would need to set the -following: -:: +following:: SDK_INCLUDE_PKGDATA = "1" See the :term:`SDK_INCLUDE_PKGDATA` variable for additional information. -Setting the ``SDK_INCLUDE_PKGDATA`` variable as shown causes the "world" +Setting the :term:`SDK_INCLUDE_PKGDATA` variable as shown causes the "world" target to be built so that information for all of the recipes included within it are available. Having these recipes available increases build time significantly and increases the size of the SDK installer by 30-80 @@ -360,15 +345,15 @@ in most cases. If you set SDK_EXT_TYPE to "minimal", then providing a shared state mirror is mandatory so - that items can be installed as needed. See the " - Providing Additional Installable Extensible SDK Content - " section for more information. + that items can be installed as needed. See the + :ref:`sdk-manual/appendix-customizing:providing additional installable extensible sdk content` + section for more information. You can explicitly control whether or not to include the toolchain when you build an SDK by setting the :term:`SDK_INCLUDE_TOOLCHAIN` variable to "1". In particular, it is useful to include the toolchain -when you have set ``SDK_EXT_TYPE`` to "minimal", which by default, +when you have set :term:`SDK_EXT_TYPE` to "minimal", which by default, excludes the toolchain. Also, it is helpful if you are building a small SDK for use with an IDE or some other tool where you do not want to take extra steps to install a toolchain. diff --git a/poky/documentation/sdk-manual/appendix-obtain.rst b/poky/documentation/sdk-manual/appendix-obtain.rst index 3c1dc52d1..fc6b8b9d5 100644 --- a/poky/documentation/sdk-manual/appendix-obtain.rst +++ b/poky/documentation/sdk-manual/appendix-obtain.rst @@ -25,8 +25,7 @@ Follow these steps to locate and hand-install the toolchain: download the installer appropriate for your build host, target hardware, and image type. - The installer files (``*.sh``) follow this naming convention: - :: + The installer files (``*.sh``) follow this naming convention:: poky-glibc-host_system-core-image-type-arch-toolchain[-ext]-release.sh @@ -55,15 +54,13 @@ Follow these steps to locate and hand-install the toolchain: For example, if your build host is a 64-bit x86 system and you need an extended SDK for a 64-bit core2 target, go into the ``x86_64`` - folder and download the following installer: - :: + folder and download the following installer:: poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-&DISTRO;.sh 4. *Run the Installer:* Be sure you have execution privileges and run the installer. Following is an example from the ``Downloads`` - directory: - :: + directory:: $ ~/Downloads/poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-&DISTRO;.sh @@ -132,8 +129,7 @@ build the SDK installer. Follow these steps: using to build the installer. If SDKMACHINE is not set appropriately, the build fails and provides an error - message similar to the following: - :: + message similar to the following:: The extensible SDK can currently only be built for the same architecture as the machine being built on - SDK_ARCH is set to i686 (likely via setting SDKMACHINE) which is different from the architecture of the build machine (x86_64). @@ -142,10 +138,11 @@ build the SDK installer. Follow these steps: 6. *Build the SDK Installer:* To build the SDK installer for a standard SDK and populate the SDK image, use the following command form. Be - sure to replace image with an image (e.g. "core-image-sato"): $ - bitbake image -c populate_sdk You can do the same for the extensible - SDK using this command form: - :: + sure to replace ``image`` with an image (e.g. "core-image-sato"):: + + $ bitbake image -c populate_sdk + + You can do the same for the extensible SDK using this command form:: $ bitbake image -c populate_sdk_ext @@ -170,8 +167,7 @@ build the SDK installer. Follow these steps: libc-staticdev" 7. *Run the Installer:* You can now run the SDK installer from - ``tmp/deploy/sdk`` in the Build Directory. Following is an example: - :: + ``tmp/deploy/sdk`` in the Build Directory. Following is an example:: $ cd poky/build/tmp/deploy/sdk $ ./poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-&DISTRO;.sh @@ -211,8 +207,7 @@ Follow these steps to extract the root filesystem: which you can use with QEMU directly. The pre-built root filesystem image files follow these naming - conventions: - :: + conventions:: core-image-profile-arch.tar.bz2 @@ -233,8 +228,7 @@ Follow these steps to extract the root filesystem: For example, if you plan on using a BeagleBone device as your target hardware and your image is a ``core-image-sato-sdk`` image, you can - download the following file: - :: + download the following file:: core-image-sato-sdk-beaglebone-yocto.tar.bz2 @@ -246,8 +240,7 @@ Follow these steps to extract the root filesystem: installed the toolchain (e.g. ``poky_sdk``). Following is an example based on the toolchain installed in the - ":ref:`sdk-manual/appendix-obtain:locating pre-built sdk installers`" section: - :: + ":ref:`sdk-manual/appendix-obtain:locating pre-built sdk installers`" section:: $ source poky_sdk/environment-setup-core2-64-poky-linux @@ -258,12 +251,11 @@ Follow these steps to extract the root filesystem: from a previously built root filesystem image that was downloaded from the :yocto_dl:`Index of Releases </releases/yocto/yocto-&DISTRO;/machines/>`. This command extracts the root filesystem into the ``core2-64-sato`` - directory: - :: + directory:: $ runqemu-extract-sdk ~/Downloads/core-image-sato-sdk-beaglebone-yocto.tar.bz2 ~/beaglebone-sato - You could now point to the target sysroot at ``beablebone-sato``. + You could now point to the target sysroot at ``beaglebone-sato``. Installed Standard SDK Directory Structure ========================================== diff --git a/poky/documentation/sdk-manual/extensible.rst b/poky/documentation/sdk-manual/extensible.rst index baa432ef3..5520a0718 100644 --- a/poky/documentation/sdk-manual/extensible.rst +++ b/poky/documentation/sdk-manual/extensible.rst @@ -15,9 +15,8 @@ hardware, and ease integration into the rest of the .. note:: For a side-by-side comparison of main features supported for an - extensible SDK as compared to a standard SDK, see the " - Introduction - " section. + extensible SDK as compared to a standard SDK, see the + :ref:`sdk-manual/intro:introduction` section. In addition to the functionality available through ``devtool``, you can alternatively make use of the toolchain directly, for example from @@ -59,8 +58,7 @@ The names of the tarball installer scripts are such that a string representing the host system appears first in the filename and then is immediately followed by a string representing the target architecture. An extensible SDK has the string "-ext" as part of the name. Following -is the general form: -:: +is the general form:: poky-glibc-host_system-image_type-arch-toolchain-ext-release_version.sh @@ -83,17 +81,16 @@ is the general form: For example, the following SDK installer is for a 64-bit development host system and a i586-tuned target architecture based off -the SDK for ``core-image-sato`` and using the current &DISTRO; snapshot: -:: +the SDK for ``core-image-sato`` and using the current &DISTRO; snapshot:: poky-glibc-x86_64-core-image-sato-i586-toolchain-ext-&DISTRO;.sh .. note:: As an alternative to downloading an SDK, you can build the SDK - installer. For information on building the installer, see the " - Building an SDK Installer - " section. + installer. For information on building the installer, see the + :ref:`sdk-manual/appendix-obtain:building an sdk installer` + section. The SDK and toolchains are self-contained and by default are installed into the ``poky_sdk`` folder in your home directory. You can choose to @@ -150,8 +147,7 @@ begin with the string "``environment-setup``" and include as part of their name the tuned target architecture. As an example, the following commands set the working directory to where the SDK was installed and then source the environment setup script. In this example, the setup -script is for an IA-based target machine using i586 tuning: -:: +script is for an IA-based target machine using i586 tuning:: $ cd /home/scottrif/poky_sdk $ source environment-setup-core2-64-poky-linux @@ -197,7 +193,7 @@ all the commands. devtool quick reference. -Three ``devtool`` subcommands exist that provide entry-points into +Three ``devtool`` subcommands provide entry-points into development: - *devtool add*: Assists in adding new software to be built. @@ -258,8 +254,7 @@ command: to be extracted. In this situation, the source code is extracted to the default workspace - you do not want the files in some specific location outside of the workspace. Thus, everything you - need will be located in the workspace: - :: + need will be located in the workspace:: $ devtool add recipe fetchuri @@ -280,28 +275,26 @@ command: devtool always creates a Git repository locally during the extraction. - Furthermore, the first positional argument srctree in this case + Furthermore, the first positional argument ``srctree`` in this case identifies where the ``devtool add`` command will locate the extracted code outside of the workspace. You need to specify an - empty directory: - :: + empty directory:: $ devtool add recipe srctree fetchuri In summary, the source code is pulled from fetchuri and extracted into the - location defined by srctree as a local Git repository. + location defined by ``srctree`` as a local Git repository. Within workspace, ``devtool`` creates a recipe named recipe along with an associated append file. - *Right*: The right scenario in the figure represents a situation - where the srctree has been previously prepared outside of the + where the ``srctree`` has been previously prepared outside of the ``devtool`` workspace. The following command provides a new recipe name and identifies - the existing source tree location: - :: + the existing source tree location:: $ devtool add recipe srctree @@ -317,8 +310,7 @@ command: 2. *Edit the Recipe*: You can use ``devtool edit-recipe`` to open up the editor as defined by the ``$EDITOR`` environment variable and modify - the file: - :: + the file:: $ devtool edit-recipe recipe @@ -338,8 +330,7 @@ command: On the other hand, if you want an image to contain the recipe's packages from the workspace for immediate deployment onto a device (e.g. for testing purposes), you can use the ``devtool build-image`` - command: - :: + command:: $ devtool build-image image @@ -435,8 +426,7 @@ command: outside the workspace (i.e. ``meta-``\ layername). The following command identifies the recipe and, by default, - extracts the source files: - :: + extracts the source files:: $ devtool modify recipe @@ -446,9 +436,9 @@ command: locate the source code and any local patch files from other developers. - With this scenario, no srctree argument exists. Consequently, the + With this scenario, there is no ``srctree`` argument. Consequently, the default behavior of the ``devtool modify`` command is to extract - the source files pointed to by the ``SRC_URI`` statements into a + the source files pointed to by the :term:`SRC_URI` statements into a local Git structure. Furthermore, the location for the extracted source is the default area within the ``devtool`` workspace. The result is that the command sets up both the source code and an @@ -456,7 +446,7 @@ command: original location. Additionally, if you have any non-patch local files (i.e. files - referred to with ``file://`` entries in ``SRC_URI`` statement + referred to with ``file://`` entries in :term:`SRC_URI` statement excluding ``*.patch/`` or ``*.diff``), these files are copied to an ``oe-local-files`` folder under the newly created source tree. Copying the files here gives you a convenient area from which you @@ -474,8 +464,7 @@ command: The following command tells ``devtool`` the recipe with which to work and, in this case, identifies a local area for the extracted source files that exists outside of the default ``devtool`` - workspace: - :: + workspace:: $ devtool modify recipe srctree @@ -487,29 +476,28 @@ command: devtool command. - As with all extractions, the command uses the recipe's ``SRC_URI`` + As with all extractions, the command uses the recipe's :term:`SRC_URI` statements to locate the source files and any associated patch files. Non-patch files are copied to an ``oe-local-files`` folder under the newly created source tree. Once the files are located, the command by default extracts them - into srctree. + into ``srctree``. Within workspace, ``devtool`` creates an append file for the recipe. The recipe remains in its original location but the source - files are extracted to the location you provide with srctree. + files are extracted to the location you provide with ``srctree``. - *Right*: The right scenario in the figure represents a situation - where the source tree (srctree) already exists locally as a + where the source tree (``srctree``) already exists locally as a previously extracted Git structure outside of the ``devtool`` workspace. In this example, the recipe also exists elsewhere locally in its own layer. The following command tells ``devtool`` the recipe with which to work, uses the "-n" option to indicate source does not need to be - extracted, and uses srctree to point to the previously extracted - source files: - :: + extracted, and uses ``srctree`` to point to the previously extracted + source files:: $ devtool modify -n recipe srctree @@ -532,8 +520,7 @@ command: depends on what you are going to do with the new code. If you need to eventually move the build output to the target - hardware, use the following ``devtool`` command: - :: + hardware, use the following ``devtool`` command:: $ devtool build recipe @@ -556,8 +543,7 @@ command: development machine. You can deploy your build output to that target hardware by using the - ``devtool deploy-target`` command: - :: + ``devtool deploy-target`` command:: $ devtool deploy-target recipe target @@ -617,11 +603,11 @@ counterparts. .. note:: Several methods exist by which you can upgrade recipes - - devtool upgrade + ``devtool upgrade`` happens to be one. You can read about all the methods by which you - can upgrade recipes in the " - Upgrading Recipes - " section of the Yocto Project Development Tasks Manual. + can upgrade recipes in the + :ref:`dev-manual/common-tasks:upgrading recipes` section + of the Yocto Project Development Tasks Manual. The ``devtool upgrade`` command is flexible enough to allow you to specify source code revision and versioning schemes, extract code into @@ -651,8 +637,7 @@ The following diagram shows the common development flow used with the A common situation is where third-party software has undergone a revision so that it has been upgraded. The recipe you have access to is likely in your own layer. Thus, you need to upgrade the recipe to - use the newer version of the software: - :: + use the newer version of the software:: $ devtool upgrade -V version recipe @@ -660,8 +645,9 @@ The following diagram shows the common development flow used with the code into the ``sources`` directory in the :ref:`devtool-the-workspace-layer-structure`. If you want the code extracted to any other location, you need to - provide the srctree positional argument with the command as follows: - $ devtool upgrade -V version recipe srctree + provide the ``srctree`` positional argument with the command as follows:: + + $ devtool upgrade -V version recipe srctree .. note:: @@ -669,18 +655,18 @@ The following diagram shows the common development flow used with the don't use "-V", the command upgrades the recipe to the latest version. - If the source files pointed to by the ``SRC_URI`` statement in the + If the source files pointed to by the :term:`SRC_URI` statement in the recipe are in a Git repository, you must provide the "-S" option and specify a revision for the software. - Once ``devtool`` locates the recipe, it uses the ``SRC_URI`` variable + Once ``devtool`` locates the recipe, it uses the :term:`SRC_URI` variable to locate the source code and any local patch files from other developers. The result is that the command sets up the source code, the new version of the recipe, and an append file all within the workspace. Additionally, if you have any non-patch local files (i.e. files - referred to with ``file://`` entries in ``SRC_URI`` statement + referred to with ``file://`` entries in :term:`SRC_URI` statement excluding ``*.patch/`` or ``*.diff``), these files are copied to an ``oe-local-files`` folder under the newly created source tree. Copying the files here gives you a convenient area from which you can @@ -688,9 +674,9 @@ The following diagram shows the common development flow used with the are incorporated into the build the next time you build the software just as are other changes you might have made to the source. -2. *Resolve any Conflicts created by the Upgrade*: Conflicts could exist - due to the software being upgraded to a new version. Conflicts occur - if your recipe specifies some patch files in ``SRC_URI`` that +2. *Resolve any Conflicts created by the Upgrade*: Conflicts could happen + after upgrading the software to a new version. Conflicts occur + if your recipe specifies some patch files in :term:`SRC_URI` that conflict with changes made in the new version of the software. For such cases, you need to resolve the conflicts by editing the source and following the normal ``git rebase`` conflict resolution process. @@ -703,16 +689,14 @@ The following diagram shows the common development flow used with the depends on what you are going to do with the new code. If you need to eventually move the build output to the target - hardware, use the following ``devtool`` command: - :: + hardware, use the following ``devtool`` command:: $ devtool build recipe On the other hand, if you want an image to contain the recipe's packages from the workspace for immediate deployment onto a device (e.g. for testing purposes), you can use the ``devtool build-image`` - command: - :: + command:: $ devtool build-image image @@ -828,8 +812,7 @@ name and version, just the name, or just the version as part of the command line. Sometimes the name or version determined from the source tree might be -incorrect. For such a case, you must reset the recipe: -:: +incorrect. For such a case, you must reset the recipe:: $ devtool reset -n recipename @@ -849,12 +832,11 @@ result from naming not being recognized or because the dependency simply is not available. For cases where the dependency is not available, you must use the ``devtool add`` command to add an additional recipe that satisfies the dependency. Once you add that recipe, you need to update -the ``DEPENDS`` variable in the original recipe to include the new +the :term:`DEPENDS` variable in the original recipe to include the new recipe. If you need to add runtime dependencies, you can do so by adding the -following to your recipe: -:: +following to your recipe:: RDEPENDS_${PN} += "dependency1 dependency2 ..." @@ -879,7 +861,7 @@ license. If so, the command sets the :term:`LICENSE` value accordingly. You should double-check the value added by the command against the documentation or source files for the software you are building and, if -necessary, update that ``LICENSE`` value. +necessary, update that :term:`LICENSE` value. The ``devtool add`` command also sets the :term:`LIC_FILES_CHKSUM` @@ -887,16 +869,16 @@ value to point to all files that appear to be license-related. Realize that license statements often appear in comments at the top of source files or within the documentation. In such cases, the command does not recognize those license statements. Consequently, you might need to -amend the ``LIC_FILES_CHKSUM`` variable to point to one or more of those -comments if present. Setting ``LIC_FILES_CHKSUM`` is particularly +amend the :term:`LIC_FILES_CHKSUM` variable to point to one or more of those +comments if present. Setting :term:`LIC_FILES_CHKSUM` is particularly important for third-party software. The mechanism attempts to ensure correct licensing should you upgrade the recipe to a newer upstream version in future. Any change in licensing is detected and you receive an error prompting you to check the license text again. If the ``devtool add`` command cannot determine licensing information, -``devtool`` sets the ``LICENSE`` value to "CLOSED" and leaves the -``LIC_FILES_CHKSUM`` value unset. This behavior allows you to continue +``devtool`` sets the :term:`LICENSE` value to "CLOSED" and leaves the +:term:`LIC_FILES_CHKSUM` value unset. This behavior allows you to continue with development even though the settings are unlikely to be correct in all cases. You should check the documentation or source files for the software you are building to determine the actual license. @@ -922,12 +904,12 @@ mind: hardcoding tools within the toolchain such as ``gcc`` and ``g++``. - The environment in which Make runs is set up with various standard - variables for compilation (e.g. ``CC``, ``CXX``, and so forth) in a + variables for compilation (e.g. :term:`CC`, :term:`CXX`, and so forth) in a similar manner to the environment set up by the SDK's environment setup script. One easy way to see these variables is to run the ``devtool build`` command on the recipe and then look in - ``oe-logs/run.do_compile``. Towards the top of this file, a list of - environment variables exists that are being set. You can take + ``oe-logs/run.do_compile``. Towards the top of this file, there is + a list of environment variables that are set. You can take advantage of these variables within the Makefile. - If the Makefile sets a default for a variable using "=", that default @@ -938,8 +920,7 @@ mind: the command line, add the variable setting to :term:`EXTRA_OEMAKE` or :term:`PACKAGECONFIG_CONFARGS` - within the recipe. Here is an example using ``EXTRA_OEMAKE``: - :: + within the recipe. Here is an example using :term:`EXTRA_OEMAKE`:: EXTRA_OEMAKE += "'CC=${CC}' 'CXX=${CXX}'" @@ -972,7 +953,7 @@ following methods when you run ``devtool add``: Specifying the name like this produces a recipe that only builds for the build host. -- Specify the "DASHDASHalso-native" option with the ``devtool add`` +- Specify the "--also-native" option with the ``devtool add`` command. Specifying this option creates a recipe file that still builds for the target but also creates a variant with a "-native" suffix that builds for the build host. @@ -983,7 +964,7 @@ following methods when you run ``devtool add``: that builds code for the target, you can typically accomplish this by building the native and target parts separately rather than within the same compilation process. Realize though that with the - "DASHDASHalso-native" option, you can add the tool using just one + "--also-native" option, you can add the tool using just one recipe file. Adding Node.js Modules @@ -993,8 +974,7 @@ You can use the ``devtool add`` command two different ways to add Node.js modules: 1) Through ``npm`` and, 2) from a repository or local source. -Use the following form to add Node.js modules through ``npm``: -:: +Use the following form to add Node.js modules through ``npm``:: $ devtool add "npm://registry.npmjs.org;name=forever;version=0.15.1" @@ -1018,8 +998,7 @@ these behaviors ensure the reproducibility and integrity of the build. As mentioned earlier, you can also add Node.js modules directly from a repository or local source tree. To add modules this way, use -``devtool add`` in the following form: -:: +``devtool add`` in the following form:: $ devtool add https://github.com/diversario/node-ssdp @@ -1058,8 +1037,8 @@ If you look at the contents of a recipe, you will see that the recipe does not include complete instructions for building the software. Instead, common functionality is encapsulated in classes inherited with the ``inherit`` directive. This technique leaves the recipe to describe -just the things that are specific to the software being built. A -:ref:`base <ref-classes-base>` class exists that +just the things that are specific to the software being built. There is +a :ref:`base <ref-classes-base>` class that is implicitly inherited by all recipes and provides the functionality that most recipes typically need. @@ -1107,21 +1086,21 @@ extras specified by :term:`EXTRA_OECONF` or :term:`PACKAGECONFIG_CONFARGS` set within the recipe. If you wish to pass additional options, add them -to ``EXTRA_OECONF`` or ``PACKAGECONFIG_CONFARGS``. Other supported build +to :term:`EXTRA_OECONF` or :term:`PACKAGECONFIG_CONFARGS`. Other supported build tools have similar variables (e.g. :term:`EXTRA_OECMAKE` for CMake, :term:`EXTRA_OESCONS` for Scons, and so forth). If you need to pass anything on the ``make`` -command line, you can use ``EXTRA_OEMAKE`` or the +command line, you can use :term:`EXTRA_OEMAKE` or the :term:`PACKAGECONFIG_CONFARGS` variables to do so. You can use the ``devtool configure-help`` command to help you set the arguments listed in the previous paragraph. The command determines the exact options being passed, and shows them to you along with any custom -arguments specified through ``EXTRA_OECONF`` or -``PACKAGECONFIG_CONFARGS``. If applicable, the command also shows you -the output of the configure script's "DASHDASHhelp" option as a +arguments specified through :term:`EXTRA_OECONF` or +:term:`PACKAGECONFIG_CONFARGS`. If applicable, the command also shows you +the output of the configure script's "--help" option as a reference. Sharing Files Between Recipes @@ -1131,9 +1110,9 @@ Recipes often need to use files provided by other recipes on the :term:`Build Host`. For example, an application linking to a common library needs access to the library itself and its associated headers. The way this access is accomplished -within the extensible SDK is through the sysroot. One sysroot exists per +within the extensible SDK is through the sysroot. There is one sysroot per "machine" for which the SDK is being built. In practical terms, this -means a sysroot exists for the target machine, and a sysroot exists for +means there is a sysroot for the target machine, and a sysroot for the build host. Recipes should never write files directly into the sysroot. Instead, @@ -1172,16 +1151,16 @@ the ``oe-workdir/packages-split`` directory, which contains a subdirectory for each package. Apart from some advanced cases, the :term:`PACKAGES` and :term:`FILES` variables controls -splitting. The ``PACKAGES`` variable lists all of the packages to be -produced, while the ``FILES`` variable specifies which files to include +splitting. The :term:`PACKAGES` variable lists all of the packages to be +produced, while the :term:`FILES` variable specifies which files to include in each package by using an override to specify the package. For example, ``FILES_${PN}`` specifies the files to go into the main package (i.e. the main package has the same name as the recipe and ``${``\ :term:`PN`\ ``}`` evaluates to the -recipe name). The order of the ``PACKAGES`` value is significant. For -each installed file, the first package whose ``FILES`` value matches the -file is the package into which the file goes. Defaults exist for both -the ``PACKAGES`` and ``FILES`` variables. Consequently, you might find +recipe name). The order of the :term:`PACKAGES` value is significant. For +each installed file, the first package whose :term:`FILES` value matches the +file is the package into which the file goes. Both the :term:`PACKAGES` and +:term:`FILES` variables have default values. Consequently, you might find you do not even need to set these variables in your recipe unless the software the recipe is building installs files into non-standard locations. @@ -1196,15 +1175,13 @@ need to restore the original files that existed prior to running the ``devtool deploy-target`` command. Because the ``devtool deploy-target`` command backs up any files it overwrites, you can use the ``devtool undeploy-target`` command to restore those files and remove -any other files the recipe deployed. Consider the following example: -:: +any other files the recipe deployed. Consider the following example:: $ devtool undeploy-target lighttpd root@192.168.7.2 If you have deployed multiple applications, you can remove them all using the "-a" option -thus restoring the target device to its original state: -:: +thus restoring the target device to its original state:: $ devtool undeploy-target -a root@192.168.7.2 @@ -1235,28 +1212,25 @@ populated on-demand. Sometimes you must explicitly install extra items into the SDK. If you need these extra items, you can first search for the items using the ``devtool search`` command. For example, suppose you need to link to libGL but you are not sure which recipe provides libGL. -You can use the following command to find out: -:: +You can use the following command to find out:: $ devtool search libGL mesa A free implementation of the OpenGL API Once you know the recipe -(i.e. ``mesa`` in this example), you can install it: -:: +(i.e. ``mesa`` in this example), you can install it:: $ devtool sdk-install mesa By default, the ``devtool sdk-install`` command assumes the item is available in pre-built form from your SDK provider. If the item is not available and it is acceptable to build the item from -source, you can add the "-s" option as follows: -:: +source, you can add the "-s" option as follows:: $ devtool sdk-install -s mesa It is important to remember that building the item from source takes significantly longer than installing the pre-built artifact. Also, -if no recipe exists for the item you want to add to the SDK, you must +if there is no recipe for the item you want to add to the SDK, you must instead add the item using the ``devtool add`` command. Applying Updates to an Installed Extensible SDK @@ -1266,8 +1240,7 @@ If you are working with an installed extensible SDK that gets occasionally updated (e.g. a third-party SDK), then you will need to manually "pull down" the updates into the installed SDK. -To update your installed SDK, use ``devtool`` as follows: -:: +To update your installed SDK, use ``devtool`` as follows:: $ devtool sdk-update diff --git a/poky/documentation/sdk-manual/intro.rst b/poky/documentation/sdk-manual/intro.rst index d966efea7..2f94aaf87 100644 --- a/poky/documentation/sdk-manual/intro.rst +++ b/poky/documentation/sdk-manual/intro.rst @@ -8,8 +8,8 @@ eSDK Introduction ================= Welcome to the Yocto Project Application Development and the Extensible -Software Development Kit (eSDK) manual. This manual provides information -that explains how to use both the Yocto Project extensible and standard +Software Development Kit (eSDK) manual. This manual +explains how to use both the Yocto Project extensible and standard SDKs to develop applications and images. .. note:: @@ -25,12 +25,13 @@ SDKs to develop applications and images. All SDKs consist of the following: - *Cross-Development Toolchain*: This toolchain contains a compiler, - debugger, and various miscellaneous tools. + debugger, and various associated tools. - *Libraries, Headers, and Symbols*: The libraries, headers, and - symbols are specific to the image (i.e. they match the image). + symbols are specific to the image (i.e. they match the image + against which the SDK was built). -- *Environment Setup Script*: This ``*.sh`` file, once run, sets up the +- *Environment Setup Script*: This ``*.sh`` file, once sourced, sets up the cross-development environment by defining variables and preparing for SDK use. @@ -48,14 +49,14 @@ time since that path cannot be dynamically altered. This is the reason for a wrapper around the ``populate_sdk`` and ``populate_sdk_ext`` archives. -Another feature for the SDKs is that only one set of cross-compiler +Another feature of the SDKs is that only one set of cross-compiler toolchain binaries are produced for any given architecture. This feature takes advantage of the fact that the target hardware can be passed to ``gcc`` as a set of compiler options. Those options are set up by the environment script and contained in variables such as :term:`CC` and :term:`LD`. This reduces the space needed -for the tools. Understand, however, that every target still needs a +for the tools. Understand, however, that every target still needs its own sysroot because those binaries are target-specific. The SDK development environment consists of the following: @@ -118,8 +119,8 @@ The Cross-Development Toolchain The :term:`Cross-Development Toolchain` consists of a cross-compiler, cross-linker, and cross-debugger that are used to -develop user-space applications for targeted hardware. Additionally, for -an extensible SDK, the toolchain also has built-in ``devtool`` +develop user-space applications for targeted hardware; in addition, +the extensible SDK comes with built-in ``devtool`` functionality. This toolchain is created by running a SDK installer script or through a :term:`Build Directory` that is based on your metadata configuration or extension for your targeted device. The @@ -138,21 +139,19 @@ The QEMU Emulator ----------------- The QEMU emulator allows you to simulate your hardware while running -your application or image. QEMU is not part of the SDK but is made -available a number of different ways: +your application or image. QEMU is not part of the SDK but is +automatically installed and available if you have done any one of +the following: -- If you have cloned the ``poky`` Git repository to create a - :term:`Source Directory` and you have - sourced the environment setup script, QEMU is installed and - automatically available. +- cloned the ``poky`` Git repository to create a + :term:`Source Directory` and sourced the environment setup script. -- If you have downloaded a Yocto Project release and unpacked it to - create a Source Directory and you have sourced the environment setup - script, QEMU is installed and automatically available. +- downloaded a Yocto Project release and unpacked it to + create a Source Directory and sourced the environment setup + script. -- If you have installed the cross-toolchain tarball and you have - sourced the toolchain's setup environment script, QEMU is also - installed and automatically available. +- installed the cross-toolchain tarball and + sourced the toolchain's setup environment script. SDK Development Model ===================== @@ -202,10 +201,9 @@ You just need to follow these general steps: .. note:: - To use the root filesystem in QEMU, you need to extract it. See - the " - Extracting the Root Filesystem - " section for information on how to extract the root filesystem. + To use the root filesystem in QEMU, you need to extract it. See the + ":ref:`sdk-manual/appendix-obtain:extracting the root filesystem`" + section for information on how to do this extraction. 3. *Develop and Test your Application:* At this point, you have the tools to develop your application. If you need to separately install @@ -216,5 +214,5 @@ You just need to follow these general steps: within the Yocto Project. The remainder of this manual describes how to use the extensible and -standard SDKs. Information also exists in appendix form that describes +standard SDKs. There is also information in appendix form describing how you can build, install, and modify an SDK. diff --git a/poky/documentation/sdk-manual/using.rst b/poky/documentation/sdk-manual/using.rst index 62967f557..301627812 100644 --- a/poky/documentation/sdk-manual/using.rst +++ b/poky/documentation/sdk-manual/using.rst @@ -11,9 +11,8 @@ standard SDK. .. note:: For a side-by-side comparison of main features supported for a - standard SDK as compared to an extensible SDK, see the " - Introduction - " section. + standard SDK as compared to an extensible SDK, see the + ":ref:`sdk-manual/intro:introduction`" section. You can use a standard SDK to work on Makefile and Autotools-based projects. See the @@ -49,7 +48,7 @@ the Index of Releases. Toolchains are available for several 32-bit and 64-bit architectures with the ``x86_64`` directories, respectively. The toolchains the Yocto Project provides are based off the ``core-image-sato`` and ``core-image-minimal`` images and contain -libraries appropriate for developing against that image. +libraries appropriate for developing against the corresponding image. The names of the tarball installer scripts are such that a string representing the host system appears first in the filename and then is @@ -77,17 +76,16 @@ immediately followed by a string representing the target architecture. For example, the following SDK installer is for a 64-bit development host system and a i586-tuned target architecture based off -the SDK for ``core-image-sato`` and using the current DISTRO snapshot: -:: +the SDK for ``core-image-sato`` and using the current DISTRO snapshot:: poky-glibc-x86_64-core-image-sato-i586-toolchain-DISTRO.sh .. note:: As an alternative to downloading an SDK, you can build the SDK - installer. For information on building the installer, see the " - Building an SDK Installer - " section. + installer. For information on building the installer, see the + ":ref:`sdk-manual/appendix-obtain:building an sdk installer`" + section. The SDK and toolchains are self-contained and by default are installed into the ``poky_sdk`` folder in your home directory. You can choose to @@ -141,8 +139,7 @@ begin with the string "``environment-setup``" and include as part of their name the tuned target architecture. As an example, the following commands set the working directory to where the SDK was installed and then source the environment setup script. In this example, the setup -script is for an IA-based target machine using i586 tuning: -:: +script is for an IA-based target machine using i586 tuning:: $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux diff --git a/poky/documentation/sdk-manual/working-projects.rst b/poky/documentation/sdk-manual/working-projects.rst index f880cbe0d..276daa9bb 100644 --- a/poky/documentation/sdk-manual/working-projects.rst +++ b/poky/documentation/sdk-manual/working-projects.rst @@ -45,16 +45,14 @@ project: respectively. Use the following command to create an empty README file, which is - required by GNU Coding Standards: - :: + required by GNU Coding Standards:: $ touch README Create the remaining three files as follows: - - ``hello.c``: - :: + - ``hello.c``:: #include <stdio.h> @@ -63,8 +61,7 @@ project: printf("Hello World!\n"); } - - ``configure.ac``: - :: + - ``configure.ac``:: AC_INIT(hello,0.1) AM_INIT_AUTOMAKE([foreign]) @@ -72,8 +69,7 @@ project: AC_CONFIG_FILES(Makefile) AC_OUTPUT - - ``Makefile.am``: - :: + - ``Makefile.am``:: bin_PROGRAMS = hello hello_SOURCES = hello.c @@ -87,8 +83,7 @@ project: which is followed by the string "poky-linux". For this example, the command sources a script from the default SDK installation directory that uses the 32-bit Intel x86 Architecture and the &DISTRO; Yocto - Project release: - :: + Project release:: $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux @@ -113,8 +108,7 @@ project: the cross-compiler. The :term:`CONFIGURE_FLAGS` environment variable provides the minimal arguments for GNU - configure: - :: + configure:: $ ./configure ${CONFIGURE_FLAGS} @@ -127,14 +121,12 @@ project: ``armv5te-poky-linux-gnueabi``. You will notice that the name of the script is ``environment-setup-armv5te-poky-linux-gnueabi``. Thus, the following command works to update your project and rebuild it using - the appropriate cross-toolchain tools: - :: + the appropriate cross-toolchain tools:: $ ./configure --host=armv5te-poky-linux-gnueabi --with-libtool-sysroot=sysroot_dir 5. *Make and Install the Project:* These two commands generate and - install the project into the destination directory: - :: + install the project into the destination directory:: $ make $ make install DESTDIR=./tmp @@ -143,9 +135,8 @@ project: To learn about environment variables established when you run the cross-toolchain environment setup script and how they are used or - overridden when the Makefile, see the " - Makefile-Based Projects - " section. + overridden by the Makefile, see the + :ref:`sdk-manual/working-projects:makefile-based projects` section. This next command is a simple way to verify the installation of your project. Running the command prints the architecture on which the @@ -157,8 +148,7 @@ project: 6. *Execute Your Project:* To execute the project, you would need to run it on your target hardware. If your target hardware happens to be - your build host, you could run the project as follows: - :: + your build host, you could run the project as follows:: $ ./tmp/usr/local/bin/hello @@ -203,8 +193,7 @@ regarding variable behavior: .. note:: Regardless of how you set your variables, if you use the "-e" option - with ``make``, the variables from the SDK setup script take precedence: - :: + with ``make``, the variables from the SDK setup script take precedence:: $ make -e target @@ -226,8 +215,7 @@ Running the SDK setup script for a 64-bit build host and an i586-tuned target architecture for a ``core-image-sato`` image using the current &DISTRO; Yocto Project release and then echoing that variable shows the value -established through the script: -:: +established through the script:: $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux $ echo ${CC} @@ -252,8 +240,7 @@ example: Create the three files as follows: - - ``main.c``: - :: + - ``main.c``:: #include "module.h" void sample_func(); @@ -263,14 +250,12 @@ example: return 0; } - - ``module.h``: - :: + - ``module.h``:: #include <stdio.h> void sample_func(); - - ``module.c``: - :: + - ``module.c``:: #include "module.h" void sample_func() @@ -288,17 +273,15 @@ example: which is followed by the string "poky-linux". For this example, the command sources a script from the default SDK installation directory that uses the 32-bit Intel x86 Architecture and the &DISTRO_NAME; Yocto - Project release: - :: + Project release:: $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux 3. *Create the Makefile:* For this example, the Makefile contains - two lines that can be used to set the ``CC`` variable. One line is + two lines that can be used to set the :term:`CC` variable. One line is identical to the value that is set when you run the SDK environment - setup script, and the other line sets ``CC`` to "gcc", the default - GNU compiler on the build host: - :: + setup script, and the other line sets :term:`CC` to "gcc", the default + GNU compiler on the build host:: # CC=i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux # CC="gcc" @@ -314,9 +297,8 @@ example: 4. *Make the Project:* Use the ``make`` command to create the binary output file. Because variables are commented out in the Makefile, the - value used for ``CC`` is the value set when the SDK environment setup - file was run: - :: + value used for :term:`CC` is the value set when the SDK environment setup + file was run:: $ make i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux -I . -c main.c @@ -324,10 +306,10 @@ example: i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux main.o module.o -o target_bin From the results of the previous command, you can see that - the compiler used was the compiler established through the ``CC`` + the compiler used was the compiler established through the :term:`CC` variable defined in the setup script. - You can override the ``CC`` environment variable with the same + You can override the :term:`CC` environment variable with the same variable as set from the Makefile by uncommenting the line in the Makefile and running ``make`` again. :: @@ -351,8 +333,7 @@ example: variable as part of the command line. Go into the Makefile and re-insert the comment character so that running ``make`` uses the established SDK compiler. However, when you run ``make``, use a - command-line argument to set ``CC`` to "gcc": - :: + command-line argument to set :term:`CC` to "gcc":: $ make clean rm -rf *.o @@ -376,8 +357,7 @@ example: environment variable. In this last case, edit Makefile again to use the "gcc" compiler but - then use the "-e" option on the ``make`` command line: - :: + then use the "-e" option on the ``make`` command line:: $ make clean rm -rf *.o @@ -402,8 +382,7 @@ example: Makefile. 5. *Execute Your Project:* To execute the project (i.e. ``target_bin``), - use the following command: - :: + use the following command:: $ ./target_bin Hello World! |