1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-01 13:09:50 +00:00

sdk-manual: extensible.rst: fix multiple formatting issues

Take advantage of this edit to also fix alignment
issues in the sources.

(From yocto-docs rev: 318261d8ea91c2373709a9c1e82304ab7e9e9a3b)

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Michael Opdenacker
2023-09-15 14:56:20 +02:00
committed by Richard Purdie
parent 81ba04522e
commit 7444138b0c
+107 -145
View File
@@ -48,18 +48,20 @@ Extensible SDK can be installed in two different ways, and both have
their own pros and cons: their own pros and cons:
#. *Setting up the Extensible SDK environment directly in a Yocto build*. This #. *Setting up the Extensible SDK environment directly in a Yocto build*. This
avoids having to produce, test, distribute and maintain separate SDK installer avoids having to produce, test, distribute and maintain separate SDK
archives, which can get very large. There is only one environment for the regular installer archives, which can get very large. There is only one environment
Yocto build and the SDK and less code paths where things can go not according to plan. for the regular Yocto build and the SDK and less code paths where things can
It's easier to update the SDK: it simply means updating the Yocto layers with go not according to plan. It's easier to update the SDK: it simply means
git fetch or layer management tooling. The SDK extensibility is better than in the updating the Yocto layers with git fetch or layer management tooling. The
second option: just run ``bitbake`` again to add more things to the sysroot, or add layers SDK extensibility is better than in the second option: just run ``bitbake``
if even more things are required. again to add more things to the sysroot, or add layers if even more things
are required.
#. *Setting up the Extensible SDK from a standalone installer*. This has the benefit of #. *Setting up the Extensible SDK from a standalone installer*. This has the
having a single, self-contained archive that includes all the needed binary artifacts. benefit of having a single, self-contained archive that includes all the
So nothing needs to be rebuilt, and there is no need to provide a well-functioning needed binary artifacts. So nothing needs to be rebuilt, and there is no
binary artefact cache over the network for developers with underpowered laptops. need to provide a well-functioning binary artefact cache over the network
for developers with underpowered laptops.
Setting up the Extensible SDK environment directly in a Yocto build Setting up the Extensible SDK environment directly in a Yocto build
------------------------------------------------------------------- -------------------------------------------------------------------
@@ -67,12 +69,12 @@ Setting up the Extensible SDK environment directly in a Yocto build
#. Set up all the needed layers and a Yocto :term:`Build Directory`, e.g. a regular Yocto #. Set up all the needed layers and a Yocto :term:`Build Directory`, e.g. a regular Yocto
build where ``bitbake`` can be executed. build where ``bitbake`` can be executed.
#. Run: #. Run::
$ bitbake meta-ide-support
$ bitbake -c populate_sysroot gtk+3
(or any other target or native item that the application developer would need)
$ bitbake build-sysroots
$ bitbake meta-ide-support
$ bitbake -c populate_sysroot gtk+3
# or any other target or native item that the application developer would need
$ bitbake build-sysroots
Setting up the Extensible SDK from a standalone installer Setting up the Extensible SDK from a standalone installer
--------------------------------------------------------- ---------------------------------------------------------
@@ -194,15 +196,13 @@ script is for an IA-based target machine using i586 tuning::
Run devtool --help for further details. Run devtool --help for further details.
When using the environment script directly in a Yocto build, it can When using the environment script directly in a Yocto build, it can
be run similarly: be run similarly::
$ source tmp/deploy/images/qemux86-64/environment-setup-core2-64-poky-linux $ source tmp/deploy/images/qemux86-64/environment-setup-core2-64-poky-linux
Running the setup script defines many environment variables needed in Running the setup script defines many environment variables needed in order to
order to use the SDK (e.g. ``PATH``, use the SDK (e.g. ``PATH``, :term:`CC`, :term:`LD`, and so forth). If you want
:term:`CC`, to see all the environment variables the script exports, examine the
:term:`LD`, and so forth). If you want to
see all the environment variables the script exports, examine the
installation file itself. installation file itself.
Using ``devtool`` in Your SDK Workflow Using ``devtool`` in Your SDK Workflow
@@ -216,11 +216,8 @@ system.
.. note:: .. note::
The use of The use of ``devtool`` is not limited to the extensible SDK. You can use
devtool ``devtool`` to help you easily develop any project whose build output must be
is not limited to the extensible SDK. You can use
devtool
to help you easily develop any project whose build output must be
part of an image built using the build system. part of an image built using the build system.
The ``devtool`` command line is organized similarly to The ``devtool`` command line is organized similarly to
@@ -230,15 +227,10 @@ all the commands.
.. note:: .. note::
See the " See the ":doc:`/ref-manual/devtool-reference`"
devtool section in the Yocto Project Reference Manual.
 Quick Reference
" in the Yocto Project Reference Manual for a
devtool
quick reference.
Three ``devtool`` subcommands provide entry-points into Three ``devtool`` subcommands provide entry-points into development:
development:
- *devtool add*: Assists in adding new software to be built. - *devtool add*: Assists in adding new software to be built.
@@ -315,9 +307,8 @@ command:
.. note:: .. note::
If required, If required, ``devtool`` always creates a Git repository locally
devtool during the extraction.
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 identifies where the ``devtool add`` command will locate the
@@ -326,8 +317,7 @@ command:
$ devtool add recipe srctree fetchuri $ devtool add recipe srctree fetchuri
In summary, In summary, the source code is pulled from fetchuri and extracted into the
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 Within workspace, ``devtool`` creates a recipe named recipe along
@@ -358,16 +348,14 @@ command:
$ devtool edit-recipe recipe $ devtool edit-recipe recipe
From within the editor, you From within the editor, you can make modifications to the recipe that
can make modifications to the recipe that take effect when you build take effect when you build it later.
it later.
#. *Build the Recipe or Rebuild the Image*: The next step you take #. *Build the Recipe or Rebuild the Image*: The next step you take
depends on what you are going to do with the new code. depends on what you are going to do with the new code.
If you need to eventually move the build output to the target 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 $ devtool build recipe
@@ -392,8 +380,11 @@ command:
development machine. development machine.
You can deploy your build output to that target hardware by using the You can deploy your build output to that target hardware by using the
``devtool deploy-target`` command: $ devtool deploy-target recipe ``devtool deploy-target`` command::
target The target is a live target machine running as an SSH server.
$ devtool deploy-target recipe target
The target is a live target machine running as an SSH server.
You can, of course, also deploy the image you build to actual You can, of course, also deploy the image you build to actual
hardware by using the ``devtool build-image`` command. However, hardware by using the ``devtool build-image`` command. However,
@@ -422,11 +413,9 @@ command:
.. note:: .. note::
You can use the You can use the ``devtool reset`` command to put things back should you
devtool reset decide you do not want to proceed with your work. If you do use this
command to put things back should you decide you do not want to command, realize that the source tree is preserved.
proceed with your work. If you do use this command, realize that
the source tree is preserved.
Use ``devtool modify`` to Modify the Source of an Existing Component Use ``devtool modify`` to Modify the Source of an Existing Component
-------------------------------------------------------------------- --------------------------------------------------------------------
@@ -473,11 +462,9 @@ command:
$ devtool modify recipe $ devtool modify recipe
Once Once ``devtool`` locates the recipe, ``devtool`` uses the recipe's
``devtool``\ locates the recipe, ``devtool`` uses the recipe's :term:`SRC_URI` statements to locate the source code and any local
:term:`SRC_URI` statements to patch files from other developers.
locate the source code and any local patch files from other
developers.
With this scenario, there is no ``srctree`` argument. Consequently, the With this scenario, there is no ``srctree`` argument. Consequently, the
default behavior of the ``devtool modify`` command is to extract default behavior of the ``devtool modify`` command is to extract
@@ -513,11 +500,7 @@ command:
.. note:: .. note::
You cannot provide a URL for You cannot provide a URL for ``srctree`` using the ``devtool`` command.
srctree
using the
devtool
command.
As with all extractions, the command uses the recipe's :term:`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 statements to locate the source files and any associated patch
@@ -570,7 +553,9 @@ command:
On the other hand, if you want an image to contain the recipe's On the other hand, if you want an image to contain the recipe's
packages from the workspace for immediate deployment onto a device packages from the workspace for immediate deployment onto a device
(e.g. for testing purposes), you can use the ``devtool build-image`` (e.g. for testing purposes), you can use the ``devtool build-image``
command: $ devtool build-image image command::
$ devtool build-image image
#. *Deploy the Build Output*: When you use the ``devtool build`` command #. *Deploy the Build Output*: When you use the ``devtool build`` command
to build out your recipe, you probably want to see if the resulting to build out your recipe, you probably want to see if the resulting
@@ -610,8 +595,7 @@ command:
Any changes you want to turn into patches must be staged and Any changes you want to turn into patches must be staged and
committed within the local Git repository before you use the committed within the local Git repository before you use the
devtool finish ``devtool finish`` command.
command.
Because there is no need to move the recipe, ``devtool finish`` Because there is no need to move the recipe, ``devtool finish``
either updates the original recipe in the original layer or the either updates the original recipe in the original layer or the
@@ -626,11 +610,9 @@ command:
.. note:: .. note::
You can use the You can use the ``devtool reset`` command to put things back should you
devtool reset decide you do not want to proceed with your work. If you do use this
command to put things back should you decide you do not want to command, realize that the source tree is preserved.
proceed with your work. If you do use this command, realize that
the source tree is preserved.
Use ``devtool upgrade`` to Create a Version of the Recipe that Supports a Newer Version of the Software Use ``devtool upgrade`` to Create a Version of the Recipe that Supports a Newer Version of the Software
------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------
@@ -644,12 +626,11 @@ counterparts.
.. note:: .. note::
Several methods exist by which you can upgrade recipes - 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
happens to be one. You can read about all the methods by which you which you can upgrade recipes in the
can upgrade recipes in the :ref:`dev-manual/upgrading-recipes:upgrading recipes` section of the Yocto
:ref:`dev-manual/upgrading-recipes:upgrading recipes` section Project Development Tasks Manual.
of the Yocto Project Development Tasks Manual.
The ``devtool upgrade`` command is flexible enough to allow you to specify The ``devtool upgrade`` command is flexible enough to allow you to specify
source code revision and versioning schemes, extract code into or out of the source code revision and versioning schemes, extract code into or out of the
@@ -755,8 +736,11 @@ The following diagram shows the common development flow used with the
development machine. development machine.
You can deploy your build output to that target hardware by using the You can deploy your build output to that target hardware by using the
``devtool deploy-target`` command: $ devtool deploy-target recipe ``devtool deploy-target`` command::
target The target is a live target machine running as an SSH server.
$ devtool deploy-target recipe target
The target is a live target machine running as an SSH server.
You can, of course, also deploy the image you build using the You can, of course, also deploy the image you build using the
``devtool build-image`` command to actual hardware. However, ``devtool build-image`` command to actual hardware. However,
@@ -790,11 +774,9 @@ The following diagram shows the common development flow used with the
.. note:: .. note::
You can use the You can use the ``devtool reset`` command to put things back should you
devtool reset decide you do not want to proceed with your work. If you do use this
command to put things back should you decide you do not want to command, realize that the source tree is preserved.
proceed with your work. If you do use this command, realize that
the source tree is preserved.
A Closer Look at ``devtool add`` A Closer Look at ``devtool add``
================================ ================================
@@ -862,10 +844,9 @@ run ``devtool add`` again and provide the name or the version.
Dependency Detection and Mapping Dependency Detection and Mapping
-------------------------------- --------------------------------
The ``devtool add`` command attempts to detect build-time dependencies The ``devtool add`` command attempts to detect build-time dependencies and map
and map them to other recipes in the system. During this mapping, the them to other recipes in the system. During this mapping, the command fills in
command fills in the names of those recipes as part of the the names of those recipes as part of the :term:`DEPENDS` variable within the
:term:`DEPENDS` variable within the
recipe. If a dependency cannot be mapped, ``devtool`` places a comment recipe. If a dependency cannot be mapped, ``devtool`` places a comment
in the recipe indicating such. The inability to map a dependency can in the recipe indicating such. The inability to map a dependency can
result from naming not being recognized or because the dependency simply result from naming not being recognized or because the dependency simply
@@ -882,10 +863,8 @@ following to your recipe::
.. note:: .. note::
The The ``devtool add`` command often cannot distinguish between mandatory and
devtool add optional dependencies. Consequently, some of the detected dependencies might
command often cannot distinguish between mandatory and optional
dependencies. Consequently, some of the detected dependencies might
in fact be optional. When in doubt, consult the documentation or the in fact be optional. When in doubt, consult the documentation or the
configure script for the software the recipe is building for further configure script for the software the recipe is building for further
details. In some cases, you might find you can substitute the details. In some cases, you might find you can substitute the
@@ -895,16 +874,14 @@ following to your recipe::
License Detection License Detection
----------------- -----------------
The ``devtool add`` command attempts to determine if the software you The ``devtool add`` command attempts to determine if the software you are
are adding is able to be distributed under a common, open-source adding is able to be distributed under a common, open-source license. If
license. If so, the command sets the so, the command sets the :term:`LICENSE` value accordingly.
:term:`LICENSE` value accordingly.
You should double-check the value added by the command against the You should double-check the value added by the command against the
documentation or source files for the software you are building and, if documentation or source files for the software you are building and, if
necessary, update that :term:`LICENSE` value. necessary, update that :term:`LICENSE` value.
The ``devtool add`` command also sets the The ``devtool add`` command also sets the :term:`LIC_FILES_CHKSUM`
:term:`LIC_FILES_CHKSUM`
value to point to all files that appear to be license-related. Realize 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 that license statements often appear in comments at the top of source
files or within the documentation. In such cases, the command does not files or within the documentation. In such cases, the command does not
@@ -984,10 +961,9 @@ mind:
Adding Native Tools Adding Native Tools
------------------- -------------------
Often, you need to build additional tools that run on the :term:`Build Often, you need to build additional tools that run on the :term:`Build Host`
Host` as opposed to as opposed to the target. You should indicate this requirement by using one of
the target. You should indicate this requirement by using one of the the following methods when you run ``devtool add``:
following methods when you run ``devtool add``:
- Specify the name of the recipe such that it ends with "-native". - Specify the name of the recipe such that it ends with "-native".
Specifying the name like this produces a recipe that only builds for Specifying the name like this produces a recipe that only builds for
@@ -1011,8 +987,7 @@ Adding Node.js Modules
---------------------- ----------------------
You can use the ``devtool add`` command two different ways to add 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 Node.js modules: through ``npm`` or from a repository or local source.
source.
Use the following form to add Node.js modules through ``npm``:: Use the following form to add Node.js modules through ``npm``::
@@ -1027,7 +1002,7 @@ these behaviors ensure the reproducibility and integrity of the build.
.. note:: .. note::
- You must use quotes around the URL. The ``devtool add`` does not - You must use quotes around the URL. ``devtool add`` does not
require the quotes, but the shell considers ";" as a splitter require the quotes, but the shell considers ";" as a splitter
between multiple commands. Thus, without the quotes, between multiple commands. Thus, without the quotes,
``devtool add`` does not receive the other parts, which results in ``devtool add`` does not receive the other parts, which results in
@@ -1042,9 +1017,8 @@ repository or local source tree. To add modules this way, use
$ devtool add https://github.com/diversario/node-ssdp $ devtool add https://github.com/diversario/node-ssdp
In this example, ``devtool`` In this example, ``devtool`` fetches the specified Git repository, detects the
fetches the specified Git repository, detects the code as Node.js code, code as Node.js code, fetches dependencies using ``npm``, and sets
fetches dependencies using ``npm``, and sets
:term:`SRC_URI` accordingly. :term:`SRC_URI` accordingly.
Working With Recipes Working With Recipes
@@ -1121,18 +1095,13 @@ Setting Configure Arguments
If the software your recipe is building uses GNU autoconf, then a fixed If the software your recipe is building uses GNU autoconf, then a fixed
set of arguments is passed to it to enable cross-compilation plus any set of arguments is passed to it to enable cross-compilation plus any
extras specified by extras specified by :term:`EXTRA_OECONF` or :term:`PACKAGECONFIG_CONFARGS`
:term:`EXTRA_OECONF` or
:term:`PACKAGECONFIG_CONFARGS`
set within the recipe. If you wish to pass additional options, add them set within the recipe. If you wish to pass additional options, add them
to :term:`EXTRA_OECONF` or :term:`PACKAGECONFIG_CONFARGS`. Other supported build to :term:`EXTRA_OECONF` or :term:`PACKAGECONFIG_CONFARGS`. Other supported build
tools have similar variables (e.g. tools have similar variables (e.g. :term:`EXTRA_OECMAKE` for CMake,
:term:`EXTRA_OECMAKE` for :term:`EXTRA_OESCONS` for Scons, and so forth). If you need to pass anything on
CMake, :term:`EXTRA_OESCONS` the ``make`` command line, you can use :term:`EXTRA_OEMAKE` or the
for Scons, and so forth). If you need to pass anything on the ``make`` :term:`PACKAGECONFIG_CONFARGS` variables to do so.
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 You can use the ``devtool configure-help`` command to help you set the
arguments listed in the previous paragraph. The command determines the arguments listed in the previous paragraph. The command determines the
@@ -1156,8 +1125,7 @@ the build host.
Recipes should never write files directly into the sysroot. Instead, Recipes should never write files directly into the sysroot. Instead,
files should be installed into standard locations during the files should be installed into standard locations during the
:ref:`ref-tasks-install` task within :ref:`ref-tasks-install` task within the ``${``\ :term:`D`\ ``}`` directory. A
the ``${``\ :term:`D`\ ``}`` directory. A
subset of these files automatically goes into the sysroot. The reason subset of these files automatically goes into the sysroot. The reason
for this limitation is that almost all files that go into the sysroot for this limitation is that almost all files that go into the sysroot
are cataloged in manifests in order to ensure they can be removed later are cataloged in manifests in order to ensure they can be removed later
@@ -1173,14 +1141,12 @@ the target device, it is important to understand packaging because the
contents of the image are expressed in terms of packages and not contents of the image are expressed in terms of packages and not
recipes. recipes.
During the :ref:`ref-tasks-package` During the :ref:`ref-tasks-package` task, files installed during the
task, files installed during the :ref:`ref-tasks-install` task are split into one main package, which is almost
:ref:`ref-tasks-install` task are always named the same as the recipe, and into several other packages. This
split into one main package, which is almost always named the same as separation exists because not all of those installed files are useful in every
the recipe, and into several other packages. This separation exists image. For example, you probably do not need any of the documentation installed
because not all of those installed files are useful in every image. For in a production image. Consequently, for each recipe the documentation
example, you probably do not need any of the documentation installed in
a production image. Consequently, for each recipe the documentation
files are separated into a ``-doc`` package. Recipes that package files are separated into a ``-doc`` package. Recipes that package
software containing optional modules or plugins might undergo additional software containing optional modules or plugins might undergo additional
package splitting as well. package splitting as well.
@@ -1188,8 +1154,7 @@ package splitting as well.
After building a recipe, you can see where files have gone by looking in After building a recipe, you can see where files have gone by looking in
the ``oe-workdir/packages-split`` directory, which contains a the ``oe-workdir/packages-split`` directory, which contains a
subdirectory for each package. Apart from some advanced cases, the subdirectory for each package. Apart from some advanced cases, the
:term:`PACKAGES` and :term:`PACKAGES` and :term:`FILES` variables controls
:term:`FILES` variables controls
splitting. The :term:`PACKAGES` variable lists all of the packages to be splitting. The :term:`PACKAGES` variable lists all of the packages to be
produced, while the :term:`FILES` variable specifies which files to include produced, while the :term:`FILES` variable specifies which files to include
in each package by using an override to specify the package. For in each package by using an override to specify the package. For
@@ -1231,16 +1196,11 @@ target machine.
.. note:: .. note::
The The ``devtool deploy-target`` and ``devtool undeploy-target`` commands do
devtool deploy-target not currently interact with any package management system on the target
and device (e.g. RPM or OPKG). Consequently, you should not intermingle
devtool undeploy-target ``devtool deploy-target`` and package manager operations on the target
commands do not currently interact with any package management system device. Doing so could result in a conflicting set of files.
on the target device (e.g. RPM or OPKG). Consequently, you should not
intermingle
devtool deploy-target
and package manager operations on the target device. Doing so could
result in a conflicting set of files.
Installing Additional Items Into the Extensible SDK Installing Additional Items Into the Extensible SDK
=================================================== ===================================================
@@ -1264,7 +1224,7 @@ When using the extensible SDK directly in a Yocto build
In this scenario, the Yocto build tooling, e.g. ``bitbake`` In this scenario, the Yocto build tooling, e.g. ``bitbake``
is directly accessible to build additional items, and it is directly accessible to build additional items, and it
can simply be executed directly: can simply be executed directly::
$ bitbake mesa $ bitbake mesa
$ bitbake build-sysroots $ bitbake build-sysroots
@@ -1272,6 +1232,8 @@ can simply be executed directly:
When using a standalone installer for the Extensible SDK When using a standalone installer for the Extensible SDK
-------------------------------------------------------- --------------------------------------------------------
::
$ devtool sdk-install mesa $ devtool sdk-install mesa
By default, the ``devtool sdk-install`` command assumes By default, the ``devtool sdk-install`` command assumes
@@ -1297,13 +1259,13 @@ To update your installed SDK, use ``devtool`` as follows::
$ devtool sdk-update $ devtool sdk-update
The previous command assumes your SDK provider has set the The previous command assumes your SDK provider has set the default update URL
default update URL for you through the :term:`SDK_UPDATE_URL` for you through the :term:`SDK_UPDATE_URL` variable as described in the
variable as described in the
":ref:`sdk-manual/appendix-customizing:Providing Updates to the Extensible SDK After Installation`" ":ref:`sdk-manual/appendix-customizing:Providing Updates to the Extensible SDK After Installation`"
section. If the SDK provider has not set that default URL, you need to section. If the SDK provider has not set that default URL, you need to
specify it yourself in the command as follows: $ devtool sdk-update specify it yourself in the command as follows::
path_to_update_directory
$ devtool sdk-update path_to_update_directory
.. note:: .. note::