Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 1 | <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" |
| 2 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" |
| 3 | [<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] > |
| 4 | |
| 5 | <chapter id='ref-devtool-reference'> |
| 6 | <title><filename>devtool</filename> Quick Reference</title> |
| 7 | |
| 8 | <para> |
| 9 | The <filename>devtool</filename> command-line tool provides a number |
| 10 | of features that help you build, test, and package software. |
| 11 | This command is available alongside the <filename>bitbake</filename> |
| 12 | command. |
| 13 | Additionally, the <filename>devtool</filename> command is a key |
| 14 | part of the extensible SDK. |
| 15 | </para> |
| 16 | |
| 17 | <para> |
| 18 | This chapter provides a Quick Reference for the |
| 19 | <filename>devtool</filename> command. |
| 20 | For more information on how to apply the command when using the |
| 21 | extensible SDK, see the |
| 22 | "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-extensible'>Using the Extensible SDK</ulink>" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame^] | 23 | chapter in the Yocto Project Application Development and the |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 24 | Extensible Software Development Kit (eSDK) manual. |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 25 | </para> |
| 26 | |
| 27 | <section id='devtool-getting-help'> |
| 28 | <title>Getting Help</title> |
| 29 | |
| 30 | <para> |
| 31 | The <filename>devtool</filename> command line is organized |
| 32 | similarly to Git in that it has a number of sub-commands for |
| 33 | each function. |
| 34 | You can run <filename>devtool --help</filename> to see all |
| 35 | the commands: |
| 36 | <literallayout class='monospaced'> |
| 37 | $ devtool --help |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame^] | 38 | NOTE: Starting bitbake server... |
| 39 | usage: devtool [--basepath BASEPATH] [--bbpath BBPATH] [-d] [-q] |
| 40 | [--color COLOR] [-h] |
| 41 | <subcommand> ... |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 42 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame^] | 43 | OpenEmbedded development tool |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 44 | |
| 45 | options: |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame^] | 46 | --basepath BASEPATH Base directory of SDK / build directory |
| 47 | --bbpath BBPATH Explicitly specify the BBPATH, rather than getting it |
| 48 | from the metadata |
| 49 | -d, --debug Enable debug output |
| 50 | -q, --quiet Print only errors |
| 51 | --color COLOR Colorize output (where COLOR is auto, always, never) |
| 52 | -h, --help show this help message and exit |
| 53 | |
| 54 | subcommands: |
| 55 | Beginning work on a recipe: |
| 56 | add Add a new recipe |
| 57 | modify Modify the source for an existing recipe |
| 58 | upgrade Upgrade an existing recipe |
| 59 | Getting information: |
| 60 | status Show workspace status |
| 61 | search Search available recipes |
| 62 | latest-version Report the latest version of an existing recipe |
| 63 | Working on a recipe in the workspace: |
| 64 | build Build a recipe |
| 65 | rename Rename a recipe file in the workspace |
| 66 | edit-recipe Edit a recipe file |
| 67 | find-recipe Find a recipe file |
| 68 | configure-help Get help on configure script options |
| 69 | update-recipe Apply changes from external source tree to recipe |
| 70 | reset Remove a recipe from your workspace |
| 71 | finish Finish working on a recipe in your workspace |
| 72 | Testing changes on target: |
| 73 | deploy-target Deploy recipe output files to live target machine |
| 74 | undeploy-target Undeploy recipe output files in live target machine |
| 75 | build-image Build image including workspace recipe packages |
| 76 | Advanced: |
| 77 | create-workspace Set up workspace in an alternative location |
| 78 | export Export workspace into a tar archive |
| 79 | import Import exported tar archive into workspace |
| 80 | extract Extract the source for an existing recipe |
| 81 | sync Synchronize the source tree for an existing recipe |
| 82 | Use devtool <subcommand> --help to get help on a specific command |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 83 | </literallayout> |
| 84 | </para> |
| 85 | |
| 86 | <para> |
| 87 | As directed in the general help output, you can get more |
| 88 | syntax on a specific command by providing the command |
| 89 | name and using <filename>--help</filename>: |
| 90 | <literallayout class='monospaced'> |
| 91 | $ devtool add --help |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame^] | 92 | NOTE: Starting bitbake server... |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 93 | usage: devtool add [-h] [--same-dir | --no-same-dir] [--fetch URI] |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame^] | 94 | [--fetch-dev] [--version VERSION] [--no-git] |
| 95 | [--srcrev SRCREV | --autorev] [--srcbranch SRCBRANCH] |
| 96 | [--binary] [--also-native] [--src-subdir SUBDIR] |
| 97 | [--mirrors] [--provides PROVIDES] |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 98 | [recipename] [srctree] [fetchuri] |
| 99 | |
| 100 | Adds a new recipe to the workspace to build a specified source tree. Can |
| 101 | optionally fetch a remote URI and unpack it to create the source tree. |
| 102 | |
| 103 | arguments: |
| 104 | recipename Name for new recipe to add (just name - no version, |
| 105 | path or extension). If not specified, will attempt to |
| 106 | auto-detect it. |
| 107 | srctree Path to external source tree. If not specified, a |
| 108 | subdirectory of |
| 109 | /home/scottrif/poky/build/workspace/sources will be |
| 110 | used. |
| 111 | fetchuri Fetch the specified URI and extract it to create the |
| 112 | source tree |
| 113 | |
| 114 | options: |
| 115 | -h, --help show this help message and exit |
| 116 | --same-dir, -s Build in same directory as source |
| 117 | --no-same-dir Force build in a separate build directory |
| 118 | --fetch URI, -f URI Fetch the specified URI and extract it to create the |
| 119 | source tree (deprecated - pass as positional argument |
| 120 | instead) |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame^] | 121 | --fetch-dev For npm, also fetch devDependencies |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 122 | --version VERSION, -V VERSION |
| 123 | Version to use within recipe (PV) |
| 124 | --no-git, -g If fetching source, do not set up source tree as a git |
| 125 | repository |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame^] | 126 | --srcrev SRCREV, -S SRCREV |
| 127 | Source revision to fetch if fetching from an SCM such |
| 128 | as git (default latest) |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 129 | --autorev, -a When fetching from a git repository, set SRCREV in the |
| 130 | recipe to a floating revision instead of fixed |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame^] | 131 | --srcbranch SRCBRANCH, -B SRCBRANCH |
| 132 | Branch in source repository if fetching from an SCM |
| 133 | such as git (default master) |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 134 | --binary, -b Treat the source tree as something that should be |
| 135 | installed verbatim (no compilation, same directory |
| 136 | structure). Useful with binary packages e.g. RPMs. |
| 137 | --also-native Also add native variant (i.e. support building recipe |
| 138 | for the build host as well as the target machine) |
| 139 | --src-subdir SUBDIR Specify subdirectory within source tree to use |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame^] | 140 | --mirrors Enable PREMIRRORS and MIRRORS for source tree fetching |
| 141 | (disable by default). |
| 142 | --provides PROVIDES, -p PROVIDES |
| 143 | Specify an alias for the item provided by the recipe. |
| 144 | E.g. virtual/libgl |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 145 | </literallayout> |
| 146 | </para> |
| 147 | </section> |
| 148 | |
| 149 | <section id='devtool-the-workspace-layer-structure'> |
| 150 | <title>The Workspace Layer Structure</title> |
| 151 | |
| 152 | <para> |
| 153 | <filename>devtool</filename> uses a "Workspace" layer |
| 154 | in which to accomplish builds. |
| 155 | This layer is not specific to any single |
| 156 | <filename>devtool</filename> command but is rather a common |
| 157 | working area used across the tool. |
| 158 | </para> |
| 159 | |
| 160 | <para> |
| 161 | The following figure shows the workspace structure: |
| 162 | </para> |
| 163 | |
| 164 | <para> |
| 165 | <imagedata fileref="figures/build-workspace-directory.png" |
| 166 | width="6in" depth="5in" align="left" scale="70" /> |
| 167 | </para> |
| 168 | |
| 169 | <para> |
| 170 | <literallayout class='monospaced'> |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame^] | 171 | attic - A directory created if devtool believes it must preserve |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 172 | anything when you run "devtool reset". For example, if you |
| 173 | run "devtool add", make changes to the recipe, and then |
| 174 | run "devtool reset", devtool takes notice that the file has |
| 175 | been changed and moves it into the attic should you still |
| 176 | want the recipe. |
| 177 | |
| 178 | README - Provides information on what is in workspace layer and how to |
| 179 | manage it. |
| 180 | |
| 181 | .devtool_md5 - A checksum file used by devtool. |
| 182 | |
| 183 | appends - A directory that contains *.bbappend files, which point to |
| 184 | external source. |
| 185 | |
| 186 | conf - A configuration directory that contains the layer.conf file. |
| 187 | |
| 188 | recipes - A directory containing recipes. This directory contains a |
| 189 | folder for each directory added whose name matches that of the |
| 190 | added recipe. devtool places the <replaceable>recipe</replaceable>.bb file |
| 191 | within that sub-directory. |
| 192 | |
| 193 | sources - A directory containing a working copy of the source files used |
| 194 | when building the recipe. This is the default directory used |
| 195 | as the location of the source tree when you do not provide a |
| 196 | source tree path. This directory contains a folder for each |
| 197 | set of source files matched to a corresponding recipe. |
| 198 | </literallayout> |
| 199 | </para> |
| 200 | </section> |
| 201 | |
| 202 | <section id='devtool-adding-a-new-recipe-to-the-workspace'> |
| 203 | <title>Adding a New Recipe to the Workspace Layer</title> |
| 204 | |
| 205 | <para> |
| 206 | Use the <filename>devtool add</filename> command to add a new recipe |
| 207 | to the workspace layer. |
| 208 | The recipe you add should not exist - |
| 209 | <filename>devtool</filename> creates it for you. |
| 210 | The source files the recipe uses should exist in an external |
| 211 | area. |
| 212 | </para> |
| 213 | |
| 214 | <para> |
| 215 | The following example creates and adds a new recipe named |
| 216 | <filename>jackson</filename> to a workspace layer the tool creates. |
| 217 | The source code built by the recipes resides in |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 218 | <filename>/home/<replaceable>user</replaceable>/sources/jackson</filename>: |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 219 | <literallayout class='monospaced'> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 220 | $ devtool add jackson /home/<replaceable>user</replaceable>/sources/jackson |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 221 | </literallayout> |
| 222 | </para> |
| 223 | |
| 224 | <para> |
| 225 | If you add a recipe and the workspace layer does not exist, |
| 226 | the command creates the layer and populates it as |
| 227 | described in |
| 228 | "<link linkend='devtool-the-workspace-layer-structure'>The Workspace Layer Structure</link>" |
| 229 | section. |
| 230 | </para> |
| 231 | |
| 232 | <para> |
| 233 | Running <filename>devtool add</filename> when the |
| 234 | workspace layer exists causes the tool to add the recipe, |
| 235 | append files, and source files into the existing workspace layer. |
| 236 | The <filename>.bbappend</filename> file is created to point |
| 237 | to the external source tree. |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 238 | <note> |
| 239 | If your recipe has runtime dependencies defined, you must be sure |
| 240 | that these packages exist on the target hardware before attempting |
| 241 | to run your application. |
| 242 | If dependent packages (e.g. libraries) do not exist on the target, |
| 243 | your application, when run, will fail to find those functions. |
| 244 | For more information, see the |
| 245 | "<link linkend='devtool-deploying-your-software-on-the-target-machine'>Deploying Your Software on the Target Machine</link>" |
| 246 | section. |
| 247 | </note> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 248 | </para> |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 249 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 250 | <para> |
| 251 | By default, <filename>devtool add</filename> uses the latest |
| 252 | revision (i.e. master) when unpacking files from a remote URI. |
| 253 | In some cases, you might want to specify a source revision by |
| 254 | branch, tag, or commit hash. You can specify these options when |
| 255 | using the <filename>devtool add</filename> command: |
| 256 | <itemizedlist> |
| 257 | <listitem><para> |
| 258 | To specify a source branch, use the |
| 259 | <filename>--srcbranch</filename> option: |
| 260 | <literallayout class='monospaced'> |
| 261 | $ devtool add --srcbranch &DISTRO_NAME_NO_CAP; jackson /home/<replaceable>user</replaceable>/sources/jackson |
| 262 | </literallayout> |
| 263 | In the previous example, you are checking out the |
| 264 | &DISTRO_NAME_NO_CAP; branch. |
| 265 | </para></listitem> |
| 266 | <listitem><para> |
| 267 | To specify a specific tag or commit hash, use the |
| 268 | <filename>--srcrev</filename> option: |
| 269 | <literallayout class='monospaced'> |
| 270 | $ devtool add --srcrev &DISTRO_REL_TAG; jackson /home/<replaceable>user</replaceable>/sources/jackson |
| 271 | $ devtool add --srcrev <replaceable>some_commit_hash</replaceable> /home/<replaceable>user</replaceable>/sources/jackson |
| 272 | </literallayout> |
| 273 | The previous examples check out the &DISTRO_REL_TAG; tag |
| 274 | and the commit associated with the |
| 275 | <replaceable>some_commit_hash</replaceable> hash. |
| 276 | </para></listitem> |
| 277 | </itemizedlist> |
| 278 | <note> |
| 279 | If you prefer to use the latest revision every time the recipe is |
| 280 | built, use the options <filename>--autorev</filename> |
| 281 | or <filename>-a</filename>. |
| 282 | </note> |
| 283 | </para> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 284 | </section> |
| 285 | |
| 286 | <section id='devtool-extracting-the-source-for-an-existing-recipe'> |
| 287 | <title>Extracting the Source for an Existing Recipe</title> |
| 288 | |
| 289 | <para> |
| 290 | Use the <filename>devtool extract</filename> command to |
| 291 | extract the source for an existing recipe. |
| 292 | When you use this command, you must supply the root name |
| 293 | of the recipe (i.e. no version, paths, or extensions), and |
| 294 | you must supply the directory to which you want the source |
| 295 | extracted. |
| 296 | </para> |
| 297 | |
| 298 | <para> |
| 299 | Additional command options let you control the name of a |
| 300 | development branch into which you can checkout the source |
| 301 | and whether or not to keep a temporary directory, which is |
| 302 | useful for debugging. |
| 303 | </para> |
| 304 | </section> |
| 305 | |
| 306 | <section id='devtool-synchronizing-a-recipes-extracted-source-tree'> |
| 307 | <title>Synchronizing a Recipe's Extracted Source Tree</title> |
| 308 | |
| 309 | <para> |
| 310 | Use the <filename>devtool sync</filename> command to |
| 311 | synchronize a previously extracted source tree for an |
| 312 | existing recipe. |
| 313 | When you use this command, you must supply the root name |
| 314 | of the recipe (i.e. no version, paths, or extensions), and |
| 315 | you must supply the directory to which you want the source |
| 316 | extracted. |
| 317 | </para> |
| 318 | |
| 319 | <para> |
| 320 | Additional command options let you control the name of a |
| 321 | development branch into which you can checkout the source |
| 322 | and whether or not to keep a temporary directory, which is |
| 323 | useful for debugging. |
| 324 | </para> |
| 325 | </section> |
| 326 | |
| 327 | <section id='devtool-modifying-a-recipe'> |
| 328 | <title>Modifying an Existing Recipe</title> |
| 329 | |
| 330 | <para> |
| 331 | Use the <filename>devtool modify</filename> command to begin |
| 332 | modifying the source of an existing recipe. |
| 333 | This command is very similar to the |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 334 | <link linkend='devtool-adding-a-new-recipe-to-the-workspace'><filename>add</filename></link> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 335 | command except that it does not physically create the |
| 336 | recipe in the workspace layer because the recipe already |
| 337 | exists in an another layer. |
| 338 | </para> |
| 339 | |
| 340 | <para> |
| 341 | The <filename>devtool modify</filename> command extracts the |
| 342 | source for a recipe, sets it up as a Git repository if the |
| 343 | source had not already been fetched from Git, checks out a |
| 344 | branch for development, and applies any patches from the recipe |
| 345 | as commits on top. |
| 346 | You can use the following command to checkout the source |
| 347 | files: |
| 348 | <literallayout class='monospaced'> |
| 349 | $ devtool modify <replaceable>recipe</replaceable> |
| 350 | </literallayout> |
| 351 | Using the above command form, <filename>devtool</filename> uses |
| 352 | the existing recipe's |
| 353 | <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link> |
| 354 | statement to locate the upstream source, extracts the source |
| 355 | into the default sources location in the workspace. |
| 356 | The default development branch used is "devtool". |
| 357 | </para> |
| 358 | </section> |
| 359 | |
| 360 | <section id='devtool-edit-an-existing-recipe'> |
| 361 | <title>Edit an Existing Recipe</title> |
| 362 | |
| 363 | <para> |
| 364 | Use the <filename>devtool edit-recipe</filename> command |
| 365 | to run the default editor, which is identified using the |
| 366 | <filename>EDITOR</filename> variable, on the specified recipe. |
| 367 | </para> |
| 368 | |
| 369 | <para> |
| 370 | When you use the <filename>devtool edit-recipe</filename> |
| 371 | command, you must supply the root name of the recipe |
| 372 | (i.e. no version, paths, or extensions). |
| 373 | Also, the recipe file itself must reside in the workspace |
| 374 | as a result of the <filename>devtool add</filename> or |
| 375 | <filename>devtool upgrade</filename> commands. |
| 376 | However, you can override that requirement by using the |
| 377 | "-a" or "--any-recipe" option. |
| 378 | Using either of these options allows you to edit any recipe |
| 379 | regardless of its location. |
| 380 | </para> |
| 381 | </section> |
| 382 | |
| 383 | <section id='devtool-updating-a-recipe'> |
| 384 | <title>Updating a Recipe</title> |
| 385 | |
| 386 | <para> |
| 387 | Use the <filename>devtool update-recipe</filename> command to |
| 388 | update your recipe with patches that reflect changes you make |
| 389 | to the source files. |
| 390 | For example, if you know you are going to work on some |
| 391 | code, you could first use the |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 392 | <link linkend='devtool-modifying-a-recipe'><filename>devtool modify</filename></link> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 393 | command to extract the code and set up the workspace. |
| 394 | After which, you could modify, compile, and test the code. |
| 395 | </para> |
| 396 | |
| 397 | <para> |
| 398 | When you are satisfied with the results and you have committed |
| 399 | your changes to the Git repository, you can then |
| 400 | run the <filename>devtool update-recipe</filename> to create the |
| 401 | patches and update the recipe: |
| 402 | <literallayout class='monospaced'> |
| 403 | $ devtool update-recipe <replaceable>recipe</replaceable> |
| 404 | </literallayout> |
| 405 | If you run the <filename>devtool update-recipe</filename> |
| 406 | without committing your changes, the command ignores the |
| 407 | changes. |
| 408 | </para> |
| 409 | |
| 410 | <para> |
| 411 | Often, you might want to apply customizations made to your |
| 412 | software in your own layer rather than apply them to the |
| 413 | original recipe. |
| 414 | If so, you can use the |
| 415 | <filename>-a</filename> or <filename>--append</filename> |
| 416 | option with the <filename>devtool update-recipe</filename> |
| 417 | command. |
| 418 | These options allow you to specify the layer into which to |
| 419 | write an append file: |
| 420 | <literallayout class='monospaced'> |
| 421 | $ devtool update-recipe <replaceable>recipe</replaceable> -a <replaceable>base-layer-directory</replaceable> |
| 422 | </literallayout> |
| 423 | The <filename>*.bbappend</filename> file is created at the |
| 424 | appropriate path within the specified layer directory, which |
| 425 | may or may not be in your <filename>bblayers.conf</filename> |
| 426 | file. |
| 427 | If an append file already exists, the command updates it |
| 428 | appropriately. |
| 429 | </para> |
| 430 | </section> |
| 431 | |
| 432 | <section id='devtool-upgrading-a-recipe'> |
| 433 | <title>Upgrading a Recipe</title> |
| 434 | |
| 435 | <para> |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame^] | 436 | As software matures, upstream recipes are upgraded to newer |
| 437 | versions. |
| 438 | As a developer, you need to keep your local recipes up-to-date |
| 439 | with the upstream version releases. |
| 440 | Several methods exist by which you can upgrade recipes. |
| 441 | You can read about them in the |
| 442 | "<ulink url='&YOCTO_DOCS_DEV_URL;#gs-upgrading-recipes'>Upgrading Recipes</ulink>" |
| 443 | section of the Yocto Project Development Tasks Manual. |
| 444 | This section overviews the <filename>devtool upgrade</filename> |
| 445 | command. |
| 446 | </para> |
| 447 | |
| 448 | <para> |
| 449 | The <filename>devtool upgrade</filename> command |
| 450 | upgrades an existing recipe to a more recent version of the |
| 451 | recipe upstream. |
| 452 | The command puts the upgraded recipe file along with any associated |
| 453 | files into a "workspace" and, if necessary, extracts the source |
| 454 | tree to a specified location. |
| 455 | During the upgrade, patches associated with the recipe are |
| 456 | rebased or added as needed. |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 457 | </para> |
| 458 | |
| 459 | <para> |
| 460 | When you use the <filename>devtool upgrade</filename> command, |
| 461 | you must supply the root name of the recipe (i.e. no version, |
| 462 | paths, or extensions), and you must supply the directory |
| 463 | to which you want the source extracted. |
| 464 | Additional command options let you control things such as |
| 465 | the version number to which you want to upgrade (i.e. the |
| 466 | <link linkend='var-PV'><filename>PV</filename></link>), |
| 467 | the source revision to which you want to upgrade (i.e. the |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame^] | 468 | <link linkend='var-SRCREV'><filename>SRCREV</filename></link>), |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 469 | whether or not to apply patches, and so forth. |
| 470 | </para> |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame^] | 471 | |
| 472 | <para> |
| 473 | You can read more on the <filename>devtool upgrade</filename> |
| 474 | workflow in the |
| 475 | "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-devtool-use-devtool-upgrade-to-create-a-version-of-the-recipe-that-supports-a-newer-version-of-the-software'>Use <filename>devtool upgrade</filename> to Create a Version of the Recipe that Supports a Newer Version of the Software</ulink>" |
| 476 | section in the Yocto Project Application Development and the |
| 477 | Extensible Software Development Kit (eSDK) manual. |
| 478 | You can also see an example of how to use |
| 479 | <filename>devtool upgrade</filename> in the |
| 480 | "<ulink url='&YOCTO_DOCS_DEV_URL;#gs-using-devtool-upgrade'>Using <filename>devtool upgrade</filename></ulink>" |
| 481 | section in the Yocto Project Development Tasks Manual. |
| 482 | </para> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 483 | </section> |
| 484 | |
| 485 | <section id='devtool-resetting-a-recipe'> |
| 486 | <title>Resetting a Recipe</title> |
| 487 | |
| 488 | <para> |
| 489 | Use the <filename>devtool reset</filename> command to remove a |
| 490 | recipe and its configuration (e.g. the corresponding |
| 491 | <filename>.bbappend</filename> file) from the workspace layer. |
| 492 | Realize that this command deletes the recipe and the |
| 493 | append file. |
| 494 | The command does not physically move them for you. |
| 495 | Consequently, you must be sure to physically relocate your |
| 496 | updated recipe and the append file outside of the workspace |
| 497 | layer before running the <filename>devtool reset</filename> |
| 498 | command. |
| 499 | </para> |
| 500 | |
| 501 | <para> |
| 502 | If the <filename>devtool reset</filename> command detects that |
| 503 | the recipe or the append files have been modified, the |
| 504 | command preserves the modified files in a separate "attic" |
| 505 | subdirectory under the workspace layer. |
| 506 | </para> |
| 507 | |
| 508 | <para> |
| 509 | Here is an example that resets the workspace directory that |
| 510 | contains the <filename>mtr</filename> recipe: |
| 511 | <literallayout class='monospaced'> |
| 512 | $ devtool reset mtr |
| 513 | NOTE: Cleaning sysroot for recipe mtr... |
| 514 | NOTE: Leaving source tree /home/scottrif/poky/build/workspace/sources/mtr as-is; if you no |
| 515 | longer need it then please delete it manually |
| 516 | $ |
| 517 | </literallayout> |
| 518 | </para> |
| 519 | </section> |
| 520 | |
| 521 | <section id='devtool-building-your-recipe'> |
| 522 | <title>Building Your Recipe</title> |
| 523 | |
| 524 | <para> |
| 525 | Use the <filename>devtool build</filename> command to cause the |
| 526 | OpenEmbedded build system to build your recipe. |
| 527 | The <filename>devtool build</filename> command is equivalent to |
| 528 | <filename>bitbake -c populate_sysroot</filename>. |
| 529 | </para> |
| 530 | |
| 531 | <para> |
| 532 | When you use the <filename>devtool build</filename> command, |
| 533 | you must supply the root name of the recipe (i.e. no version, |
| 534 | paths, or extensions). |
| 535 | You can use either the "-s" or the "--disable-parallel-make" |
| 536 | option to disable parallel makes during the build. |
| 537 | Here is an example: |
| 538 | <literallayout class='monospaced'> |
| 539 | $ devtool build <replaceable>recipe</replaceable> |
| 540 | </literallayout> |
| 541 | </para> |
| 542 | </section> |
| 543 | |
| 544 | <section id='devtool-building-your-image'> |
| 545 | <title>Building Your Image</title> |
| 546 | |
| 547 | <para> |
| 548 | Use the <filename>devtool build-image</filename> command |
| 549 | to build an image, extending it to include packages from |
| 550 | recipes in the workspace. |
| 551 | Using this command is useful when you want an image that |
| 552 | ready for immediate deployment onto a device for testing. |
| 553 | For proper integration into a final image, you need to |
| 554 | edit your custom image recipe appropriately. |
| 555 | </para> |
| 556 | |
| 557 | <para> |
| 558 | When you use the <filename>devtool build-image</filename> |
| 559 | command, you must supply the name of the image. |
| 560 | This command has no command line options: |
| 561 | <literallayout class='monospaced'> |
| 562 | $ devtool build-image <replaceable>image</replaceable> |
| 563 | </literallayout> |
| 564 | </para> |
| 565 | </section> |
| 566 | |
| 567 | <section id='devtool-deploying-your-software-on-the-target-machine'> |
| 568 | <title>Deploying Your Software on the Target Machine</title> |
| 569 | |
| 570 | <para> |
| 571 | Use the <filename>devtool deploy-target</filename> command to |
| 572 | deploy the recipe's build output to the live target machine: |
| 573 | <literallayout class='monospaced'> |
| 574 | $ devtool deploy-target <replaceable>recipe</replaceable> <replaceable>target</replaceable> |
| 575 | </literallayout> |
| 576 | The <replaceable>target</replaceable> is the address of the |
| 577 | target machine, which must be running an SSH server (i.e. |
| 578 | <filename>user@hostname[:destdir]</filename>). |
| 579 | </para> |
| 580 | |
| 581 | <para> |
| 582 | This command deploys all files installed during the |
| 583 | <link linkend='ref-tasks-install'><filename>do_install</filename></link> |
| 584 | task. |
| 585 | Furthermore, you do not need to have package management enabled |
| 586 | within the target machine. |
| 587 | If you do, the package manager is bypassed. |
| 588 | <note><title>Notes</title> |
| 589 | <para> |
| 590 | The <filename>deploy-target</filename> |
| 591 | functionality is for development only. |
| 592 | You should never use it to update an image that will be |
| 593 | used in production. |
| 594 | </para> |
| 595 | </note> |
| 596 | </para> |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 597 | |
| 598 | <para> |
| 599 | Some conditions exist that could prevent a deployed application |
| 600 | from behaving as expected. |
| 601 | When both of the following conditions exist, your application has |
| 602 | the potential to not behave correctly when run on the target: |
| 603 | <itemizedlist> |
| 604 | <listitem><para> |
| 605 | You are deploying a new application to the target and |
| 606 | the recipe you used to build the application had |
| 607 | correctly defined runtime dependencies. |
| 608 | </para></listitem> |
| 609 | <listitem><para> |
| 610 | The target does not physically have the packages on which |
| 611 | the application depends installed. |
| 612 | </para></listitem> |
| 613 | </itemizedlist> |
| 614 | If both of these conditions exist, your application will not |
| 615 | behave as expected. |
| 616 | The reason for this misbehavior is because the |
| 617 | <filename>devtool deploy-target</filename> command does not deploy |
| 618 | the packages (e.g. libraries) on which your new application |
| 619 | depends. |
| 620 | The assumption is that the packages are already on the target. |
| 621 | Consequently, when a runtime call is made in the application |
| 622 | for a dependent function (e.g. a library call), the function |
| 623 | cannot be found. |
| 624 | </para> |
| 625 | |
| 626 | <para> |
| 627 | To be sure you have all the dependencies local to the target, you |
| 628 | need to be sure that the packages are pre-deployed (installed) |
| 629 | on the target before attempting to run your application. |
| 630 | </para> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 631 | </section> |
| 632 | |
| 633 | <section id='devtool-removing-your-software-from-the-target-machine'> |
| 634 | <title>Removing Your Software from the Target Machine</title> |
| 635 | |
| 636 | <para> |
| 637 | Use the <filename>devtool undeploy-target</filename> command to |
| 638 | remove deployed build output from the target machine. |
| 639 | For the <filename>devtool undeploy-target</filename> command to |
| 640 | work, you must have previously used the |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 641 | <link linkend='devtool-deploying-your-software-on-the-target-machine'><filename>devtool deploy-target</filename></link> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 642 | command. |
| 643 | <literallayout class='monospaced'> |
| 644 | $ devtool undeploy-target <replaceable>recipe</replaceable> <replaceable>target</replaceable> |
| 645 | </literallayout> |
| 646 | The <replaceable>target</replaceable> is the address of the |
| 647 | target machine, which must be running an SSH server (i.e. |
| 648 | <filename>user@hostname</filename>). |
| 649 | </para> |
| 650 | </section> |
| 651 | |
| 652 | <section id='devtool-creating-the-workspace'> |
| 653 | <title>Creating the Workspace Layer in an Alternative Location</title> |
| 654 | |
| 655 | <para> |
| 656 | Use the <filename>devtool create-workspace</filename> command to |
| 657 | create a new workspace layer in your |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 658 | <link linkend='build-directory'>Build Directory</link>. |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 659 | When you create a new workspace layer, it is populated with the |
| 660 | <filename>README</filename> file and the |
| 661 | <filename>conf</filename> directory only. |
| 662 | </para> |
| 663 | |
| 664 | <para> |
| 665 | The following example creates a new workspace layer in your |
| 666 | current working and by default names the workspace layer |
| 667 | "workspace": |
| 668 | <literallayout class='monospaced'> |
| 669 | $ devtool create-workspace |
| 670 | </literallayout> |
| 671 | </para> |
| 672 | |
| 673 | <para> |
| 674 | You can create a workspace layer anywhere by supplying |
| 675 | a pathname with the command. |
| 676 | The following command creates a new workspace layer named |
| 677 | "new-workspace": |
| 678 | <literallayout class='monospaced'> |
| 679 | $ devtool create-workspace /home/scottrif/new-workspace |
| 680 | </literallayout> |
| 681 | </para> |
| 682 | </section> |
| 683 | |
| 684 | <section id='devtool-get-the-status-of-the-recipes-in-your-workspace'> |
| 685 | <title>Get the Status of the Recipes in Your Workspace</title> |
| 686 | |
| 687 | <para> |
| 688 | Use the <filename>devtool status</filename> command to |
| 689 | list the recipes currently in your workspace. |
| 690 | Information includes the paths to their respective |
| 691 | external source trees. |
| 692 | </para> |
| 693 | |
| 694 | <para> |
| 695 | The <filename>devtool status</filename> command has no |
| 696 | command-line options: |
| 697 | <literallayout class='monospaced'> |
| 698 | $ devtool status |
| 699 | </literallayout> |
| 700 | Following is sample output after using |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 701 | <link linkend='devtool-adding-a-new-recipe-to-the-workspace'><filename>devtool add</filename></link> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 702 | to create and add the <filename>mtr_0.86.bb</filename> recipe |
| 703 | to the <filename>workspace</filename> directory: |
| 704 | <literallayout class='monospaced'> |
| 705 | $ devtool status |
| 706 | mtr: /home/scottrif/poky/build/workspace/sources/mtr (/home/scottrif/poky/build/workspace/recipes/mtr/mtr_0.86.bb) |
| 707 | $ |
| 708 | </literallayout> |
| 709 | </para> |
| 710 | </section> |
| 711 | |
| 712 | <section id='devtool-search-for-available-target-recipes'> |
| 713 | <title>Search for Available Target Recipes</title> |
| 714 | |
| 715 | <para> |
| 716 | Use the <filename>devtool search</filename> command to |
| 717 | search for available target recipes. |
| 718 | The command matches the recipe name, package name, |
| 719 | description, and installed files. |
| 720 | The command displays the recipe name as a result of a |
| 721 | match. |
| 722 | </para> |
| 723 | |
| 724 | <para> |
| 725 | When you use the <filename>devtool search</filename> command, |
| 726 | you must supply a <replaceable>keyword</replaceable>. |
| 727 | The command uses the <replaceable>keyword</replaceable> when |
| 728 | searching for a match. |
| 729 | </para> |
| 730 | </section> |
| 731 | </chapter> |
| 732 | <!-- |
| 733 | vim: expandtab tw=80 ts=4 |
| 734 | --> |