summaryrefslogtreecommitdiffstats
path: root/documentation/ref-manual/devtool-reference.rst
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/ref-manual/devtool-reference.rst')
-rw-r--r--documentation/ref-manual/devtool-reference.rst159
1 files changed, 74 insertions, 85 deletions
diff --git a/documentation/ref-manual/devtool-reference.rst b/documentation/ref-manual/devtool-reference.rst
index 5075f0c224..9319addc3c 100644
--- a/documentation/ref-manual/devtool-reference.rst
+++ b/documentation/ref-manual/devtool-reference.rst
@@ -22,8 +22,7 @@ Getting Help
22 22
23The ``devtool`` command line is organized similarly to Git in that it 23The ``devtool`` command line is organized similarly to Git in that it
24has a number of sub-commands for each function. You can run 24has a number of sub-commands for each function. You can run
25``devtool --help`` to see all the commands: 25``devtool --help`` to see all the commands::
26::
27 26
28 $ devtool -h 27 $ devtool -h
29 NOTE: Starting bitbake server... 28 NOTE: Starting bitbake server...
@@ -79,8 +78,7 @@ has a number of sub-commands for each function. You can run
79 78
80As directed in the general help output, you can 79As directed in the general help output, you can
81get more syntax on a specific command by providing the command name and 80get more syntax on a specific command by providing the command name and
82using "--help": 81using ``--help``::
83::
84 82
85 $ devtool add --help 83 $ devtool add --help
86 NOTE: Starting bitbake server... 84 NOTE: Starting bitbake server...
@@ -128,8 +126,7 @@ common working area used across the tool.
128The following figure shows the workspace structure: 126The following figure shows the workspace structure:
129 127
130.. image:: figures/build-workspace-directory.png 128.. image:: figures/build-workspace-directory.png
131 :align: center 129 :scale: 100%
132 :scale: 70%
133 130
134.. code-block:: none 131.. code-block:: none
135 132
@@ -167,19 +164,18 @@ Adding a New Recipe to the Workspace Layer
167========================================== 164==========================================
168 165
169Use the ``devtool add`` command to add a new recipe to the workspace 166Use the ``devtool add`` command to add a new recipe to the workspace
170layer. The recipe you add should not exist - ``devtool`` creates it for 167layer. The recipe you add should not exist --- ``devtool`` creates it for
171you. The source files the recipe uses should exist in an external area. 168you. The source files the recipe uses should exist in an external area.
172 169
173The following example creates and adds a new recipe named ``jackson`` to 170The following example creates and adds a new recipe named ``jackson`` to
174a workspace layer the tool creates. The source code built by the recipes 171a workspace layer the tool creates. The source code built by the recipes
175resides in ``/home/user/sources/jackson``: 172resides in ``/home/user/sources/jackson``::
176::
177 173
178 $ devtool add jackson /home/user/sources/jackson 174 $ devtool add jackson /home/user/sources/jackson
179 175
180If you add a recipe and the workspace layer does not exist, the command 176If you add a recipe and the workspace layer does not exist, the command
181creates the layer and populates it as described in "`The Workspace Layer 177creates the layer and populates it as described in
182Structure <#devtool-the-workspace-layer-structure>`__" section. 178":ref:`devtool-the-workspace-layer-structure`" section.
183 179
184Running ``devtool add`` when the workspace layer exists causes the tool 180Running ``devtool add`` when the workspace layer exists causes the tool
185to add the recipe, append files, and source files into the existing 181to add the recipe, append files, and source files into the existing
@@ -201,8 +197,7 @@ unpacking files from a remote URI. In some cases, you might want to
201specify a source revision by branch, tag, or commit hash. You can 197specify a source revision by branch, tag, or commit hash. You can
202specify these options when using the ``devtool add`` command: 198specify these options when using the ``devtool add`` command:
203 199
204- To specify a source branch, use the ``--srcbranch`` option: 200- To specify a source branch, use the ``--srcbranch`` option::
205 ::
206 201
207 $ devtool add --srcbranch &DISTRO_NAME_NO_CAP; jackson /home/user/sources/jackson 202 $ devtool add --srcbranch &DISTRO_NAME_NO_CAP; jackson /home/user/sources/jackson
208 203
@@ -210,8 +205,7 @@ specify these options when using the ``devtool add`` command:
210 branch. 205 branch.
211 206
212- To specify a specific tag or commit hash, use the ``--srcrev`` 207- To specify a specific tag or commit hash, use the ``--srcrev``
213 option: 208 option::
214 ::
215 209
216 $ devtool add --srcrev &DISTRO_REL_TAG; jackson /home/user/sources/jackson 210 $ devtool add --srcrev &DISTRO_REL_TAG; jackson /home/user/sources/jackson
217 $ devtool add --srcrev some_commit_hash /home/user/sources/jackson 211 $ devtool add --srcrev some_commit_hash /home/user/sources/jackson
@@ -269,8 +263,7 @@ The ``devtool modify`` command extracts the source for a recipe, sets it
269up as a Git repository if the source had not already been fetched from 263up as a Git repository if the source had not already been fetched from
270Git, checks out a branch for development, and applies any patches from 264Git, checks out a branch for development, and applies any patches from
271the recipe as commits on top. You can use the following command to 265the recipe as commits on top. You can use the following command to
272checkout the source files: 266checkout the source files::
273::
274 267
275 $ devtool modify recipe 268 $ devtool modify recipe
276 269
@@ -290,10 +283,7 @@ is identified using the ``EDITOR`` variable, on the specified recipe.
290When you use the ``devtool edit-recipe`` command, you must supply the 283When you use the ``devtool edit-recipe`` command, you must supply the
291root name of the recipe (i.e. no version, paths, or extensions). Also, 284root name of the recipe (i.e. no version, paths, or extensions). Also,
292the recipe file itself must reside in the workspace as a result of the 285the recipe file itself must reside in the workspace as a result of the
293``devtool add`` or ``devtool upgrade`` commands. However, you can 286``devtool add`` or ``devtool upgrade`` commands.
294override that requirement by using the "-a" or "--any-recipe" option.
295Using either of these options allows you to edit any recipe regardless
296of its location.
297 287
298.. _devtool-updating-a-recipe: 288.. _devtool-updating-a-recipe:
299 289
@@ -309,8 +299,7 @@ compile, and test the code.
309 299
310When you are satisfied with the results and you have committed your 300When you are satisfied with the results and you have committed your
311changes to the Git repository, you can then run the 301changes to the Git repository, you can then run the
312``devtool update-recipe`` to create the patches and update the recipe: 302``devtool update-recipe`` to create the patches and update the recipe::
313::
314 303
315 $ devtool update-recipe recipe 304 $ devtool update-recipe recipe
316 305
@@ -321,8 +310,7 @@ Often, you might want to apply customizations made to your software in
321your own layer rather than apply them to the original recipe. If so, you 310your own layer rather than apply them to the original recipe. If so, you
322can use the ``-a`` or ``--append`` option with the 311can use the ``-a`` or ``--append`` option with the
323``devtool update-recipe`` command. These options allow you to specify 312``devtool update-recipe`` command. These options allow you to specify
324the layer into which to write an append file: 313the layer into which to write an append file::
325::
326 314
327 $ devtool update-recipe recipe -a base-layer-directory 315 $ devtool update-recipe recipe -a base-layer-directory
328 316
@@ -339,27 +327,40 @@ Checking on the Upgrade Status of a Recipe
339Upstream recipes change over time. Consequently, you might find that you 327Upstream recipes change over time. Consequently, you might find that you
340need to determine if you can upgrade a recipe to a newer version. 328need to determine if you can upgrade a recipe to a newer version.
341 329
342To check on the upgrade status of a recipe, use the 330To check on the upgrade status of a recipe, you can use the
343``devtool check-upgrade-status`` command. The command displays a table 331``devtool latest-version recipe`` command, which quickly shows the current
344of your current recipe versions, the latest upstream versions, the email 332version and the latest version available upstream. To get a more global
345address of the recipe's maintainer, and any additional information such 333picture, use the ``devtool check-upgrade-status`` command, which takes a
346as commit hash strings and reasons you might not be able to upgrade a 334list of recipes as input, or no arguments, in which case it checks all
347particular recipe. 335available recipes. This command will only print the recipes for which
336a new upstream version is available. Each such recipe will have its current
337version and latest upstream version, as well as the email of the maintainer
338and any additional information such as the commit hash or reason for not
339being able to upgrade it, displayed in a table.
340
341This upgrade checking mechanism relies on the optional :term:`UPSTREAM_CHECK_URI`,
342:term:`UPSTREAM_CHECK_REGEX`, :term:`UPSTREAM_CHECK_GITTAGREGEX`,
343:term:`UPSTREAM_CHECK_COMMITS` and :term:`UPSTREAM_VERSION_UNKNOWN`
344variables in package recipes.
348 345
349.. note:: 346.. note::
350 347
348 - Most of the time, the above variables are unnecessary. They are only
349 required when upstream does something unusual, and default
350 mechanisms cannot find the new upstream versions.
351
351 - For the ``oe-core`` layer, recipe maintainers come from the 352 - For the ``oe-core`` layer, recipe maintainers come from the
352 :yocto_git:`maintainers.inc </poky/tree/meta/conf/distro/include/maintainers.inc>` 353 :yocto_git:`maintainers.inc </poky/tree/meta/conf/distro/include/maintainers.inc>`
353 file. 354 file.
354 355
355 - If the recipe is using the :ref:`bitbake:bitbake-user-manual/bitbake-user-manual-fetching:git fetcher (\`\`git://\`\`)` 356 - If the recipe is using the :ref:`bitbake-user-manual/bitbake-user-manual-fetching:git fetcher (\`\`git://\`\`)`
356 rather than a 357 rather than a tarball, the commit hash points to the commit that matches
357 tarball, the commit hash points to the commit that matches the 358 the recipe's latest version tag, or in the absence of suitable tags,
358 recipe's latest version tag. 359 to the latest commit (when :term:`UPSTREAM_CHECK_COMMITS` set to ``1``
360 in the recipe).
359 361
360As with all ``devtool`` commands, you can get help on the individual 362As with all ``devtool`` commands, you can get help on the individual
361command: 363command::
362::
363 364
364 $ devtool check-upgrade-status -h 365 $ devtool check-upgrade-status -h
365 NOTE: Starting bitbake server... 366 NOTE: Starting bitbake server...
@@ -377,33 +378,30 @@ command:
377Unless you provide a specific recipe name on the command line, the 378Unless you provide a specific recipe name on the command line, the
378command checks all recipes in all configured layers. 379command checks all recipes in all configured layers.
379 380
380Following is a partial example table that reports on all the recipes. 381Here is a partial example table that reports on all the recipes::
382
383 $ devtool check-upgrade-status
384 ...
385 INFO: bind 9.16.20 9.16.21 Armin Kuster <akuster808@gmail.com>
386 INFO: inetutils 2.1 2.2 Tom Rini <trini@konsulko.com>
387 INFO: iproute2 5.13.0 5.14.0 Changhyeok Bae <changhyeok.bae@gmail.com>
388 INFO: openssl 1.1.1l 3.0.0 Alexander Kanavin <alex.kanavin@gmail.com>
389 INFO: base-passwd 3.5.29 3.5.51 Anuj Mittal <anuj.mittal@intel.com> cannot be updated due to: Version 3.5.38 requires cdebconf for update-passwd utility
390 ...
391
381Notice the reported reason for not upgrading the ``base-passwd`` recipe. 392Notice the reported reason for not upgrading the ``base-passwd`` recipe.
382In this example, while a new version is available upstream, you do not 393In this example, while a new version is available upstream, you do not
383want to use it because the dependency on ``cdebconf`` is not easily 394want to use it because the dependency on ``cdebconf`` is not easily
384satisfied. 395satisfied. Maintainers can explicit the reason that is shown by adding
396the :term:`RECIPE_NO_UPDATE_REASON` variable to the corresponding recipe.
397See :yocto_git:`base-passwd.bb </poky/tree/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb?h=kirkstone>`
398for an example::
385 399
386.. note:: 400 RECIPE_NO_UPDATE_REASON = "Version 3.5.38 requires cdebconf for update-passwd utility"
387
388 When a reason for not upgrading displays, the reason is usually
389 written into the recipe using the ``RECIPE_NO_UPDATE_REASON``
390 variable. See the
391 :yocto_git:`base-passwd.bb </poky/tree/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb>`
392 recipe for an example.
393
394::
395 401
396 $ devtool check-upgrade-status 402Last but not least, you may set :term:`UPSTREAM_VERSION_UNKNOWN` to ``1``
397 ... 403in a recipe when there's currently no way to determine its latest upstream
398 NOTE: acpid 2.0.30 2.0.31 Ross Burton <ross.burton@intel.com> 404version.
399 NOTE: u-boot-fw-utils 2018.11 2019.01 Marek Vasut <marek.vasut@gmail.com> d3689267f92c5956e09cc7d1baa4700141662bff
400 NOTE: u-boot-tools 2018.11 2019.01 Marek Vasut <marek.vasut@gmail.com> d3689267f92c5956e09cc7d1baa4700141662bff
401 .
402 .
403 .
404 NOTE: base-passwd 3.5.29 3.5.45 Anuj Mittal <anuj.mittal@intel.com> cannot be updated due to: Version 3.5.38 requires cdebconf for update-passwd utility
405 NOTE: busybox 1.29.2 1.30.0 Andrej Valek <andrej.valek@siemens.com>
406 NOTE: dbus-test 1.12.10 1.12.12 Chen Qi <Qi.Chen@windriver.com>
407 405
408.. _devtool-upgrading-a-recipe: 406.. _devtool-upgrading-a-recipe:
409 407
@@ -412,8 +410,8 @@ Upgrading a Recipe
412 410
413As software matures, upstream recipes are upgraded to newer versions. As 411As software matures, upstream recipes are upgraded to newer versions. As
414a developer, you need to keep your local recipes up-to-date with the 412a developer, you need to keep your local recipes up-to-date with the
415upstream version releases. Several methods exist by which you can 413upstream version releases. There are several ways of upgrading recipes.
416upgrade recipes. You can read about them in the ":ref:`dev-manual/common-tasks:upgrading recipes`" 414You can read about them in the ":ref:`dev-manual/upgrading-recipes:upgrading recipes`"
417section of the Yocto Project Development Tasks Manual. This section 415section of the Yocto Project Development Tasks Manual. This section
418overviews the ``devtool upgrade`` command. 416overviews the ``devtool upgrade`` command.
419 417
@@ -441,7 +439,7 @@ You can read more on the ``devtool upgrade`` workflow in the
441":ref:`sdk-manual/extensible:use \`\`devtool upgrade\`\` to create a version of the recipe that supports a newer version of the software`" 439":ref:`sdk-manual/extensible:use \`\`devtool upgrade\`\` to create a version of the recipe that supports a newer version of the software`"
442section in the Yocto Project Application Development and the Extensible 440section in the Yocto Project Application Development and the Extensible
443Software Development Kit (eSDK) manual. You can also see an example of 441Software Development Kit (eSDK) manual. You can also see an example of
444how to use ``devtool upgrade`` in the ":ref:`dev-manual/common-tasks:using \`\`devtool upgrade\`\``" 442how to use ``devtool upgrade`` in the ":ref:`dev-manual/upgrading-recipes:using \`\`devtool upgrade\`\``"
445section in the Yocto Project Development Tasks Manual. 443section in the Yocto Project Development Tasks Manual.
446 444
447.. _devtool-resetting-a-recipe: 445.. _devtool-resetting-a-recipe:
@@ -462,8 +460,7 @@ files have been modified, the command preserves the modified files in a
462separate "attic" subdirectory under the workspace layer. 460separate "attic" subdirectory under the workspace layer.
463 461
464Here is an example that resets the workspace directory that contains the 462Here is an example that resets the workspace directory that contains the
465``mtr`` recipe: 463``mtr`` recipe::
466::
467 464
468 $ devtool reset mtr 465 $ devtool reset mtr
469 NOTE: Cleaning sysroot for recipe mtr... 466 NOTE: Cleaning sysroot for recipe mtr...
@@ -481,9 +478,8 @@ Use the ``devtool build`` command to build your recipe. The
481 478
482When you use the ``devtool build`` command, you must supply the root 479When you use the ``devtool build`` command, you must supply the root
483name of the recipe (i.e. do not provide versions, paths, or extensions). 480name of the recipe (i.e. do not provide versions, paths, or extensions).
484You can use either the "-s" or the "--disable-parallel-make" options to 481You can use either the ``-s`` or the ``--disable-parallel-make`` options to
485disable parallel makes during the build. Here is an example: 482disable parallel makes during the build. Here is an example::
486::
487 483
488 $ devtool build recipe 484 $ devtool build recipe
489 485
@@ -499,8 +495,7 @@ device for testing. For proper integration into a final image, you need
499to edit your custom image recipe appropriately. 495to edit your custom image recipe appropriately.
500 496
501When you use the ``devtool build-image`` command, you must supply the 497When you use the ``devtool build-image`` command, you must supply the
502name of the image. This command has no command line options: 498name of the image. This command has no command line options::
503::
504 499
505 $ devtool build-image image 500 $ devtool build-image image
506 501
@@ -510,8 +505,7 @@ Deploying Your Software on the Target Machine
510============================================= 505=============================================
511 506
512Use the ``devtool deploy-target`` command to deploy the recipe's build 507Use the ``devtool deploy-target`` command to deploy the recipe's build
513output to the live target machine: 508output to the live target machine::
514::
515 509
516 $ devtool deploy-target recipe target 510 $ devtool deploy-target recipe target
517 511
@@ -529,8 +523,8 @@ you do, the package manager is bypassed.
529 should never use it to update an image that will be used in 523 should never use it to update an image that will be used in
530 production. 524 production.
531 525
532Some conditions exist that could prevent a deployed application from 526Some conditions could prevent a deployed application from
533behaving as expected. When both of the following conditions exist, your 527behaving as expected. When both of the following conditions are met, your
534application has the potential to not behave correctly when run on the 528application has the potential to not behave correctly when run on the
535target: 529target:
536 530
@@ -541,7 +535,7 @@ target:
541- The target does not physically have the packages on which the 535- The target does not physically have the packages on which the
542 application depends installed. 536 application depends installed.
543 537
544If both of these conditions exist, your application will not behave as 538If both of these conditions are met, your application will not behave as
545expected. The reason for this misbehavior is because the 539expected. The reason for this misbehavior is because the
546``devtool deploy-target`` command does not deploy the packages (e.g. 540``devtool deploy-target`` command does not deploy the packages (e.g.
547libraries) on which your new application depends. The assumption is that 541libraries) on which your new application depends. The assumption is that
@@ -562,8 +556,7 @@ Use the ``devtool undeploy-target`` command to remove deployed build
562output from the target machine. For the ``devtool undeploy-target`` 556output from the target machine. For the ``devtool undeploy-target``
563command to work, you must have previously used the 557command to work, you must have previously used the
564":ref:`devtool deploy-target <ref-manual/devtool-reference:deploying your software on the target machine>`" 558":ref:`devtool deploy-target <ref-manual/devtool-reference:deploying your software on the target machine>`"
565command. 559command::
566::
567 560
568 $ devtool undeploy-target recipe target 561 $ devtool undeploy-target recipe target
569 562
@@ -582,15 +575,13 @@ new workspace layer, it is populated with the ``README`` file and the
582``conf`` directory only. 575``conf`` directory only.
583 576
584The following example creates a new workspace layer in your current 577The following example creates a new workspace layer in your current
585working and by default names the workspace layer "workspace": 578working and by default names the workspace layer "workspace"::
586::
587 579
588 $ devtool create-workspace 580 $ devtool create-workspace
589 581
590You can create a workspace layer anywhere by supplying a pathname with 582You can create a workspace layer anywhere by supplying a pathname with
591the command. The following command creates a new workspace layer named 583the command. The following command creates a new workspace layer named
592"new-workspace": 584"new-workspace"::
593::
594 585
595 $ devtool create-workspace /home/scottrif/new-workspace 586 $ devtool create-workspace /home/scottrif/new-workspace
596 587
@@ -603,15 +594,13 @@ Use the ``devtool status`` command to list the recipes currently in your
603workspace. Information includes the paths to their respective external 594workspace. Information includes the paths to their respective external
604source trees. 595source trees.
605 596
606The ``devtool status`` command has no command-line options: 597The ``devtool status`` command has no command-line options::
607::
608 598
609 $ devtool status 599 $ devtool status
610 600
611Following is sample output after using 601Here is sample output after using
612:ref:`devtool add <ref-manual/devtool-reference:adding a new recipe to the workspace layer>` 602:ref:`devtool add <ref-manual/devtool-reference:adding a new recipe to the workspace layer>`
613to create and add the ``mtr_0.86.bb`` recipe to the ``workspace`` directory: 603to create and add the ``mtr_0.86.bb`` recipe to the ``workspace`` directory::
614::
615 604
616 $ devtool status 605 $ devtool status
617 mtr:/home/scottrif/poky/build/workspace/sources/mtr (/home/scottrif/poky/build/workspace/recipes/mtr/mtr_0.86.bb) 606 mtr:/home/scottrif/poky/build/workspace/sources/mtr (/home/scottrif/poky/build/workspace/recipes/mtr/mtr_0.86.bb)