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