109209eecSAndrew Geissler.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
209209eecSAndrew Geissler
309209eecSAndrew Geissler***************************
409209eecSAndrew Geissler``devtool`` Quick Reference
509209eecSAndrew Geissler***************************
609209eecSAndrew Geissler
709209eecSAndrew GeisslerThe ``devtool`` command-line tool provides a number of features that
809209eecSAndrew Geisslerhelp you build, test, and package software. This command is available
909209eecSAndrew Geissleralongside the ``bitbake`` command. Additionally, the ``devtool`` command
1009209eecSAndrew Geissleris a key part of the extensible SDK.
1109209eecSAndrew Geissler
1209209eecSAndrew GeisslerThis chapter provides a Quick Reference for the ``devtool`` command. For
1309209eecSAndrew Geisslermore information on how to apply the command when using the extensible
1409209eecSAndrew GeisslerSDK, see the ":doc:`/sdk-manual/extensible`" chapter in the Yocto
1509209eecSAndrew GeisslerProject Application Development and the Extensible Software Development
1609209eecSAndrew GeisslerKit (eSDK) manual.
1709209eecSAndrew Geissler
1809209eecSAndrew Geissler.. _devtool-getting-help:
1909209eecSAndrew Geissler
2009209eecSAndrew GeisslerGetting Help
2109209eecSAndrew Geissler============
2209209eecSAndrew Geissler
2309209eecSAndrew GeisslerThe ``devtool`` command line is organized similarly to Git in that it
2409209eecSAndrew Geisslerhas a number of sub-commands for each function. You can run
25c926e17cSAndrew Geissler``devtool --help`` to see all the commands::
2609209eecSAndrew Geissler
2709209eecSAndrew Geissler   $ devtool -h
2809209eecSAndrew Geissler   NOTE: Starting bitbake server...
2909209eecSAndrew Geissler   usage: devtool [--basepath BASEPATH] [--bbpath BBPATH] [-d] [-q] [--color COLOR] [-h] <subcommand> ...
3009209eecSAndrew Geissler
3109209eecSAndrew Geissler   OpenEmbedded development tool
3209209eecSAndrew Geissler
3309209eecSAndrew Geissler   options:
3409209eecSAndrew Geissler     --basepath BASEPATH   Base directory of SDK / build directory
3509209eecSAndrew Geissler     --bbpath BBPATH       Explicitly specify the BBPATH, rather than getting it from the metadata
3609209eecSAndrew Geissler     -d, --debug           Enable debug output
3709209eecSAndrew Geissler     -q, --quiet           Print only errors
3809209eecSAndrew Geissler     --color COLOR         Colorize output (where COLOR is auto, always, never)
3909209eecSAndrew Geissler     -h, --help            show this help message and exit
4009209eecSAndrew Geissler
4109209eecSAndrew Geissler   subcommands:
4209209eecSAndrew Geissler     Beginning work on a recipe:
4309209eecSAndrew Geissler       add                   Add a new recipe
4409209eecSAndrew Geissler       modify                Modify the source for an existing recipe
4509209eecSAndrew Geissler       upgrade               Upgrade an existing recipe
4609209eecSAndrew Geissler     Getting information:
4709209eecSAndrew Geissler       status                Show workspace status
4809209eecSAndrew Geissler       latest-version        Report the latest version of an existing recipe
4909209eecSAndrew Geissler       check-upgrade-status  Report upgradability for multiple (or all) recipes
5009209eecSAndrew Geissler       search                Search available recipes
5109209eecSAndrew Geissler     Working on a recipe in the workspace:
5209209eecSAndrew Geissler       build                 Build a recipe
5309209eecSAndrew Geissler       rename                Rename a recipe file in the workspace
5409209eecSAndrew Geissler       edit-recipe           Edit a recipe file
5509209eecSAndrew Geissler       find-recipe           Find a recipe file
5609209eecSAndrew Geissler       configure-help        Get help on configure script options
5709209eecSAndrew Geissler       update-recipe         Apply changes from external source tree to recipe
5809209eecSAndrew Geissler       reset                 Remove a recipe from your workspace
5909209eecSAndrew Geissler       finish                Finish working on a recipe in your workspace
6009209eecSAndrew Geissler     Testing changes on target:
6109209eecSAndrew Geissler       deploy-target         Deploy recipe output files to live target machine
6209209eecSAndrew Geissler       undeploy-target       Undeploy recipe output files in live target machine
6309209eecSAndrew Geissler       build-image           Build image including workspace recipe packages
6409209eecSAndrew Geissler     Advanced:
6509209eecSAndrew Geissler       create-workspace      Set up workspace in an alternative location
6609209eecSAndrew Geissler       extract               Extract the source for an existing recipe
6709209eecSAndrew Geissler       sync                  Synchronize the source tree for an existing recipe
6809209eecSAndrew Geissler       menuconfig            Alter build-time configuration for a recipe
6909209eecSAndrew Geissler       import                Import exported tar archive into workspace
7009209eecSAndrew Geissler       export                Export workspace into a tar archive
7109209eecSAndrew Geissler     other:
7209209eecSAndrew Geissler       selftest-reverse      Reverse value (for selftest)
7309209eecSAndrew Geissler       pluginfile            Print the filename of this plugin
7409209eecSAndrew Geissler       bbdir                 Print the BBPATH directory of this plugin
7509209eecSAndrew Geissler       count                 How many times have this plugin been registered.
7609209eecSAndrew Geissler       multiloaded           How many times have this plugin been initialized
7709209eecSAndrew Geissler   Use devtool <subcommand> --help to get help on a specific command
7809209eecSAndrew Geissler
7909209eecSAndrew GeisslerAs directed in the general help output, you can
8009209eecSAndrew Geisslerget more syntax on a specific command by providing the command name and
81c926e17cSAndrew Geisslerusing "--help"::
8209209eecSAndrew Geissler
8309209eecSAndrew Geissler   $ devtool add --help
8409209eecSAndrew Geissler   NOTE: Starting bitbake server...
8509209eecSAndrew Geissler   usage: devtool add [-h] [--same-dir | --no-same-dir] [--fetch URI] [--npm-dev] [--version VERSION] [--no-git] [--srcrev SRCREV | --autorev] [--srcbranch SRCBRANCH] [--binary] [--also-native] [--src-subdir SUBDIR] [--mirrors]
8609209eecSAndrew Geissler                      [--provides PROVIDES]
8709209eecSAndrew Geissler                      [recipename] [srctree] [fetchuri]
8809209eecSAndrew Geissler
8909209eecSAndrew Geissler   Adds a new recipe to the workspace to build a specified source tree. Can optionally fetch a remote URI and unpack it to create the source tree.
9009209eecSAndrew Geissler
9109209eecSAndrew Geissler   arguments:
9209209eecSAndrew Geissler     recipename            Name for new recipe to add (just name - no version, path or extension). If not specified, will attempt to auto-detect it.
9309209eecSAndrew Geissler     srctree               Path to external source tree. If not specified, a subdirectory of /media/build1/poky/build/workspace/sources will be used.
9409209eecSAndrew Geissler     fetchuri              Fetch the specified URI and extract it to create the source tree
9509209eecSAndrew Geissler
9609209eecSAndrew Geissler   options:
9709209eecSAndrew Geissler     -h, --help            show this help message and exit
9809209eecSAndrew Geissler     --same-dir, -s        Build in same directory as source
9909209eecSAndrew Geissler     --no-same-dir         Force build in a separate build directory
10009209eecSAndrew Geissler     --fetch URI, -f URI   Fetch the specified URI and extract it to create the source tree (deprecated - pass as positional argument instead)
10109209eecSAndrew Geissler     --npm-dev             For npm, also fetch devDependencies
10209209eecSAndrew Geissler     --version VERSION, -V VERSION
10309209eecSAndrew Geissler                           Version to use within recipe (PV)
10409209eecSAndrew Geissler     --no-git, -g          If fetching source, do not set up source tree as a git repository
10509209eecSAndrew Geissler     --srcrev SRCREV, -S SRCREV
10609209eecSAndrew Geissler                           Source revision to fetch if fetching from an SCM such as git (default latest)
10709209eecSAndrew Geissler     --autorev, -a         When fetching from a git repository, set SRCREV in the recipe to a floating revision instead of fixed
10809209eecSAndrew Geissler     --srcbranch SRCBRANCH, -B SRCBRANCH
10909209eecSAndrew Geissler                           Branch in source repository if fetching from an SCM such as git (default master)
11009209eecSAndrew Geissler     --binary, -b          Treat the source tree as something that should be installed verbatim (no compilation, same directory structure). Useful with binary packages e.g. RPMs.
11109209eecSAndrew Geissler     --also-native         Also add native variant (i.e. support building recipe for the build host as well as the target machine)
11209209eecSAndrew Geissler     --src-subdir SUBDIR   Specify subdirectory within source tree to use
11309209eecSAndrew Geissler     --mirrors             Enable PREMIRRORS and MIRRORS for source tree fetching (disable by default).
11409209eecSAndrew Geissler     --provides PROVIDES, -p PROVIDES
11509209eecSAndrew Geissler                           Specify an alias for the item provided by the recipe. E.g. virtual/libgl
11609209eecSAndrew Geissler
11709209eecSAndrew Geissler.. _devtool-the-workspace-layer-structure:
11809209eecSAndrew Geissler
11909209eecSAndrew GeisslerThe Workspace Layer Structure
12009209eecSAndrew Geissler=============================
12109209eecSAndrew Geissler
12209209eecSAndrew Geissler``devtool`` uses a "Workspace" layer in which to accomplish builds. This
12309209eecSAndrew Geisslerlayer is not specific to any single ``devtool`` command but is rather a
12409209eecSAndrew Geisslercommon working area used across the tool.
12509209eecSAndrew Geissler
12609209eecSAndrew GeisslerThe following figure shows the workspace structure:
12709209eecSAndrew Geissler
12809209eecSAndrew Geissler.. image:: figures/build-workspace-directory.png
12909209eecSAndrew Geissler   :align: center
13009209eecSAndrew Geissler   :scale: 70%
13109209eecSAndrew Geissler
13209209eecSAndrew Geissler.. code-block:: none
13309209eecSAndrew Geissler
13409209eecSAndrew Geissler   attic - A directory created if devtool believes it must preserve
13509209eecSAndrew Geissler           anything when you run "devtool reset".  For example, if you
13609209eecSAndrew Geissler           run "devtool add", make changes to the recipe, and then
13709209eecSAndrew Geissler           run "devtool reset", devtool takes notice that the file has
13809209eecSAndrew Geissler           been changed and moves it into the attic should you still
13909209eecSAndrew Geissler           want the recipe.
14009209eecSAndrew Geissler
14109209eecSAndrew Geissler   README - Provides information on what is in workspace layer and how to
14209209eecSAndrew Geissler            manage it.
14309209eecSAndrew Geissler
14409209eecSAndrew Geissler   .devtool_md5 - A checksum file used by devtool.
14509209eecSAndrew Geissler
14609209eecSAndrew Geissler   appends - A directory that contains *.bbappend files, which point to
14709209eecSAndrew Geissler             external source.
14809209eecSAndrew Geissler
14909209eecSAndrew Geissler   conf - A configuration directory that contains the layer.conf file.
15009209eecSAndrew Geissler
15109209eecSAndrew Geissler   recipes - A directory containing recipes.  This directory contains a
15209209eecSAndrew Geissler             folder for each directory added whose name matches that of the
15309209eecSAndrew Geissler             added recipe.  devtool places the recipe.bb file
15409209eecSAndrew Geissler             within that sub-directory.
15509209eecSAndrew Geissler
15609209eecSAndrew Geissler   sources - A directory containing a working copy of the source files used
15709209eecSAndrew Geissler             when building the recipe.  This is the default directory used
15809209eecSAndrew Geissler             as the location of the source tree when you do not provide a
15909209eecSAndrew Geissler             source tree path.  This directory contains a folder for each
16009209eecSAndrew Geissler             set of source files matched to a corresponding recipe.
16109209eecSAndrew Geissler
16209209eecSAndrew Geissler.. _devtool-adding-a-new-recipe-to-the-workspace:
16309209eecSAndrew Geissler
16409209eecSAndrew GeisslerAdding a New Recipe to the Workspace Layer
16509209eecSAndrew Geissler==========================================
16609209eecSAndrew Geissler
16709209eecSAndrew GeisslerUse the ``devtool add`` command to add a new recipe to the workspace
16809209eecSAndrew Geisslerlayer. The recipe you add should not exist - ``devtool`` creates it for
16909209eecSAndrew Geissleryou. The source files the recipe uses should exist in an external area.
17009209eecSAndrew Geissler
17109209eecSAndrew GeisslerThe following example creates and adds a new recipe named ``jackson`` to
17209209eecSAndrew Geisslera workspace layer the tool creates. The source code built by the recipes
173c926e17cSAndrew Geisslerresides in ``/home/user/sources/jackson``::
17409209eecSAndrew Geissler
17509209eecSAndrew Geissler   $ devtool add jackson /home/user/sources/jackson
17609209eecSAndrew Geissler
17709209eecSAndrew GeisslerIf you add a recipe and the workspace layer does not exist, the command
1783b8a17c1SAndrew Geisslercreates the layer and populates it as described in
1793b8a17c1SAndrew Geissler":ref:`devtool-the-workspace-layer-structure`" section.
18009209eecSAndrew Geissler
18109209eecSAndrew GeisslerRunning ``devtool add`` when the workspace layer exists causes the tool
18209209eecSAndrew Geisslerto add the recipe, append files, and source files into the existing
18309209eecSAndrew Geisslerworkspace layer. The ``.bbappend`` file is created to point to the
18409209eecSAndrew Geisslerexternal source tree.
18509209eecSAndrew Geissler
18609209eecSAndrew Geissler.. note::
18709209eecSAndrew Geissler
18809209eecSAndrew Geissler   If your recipe has runtime dependencies defined, you must be sure
18909209eecSAndrew Geissler   that these packages exist on the target hardware before attempting to
19009209eecSAndrew Geissler   run your application. If dependent packages (e.g. libraries) do not
19109209eecSAndrew Geissler   exist on the target, your application, when run, will fail to find
19209209eecSAndrew Geissler   those functions. For more information, see the
19309209eecSAndrew Geissler   ":ref:`ref-manual/devtool-reference:deploying your software on the target machine`"
19409209eecSAndrew Geissler   section.
19509209eecSAndrew Geissler
19609209eecSAndrew GeisslerBy default, ``devtool add`` uses the latest revision (i.e. master) when
19709209eecSAndrew Geisslerunpacking files from a remote URI. In some cases, you might want to
19809209eecSAndrew Geisslerspecify a source revision by branch, tag, or commit hash. You can
19909209eecSAndrew Geisslerspecify these options when using the ``devtool add`` command:
20009209eecSAndrew Geissler
201c926e17cSAndrew Geissler-  To specify a source branch, use the ``--srcbranch`` option::
20209209eecSAndrew Geissler
203d1e89497SAndrew Geissler      $ devtool add --srcbranch &DISTRO_NAME_NO_CAP; jackson /home/user/sources/jackson
20409209eecSAndrew Geissler
205d1e89497SAndrew Geissler   In the previous example, you are checking out the &DISTRO_NAME_NO_CAP;
20609209eecSAndrew Geissler   branch.
20709209eecSAndrew Geissler
20809209eecSAndrew Geissler-  To specify a specific tag or commit hash, use the ``--srcrev``
209c926e17cSAndrew Geissler   option::
21009209eecSAndrew Geissler
211d1e89497SAndrew Geissler      $ devtool add --srcrev &DISTRO_REL_TAG; jackson /home/user/sources/jackson
21209209eecSAndrew Geissler      $ devtool add --srcrev some_commit_hash /home/user/sources/jackson
21309209eecSAndrew Geissler
21409209eecSAndrew Geissler   The previous examples check out the
215d1e89497SAndrew Geissler   &DISTRO_REL_TAG; tag and the commit associated with the
21609209eecSAndrew Geissler   some_commit_hash hash.
21709209eecSAndrew Geissler
21809209eecSAndrew Geissler.. note::
21909209eecSAndrew Geissler
22009209eecSAndrew Geissler   If you prefer to use the latest revision every time the recipe is
22109209eecSAndrew Geissler   built, use the options ``--autorev`` or ``-a``.
22209209eecSAndrew Geissler
22309209eecSAndrew Geissler.. _devtool-extracting-the-source-for-an-existing-recipe:
22409209eecSAndrew Geissler
22509209eecSAndrew GeisslerExtracting the Source for an Existing Recipe
22609209eecSAndrew Geissler============================================
22709209eecSAndrew Geissler
22809209eecSAndrew GeisslerUse the ``devtool extract`` command to extract the source for an
22909209eecSAndrew Geisslerexisting recipe. When you use this command, you must supply the root
23009209eecSAndrew Geisslername of the recipe (i.e. no version, paths, or extensions), and you must
23109209eecSAndrew Geisslersupply the directory to which you want the source extracted.
23209209eecSAndrew Geissler
23309209eecSAndrew GeisslerAdditional command options let you control the name of a development
23409209eecSAndrew Geisslerbranch into which you can checkout the source and whether or not to keep
23509209eecSAndrew Geisslera temporary directory, which is useful for debugging.
23609209eecSAndrew Geissler
23709209eecSAndrew Geissler.. _devtool-synchronizing-a-recipes-extracted-source-tree:
23809209eecSAndrew Geissler
23909209eecSAndrew GeisslerSynchronizing a Recipe's Extracted Source Tree
24009209eecSAndrew Geissler==============================================
24109209eecSAndrew Geissler
24209209eecSAndrew GeisslerUse the ``devtool sync`` command to synchronize a previously extracted
24309209eecSAndrew Geisslersource tree for an existing recipe. When you use this command, you must
24409209eecSAndrew Geisslersupply the root name of the recipe (i.e. no version, paths, or
24509209eecSAndrew Geisslerextensions), and you must supply the directory to which you want the
24609209eecSAndrew Geisslersource extracted.
24709209eecSAndrew Geissler
24809209eecSAndrew GeisslerAdditional command options let you control the name of a development
24909209eecSAndrew Geisslerbranch into which you can checkout the source and whether or not to keep
25009209eecSAndrew Geisslera temporary directory, which is useful for debugging.
25109209eecSAndrew Geissler
25209209eecSAndrew Geissler.. _devtool-modifying-a-recipe:
25309209eecSAndrew Geissler
25409209eecSAndrew GeisslerModifying an Existing Recipe
25509209eecSAndrew Geissler============================
25609209eecSAndrew Geissler
25709209eecSAndrew GeisslerUse the ``devtool modify`` command to begin modifying the source of an
25809209eecSAndrew Geisslerexisting recipe. This command is very similar to the
25909209eecSAndrew Geissler:ref:`add <devtool-adding-a-new-recipe-to-the-workspace>` command
26009209eecSAndrew Geisslerexcept that it does not physically create the recipe in the workspace
26109209eecSAndrew Geisslerlayer because the recipe already exists in an another layer.
26209209eecSAndrew Geissler
26309209eecSAndrew GeisslerThe ``devtool modify`` command extracts the source for a recipe, sets it
26409209eecSAndrew Geisslerup as a Git repository if the source had not already been fetched from
26509209eecSAndrew GeisslerGit, checks out a branch for development, and applies any patches from
26609209eecSAndrew Geisslerthe recipe as commits on top. You can use the following command to
267c926e17cSAndrew Geisslercheckout the source files::
26809209eecSAndrew Geissler
26909209eecSAndrew Geissler   $ devtool modify recipe
27009209eecSAndrew Geissler
27109209eecSAndrew GeisslerUsing the above command form, ``devtool`` uses the existing recipe's
27209209eecSAndrew Geissler:term:`SRC_URI` statement to locate the upstream source,
27309209eecSAndrew Geisslerextracts the source into the default sources location in the workspace.
27409209eecSAndrew GeisslerThe default development branch used is "devtool".
27509209eecSAndrew Geissler
27609209eecSAndrew Geissler.. _devtool-edit-an-existing-recipe:
27709209eecSAndrew Geissler
27809209eecSAndrew GeisslerEdit an Existing Recipe
27909209eecSAndrew Geissler=======================
28009209eecSAndrew Geissler
28109209eecSAndrew GeisslerUse the ``devtool edit-recipe`` command to run the default editor, which
28209209eecSAndrew Geissleris identified using the ``EDITOR`` variable, on the specified recipe.
28309209eecSAndrew Geissler
28409209eecSAndrew GeisslerWhen you use the ``devtool edit-recipe`` command, you must supply the
28509209eecSAndrew Geisslerroot name of the recipe (i.e. no version, paths, or extensions). Also,
28609209eecSAndrew Geisslerthe recipe file itself must reside in the workspace as a result of the
28709209eecSAndrew Geissler``devtool add`` or ``devtool upgrade`` commands. However, you can
28809209eecSAndrew Geissleroverride that requirement by using the "-a" or "--any-recipe" option.
28909209eecSAndrew GeisslerUsing either of these options allows you to edit any recipe regardless
29009209eecSAndrew Geisslerof its location.
29109209eecSAndrew Geissler
29209209eecSAndrew Geissler.. _devtool-updating-a-recipe:
29309209eecSAndrew Geissler
29409209eecSAndrew GeisslerUpdating a Recipe
29509209eecSAndrew Geissler=================
29609209eecSAndrew Geissler
29709209eecSAndrew GeisslerUse the ``devtool update-recipe`` command to update your recipe with
29809209eecSAndrew Geisslerpatches that reflect changes you make to the source files. For example,
29909209eecSAndrew Geisslerif you know you are going to work on some code, you could first use the
30009209eecSAndrew Geissler:ref:`devtool modify <devtool-modifying-a-recipe>` command to extract
30109209eecSAndrew Geisslerthe code and set up the workspace. After which, you could modify,
30209209eecSAndrew Geisslercompile, and test the code.
30309209eecSAndrew Geissler
30409209eecSAndrew GeisslerWhen you are satisfied with the results and you have committed your
30509209eecSAndrew Geisslerchanges to the Git repository, you can then run the
306c926e17cSAndrew Geissler``devtool update-recipe`` to create the patches and update the recipe::
30709209eecSAndrew Geissler
30809209eecSAndrew Geissler   $ devtool update-recipe recipe
30909209eecSAndrew Geissler
31009209eecSAndrew GeisslerIf you run the ``devtool update-recipe``
31109209eecSAndrew Geisslerwithout committing your changes, the command ignores the changes.
31209209eecSAndrew Geissler
31309209eecSAndrew GeisslerOften, you might want to apply customizations made to your software in
31409209eecSAndrew Geissleryour own layer rather than apply them to the original recipe. If so, you
31509209eecSAndrew Geisslercan use the ``-a`` or ``--append`` option with the
31609209eecSAndrew Geissler``devtool update-recipe`` command. These options allow you to specify
317c926e17cSAndrew Geisslerthe layer into which to write an append file::
31809209eecSAndrew Geissler
31909209eecSAndrew Geissler   $ devtool update-recipe recipe -a base-layer-directory
32009209eecSAndrew Geissler
32109209eecSAndrew GeisslerThe ``*.bbappend`` file is created at the
32209209eecSAndrew Geisslerappropriate path within the specified layer directory, which may or may
32309209eecSAndrew Geisslernot be in your ``bblayers.conf`` file. If an append file already exists,
32409209eecSAndrew Geisslerthe command updates it appropriately.
32509209eecSAndrew Geissler
32609209eecSAndrew Geissler.. _devtool-checking-on-the-upgrade-status-of-a-recipe:
32709209eecSAndrew Geissler
32809209eecSAndrew GeisslerChecking on the Upgrade Status of a Recipe
32909209eecSAndrew Geissler==========================================
33009209eecSAndrew Geissler
33109209eecSAndrew GeisslerUpstream recipes change over time. Consequently, you might find that you
33209209eecSAndrew Geisslerneed to determine if you can upgrade a recipe to a newer version.
33309209eecSAndrew Geissler
33409209eecSAndrew GeisslerTo check on the upgrade status of a recipe, use the
33509209eecSAndrew Geissler``devtool check-upgrade-status`` command. The command displays a table
33609209eecSAndrew Geisslerof your current recipe versions, the latest upstream versions, the email
33709209eecSAndrew Geissleraddress of the recipe's maintainer, and any additional information such
33809209eecSAndrew Geissleras commit hash strings and reasons you might not be able to upgrade a
33909209eecSAndrew Geisslerparticular recipe.
34009209eecSAndrew Geissler
34109209eecSAndrew Geissler.. note::
34209209eecSAndrew Geissler
34309209eecSAndrew Geissler   -  For the ``oe-core`` layer, recipe maintainers come from the
34409209eecSAndrew Geissler      :yocto_git:`maintainers.inc </poky/tree/meta/conf/distro/include/maintainers.inc>`
34509209eecSAndrew Geissler      file.
34609209eecSAndrew Geissler
34709209eecSAndrew Geissler   -  If the recipe is using the :ref:`bitbake:bitbake-user-manual/bitbake-user-manual-fetching:git fetcher (\`\`git://\`\`)`
34809209eecSAndrew Geissler      rather than a
34909209eecSAndrew Geissler      tarball, the commit hash points to the commit that matches the
35009209eecSAndrew Geissler      recipe's latest version tag.
35109209eecSAndrew Geissler
35209209eecSAndrew GeisslerAs with all ``devtool`` commands, you can get help on the individual
353c926e17cSAndrew Geisslercommand::
35409209eecSAndrew Geissler
35509209eecSAndrew Geissler   $ devtool check-upgrade-status -h
35609209eecSAndrew Geissler   NOTE: Starting bitbake server...
35709209eecSAndrew Geissler   usage: devtool check-upgrade-status [-h] [--all] [recipe [recipe ...]]
35809209eecSAndrew Geissler
35909209eecSAndrew Geissler   Prints a table of recipes together with versions currently provided by recipes, and latest upstream versions, when there is a later version available
36009209eecSAndrew Geissler
36109209eecSAndrew Geissler   arguments:
36209209eecSAndrew Geissler     recipe      Name of the recipe to report (omit to report upgrade info for all recipes)
36309209eecSAndrew Geissler
36409209eecSAndrew Geissler   options:
36509209eecSAndrew Geissler     -h, --help  show this help message and exit
36609209eecSAndrew Geissler     --all, -a   Show all recipes, not just recipes needing upgrade
36709209eecSAndrew Geissler
36809209eecSAndrew GeisslerUnless you provide a specific recipe name on the command line, the
36909209eecSAndrew Geisslercommand checks all recipes in all configured layers.
37009209eecSAndrew Geissler
37109209eecSAndrew GeisslerFollowing is a partial example table that reports on all the recipes.
37209209eecSAndrew GeisslerNotice the reported reason for not upgrading the ``base-passwd`` recipe.
37309209eecSAndrew GeisslerIn this example, while a new version is available upstream, you do not
37409209eecSAndrew Geisslerwant to use it because the dependency on ``cdebconf`` is not easily
37509209eecSAndrew Geisslersatisfied.
37609209eecSAndrew Geissler
37709209eecSAndrew Geissler.. note::
37809209eecSAndrew Geissler
37909209eecSAndrew Geissler   When a reason for not upgrading displays, the reason is usually
38009209eecSAndrew Geissler   written into the recipe using the ``RECIPE_NO_UPDATE_REASON``
38109209eecSAndrew Geissler   variable. See the
38209209eecSAndrew Geissler   :yocto_git:`base-passwd.bb </poky/tree/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb>`
38309209eecSAndrew Geissler   recipe for an example.
38409209eecSAndrew Geissler
38509209eecSAndrew Geissler::
38609209eecSAndrew Geissler
38709209eecSAndrew Geissler   $ devtool check-upgrade-status
38809209eecSAndrew Geissler   ...
38909209eecSAndrew Geissler   NOTE: acpid 2.0.30 2.0.31 Ross Burton <ross.burton@intel.com>
39009209eecSAndrew Geissler   NOTE: u-boot-fw-utils 2018.11 2019.01 Marek Vasut <marek.vasut@gmail.com> d3689267f92c5956e09cc7d1baa4700141662bff
39109209eecSAndrew Geissler   NOTE: u-boot-tools 2018.11 2019.01 Marek Vasut <marek.vasut@gmail.com> d3689267f92c5956e09cc7d1baa4700141662bff
39209209eecSAndrew Geissler   .
39309209eecSAndrew Geissler   .
39409209eecSAndrew Geissler   .
39509209eecSAndrew Geissler   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
39609209eecSAndrew Geissler   NOTE: busybox 1.29.2 1.30.0 Andrej Valek <andrej.valek@siemens.com>
39709209eecSAndrew Geissler   NOTE: dbus-test 1.12.10 1.12.12 Chen Qi <Qi.Chen@windriver.com>
39809209eecSAndrew Geissler
39909209eecSAndrew Geissler.. _devtool-upgrading-a-recipe:
40009209eecSAndrew Geissler
40109209eecSAndrew GeisslerUpgrading a Recipe
40209209eecSAndrew Geissler==================
40309209eecSAndrew Geissler
40409209eecSAndrew GeisslerAs software matures, upstream recipes are upgraded to newer versions. As
40509209eecSAndrew Geisslera developer, you need to keep your local recipes up-to-date with the
406*ac69b488SWilliam A. Kennington IIIupstream version releases. There are several ways of upgrading recipes.
407*ac69b488SWilliam A. Kennington IIIYou can read about them in the ":ref:`dev-manual/common-tasks:upgrading recipes`"
40809209eecSAndrew Geisslersection of the Yocto Project Development Tasks Manual. This section
40909209eecSAndrew Geissleroverviews the ``devtool upgrade`` command.
41009209eecSAndrew Geissler
41109209eecSAndrew GeisslerBefore you upgrade a recipe, you can check on its upgrade status. See
41209209eecSAndrew Geisslerthe ":ref:`devtool-checking-on-the-upgrade-status-of-a-recipe`" section
41309209eecSAndrew Geisslerfor more information.
41409209eecSAndrew Geissler
41509209eecSAndrew GeisslerThe ``devtool upgrade`` command upgrades an existing recipe to a more
41609209eecSAndrew Geisslerrecent version of the recipe upstream. The command puts the upgraded
41709209eecSAndrew Geisslerrecipe file along with any associated files into a "workspace" and, if
41809209eecSAndrew Geisslernecessary, extracts the source tree to a specified location. During the
41909209eecSAndrew Geisslerupgrade, patches associated with the recipe are rebased or added as
42009209eecSAndrew Geisslerneeded.
42109209eecSAndrew Geissler
42209209eecSAndrew GeisslerWhen you use the ``devtool upgrade`` command, you must supply the root
42309209eecSAndrew Geisslername of the recipe (i.e. no version, paths, or extensions), and you must
42409209eecSAndrew Geisslersupply the directory to which you want the source extracted. Additional
42509209eecSAndrew Geisslercommand options let you control things such as the version number to
42609209eecSAndrew Geisslerwhich you want to upgrade (i.e. the :term:`PV`), the source
42709209eecSAndrew Geisslerrevision to which you want to upgrade (i.e. the
42809209eecSAndrew Geissler:term:`SRCREV`), whether or not to apply patches, and so
42909209eecSAndrew Geisslerforth.
43009209eecSAndrew Geissler
43109209eecSAndrew GeisslerYou can read more on the ``devtool upgrade`` workflow in the
43209209eecSAndrew Geissler":ref:`sdk-manual/extensible:use \`\`devtool upgrade\`\` to create a version of the recipe that supports a newer version of the software`"
43309209eecSAndrew Geisslersection in the Yocto Project Application Development and the Extensible
43409209eecSAndrew GeisslerSoftware Development Kit (eSDK) manual. You can also see an example of
43509209eecSAndrew Geisslerhow to use ``devtool upgrade`` in the ":ref:`dev-manual/common-tasks:using \`\`devtool upgrade\`\``"
43609209eecSAndrew Geisslersection in the Yocto Project Development Tasks Manual.
43709209eecSAndrew Geissler
43809209eecSAndrew Geissler.. _devtool-resetting-a-recipe:
43909209eecSAndrew Geissler
44009209eecSAndrew GeisslerResetting a Recipe
44109209eecSAndrew Geissler==================
44209209eecSAndrew Geissler
44309209eecSAndrew GeisslerUse the ``devtool reset`` command to remove a recipe and its
44409209eecSAndrew Geisslerconfiguration (e.g. the corresponding ``.bbappend`` file) from the
44509209eecSAndrew Geisslerworkspace layer. Realize that this command deletes the recipe and the
44609209eecSAndrew Geisslerappend file. The command does not physically move them for you.
44709209eecSAndrew GeisslerConsequently, you must be sure to physically relocate your updated
44809209eecSAndrew Geisslerrecipe and the append file outside of the workspace layer before running
44909209eecSAndrew Geisslerthe ``devtool reset`` command.
45009209eecSAndrew Geissler
45109209eecSAndrew GeisslerIf the ``devtool reset`` command detects that the recipe or the append
45209209eecSAndrew Geisslerfiles have been modified, the command preserves the modified files in a
45309209eecSAndrew Geisslerseparate "attic" subdirectory under the workspace layer.
45409209eecSAndrew Geissler
45509209eecSAndrew GeisslerHere is an example that resets the workspace directory that contains the
456c926e17cSAndrew Geissler``mtr`` recipe::
45709209eecSAndrew Geissler
45809209eecSAndrew Geissler   $ devtool reset mtr
45909209eecSAndrew Geissler   NOTE: Cleaning sysroot for recipe mtr...
46009209eecSAndrew Geissler   NOTE: Leaving source tree /home/scottrif/poky/build/workspace/sources/mtr as-is; if you no longer need it then please delete it manually
46109209eecSAndrew Geissler   $
46209209eecSAndrew Geissler
46309209eecSAndrew Geissler.. _devtool-building-your-recipe:
46409209eecSAndrew Geissler
46509209eecSAndrew GeisslerBuilding Your Recipe
46609209eecSAndrew Geissler====================
46709209eecSAndrew Geissler
46809209eecSAndrew GeisslerUse the ``devtool build`` command to build your recipe. The
46909209eecSAndrew Geissler``devtool build`` command is equivalent to the
47009209eecSAndrew Geissler``bitbake -c populate_sysroot`` command.
47109209eecSAndrew Geissler
47209209eecSAndrew GeisslerWhen you use the ``devtool build`` command, you must supply the root
47309209eecSAndrew Geisslername of the recipe (i.e. do not provide versions, paths, or extensions).
47409209eecSAndrew GeisslerYou can use either the "-s" or the "--disable-parallel-make" options to
475c926e17cSAndrew Geisslerdisable parallel makes during the build. Here is an example::
47609209eecSAndrew Geissler
47709209eecSAndrew Geissler   $ devtool build recipe
47809209eecSAndrew Geissler
47909209eecSAndrew Geissler.. _devtool-building-your-image:
48009209eecSAndrew Geissler
48109209eecSAndrew GeisslerBuilding Your Image
48209209eecSAndrew Geissler===================
48309209eecSAndrew Geissler
48409209eecSAndrew GeisslerUse the ``devtool build-image`` command to build an image, extending it
48509209eecSAndrew Geisslerto include packages from recipes in the workspace. Using this command is
48609209eecSAndrew Geissleruseful when you want an image that ready for immediate deployment onto a
48709209eecSAndrew Geisslerdevice for testing. For proper integration into a final image, you need
48809209eecSAndrew Geisslerto edit your custom image recipe appropriately.
48909209eecSAndrew Geissler
49009209eecSAndrew GeisslerWhen you use the ``devtool build-image`` command, you must supply the
491c926e17cSAndrew Geisslername of the image. This command has no command line options::
49209209eecSAndrew Geissler
49309209eecSAndrew Geissler   $ devtool build-image image
49409209eecSAndrew Geissler
49509209eecSAndrew Geissler.. _devtool-deploying-your-software-on-the-target-machine:
49609209eecSAndrew Geissler
49709209eecSAndrew GeisslerDeploying Your Software on the Target Machine
49809209eecSAndrew Geissler=============================================
49909209eecSAndrew Geissler
50009209eecSAndrew GeisslerUse the ``devtool deploy-target`` command to deploy the recipe's build
501c926e17cSAndrew Geissleroutput to the live target machine::
50209209eecSAndrew Geissler
50309209eecSAndrew Geissler   $ devtool deploy-target recipe target
50409209eecSAndrew Geissler
50509209eecSAndrew GeisslerThe target is the address of the target machine, which must be running
50609209eecSAndrew Geissleran SSH server (i.e. ``user@hostname[:destdir]``).
50709209eecSAndrew Geissler
50809209eecSAndrew GeisslerThis command deploys all files installed during the
50909209eecSAndrew Geissler:ref:`ref-tasks-install` task. Furthermore, you do not
51009209eecSAndrew Geisslerneed to have package management enabled within the target machine. If
51109209eecSAndrew Geissleryou do, the package manager is bypassed.
51209209eecSAndrew Geissler
51309209eecSAndrew Geissler.. note::
51409209eecSAndrew Geissler
51509209eecSAndrew Geissler   The ``deploy-target`` functionality is for development only. You
51609209eecSAndrew Geissler   should never use it to update an image that will be used in
51709209eecSAndrew Geissler   production.
51809209eecSAndrew Geissler
519*ac69b488SWilliam A. Kennington IIISome conditions could prevent a deployed application from
520*ac69b488SWilliam A. Kennington IIIbehaving as expected. When both of the following conditions are met, your
52109209eecSAndrew Geisslerapplication has the potential to not behave correctly when run on the
52209209eecSAndrew Geisslertarget:
52309209eecSAndrew Geissler
52409209eecSAndrew Geissler-  You are deploying a new application to the target and the recipe you
52509209eecSAndrew Geissler   used to build the application had correctly defined runtime
52609209eecSAndrew Geissler   dependencies.
52709209eecSAndrew Geissler
52809209eecSAndrew Geissler-  The target does not physically have the packages on which the
52909209eecSAndrew Geissler   application depends installed.
53009209eecSAndrew Geissler
531*ac69b488SWilliam A. Kennington IIIIf both of these conditions are met, your application will not behave as
53209209eecSAndrew Geisslerexpected. The reason for this misbehavior is because the
53309209eecSAndrew Geissler``devtool deploy-target`` command does not deploy the packages (e.g.
53409209eecSAndrew Geisslerlibraries) on which your new application depends. The assumption is that
53509209eecSAndrew Geisslerthe packages are already on the target. Consequently, when a runtime
53609209eecSAndrew Geisslercall is made in the application for a dependent function (e.g. a library
53709209eecSAndrew Geisslercall), the function cannot be found.
53809209eecSAndrew Geissler
53909209eecSAndrew GeisslerTo be sure you have all the dependencies local to the target, you need
54009209eecSAndrew Geisslerto be sure that the packages are pre-deployed (installed) on the target
54109209eecSAndrew Geisslerbefore attempting to run your application.
54209209eecSAndrew Geissler
54309209eecSAndrew Geissler.. _devtool-removing-your-software-from-the-target-machine:
54409209eecSAndrew Geissler
54509209eecSAndrew GeisslerRemoving Your Software from the Target Machine
54609209eecSAndrew Geissler==============================================
54709209eecSAndrew Geissler
54809209eecSAndrew GeisslerUse the ``devtool undeploy-target`` command to remove deployed build
54909209eecSAndrew Geissleroutput from the target machine. For the ``devtool undeploy-target``
55009209eecSAndrew Geisslercommand to work, you must have previously used the
55109209eecSAndrew Geissler":ref:`devtool deploy-target <ref-manual/devtool-reference:deploying your software on the target machine>`"
55209209eecSAndrew Geisslercommand.
55309209eecSAndrew Geissler::
55409209eecSAndrew Geissler
55509209eecSAndrew Geissler   $ devtool undeploy-target recipe target
55609209eecSAndrew Geissler
55709209eecSAndrew GeisslerThe target is the
55809209eecSAndrew Geissleraddress of the target machine, which must be running an SSH server (i.e.
55909209eecSAndrew Geissler``user@hostname``).
56009209eecSAndrew Geissler
56109209eecSAndrew Geissler.. _devtool-creating-the-workspace:
56209209eecSAndrew Geissler
56309209eecSAndrew GeisslerCreating the Workspace Layer in an Alternative Location
56409209eecSAndrew Geissler=======================================================
56509209eecSAndrew Geissler
56609209eecSAndrew GeisslerUse the ``devtool create-workspace`` command to create a new workspace
56709209eecSAndrew Geisslerlayer in your :term:`Build Directory`. When you create a
56809209eecSAndrew Geisslernew workspace layer, it is populated with the ``README`` file and the
56909209eecSAndrew Geissler``conf`` directory only.
57009209eecSAndrew Geissler
57109209eecSAndrew GeisslerThe following example creates a new workspace layer in your current
572c926e17cSAndrew Geisslerworking and by default names the workspace layer "workspace"::
57309209eecSAndrew Geissler
57409209eecSAndrew Geissler   $ devtool create-workspace
57509209eecSAndrew Geissler
57609209eecSAndrew GeisslerYou can create a workspace layer anywhere by supplying a pathname with
57709209eecSAndrew Geisslerthe command. The following command creates a new workspace layer named
578c926e17cSAndrew Geissler"new-workspace"::
57909209eecSAndrew Geissler
58009209eecSAndrew Geissler   $ devtool create-workspace /home/scottrif/new-workspace
58109209eecSAndrew Geissler
58209209eecSAndrew Geissler.. _devtool-get-the-status-of-the-recipes-in-your-workspace:
58309209eecSAndrew Geissler
58409209eecSAndrew GeisslerGet the Status of the Recipes in Your Workspace
58509209eecSAndrew Geissler===============================================
58609209eecSAndrew Geissler
58709209eecSAndrew GeisslerUse the ``devtool status`` command to list the recipes currently in your
58809209eecSAndrew Geisslerworkspace. Information includes the paths to their respective external
58909209eecSAndrew Geisslersource trees.
59009209eecSAndrew Geissler
591c926e17cSAndrew GeisslerThe ``devtool status`` command has no command-line options::
59209209eecSAndrew Geissler
59309209eecSAndrew Geissler   $ devtool status
59409209eecSAndrew Geissler
59509209eecSAndrew GeisslerFollowing is sample output after using
59609209eecSAndrew Geissler:ref:`devtool add <ref-manual/devtool-reference:adding a new recipe to the workspace layer>`
597c926e17cSAndrew Geisslerto create and add the ``mtr_0.86.bb`` recipe to the ``workspace`` directory::
59809209eecSAndrew Geissler
59909209eecSAndrew Geissler   $ devtool status
60009209eecSAndrew Geissler   mtr:/home/scottrif/poky/build/workspace/sources/mtr (/home/scottrif/poky/build/workspace/recipes/mtr/mtr_0.86.bb)
60109209eecSAndrew Geissler   $
60209209eecSAndrew Geissler
60309209eecSAndrew Geissler.. _devtool-search-for-available-target-recipes:
60409209eecSAndrew Geissler
60509209eecSAndrew GeisslerSearch for Available Target Recipes
60609209eecSAndrew Geissler===================================
60709209eecSAndrew Geissler
60809209eecSAndrew GeisslerUse the ``devtool search`` command to search for available target
60909209eecSAndrew Geisslerrecipes. The command matches the recipe name, package name, description,
61009209eecSAndrew Geisslerand installed files. The command displays the recipe name as a result of
61109209eecSAndrew Geisslera match.
61209209eecSAndrew Geissler
61309209eecSAndrew GeisslerWhen you use the ``devtool search`` command, you must supply a keyword.
61409209eecSAndrew GeisslerThe command uses the keyword when searching for a match.
615