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 815199d831SAndrew 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 129d583833aSAndrew Geissler :scale: 100% 13009209eecSAndrew Geissler 13109209eecSAndrew Geissler.. code-block:: none 13209209eecSAndrew Geissler 13309209eecSAndrew Geissler attic - A directory created if devtool believes it must preserve 13409209eecSAndrew Geissler anything when you run "devtool reset". For example, if you 13509209eecSAndrew Geissler run "devtool add", make changes to the recipe, and then 13609209eecSAndrew Geissler run "devtool reset", devtool takes notice that the file has 13709209eecSAndrew Geissler been changed and moves it into the attic should you still 13809209eecSAndrew Geissler want the recipe. 13909209eecSAndrew Geissler 14009209eecSAndrew Geissler README - Provides information on what is in workspace layer and how to 14109209eecSAndrew Geissler manage it. 14209209eecSAndrew Geissler 14309209eecSAndrew Geissler .devtool_md5 - A checksum file used by devtool. 14409209eecSAndrew Geissler 14509209eecSAndrew Geissler appends - A directory that contains *.bbappend files, which point to 14609209eecSAndrew Geissler external source. 14709209eecSAndrew Geissler 14809209eecSAndrew Geissler conf - A configuration directory that contains the layer.conf file. 14909209eecSAndrew Geissler 15009209eecSAndrew Geissler recipes - A directory containing recipes. This directory contains a 15109209eecSAndrew Geissler folder for each directory added whose name matches that of the 15209209eecSAndrew Geissler added recipe. devtool places the recipe.bb file 15309209eecSAndrew Geissler within that sub-directory. 15409209eecSAndrew Geissler 15509209eecSAndrew Geissler sources - A directory containing a working copy of the source files used 15609209eecSAndrew Geissler when building the recipe. This is the default directory used 15709209eecSAndrew Geissler as the location of the source tree when you do not provide a 15809209eecSAndrew Geissler source tree path. This directory contains a folder for each 15909209eecSAndrew Geissler set of source files matched to a corresponding recipe. 16009209eecSAndrew Geissler 16109209eecSAndrew Geissler.. _devtool-adding-a-new-recipe-to-the-workspace: 16209209eecSAndrew Geissler 16309209eecSAndrew GeisslerAdding a New Recipe to the Workspace Layer 16409209eecSAndrew Geissler========================================== 16509209eecSAndrew Geissler 16609209eecSAndrew GeisslerUse the ``devtool add`` command to add a new recipe to the workspace 167615f2f11SAndrew Geisslerlayer. The recipe you add should not exist --- ``devtool`` creates it for 16809209eecSAndrew Geissleryou. The source files the recipe uses should exist in an external area. 16909209eecSAndrew Geissler 17009209eecSAndrew GeisslerThe following example creates and adds a new recipe named ``jackson`` to 17109209eecSAndrew Geisslera workspace layer the tool creates. The source code built by the recipes 172c926e17cSAndrew Geisslerresides in ``/home/user/sources/jackson``:: 17309209eecSAndrew Geissler 17409209eecSAndrew Geissler $ devtool add jackson /home/user/sources/jackson 17509209eecSAndrew Geissler 17609209eecSAndrew GeisslerIf you add a recipe and the workspace layer does not exist, the command 1773b8a17c1SAndrew Geisslercreates the layer and populates it as described in 1783b8a17c1SAndrew Geissler":ref:`devtool-the-workspace-layer-structure`" section. 17909209eecSAndrew Geissler 18009209eecSAndrew GeisslerRunning ``devtool add`` when the workspace layer exists causes the tool 18109209eecSAndrew Geisslerto add the recipe, append files, and source files into the existing 18209209eecSAndrew Geisslerworkspace layer. The ``.bbappend`` file is created to point to the 18309209eecSAndrew Geisslerexternal source tree. 18409209eecSAndrew Geissler 18509209eecSAndrew Geissler.. note:: 18609209eecSAndrew Geissler 18709209eecSAndrew Geissler If your recipe has runtime dependencies defined, you must be sure 18809209eecSAndrew Geissler that these packages exist on the target hardware before attempting to 18909209eecSAndrew Geissler run your application. If dependent packages (e.g. libraries) do not 19009209eecSAndrew Geissler exist on the target, your application, when run, will fail to find 19109209eecSAndrew Geissler those functions. For more information, see the 19209209eecSAndrew Geissler ":ref:`ref-manual/devtool-reference:deploying your software on the target machine`" 19309209eecSAndrew Geissler section. 19409209eecSAndrew Geissler 19509209eecSAndrew GeisslerBy default, ``devtool add`` uses the latest revision (i.e. master) when 19609209eecSAndrew Geisslerunpacking files from a remote URI. In some cases, you might want to 19709209eecSAndrew Geisslerspecify a source revision by branch, tag, or commit hash. You can 19809209eecSAndrew Geisslerspecify these options when using the ``devtool add`` command: 19909209eecSAndrew Geissler 200c926e17cSAndrew Geissler- To specify a source branch, use the ``--srcbranch`` option:: 20109209eecSAndrew Geissler 202d1e89497SAndrew Geissler $ devtool add --srcbranch &DISTRO_NAME_NO_CAP; jackson /home/user/sources/jackson 20309209eecSAndrew Geissler 204d1e89497SAndrew Geissler In the previous example, you are checking out the &DISTRO_NAME_NO_CAP; 20509209eecSAndrew Geissler branch. 20609209eecSAndrew Geissler 20709209eecSAndrew Geissler- To specify a specific tag or commit hash, use the ``--srcrev`` 208c926e17cSAndrew Geissler option:: 20909209eecSAndrew Geissler 210d1e89497SAndrew Geissler $ devtool add --srcrev &DISTRO_REL_TAG; jackson /home/user/sources/jackson 21109209eecSAndrew Geissler $ devtool add --srcrev some_commit_hash /home/user/sources/jackson 21209209eecSAndrew Geissler 21309209eecSAndrew Geissler The previous examples check out the 214d1e89497SAndrew Geissler &DISTRO_REL_TAG; tag and the commit associated with the 21509209eecSAndrew Geissler some_commit_hash hash. 21609209eecSAndrew Geissler 21709209eecSAndrew Geissler.. note:: 21809209eecSAndrew Geissler 21909209eecSAndrew Geissler If you prefer to use the latest revision every time the recipe is 22009209eecSAndrew Geissler built, use the options ``--autorev`` or ``-a``. 22109209eecSAndrew Geissler 22209209eecSAndrew Geissler.. _devtool-extracting-the-source-for-an-existing-recipe: 22309209eecSAndrew Geissler 22409209eecSAndrew GeisslerExtracting the Source for an Existing Recipe 22509209eecSAndrew Geissler============================================ 22609209eecSAndrew Geissler 22709209eecSAndrew GeisslerUse the ``devtool extract`` command to extract the source for an 22809209eecSAndrew Geisslerexisting recipe. When you use this command, you must supply the root 22909209eecSAndrew Geisslername of the recipe (i.e. no version, paths, or extensions), and you must 23009209eecSAndrew Geisslersupply the directory to which you want the source extracted. 23109209eecSAndrew Geissler 23209209eecSAndrew GeisslerAdditional command options let you control the name of a development 23309209eecSAndrew Geisslerbranch into which you can checkout the source and whether or not to keep 23409209eecSAndrew Geisslera temporary directory, which is useful for debugging. 23509209eecSAndrew Geissler 23609209eecSAndrew Geissler.. _devtool-synchronizing-a-recipes-extracted-source-tree: 23709209eecSAndrew Geissler 23809209eecSAndrew GeisslerSynchronizing a Recipe's Extracted Source Tree 23909209eecSAndrew Geissler============================================== 24009209eecSAndrew Geissler 24109209eecSAndrew GeisslerUse the ``devtool sync`` command to synchronize a previously extracted 24209209eecSAndrew Geisslersource tree for an existing recipe. When you use this command, you must 24309209eecSAndrew Geisslersupply the root name of the recipe (i.e. no version, paths, or 24409209eecSAndrew Geisslerextensions), and you must supply the directory to which you want the 24509209eecSAndrew Geisslersource extracted. 24609209eecSAndrew Geissler 24709209eecSAndrew GeisslerAdditional command options let you control the name of a development 24809209eecSAndrew Geisslerbranch into which you can checkout the source and whether or not to keep 24909209eecSAndrew Geisslera temporary directory, which is useful for debugging. 25009209eecSAndrew Geissler 25109209eecSAndrew Geissler.. _devtool-modifying-a-recipe: 25209209eecSAndrew Geissler 25309209eecSAndrew GeisslerModifying an Existing Recipe 25409209eecSAndrew Geissler============================ 25509209eecSAndrew Geissler 25609209eecSAndrew GeisslerUse the ``devtool modify`` command to begin modifying the source of an 25709209eecSAndrew Geisslerexisting recipe. This command is very similar to the 25809209eecSAndrew Geissler:ref:`add <devtool-adding-a-new-recipe-to-the-workspace>` command 25909209eecSAndrew Geisslerexcept that it does not physically create the recipe in the workspace 26009209eecSAndrew Geisslerlayer because the recipe already exists in an another layer. 26109209eecSAndrew Geissler 26209209eecSAndrew GeisslerThe ``devtool modify`` command extracts the source for a recipe, sets it 26309209eecSAndrew Geisslerup as a Git repository if the source had not already been fetched from 26409209eecSAndrew GeisslerGit, checks out a branch for development, and applies any patches from 26509209eecSAndrew Geisslerthe recipe as commits on top. You can use the following command to 266c926e17cSAndrew Geisslercheckout the source files:: 26709209eecSAndrew Geissler 26809209eecSAndrew Geissler $ devtool modify recipe 26909209eecSAndrew Geissler 27009209eecSAndrew GeisslerUsing the above command form, ``devtool`` uses the existing recipe's 27109209eecSAndrew Geissler:term:`SRC_URI` statement to locate the upstream source, 27209209eecSAndrew Geisslerextracts the source into the default sources location in the workspace. 27309209eecSAndrew GeisslerThe default development branch used is "devtool". 27409209eecSAndrew Geissler 27509209eecSAndrew Geissler.. _devtool-edit-an-existing-recipe: 27609209eecSAndrew Geissler 27709209eecSAndrew GeisslerEdit an Existing Recipe 27809209eecSAndrew Geissler======================= 27909209eecSAndrew Geissler 28009209eecSAndrew GeisslerUse the ``devtool edit-recipe`` command to run the default editor, which 28109209eecSAndrew Geissleris identified using the ``EDITOR`` variable, on the specified recipe. 28209209eecSAndrew Geissler 28309209eecSAndrew GeisslerWhen you use the ``devtool edit-recipe`` command, you must supply the 28409209eecSAndrew Geisslerroot name of the recipe (i.e. no version, paths, or extensions). Also, 28509209eecSAndrew Geisslerthe recipe file itself must reside in the workspace as a result of the 2865199d831SAndrew Geissler``devtool add`` or ``devtool upgrade`` commands. 28709209eecSAndrew Geissler 28809209eecSAndrew Geissler.. _devtool-updating-a-recipe: 28909209eecSAndrew Geissler 29009209eecSAndrew GeisslerUpdating a Recipe 29109209eecSAndrew Geissler================= 29209209eecSAndrew Geissler 29309209eecSAndrew GeisslerUse the ``devtool update-recipe`` command to update your recipe with 29409209eecSAndrew Geisslerpatches that reflect changes you make to the source files. For example, 29509209eecSAndrew Geisslerif you know you are going to work on some code, you could first use the 29609209eecSAndrew Geissler:ref:`devtool modify <devtool-modifying-a-recipe>` command to extract 29709209eecSAndrew Geisslerthe code and set up the workspace. After which, you could modify, 29809209eecSAndrew Geisslercompile, and test the code. 29909209eecSAndrew Geissler 30009209eecSAndrew GeisslerWhen you are satisfied with the results and you have committed your 30109209eecSAndrew Geisslerchanges to the Git repository, you can then run the 302c926e17cSAndrew Geissler``devtool update-recipe`` to create the patches and update the recipe:: 30309209eecSAndrew Geissler 30409209eecSAndrew Geissler $ devtool update-recipe recipe 30509209eecSAndrew Geissler 30609209eecSAndrew GeisslerIf you run the ``devtool update-recipe`` 30709209eecSAndrew Geisslerwithout committing your changes, the command ignores the changes. 30809209eecSAndrew Geissler 30909209eecSAndrew GeisslerOften, you might want to apply customizations made to your software in 31009209eecSAndrew Geissleryour own layer rather than apply them to the original recipe. If so, you 31109209eecSAndrew Geisslercan use the ``-a`` or ``--append`` option with the 31209209eecSAndrew Geissler``devtool update-recipe`` command. These options allow you to specify 313c926e17cSAndrew Geisslerthe layer into which to write an append file:: 31409209eecSAndrew Geissler 31509209eecSAndrew Geissler $ devtool update-recipe recipe -a base-layer-directory 31609209eecSAndrew Geissler 31709209eecSAndrew GeisslerThe ``*.bbappend`` file is created at the 31809209eecSAndrew Geisslerappropriate path within the specified layer directory, which may or may 31909209eecSAndrew Geisslernot be in your ``bblayers.conf`` file. If an append file already exists, 32009209eecSAndrew Geisslerthe command updates it appropriately. 32109209eecSAndrew Geissler 32209209eecSAndrew Geissler.. _devtool-checking-on-the-upgrade-status-of-a-recipe: 32309209eecSAndrew Geissler 32409209eecSAndrew GeisslerChecking on the Upgrade Status of a Recipe 32509209eecSAndrew Geissler========================================== 32609209eecSAndrew Geissler 32709209eecSAndrew GeisslerUpstream recipes change over time. Consequently, you might find that you 32809209eecSAndrew Geisslerneed to determine if you can upgrade a recipe to a newer version. 32909209eecSAndrew Geissler 3305199d831SAndrew GeisslerTo check on the upgrade status of a recipe, you can use the 3315199d831SAndrew Geissler``devtool latest-version recipe`` command, which quickly shows the current 3325199d831SAndrew Geisslerversion and the latest version available upstream. To get a more global 3335199d831SAndrew Geisslerpicture, use the ``devtool check-upgrade-status`` command, which takes a 3345199d831SAndrew Geisslerlist of recipes as input, or no arguments, in which case it checks all 3355199d831SAndrew Geissleravailable recipes. This command will only print the recipes for which 3365199d831SAndrew Geisslera new upstream version is available. Each such recipe will have its current 3375199d831SAndrew Geisslerversion and latest upstream version, as well as the email of the maintainer 3385199d831SAndrew Geisslerand any additional information such as the commit hash or reason for not 3395199d831SAndrew Geisslerbeing able to upgrade it, displayed in a table. 3405199d831SAndrew Geissler 3415199d831SAndrew GeisslerThis upgrade checking mechanism relies on the optional :term:`UPSTREAM_CHECK_URI`, 3425199d831SAndrew Geissler:term:`UPSTREAM_CHECK_REGEX`, :term:`UPSTREAM_CHECK_GITTAGREGEX`, 3435199d831SAndrew Geissler:term:`UPSTREAM_CHECK_COMMITS` and :term:`UPSTREAM_VERSION_UNKNOWN` 3445199d831SAndrew Geisslervariables in package recipes. 34509209eecSAndrew Geissler 34609209eecSAndrew Geissler.. note:: 34709209eecSAndrew Geissler 3485199d831SAndrew Geissler - Most of the time, the above variables are unnecessary. They are only 3495199d831SAndrew Geissler required when upstream does something unusual, and default 3505199d831SAndrew Geissler mechanisms cannot find the new upstream versions. 3515199d831SAndrew Geissler 35209209eecSAndrew Geissler - For the ``oe-core`` layer, recipe maintainers come from the 35309209eecSAndrew Geissler :yocto_git:`maintainers.inc </poky/tree/meta/conf/distro/include/maintainers.inc>` 35409209eecSAndrew Geissler file. 35509209eecSAndrew Geissler 356fc113eadSAndrew Geissler - If the recipe is using the :ref:`bitbake-user-manual/bitbake-user-manual-fetching:git fetcher (\`\`git://\`\`)` 3575199d831SAndrew Geissler rather than a tarball, the commit hash points to the commit that matches 3585199d831SAndrew Geissler the recipe's latest version tag, or in the absence of suitable tags, 3595199d831SAndrew Geissler to the latest commit (when :term:`UPSTREAM_CHECK_COMMITS` set to ``1`` 3605199d831SAndrew Geissler in the recipe). 36109209eecSAndrew Geissler 36209209eecSAndrew GeisslerAs with all ``devtool`` commands, you can get help on the individual 363c926e17cSAndrew Geisslercommand:: 36409209eecSAndrew Geissler 36509209eecSAndrew Geissler $ devtool check-upgrade-status -h 36609209eecSAndrew Geissler NOTE: Starting bitbake server... 36709209eecSAndrew Geissler usage: devtool check-upgrade-status [-h] [--all] [recipe [recipe ...]] 36809209eecSAndrew Geissler 36909209eecSAndrew Geissler Prints a table of recipes together with versions currently provided by recipes, and latest upstream versions, when there is a later version available 37009209eecSAndrew Geissler 37109209eecSAndrew Geissler arguments: 37209209eecSAndrew Geissler recipe Name of the recipe to report (omit to report upgrade info for all recipes) 37309209eecSAndrew Geissler 37409209eecSAndrew Geissler options: 37509209eecSAndrew Geissler -h, --help show this help message and exit 37609209eecSAndrew Geissler --all, -a Show all recipes, not just recipes needing upgrade 37709209eecSAndrew Geissler 37809209eecSAndrew GeisslerUnless you provide a specific recipe name on the command line, the 37909209eecSAndrew Geisslercommand checks all recipes in all configured layers. 38009209eecSAndrew Geissler 381*39653566SPatrick WilliamsHere is a partial example table that reports on all the recipes:: 38209209eecSAndrew Geissler 38309209eecSAndrew Geissler $ devtool check-upgrade-status 38409209eecSAndrew Geissler ... 3855199d831SAndrew Geissler INFO: bind 9.16.20 9.16.21 Armin Kuster <akuster808@gmail.com> 3865199d831SAndrew Geissler INFO: inetutils 2.1 2.2 Tom Rini <trini@konsulko.com> 3875199d831SAndrew Geissler INFO: iproute2 5.13.0 5.14.0 Changhyeok Bae <changhyeok.bae@gmail.com> 3885199d831SAndrew Geissler INFO: openssl 1.1.1l 3.0.0 Alexander Kanavin <alex.kanavin@gmail.com> 3895199d831SAndrew Geissler 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 3905199d831SAndrew Geissler ... 3915199d831SAndrew Geissler 3926aa7eec5SAndrew GeisslerNotice the reported reason for not upgrading the ``base-passwd`` recipe. 3936aa7eec5SAndrew GeisslerIn this example, while a new version is available upstream, you do not 3946aa7eec5SAndrew Geisslerwant to use it because the dependency on ``cdebconf`` is not easily 3956aa7eec5SAndrew Geisslersatisfied. Maintainers can explicit the reason that is shown by adding 3966aa7eec5SAndrew Geisslerthe :term:`RECIPE_NO_UPDATE_REASON` variable to the corresponding recipe. 3976aa7eec5SAndrew GeisslerSee :yocto_git:`base-passwd.bb </poky/tree/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb?h=kirkstone>` 3986aa7eec5SAndrew Geisslerfor an example:: 3996aa7eec5SAndrew Geissler 4006aa7eec5SAndrew Geissler RECIPE_NO_UPDATE_REASON = "Version 3.5.38 requires cdebconf for update-passwd utility" 4016aa7eec5SAndrew Geissler 4025199d831SAndrew GeisslerLast but not least, you may set :term:`UPSTREAM_VERSION_UNKNOWN` to ``1`` 4035199d831SAndrew Geisslerin a recipe when there's currently no way to determine its latest upstream 4045199d831SAndrew Geisslerversion. 40509209eecSAndrew Geissler 40609209eecSAndrew Geissler.. _devtool-upgrading-a-recipe: 40709209eecSAndrew Geissler 40809209eecSAndrew GeisslerUpgrading a Recipe 40909209eecSAndrew Geissler================== 41009209eecSAndrew Geissler 41109209eecSAndrew GeisslerAs software matures, upstream recipes are upgraded to newer versions. As 41209209eecSAndrew Geisslera developer, you need to keep your local recipes up-to-date with the 413ac69b488SWilliam A. Kennington IIIupstream version releases. There are several ways of upgrading recipes. 414517393d9SAndrew GeisslerYou can read about them in the ":ref:`dev-manual/upgrading-recipes:upgrading recipes`" 41509209eecSAndrew Geisslersection of the Yocto Project Development Tasks Manual. This section 41609209eecSAndrew Geissleroverviews the ``devtool upgrade`` command. 41709209eecSAndrew Geissler 41809209eecSAndrew GeisslerBefore you upgrade a recipe, you can check on its upgrade status. See 41909209eecSAndrew Geisslerthe ":ref:`devtool-checking-on-the-upgrade-status-of-a-recipe`" section 42009209eecSAndrew Geisslerfor more information. 42109209eecSAndrew Geissler 42209209eecSAndrew GeisslerThe ``devtool upgrade`` command upgrades an existing recipe to a more 42309209eecSAndrew Geisslerrecent version of the recipe upstream. The command puts the upgraded 42409209eecSAndrew Geisslerrecipe file along with any associated files into a "workspace" and, if 42509209eecSAndrew Geisslernecessary, extracts the source tree to a specified location. During the 42609209eecSAndrew Geisslerupgrade, patches associated with the recipe are rebased or added as 42709209eecSAndrew Geisslerneeded. 42809209eecSAndrew Geissler 42909209eecSAndrew GeisslerWhen you use the ``devtool upgrade`` command, you must supply the root 43009209eecSAndrew Geisslername of the recipe (i.e. no version, paths, or extensions), and you must 43109209eecSAndrew Geisslersupply the directory to which you want the source extracted. Additional 43209209eecSAndrew Geisslercommand options let you control things such as the version number to 43309209eecSAndrew Geisslerwhich you want to upgrade (i.e. the :term:`PV`), the source 43409209eecSAndrew Geisslerrevision to which you want to upgrade (i.e. the 43509209eecSAndrew Geissler:term:`SRCREV`), whether or not to apply patches, and so 43609209eecSAndrew Geisslerforth. 43709209eecSAndrew Geissler 43809209eecSAndrew GeisslerYou can read more on the ``devtool upgrade`` workflow in the 43909209eecSAndrew Geissler":ref:`sdk-manual/extensible:use \`\`devtool upgrade\`\` to create a version of the recipe that supports a newer version of the software`" 44009209eecSAndrew Geisslersection in the Yocto Project Application Development and the Extensible 44109209eecSAndrew GeisslerSoftware Development Kit (eSDK) manual. You can also see an example of 442517393d9SAndrew Geisslerhow to use ``devtool upgrade`` in the ":ref:`dev-manual/upgrading-recipes:using \`\`devtool upgrade\`\``" 44309209eecSAndrew Geisslersection in the Yocto Project Development Tasks Manual. 44409209eecSAndrew Geissler 44509209eecSAndrew Geissler.. _devtool-resetting-a-recipe: 44609209eecSAndrew Geissler 44709209eecSAndrew GeisslerResetting a Recipe 44809209eecSAndrew Geissler================== 44909209eecSAndrew Geissler 45009209eecSAndrew GeisslerUse the ``devtool reset`` command to remove a recipe and its 45109209eecSAndrew Geisslerconfiguration (e.g. the corresponding ``.bbappend`` file) from the 45209209eecSAndrew Geisslerworkspace layer. Realize that this command deletes the recipe and the 45309209eecSAndrew Geisslerappend file. The command does not physically move them for you. 45409209eecSAndrew GeisslerConsequently, you must be sure to physically relocate your updated 45509209eecSAndrew Geisslerrecipe and the append file outside of the workspace layer before running 45609209eecSAndrew Geisslerthe ``devtool reset`` command. 45709209eecSAndrew Geissler 45809209eecSAndrew GeisslerIf the ``devtool reset`` command detects that the recipe or the append 45909209eecSAndrew Geisslerfiles have been modified, the command preserves the modified files in a 46009209eecSAndrew Geisslerseparate "attic" subdirectory under the workspace layer. 46109209eecSAndrew Geissler 46209209eecSAndrew GeisslerHere is an example that resets the workspace directory that contains the 463c926e17cSAndrew Geissler``mtr`` recipe:: 46409209eecSAndrew Geissler 46509209eecSAndrew Geissler $ devtool reset mtr 46609209eecSAndrew Geissler NOTE: Cleaning sysroot for recipe mtr... 46709209eecSAndrew 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 46809209eecSAndrew Geissler $ 46909209eecSAndrew Geissler 47009209eecSAndrew Geissler.. _devtool-building-your-recipe: 47109209eecSAndrew Geissler 47209209eecSAndrew GeisslerBuilding Your Recipe 47309209eecSAndrew Geissler==================== 47409209eecSAndrew Geissler 47509209eecSAndrew GeisslerUse the ``devtool build`` command to build your recipe. The 47609209eecSAndrew Geissler``devtool build`` command is equivalent to the 47709209eecSAndrew Geissler``bitbake -c populate_sysroot`` command. 47809209eecSAndrew Geissler 47909209eecSAndrew GeisslerWhen you use the ``devtool build`` command, you must supply the root 48009209eecSAndrew Geisslername of the recipe (i.e. do not provide versions, paths, or extensions). 4815199d831SAndrew GeisslerYou can use either the ``-s`` or the ``--disable-parallel-make`` options to 482c926e17cSAndrew Geisslerdisable parallel makes during the build. Here is an example:: 48309209eecSAndrew Geissler 48409209eecSAndrew Geissler $ devtool build recipe 48509209eecSAndrew Geissler 48609209eecSAndrew Geissler.. _devtool-building-your-image: 48709209eecSAndrew Geissler 48809209eecSAndrew GeisslerBuilding Your Image 48909209eecSAndrew Geissler=================== 49009209eecSAndrew Geissler 49109209eecSAndrew GeisslerUse the ``devtool build-image`` command to build an image, extending it 49209209eecSAndrew Geisslerto include packages from recipes in the workspace. Using this command is 49309209eecSAndrew Geissleruseful when you want an image that ready for immediate deployment onto a 49409209eecSAndrew Geisslerdevice for testing. For proper integration into a final image, you need 49509209eecSAndrew Geisslerto edit your custom image recipe appropriately. 49609209eecSAndrew Geissler 49709209eecSAndrew GeisslerWhen you use the ``devtool build-image`` command, you must supply the 498c926e17cSAndrew Geisslername of the image. This command has no command line options:: 49909209eecSAndrew Geissler 50009209eecSAndrew Geissler $ devtool build-image image 50109209eecSAndrew Geissler 50209209eecSAndrew Geissler.. _devtool-deploying-your-software-on-the-target-machine: 50309209eecSAndrew Geissler 50409209eecSAndrew GeisslerDeploying Your Software on the Target Machine 50509209eecSAndrew Geissler============================================= 50609209eecSAndrew Geissler 50709209eecSAndrew GeisslerUse the ``devtool deploy-target`` command to deploy the recipe's build 508c926e17cSAndrew Geissleroutput to the live target machine:: 50909209eecSAndrew Geissler 51009209eecSAndrew Geissler $ devtool deploy-target recipe target 51109209eecSAndrew Geissler 51209209eecSAndrew GeisslerThe target is the address of the target machine, which must be running 51309209eecSAndrew Geissleran SSH server (i.e. ``user@hostname[:destdir]``). 51409209eecSAndrew Geissler 51509209eecSAndrew GeisslerThis command deploys all files installed during the 51609209eecSAndrew Geissler:ref:`ref-tasks-install` task. Furthermore, you do not 51709209eecSAndrew Geisslerneed to have package management enabled within the target machine. If 51809209eecSAndrew Geissleryou do, the package manager is bypassed. 51909209eecSAndrew Geissler 52009209eecSAndrew Geissler.. note:: 52109209eecSAndrew Geissler 52209209eecSAndrew Geissler The ``deploy-target`` functionality is for development only. You 52309209eecSAndrew Geissler should never use it to update an image that will be used in 52409209eecSAndrew Geissler production. 52509209eecSAndrew Geissler 526ac69b488SWilliam A. Kennington IIISome conditions could prevent a deployed application from 527ac69b488SWilliam A. Kennington IIIbehaving as expected. When both of the following conditions are met, your 52809209eecSAndrew Geisslerapplication has the potential to not behave correctly when run on the 52909209eecSAndrew Geisslertarget: 53009209eecSAndrew Geissler 53109209eecSAndrew Geissler- You are deploying a new application to the target and the recipe you 53209209eecSAndrew Geissler used to build the application had correctly defined runtime 53309209eecSAndrew Geissler dependencies. 53409209eecSAndrew Geissler 53509209eecSAndrew Geissler- The target does not physically have the packages on which the 53609209eecSAndrew Geissler application depends installed. 53709209eecSAndrew Geissler 538ac69b488SWilliam A. Kennington IIIIf both of these conditions are met, your application will not behave as 53909209eecSAndrew Geisslerexpected. The reason for this misbehavior is because the 54009209eecSAndrew Geissler``devtool deploy-target`` command does not deploy the packages (e.g. 54109209eecSAndrew Geisslerlibraries) on which your new application depends. The assumption is that 54209209eecSAndrew Geisslerthe packages are already on the target. Consequently, when a runtime 54309209eecSAndrew Geisslercall is made in the application for a dependent function (e.g. a library 54409209eecSAndrew Geisslercall), the function cannot be found. 54509209eecSAndrew Geissler 54609209eecSAndrew GeisslerTo be sure you have all the dependencies local to the target, you need 54709209eecSAndrew Geisslerto be sure that the packages are pre-deployed (installed) on the target 54809209eecSAndrew Geisslerbefore attempting to run your application. 54909209eecSAndrew Geissler 55009209eecSAndrew Geissler.. _devtool-removing-your-software-from-the-target-machine: 55109209eecSAndrew Geissler 55209209eecSAndrew GeisslerRemoving Your Software from the Target Machine 55309209eecSAndrew Geissler============================================== 55409209eecSAndrew Geissler 55509209eecSAndrew GeisslerUse the ``devtool undeploy-target`` command to remove deployed build 55609209eecSAndrew Geissleroutput from the target machine. For the ``devtool undeploy-target`` 55709209eecSAndrew Geisslercommand to work, you must have previously used the 55809209eecSAndrew Geissler":ref:`devtool deploy-target <ref-manual/devtool-reference:deploying your software on the target machine>`" 559517393d9SAndrew Geisslercommand:: 56009209eecSAndrew Geissler 56109209eecSAndrew Geissler $ devtool undeploy-target recipe target 56209209eecSAndrew Geissler 56309209eecSAndrew GeisslerThe target is the 56409209eecSAndrew Geissleraddress of the target machine, which must be running an SSH server (i.e. 56509209eecSAndrew Geissler``user@hostname``). 56609209eecSAndrew Geissler 56709209eecSAndrew Geissler.. _devtool-creating-the-workspace: 56809209eecSAndrew Geissler 56909209eecSAndrew GeisslerCreating the Workspace Layer in an Alternative Location 57009209eecSAndrew Geissler======================================================= 57109209eecSAndrew Geissler 57209209eecSAndrew GeisslerUse the ``devtool create-workspace`` command to create a new workspace 57309209eecSAndrew Geisslerlayer in your :term:`Build Directory`. When you create a 57409209eecSAndrew Geisslernew workspace layer, it is populated with the ``README`` file and the 57509209eecSAndrew Geissler``conf`` directory only. 57609209eecSAndrew Geissler 57709209eecSAndrew GeisslerThe following example creates a new workspace layer in your current 578c926e17cSAndrew Geisslerworking and by default names the workspace layer "workspace":: 57909209eecSAndrew Geissler 58009209eecSAndrew Geissler $ devtool create-workspace 58109209eecSAndrew Geissler 58209209eecSAndrew GeisslerYou can create a workspace layer anywhere by supplying a pathname with 58309209eecSAndrew Geisslerthe command. The following command creates a new workspace layer named 584c926e17cSAndrew Geissler"new-workspace":: 58509209eecSAndrew Geissler 58609209eecSAndrew Geissler $ devtool create-workspace /home/scottrif/new-workspace 58709209eecSAndrew Geissler 58809209eecSAndrew Geissler.. _devtool-get-the-status-of-the-recipes-in-your-workspace: 58909209eecSAndrew Geissler 59009209eecSAndrew GeisslerGet the Status of the Recipes in Your Workspace 59109209eecSAndrew Geissler=============================================== 59209209eecSAndrew Geissler 59309209eecSAndrew GeisslerUse the ``devtool status`` command to list the recipes currently in your 59409209eecSAndrew Geisslerworkspace. Information includes the paths to their respective external 59509209eecSAndrew Geisslersource trees. 59609209eecSAndrew Geissler 597c926e17cSAndrew GeisslerThe ``devtool status`` command has no command-line options:: 59809209eecSAndrew Geissler 59909209eecSAndrew Geissler $ devtool status 60009209eecSAndrew Geissler 601*39653566SPatrick WilliamsHere is sample output after using 60209209eecSAndrew Geissler:ref:`devtool add <ref-manual/devtool-reference:adding a new recipe to the workspace layer>` 603c926e17cSAndrew Geisslerto create and add the ``mtr_0.86.bb`` recipe to the ``workspace`` directory:: 60409209eecSAndrew Geissler 60509209eecSAndrew Geissler $ devtool status 60609209eecSAndrew Geissler mtr:/home/scottrif/poky/build/workspace/sources/mtr (/home/scottrif/poky/build/workspace/recipes/mtr/mtr_0.86.bb) 60709209eecSAndrew Geissler $ 60809209eecSAndrew Geissler 60909209eecSAndrew Geissler.. _devtool-search-for-available-target-recipes: 61009209eecSAndrew Geissler 61109209eecSAndrew GeisslerSearch for Available Target Recipes 61209209eecSAndrew Geissler=================================== 61309209eecSAndrew Geissler 61409209eecSAndrew GeisslerUse the ``devtool search`` command to search for available target 61509209eecSAndrew Geisslerrecipes. The command matches the recipe name, package name, description, 61609209eecSAndrew Geisslerand installed files. The command displays the recipe name as a result of 61709209eecSAndrew Geisslera match. 61809209eecSAndrew Geissler 61909209eecSAndrew GeisslerWhen you use the ``devtool search`` command, you must supply a keyword. 62009209eecSAndrew GeisslerThe command uses the keyword when searching for a match. 621