summaryrefslogtreecommitdiffstats
path: root/documentation/sdk-manual
diff options
context:
space:
mode:
authorMichael Opdenacker <michael.opdenacker@bootlin.com>2023-09-20 05:50:59 +0200
committerSteve Sakoman <steve@sakoman.com>2023-09-23 05:26:16 -1000
commitbdf0b48912155d9f2e14be864438a8b3e6d2aca1 (patch)
treeafba3634799613031653fddaa4c4fd710fcd3fd8 /documentation/sdk-manual
parentb099a1c252a8bd03bb882f6351f423b96648e921 (diff)
downloadpoky-bdf0b48912155d9f2e14be864438a8b3e6d2aca1.tar.gz
sdk-manual: extensible.rst: align with master branch
In particular, this addresses multiple formatting issues. Aligning with the master branch as all updates apply to kirkstone too. (From yocto-docs rev: 5e2ec35e3d63f9c73726122fe2b3dd6d6f85a77e) Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'documentation/sdk-manual')
-rw-r--r--documentation/sdk-manual/extensible.rst389
1 files changed, 202 insertions, 187 deletions
diff --git a/documentation/sdk-manual/extensible.rst b/documentation/sdk-manual/extensible.rst
index 18a2b59c96..355c6cb0e4 100644
--- a/documentation/sdk-manual/extensible.rst
+++ b/documentation/sdk-manual/extensible.rst
@@ -41,6 +41,44 @@ functionality.
41Installing the Extensible SDK 41Installing the Extensible SDK
42============================= 42=============================
43 43
44Two ways to install the Extensible SDK
45--------------------------------------
46
47Extensible SDK can be installed in two different ways, and both have
48their own pros and cons:
49
50#. *Setting up the Extensible SDK environment directly in a Yocto build*. This
51 avoids having to produce, test, distribute and maintain separate SDK
52 installer archives, which can get very large. There is only one environment
53 for the regular Yocto build and the SDK and less code paths where things can
54 go not according to plan. It's easier to update the SDK: it simply means
55 updating the Yocto layers with git fetch or layer management tooling. The
56 SDK extensibility is better than in the second option: just run ``bitbake``
57 again to add more things to the sysroot, or add layers if even more things
58 are required.
59
60#. *Setting up the Extensible SDK from a standalone installer*. This has the
61 benefit of having a single, self-contained archive that includes all the
62 needed binary artifacts. So nothing needs to be rebuilt, and there is no
63 need to provide a well-functioning binary artefact cache over the network
64 for developers with underpowered laptops.
65
66Setting up the Extensible SDK environment directly in a Yocto build
67-------------------------------------------------------------------
68
69#. Set up all the needed layers and a Yocto :term:`Build Directory`, e.g. a regular Yocto
70 build where ``bitbake`` can be executed.
71
72#. Run::
73
74 $ bitbake meta-ide-support
75 $ bitbake -c populate_sysroot gtk+3
76 # or any other target or native item that the application developer would need
77 $ bitbake build-sysroots
78
79Setting up the Extensible SDK from a standalone installer
80---------------------------------------------------------
81
44The first thing you need to do is install the SDK on your :term:`Build 82The first thing you need to do is install the SDK on your :term:`Build
45Host` by running the ``*.sh`` installation script. 83Host` by running the ``*.sh`` installation script.
46 84
@@ -102,16 +140,7 @@ must be writable for whichever users need to use the SDK.
102The following command shows how to run the installer given a toolchain 140The following command shows how to run the installer given a toolchain
103tarball for a 64-bit x86 development host system and a 64-bit x86 target 141tarball for a 64-bit x86 development host system and a 64-bit x86 target
104architecture. The example assumes the SDK installer is located in 142architecture. The example assumes the SDK installer is located in
105``~/Downloads/`` and has execution rights. 143``~/Downloads/`` and has execution rights::
106
107.. note::
108
109 If you do not have write permissions for the directory into which you
110 are installing the SDK, the installer notifies you and exits. For
111 that case, set up the proper permissions in the directory and run the
112 installer again.
113
114::
115 144
116 $ ./Downloads/poky-glibc-x86_64-core-image-minimal-core2-64-toolchain-ext-2.5.sh 145 $ ./Downloads/poky-glibc-x86_64-core-image-minimal-core2-64-toolchain-ext-2.5.sh
117 Poky (Yocto Project Reference Distro) Extensible SDK installer version 2.5 146 Poky (Yocto Project Reference Distro) Extensible SDK installer version 2.5
@@ -132,11 +161,23 @@ architecture. The example assumes the SDK installer is located in
132 Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g. 161 Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
133 $ . /home/scottrif/poky_sdk/environment-setup-core2-64-poky-linux 162 $ . /home/scottrif/poky_sdk/environment-setup-core2-64-poky-linux
134 163
164.. note::
165
166 If you do not have write permissions for the directory into which you
167 are installing the SDK, the installer notifies you and exits. For
168 that case, set up the proper permissions in the directory and run the
169 installer again.
170
135Running the Extensible SDK Environment Setup Script 171Running the Extensible SDK Environment Setup Script
136=================================================== 172===================================================
137 173
138Once you have the SDK installed, you must run the SDK environment setup 174Once you have the SDK installed, you must run the SDK environment setup
139script before you can actually use the SDK. This setup script resides in 175script before you can actually use the SDK.
176
177When using a SDK directly in a Yocto build, you will find the script in
178``tmp/deploy/images/qemux86-64/`` in your :term:`Build Directory`.
179
180When using a standalone SDK installer, this setup script resides in
140the directory you chose when you installed the SDK, which is either the 181the directory you chose when you installed the SDK, which is either the
141default ``poky_sdk`` directory or the directory you chose during 182default ``poky_sdk`` directory or the directory you chose during
142installation. 183installation.
@@ -154,11 +195,14 @@ script is for an IA-based target machine using i586 tuning::
154 SDK environment now set up; additionally you may now run devtool to perform development tasks. 195 SDK environment now set up; additionally you may now run devtool to perform development tasks.
155 Run devtool --help for further details. 196 Run devtool --help for further details.
156 197
157Running the setup script defines many environment variables needed in 198When using the environment script directly in a Yocto build, it can
158order to use the SDK (e.g. ``PATH``, 199be run similarly::
159:term:`CC`, 200
160:term:`LD`, and so forth). If you want to 201 $ source tmp/deploy/images/qemux86-64/environment-setup-core2-64-poky-linux
161see all the environment variables the script exports, examine the 202
203Running the setup script defines many environment variables needed in order to
204use the SDK (e.g. ``PATH``, :term:`CC`, :term:`LD`, and so forth). If you want
205to see all the environment variables the script exports, examine the
162installation file itself. 206installation file itself.
163 207
164Using ``devtool`` in Your SDK Workflow 208Using ``devtool`` in Your SDK Workflow
@@ -172,11 +216,8 @@ system.
172 216
173.. note:: 217.. note::
174 218
175 The use of 219 The use of ``devtool`` is not limited to the extensible SDK. You can use
176 devtool 220 ``devtool`` to help you easily develop any project whose build output must be
177 is not limited to the extensible SDK. You can use
178 devtool
179 to help you easily develop any project whose build output must be
180 part of an image built using the build system. 221 part of an image built using the build system.
181 222
182The ``devtool`` command line is organized similarly to 223The ``devtool`` command line is organized similarly to
@@ -186,15 +227,10 @@ all the commands.
186 227
187.. note:: 228.. note::
188 229
189 See the " 230 See the ":doc:`/ref-manual/devtool-reference`"
190 devtool 231 section in the Yocto Project Reference Manual.
191  Quick Reference
192 " in the Yocto Project Reference Manual for a
193 devtool
194 quick reference.
195 232
196Three ``devtool`` subcommands provide entry-points into 233Three ``devtool`` subcommands provide entry-points into development:
197development:
198 234
199- *devtool add*: Assists in adding new software to be built. 235- *devtool add*: Assists in adding new software to be built.
200 236
@@ -233,9 +269,9 @@ shows common development flows you would use with the ``devtool add``
233command: 269command:
234 270
235.. image:: figures/sdk-devtool-add-flow.png 271.. image:: figures/sdk-devtool-add-flow.png
236 :align: center 272 :width: 100%
237 273
2381. *Generating the New Recipe*: The top part of the flow shows three 274#. *Generating the New Recipe*: The top part of the flow shows three
239 scenarios by which you could use ``devtool add`` to generate a recipe 275 scenarios by which you could use ``devtool add`` to generate a recipe
240 based on existing source code. 276 based on existing source code.
241 277
@@ -252,7 +288,7 @@ command:
252 - *Left*: The left scenario in the figure represents a common 288 - *Left*: The left scenario in the figure represents a common
253 situation where the source code does not exist locally and needs 289 situation where the source code does not exist locally and needs
254 to be extracted. In this situation, the source code is extracted 290 to be extracted. In this situation, the source code is extracted
255 to the default workspace - you do not want the files in some 291 to the default workspace --- you do not want the files in some
256 specific location outside of the workspace. Thus, everything you 292 specific location outside of the workspace. Thus, everything you
257 need will be located in the workspace:: 293 need will be located in the workspace::
258 294
@@ -267,13 +303,12 @@ command:
267 - *Middle*: The middle scenario in the figure also represents a 303 - *Middle*: The middle scenario in the figure also represents a
268 situation where the source code does not exist locally. In this 304 situation where the source code does not exist locally. In this
269 case, the code is again upstream and needs to be extracted to some 305 case, the code is again upstream and needs to be extracted to some
270 local area - this time outside of the default workspace. 306 local area --- this time outside of the default workspace.
271 307
272 .. note:: 308 .. note::
273 309
274 If required, 310 If required, ``devtool`` always creates a Git repository locally
275 devtool 311 during the extraction.
276 always creates a Git repository locally during the extraction.
277 312
278 Furthermore, the first positional argument ``srctree`` in this case 313 Furthermore, the first positional argument ``srctree`` in this case
279 identifies where the ``devtool add`` command will locate the 314 identifies where the ``devtool add`` command will locate the
@@ -282,8 +317,7 @@ command:
282 317
283 $ devtool add recipe srctree fetchuri 318 $ devtool add recipe srctree fetchuri
284 319
285 In summary, 320 In summary, the source code is pulled from fetchuri and extracted into the
286 the source code is pulled from fetchuri and extracted into the
287 location defined by ``srctree`` as a local Git repository. 321 location defined by ``srctree`` as a local Git repository.
288 322
289 Within workspace, ``devtool`` creates a recipe named recipe along 323 Within workspace, ``devtool`` creates a recipe named recipe along
@@ -302,28 +336,26 @@ command:
302 recipe for the code and places the recipe into the workspace. 336 recipe for the code and places the recipe into the workspace.
303 337
304 Because the extracted source code already exists, ``devtool`` does 338 Because the extracted source code already exists, ``devtool`` does
305 not try to relocate the source code into the workspace - only the 339 not try to relocate the source code into the workspace --- only the
306 new recipe is placed in the workspace. 340 new recipe is placed in the workspace.
307 341
308 Aside from a recipe folder, the command also creates an associated 342 Aside from a recipe folder, the command also creates an associated
309 append folder and places an initial ``*.bbappend`` file within. 343 append folder and places an initial ``*.bbappend`` file within.
310 344
3112. *Edit the Recipe*: You can use ``devtool edit-recipe`` to open up the 345#. *Edit the Recipe*: You can use ``devtool edit-recipe`` to open up the
312 editor as defined by the ``$EDITOR`` environment variable and modify 346 editor as defined by the ``$EDITOR`` environment variable and modify
313 the file:: 347 the file::
314 348
315 $ devtool edit-recipe recipe 349 $ devtool edit-recipe recipe
316 350
317 From within the editor, you 351 From within the editor, you can make modifications to the recipe that
318 can make modifications to the recipe that take effect when you build 352 take effect when you build it later.
319 it later.
320 353
3213. *Build the Recipe or Rebuild the Image*: The next step you take 354#. *Build the Recipe or Rebuild the Image*: The next step you take
322 depends on what you are going to do with the new code. 355 depends on what you are going to do with the new code.
323 356
324 If you need to eventually move the build output to the target 357 If you need to eventually move the build output to the target
325 hardware, use the following ``devtool`` command: 358 hardware, use the following ``devtool`` command::
326 :;
327 359
328 $ devtool build recipe 360 $ devtool build recipe
329 361
@@ -334,7 +366,7 @@ command:
334 366
335 $ devtool build-image image 367 $ devtool build-image image
336 368
3374. *Deploy the Build Output*: When you use the ``devtool build`` command 369#. *Deploy the Build Output*: When you use the ``devtool build`` command
338 to build out your recipe, you probably want to see if the resulting 370 to build out your recipe, you probably want to see if the resulting
339 build output works as expected on the target hardware. 371 build output works as expected on the target hardware.
340 372
@@ -348,20 +380,22 @@ command:
348 development machine. 380 development machine.
349 381
350 You can deploy your build output to that target hardware by using the 382 You can deploy your build output to that target hardware by using the
351 ``devtool deploy-target`` command: $ devtool deploy-target recipe 383 ``devtool deploy-target`` command::
352 target The target is a live target machine running as an SSH server. 384
385 $ devtool deploy-target recipe target
386
387 The target is a live target machine running as an SSH server.
353 388
354 You can, of course, also deploy the image you build to actual 389 You can, of course, also deploy the image you build to actual
355 hardware by using the ``devtool build-image`` command. However, 390 hardware by using the ``devtool build-image`` command. However,
356 ``devtool`` does not provide a specific command that allows you to 391 ``devtool`` does not provide a specific command that allows you to
357 deploy the image to actual hardware. 392 deploy the image to actual hardware.
358 393
3595. *Finish Your Work With the Recipe*: The ``devtool finish`` command 394#. *Finish Your Work With the Recipe*: The ``devtool finish`` command
360 creates any patches corresponding to commits in the local Git 395 creates any patches corresponding to commits in the local Git
361 repository, moves the new recipe to a more permanent layer, and then 396 repository, moves the new recipe to a more permanent layer, and then
362 resets the recipe so that the recipe is built normally rather than 397 resets the recipe so that the recipe is built normally rather than
363 from the workspace. 398 from the workspace::
364 ::
365 399
366 $ devtool finish recipe layer 400 $ devtool finish recipe layer
367 401
@@ -379,11 +413,9 @@ command:
379 413
380 .. note:: 414 .. note::
381 415
382 You can use the 416 You can use the ``devtool reset`` command to put things back should you
383 devtool reset 417 decide you do not want to proceed with your work. If you do use this
384 command to put things back should you decide you do not want to 418 command, realize that the source tree is preserved.
385 proceed with your work. If you do use this command, realize that
386 the source tree is preserved.
387 419
388Use ``devtool modify`` to Modify the Source of an Existing Component 420Use ``devtool modify`` to Modify the Source of an Existing Component
389-------------------------------------------------------------------- 421--------------------------------------------------------------------
@@ -401,9 +433,9 @@ diagram shows common development flows for the ``devtool modify``
401command: 433command:
402 434
403.. image:: figures/sdk-devtool-modify-flow.png 435.. image:: figures/sdk-devtool-modify-flow.png
404 :align: center 436 :width: 100%
405 437
4061. *Preparing to Modify the Code*: The top part of the flow shows three 438#. *Preparing to Modify the Code*: The top part of the flow shows three
407 scenarios by which you could use ``devtool modify`` to prepare to 439 scenarios by which you could use ``devtool modify`` to prepare to
408 work on source files. Each scenario assumes the following: 440 work on source files. Each scenario assumes the following:
409 441
@@ -430,11 +462,9 @@ command:
430 462
431 $ devtool modify recipe 463 $ devtool modify recipe
432 464
433 Once 465 Once ``devtool`` locates the recipe, ``devtool`` uses the recipe's
434 ``devtool``\ locates the recipe, ``devtool`` uses the recipe's 466 :term:`SRC_URI` statements to locate the source code and any local
435 :term:`SRC_URI` statements to 467 patch files from other developers.
436 locate the source code and any local patch files from other
437 developers.
438 468
439 With this scenario, there is no ``srctree`` argument. Consequently, the 469 With this scenario, there is no ``srctree`` argument. Consequently, the
440 default behavior of the ``devtool modify`` command is to extract 470 default behavior of the ``devtool modify`` command is to extract
@@ -470,11 +500,7 @@ command:
470 500
471 .. note:: 501 .. note::
472 502
473 You cannot provide a URL for 503 You cannot provide a URL for ``srctree`` using the ``devtool`` command.
474 srctree
475 using the
476 devtool
477 command.
478 504
479 As with all extractions, the command uses the recipe's :term:`SRC_URI` 505 As with all extractions, the command uses the recipe's :term:`SRC_URI`
480 statements to locate the source files and any associated patch 506 statements to locate the source files and any associated patch
@@ -512,11 +538,11 @@ command:
512 append file for the recipe in the ``devtool`` workspace. The 538 append file for the recipe in the ``devtool`` workspace. The
513 recipe and the source code remain in their original locations. 539 recipe and the source code remain in their original locations.
514 540
5152. *Edit the Source*: Once you have used the ``devtool modify`` command, 541#. *Edit the Source*: Once you have used the ``devtool modify`` command,
516 you are free to make changes to the source files. You can use any 542 you are free to make changes to the source files. You can use any
517 editor you like to make and save your source code modifications. 543 editor you like to make and save your source code modifications.
518 544
5193. *Build the Recipe or Rebuild the Image*: The next step you take 545#. *Build the Recipe or Rebuild the Image*: The next step you take
520 depends on what you are going to do with the new code. 546 depends on what you are going to do with the new code.
521 547
522 If you need to eventually move the build output to the target 548 If you need to eventually move the build output to the target
@@ -527,9 +553,11 @@ command:
527 On the other hand, if you want an image to contain the recipe's 553 On the other hand, if you want an image to contain the recipe's
528 packages from the workspace for immediate deployment onto a device 554 packages from the workspace for immediate deployment onto a device
529 (e.g. for testing purposes), you can use the ``devtool build-image`` 555 (e.g. for testing purposes), you can use the ``devtool build-image``
530 command: $ devtool build-image image 556 command::
557
558 $ devtool build-image image
531 559
5324. *Deploy the Build Output*: When you use the ``devtool build`` command 560#. *Deploy the Build Output*: When you use the ``devtool build`` command
533 to build out your recipe, you probably want to see if the resulting 561 to build out your recipe, you probably want to see if the resulting
534 build output works as expected on target hardware. 562 build output works as expected on target hardware.
535 563
@@ -554,13 +582,12 @@ command:
554 ``devtool`` does not provide a specific command to deploy the image 582 ``devtool`` does not provide a specific command to deploy the image
555 to actual hardware. 583 to actual hardware.
556 584
5575. *Finish Your Work With the Recipe*: The ``devtool finish`` command 585#. *Finish Your Work With the Recipe*: The ``devtool finish`` command
558 creates any patches corresponding to commits in the local Git 586 creates any patches corresponding to commits in the local Git
559 repository, updates the recipe to point to them (or creates a 587 repository, updates the recipe to point to them (or creates a
560 ``.bbappend`` file to do so, depending on the specified destination 588 ``.bbappend`` file to do so, depending on the specified destination
561 layer), and then resets the recipe so that the recipe is built 589 layer), and then resets the recipe so that the recipe is built
562 normally rather than from the workspace. 590 normally rather than from the workspace::
563 ::
564 591
565 $ devtool finish recipe layer 592 $ devtool finish recipe layer
566 593
@@ -568,8 +595,7 @@ command:
568 595
569 Any changes you want to turn into patches must be staged and 596 Any changes you want to turn into patches must be staged and
570 committed within the local Git repository before you use the 597 committed within the local Git repository before you use the
571 devtool finish 598 ``devtool finish`` command.
572 command.
573 599
574 Because there is no need to move the recipe, ``devtool finish`` 600 Because there is no need to move the recipe, ``devtool finish``
575 either updates the original recipe in the original layer or the 601 either updates the original recipe in the original layer or the
@@ -584,11 +610,9 @@ command:
584 610
585 .. note:: 611 .. note::
586 612
587 You can use the 613 You can use the ``devtool reset`` command to put things back should you
588 devtool reset 614 decide you do not want to proceed with your work. If you do use this
589 command to put things back should you decide you do not want to 615 command, realize that the source tree is preserved.
590 proceed with your work. If you do use this command, realize that
591 the source tree is preserved.
592 616
593Use ``devtool upgrade`` to Create a Version of the Recipe that Supports a Newer Version of the Software 617Use ``devtool upgrade`` to Create a Version of the Recipe that Supports a Newer Version of the Software
594------------------------------------------------------------------------------------------------------- 618-------------------------------------------------------------------------------------------------------
@@ -602,27 +626,25 @@ counterparts.
602 626
603.. note:: 627.. note::
604 628
605 Several methods exist by which you can upgrade recipes - 629 Several methods exist by which you can upgrade recipes ---
606 ``devtool upgrade`` 630 ``devtool upgrade`` happens to be one. You can read about all the methods by
607 happens to be one. You can read about all the methods by which you 631 which you can upgrade recipes in the
608 can upgrade recipes in the 632 :ref:`dev-manual/upgrading-recipes:upgrading recipes` section of the Yocto
609 :ref:`dev-manual/upgrading-recipes:upgrading recipes` section 633 Project Development Tasks Manual.
610 of the Yocto Project Development Tasks Manual.
611 634
612The ``devtool upgrade`` command is flexible enough to allow you to 635The ``devtool upgrade`` command is flexible enough to allow you to specify
613specify source code revision and versioning schemes, extract code into 636source code revision and versioning schemes, extract code into or out of the
614or out of the ``devtool`` 637``devtool`` :ref:`devtool-the-workspace-layer-structure`, and work with any
615:ref:`devtool-the-workspace-layer-structure`, 638source file forms that the
616and work with any source file forms that the 639:ref:`bitbake-user-manual/bitbake-user-manual-fetching:fetchers` support.
617:ref:`bitbake:bitbake-user-manual/bitbake-user-manual-fetching:fetchers` support.
618 640
619The following diagram shows the common development flow used with the 641The following diagram shows the common development flow used with the
620``devtool upgrade`` command: 642``devtool upgrade`` command:
621 643
622.. image:: figures/sdk-devtool-upgrade-flow.png 644.. image:: figures/sdk-devtool-upgrade-flow.png
623 :align: center 645 :width: 100%
624 646
6251. *Initiate the Upgrade*: The top part of the flow shows the typical 647#. *Initiate the Upgrade*: The top part of the flow shows the typical
626 scenario by which you use the ``devtool upgrade`` command. The 648 scenario by which you use the ``devtool upgrade`` command. The
627 following conditions exist: 649 following conditions exist:
628 650
@@ -674,7 +696,7 @@ The following diagram shows the common development flow used with the
674 are incorporated into the build the next time you build the software 696 are incorporated into the build the next time you build the software
675 just as are other changes you might have made to the source. 697 just as are other changes you might have made to the source.
676 698
6772. *Resolve any Conflicts created by the Upgrade*: Conflicts could happen 699#. *Resolve any Conflicts created by the Upgrade*: Conflicts could happen
678 after upgrading the software to a new version. Conflicts occur 700 after upgrading the software to a new version. Conflicts occur
679 if your recipe specifies some patch files in :term:`SRC_URI` that 701 if your recipe specifies some patch files in :term:`SRC_URI` that
680 conflict with changes made in the new version of the software. For 702 conflict with changes made in the new version of the software. For
@@ -685,7 +707,7 @@ The following diagram shows the common development flow used with the
685 conflicts created through use of a newer or different version of the 707 conflicts created through use of a newer or different version of the
686 software. 708 software.
687 709
6883. *Build the Recipe or Rebuild the Image*: The next step you take 710#. *Build the Recipe or Rebuild the Image*: The next step you take
689 depends on what you are going to do with the new code. 711 depends on what you are going to do with the new code.
690 712
691 If you need to eventually move the build output to the target 713 If you need to eventually move the build output to the target
@@ -700,7 +722,7 @@ The following diagram shows the common development flow used with the
700 722
701 $ devtool build-image image 723 $ devtool build-image image
702 724
7034. *Deploy the Build Output*: When you use the ``devtool build`` command 725#. *Deploy the Build Output*: When you use the ``devtool build`` command
704 or ``bitbake`` to build your recipe, you probably want to see if the 726 or ``bitbake`` to build your recipe, you probably want to see if the
705 resulting build output works as expected on target hardware. 727 resulting build output works as expected on target hardware.
706 728
@@ -714,15 +736,18 @@ The following diagram shows the common development flow used with the
714 development machine. 736 development machine.
715 737
716 You can deploy your build output to that target hardware by using the 738 You can deploy your build output to that target hardware by using the
717 ``devtool deploy-target`` command: $ devtool deploy-target recipe 739 ``devtool deploy-target`` command::
718 target The target is a live target machine running as an SSH server. 740
741 $ devtool deploy-target recipe target
742
743 The target is a live target machine running as an SSH server.
719 744
720 You can, of course, also deploy the image you build using the 745 You can, of course, also deploy the image you build using the
721 ``devtool build-image`` command to actual hardware. However, 746 ``devtool build-image`` command to actual hardware. However,
722 ``devtool`` does not provide a specific command that allows you to do 747 ``devtool`` does not provide a specific command that allows you to do
723 this. 748 this.
724 749
7255. *Finish Your Work With the Recipe*: The ``devtool finish`` command 750#. *Finish Your Work With the Recipe*: The ``devtool finish`` command
726 creates any patches corresponding to commits in the local Git 751 creates any patches corresponding to commits in the local Git
727 repository, moves the new recipe to a more permanent layer, and then 752 repository, moves the new recipe to a more permanent layer, and then
728 resets the recipe so that the recipe is built normally rather than 753 resets the recipe so that the recipe is built normally rather than
@@ -734,8 +759,7 @@ The following diagram shows the common development flow used with the
734 759
735 If you specify a destination layer that is the same as the original 760 If you specify a destination layer that is the same as the original
736 source, then the old version of the recipe and associated files are 761 source, then the old version of the recipe and associated files are
737 removed prior to adding the new version. 762 removed prior to adding the new version::
738 ::
739 763
740 $ devtool finish recipe layer 764 $ devtool finish recipe layer
741 765
@@ -750,11 +774,9 @@ The following diagram shows the common development flow used with the
750 774
751 .. note:: 775 .. note::
752 776
753 You can use the 777 You can use the ``devtool reset`` command to put things back should you
754 devtool reset 778 decide you do not want to proceed with your work. If you do use this
755 command to put things back should you decide you do not want to 779 command, realize that the source tree is preserved.
756 proceed with your work. If you do use this command, realize that
757 the source tree is preserved.
758 780
759A Closer Look at ``devtool add`` 781A Closer Look at ``devtool add``
760================================ 782================================
@@ -822,10 +844,9 @@ run ``devtool add`` again and provide the name or the version.
822Dependency Detection and Mapping 844Dependency Detection and Mapping
823-------------------------------- 845--------------------------------
824 846
825The ``devtool add`` command attempts to detect build-time dependencies 847The ``devtool add`` command attempts to detect build-time dependencies and map
826and map them to other recipes in the system. During this mapping, the 848them to other recipes in the system. During this mapping, the command fills in
827command fills in the names of those recipes as part of the 849the names of those recipes as part of the :term:`DEPENDS` variable within the
828:term:`DEPENDS` variable within the
829recipe. If a dependency cannot be mapped, ``devtool`` places a comment 850recipe. If a dependency cannot be mapped, ``devtool`` places a comment
830in the recipe indicating such. The inability to map a dependency can 851in the recipe indicating such. The inability to map a dependency can
831result from naming not being recognized or because the dependency simply 852result from naming not being recognized or because the dependency simply
@@ -842,10 +863,8 @@ following to your recipe::
842 863
843.. note:: 864.. note::
844 865
845 The 866 The ``devtool add`` command often cannot distinguish between mandatory and
846 devtool add 867 optional dependencies. Consequently, some of the detected dependencies might
847 command often cannot distinguish between mandatory and optional
848 dependencies. Consequently, some of the detected dependencies might
849 in fact be optional. When in doubt, consult the documentation or the 868 in fact be optional. When in doubt, consult the documentation or the
850 configure script for the software the recipe is building for further 869 configure script for the software the recipe is building for further
851 details. In some cases, you might find you can substitute the 870 details. In some cases, you might find you can substitute the
@@ -855,16 +874,14 @@ following to your recipe::
855License Detection 874License Detection
856----------------- 875-----------------
857 876
858The ``devtool add`` command attempts to determine if the software you 877The ``devtool add`` command attempts to determine if the software you are
859are adding is able to be distributed under a common, open-source 878adding is able to be distributed under a common, open-source license. If
860license. If so, the command sets the 879so, the command sets the :term:`LICENSE` value accordingly.
861:term:`LICENSE` value accordingly.
862You should double-check the value added by the command against the 880You should double-check the value added by the command against the
863documentation or source files for the software you are building and, if 881documentation or source files for the software you are building and, if
864necessary, update that :term:`LICENSE` value. 882necessary, update that :term:`LICENSE` value.
865 883
866The ``devtool add`` command also sets the 884The ``devtool add`` command also sets the :term:`LIC_FILES_CHKSUM`
867:term:`LIC_FILES_CHKSUM`
868value to point to all files that appear to be license-related. Realize 885value to point to all files that appear to be license-related. Realize
869that license statements often appear in comments at the top of source 886that license statements often appear in comments at the top of source
870files or within the documentation. In such cases, the command does not 887files or within the documentation. In such cases, the command does not
@@ -944,10 +961,9 @@ mind:
944Adding Native Tools 961Adding Native Tools
945------------------- 962-------------------
946 963
947Often, you need to build additional tools that run on the :term:`Build 964Often, you need to build additional tools that run on the :term:`Build Host`
948Host` as opposed to 965as opposed to the target. You should indicate this requirement by using one of
949the target. You should indicate this requirement by using one of the 966the following methods when you run ``devtool add``:
950following methods when you run ``devtool add``:
951 967
952- Specify the name of the recipe such that it ends with "-native". 968- Specify the name of the recipe such that it ends with "-native".
953 Specifying the name like this produces a recipe that only builds for 969 Specifying the name like this produces a recipe that only builds for
@@ -971,8 +987,7 @@ Adding Node.js Modules
971---------------------- 987----------------------
972 988
973You can use the ``devtool add`` command two different ways to add 989You can use the ``devtool add`` command two different ways to add
974Node.js modules: 1) Through ``npm`` and, 2) from a repository or local 990Node.js modules: through ``npm`` or from a repository or local source.
975source.
976 991
977Use the following form to add Node.js modules through ``npm``:: 992Use the following form to add Node.js modules through ``npm``::
978 993
@@ -987,7 +1002,7 @@ these behaviors ensure the reproducibility and integrity of the build.
987 1002
988.. note:: 1003.. note::
989 1004
990 - You must use quotes around the URL. The ``devtool add`` does not 1005 - You must use quotes around the URL. ``devtool add`` does not
991 require the quotes, but the shell considers ";" as a splitter 1006 require the quotes, but the shell considers ";" as a splitter
992 between multiple commands. Thus, without the quotes, 1007 between multiple commands. Thus, without the quotes,
993 ``devtool add`` does not receive the other parts, which results in 1008 ``devtool add`` does not receive the other parts, which results in
@@ -1002,9 +1017,8 @@ repository or local source tree. To add modules this way, use
1002 1017
1003 $ devtool add https://github.com/diversario/node-ssdp 1018 $ devtool add https://github.com/diversario/node-ssdp
1004 1019
1005In this example, ``devtool`` 1020In this example, ``devtool`` fetches the specified Git repository, detects the
1006fetches the specified Git repository, detects the code as Node.js code, 1021code as Node.js code, fetches dependencies using ``npm``, and sets
1007fetches dependencies using ``npm``, and sets
1008:term:`SRC_URI` accordingly. 1022:term:`SRC_URI` accordingly.
1009 1023
1010Working With Recipes 1024Working With Recipes
@@ -1013,17 +1027,17 @@ Working With Recipes
1013When building a recipe using the ``devtool build`` command, the typical 1027When building a recipe using the ``devtool build`` command, the typical
1014build progresses as follows: 1028build progresses as follows:
1015 1029
10161. Fetch the source 1030#. Fetch the source
1017 1031
10182. Unpack the source 1032#. Unpack the source
1019 1033
10203. Configure the source 1034#. Configure the source
1021 1035
10224. Compile the source 1036#. Compile the source
1023 1037
10245. Install the build output 1038#. Install the build output
1025 1039
10266. Package the installed output 1040#. Package the installed output
1027 1041
1028For recipes in the workspace, fetching and unpacking is disabled as the 1042For recipes in the workspace, fetching and unpacking is disabled as the
1029source tree has already been prepared and is persistent. Each of these 1043source tree has already been prepared and is persistent. Each of these
@@ -1038,9 +1052,8 @@ does not include complete instructions for building the software.
1038Instead, common functionality is encapsulated in classes inherited with 1052Instead, common functionality is encapsulated in classes inherited with
1039the ``inherit`` directive. This technique leaves the recipe to describe 1053the ``inherit`` directive. This technique leaves the recipe to describe
1040just the things that are specific to the software being built. There is 1054just the things that are specific to the software being built. There is
1041a :ref:`base <ref-classes-base>` class that 1055a :ref:`ref-classes-base` class that is implicitly inherited by all recipes
1042is implicitly inherited by all recipes and provides the functionality 1056and provides the functionality that most recipes typically need.
1043that most recipes typically need.
1044 1057
1045The remainder of this section presents information useful when working 1058The remainder of this section presents information useful when working
1046with recipes. 1059with recipes.
@@ -1066,7 +1079,7 @@ links created within the source tree:
1066 ``${``\ :term:`D`\ ``}``. 1079 ``${``\ :term:`D`\ ``}``.
1067 1080
1068 - ``sysroot-destdir/``: Contains a subset of files installed within 1081 - ``sysroot-destdir/``: Contains a subset of files installed within
1069 ``do_install`` that have been put into the shared sysroot. For 1082 :ref:`ref-tasks-install` that have been put into the shared sysroot. For
1070 more information, see the 1083 more information, see the
1071 ":ref:`dev-manual/new-recipe:sharing files between recipes`" section. 1084 ":ref:`dev-manual/new-recipe:sharing files between recipes`" section.
1072 1085
@@ -1082,18 +1095,13 @@ Setting Configure Arguments
1082 1095
1083If the software your recipe is building uses GNU autoconf, then a fixed 1096If the software your recipe is building uses GNU autoconf, then a fixed
1084set of arguments is passed to it to enable cross-compilation plus any 1097set of arguments is passed to it to enable cross-compilation plus any
1085extras specified by 1098extras specified by :term:`EXTRA_OECONF` or :term:`PACKAGECONFIG_CONFARGS`
1086:term:`EXTRA_OECONF` or
1087:term:`PACKAGECONFIG_CONFARGS`
1088set within the recipe. If you wish to pass additional options, add them 1099set within the recipe. If you wish to pass additional options, add them
1089to :term:`EXTRA_OECONF` or :term:`PACKAGECONFIG_CONFARGS`. Other supported build 1100to :term:`EXTRA_OECONF` or :term:`PACKAGECONFIG_CONFARGS`. Other supported build
1090tools have similar variables (e.g. 1101tools have similar variables (e.g. :term:`EXTRA_OECMAKE` for CMake,
1091:term:`EXTRA_OECMAKE` for 1102:term:`EXTRA_OESCONS` for Scons, and so forth). If you need to pass anything on
1092CMake, :term:`EXTRA_OESCONS` 1103the ``make`` command line, you can use :term:`EXTRA_OEMAKE` or the
1093for Scons, and so forth). If you need to pass anything on the ``make`` 1104:term:`PACKAGECONFIG_CONFARGS` variables to do so.
1094command line, you can use :term:`EXTRA_OEMAKE` or the
1095:term:`PACKAGECONFIG_CONFARGS`
1096variables to do so.
1097 1105
1098You can use the ``devtool configure-help`` command to help you set the 1106You can use the ``devtool configure-help`` command to help you set the
1099arguments listed in the previous paragraph. The command determines the 1107arguments listed in the previous paragraph. The command determines the
@@ -1117,8 +1125,7 @@ the build host.
1117 1125
1118Recipes should never write files directly into the sysroot. Instead, 1126Recipes should never write files directly into the sysroot. Instead,
1119files should be installed into standard locations during the 1127files should be installed into standard locations during the
1120:ref:`ref-tasks-install` task within 1128:ref:`ref-tasks-install` task within the ``${``\ :term:`D`\ ``}`` directory. A
1121the ``${``\ :term:`D`\ ``}`` directory. A
1122subset of these files automatically goes into the sysroot. The reason 1129subset of these files automatically goes into the sysroot. The reason
1123for this limitation is that almost all files that go into the sysroot 1130for this limitation is that almost all files that go into the sysroot
1124are cataloged in manifests in order to ensure they can be removed later 1131are cataloged in manifests in order to ensure they can be removed later
@@ -1134,14 +1141,12 @@ the target device, it is important to understand packaging because the
1134contents of the image are expressed in terms of packages and not 1141contents of the image are expressed in terms of packages and not
1135recipes. 1142recipes.
1136 1143
1137During the :ref:`ref-tasks-package` 1144During the :ref:`ref-tasks-package` task, files installed during the
1138task, files installed during the 1145:ref:`ref-tasks-install` task are split into one main package, which is almost
1139:ref:`ref-tasks-install` task are 1146always named the same as the recipe, and into several other packages. This
1140split into one main package, which is almost always named the same as 1147separation exists because not all of those installed files are useful in every
1141the recipe, and into several other packages. This separation exists 1148image. For example, you probably do not need any of the documentation installed
1142because not all of those installed files are useful in every image. For 1149in a production image. Consequently, for each recipe the documentation
1143example, you probably do not need any of the documentation installed in
1144a production image. Consequently, for each recipe the documentation
1145files are separated into a ``-doc`` package. Recipes that package 1150files are separated into a ``-doc`` package. Recipes that package
1146software containing optional modules or plugins might undergo additional 1151software containing optional modules or plugins might undergo additional
1147package splitting as well. 1152package splitting as well.
@@ -1149,8 +1154,7 @@ package splitting as well.
1149After building a recipe, you can see where files have gone by looking in 1154After building a recipe, you can see where files have gone by looking in
1150the ``oe-workdir/packages-split`` directory, which contains a 1155the ``oe-workdir/packages-split`` directory, which contains a
1151subdirectory for each package. Apart from some advanced cases, the 1156subdirectory for each package. Apart from some advanced cases, the
1152:term:`PACKAGES` and 1157:term:`PACKAGES` and :term:`FILES` variables controls
1153:term:`FILES` variables controls
1154splitting. The :term:`PACKAGES` variable lists all of the packages to be 1158splitting. The :term:`PACKAGES` variable lists all of the packages to be
1155produced, while the :term:`FILES` variable specifies which files to include 1159produced, while the :term:`FILES` variable specifies which files to include
1156in each package by using an override to specify the package. For 1160in each package by using an override to specify the package. For
@@ -1192,16 +1196,11 @@ target machine.
1192 1196
1193.. note:: 1197.. note::
1194 1198
1195 The 1199 The ``devtool deploy-target`` and ``devtool undeploy-target`` commands do
1196 devtool deploy-target 1200 not currently interact with any package management system on the target
1197 and 1201 device (e.g. RPM or OPKG). Consequently, you should not intermingle
1198 devtool undeploy-target 1202 ``devtool deploy-target`` and package manager operations on the target
1199 commands do not currently interact with any package management system 1203 device. Doing so could result in a conflicting set of files.
1200 on the target device (e.g. RPM or OPKG). Consequently, you should not
1201 intermingle
1202 devtool deploy-target
1203 and package manager operations on the target device. Doing so could
1204 result in a conflicting set of files.
1205 1204
1206Installing Additional Items Into the Extensible SDK 1205Installing Additional Items Into the Extensible SDK
1207=================================================== 1206===================================================
@@ -1215,9 +1214,25 @@ need to link to libGL but you are not sure which recipe provides libGL.
1215You can use the following command to find out:: 1214You can use the following command to find out::
1216 1215
1217 $ devtool search libGL mesa 1216 $ devtool search libGL mesa
1217 A free implementation of the OpenGL API
1218
1219Once you know the recipe
1220(i.e. ``mesa`` in this example), you can install it.
1218 1221
1219A free implementation of the OpenGL API Once you know the recipe 1222When using the extensible SDK directly in a Yocto build
1220(i.e. ``mesa`` in this example), you can install it:: 1223-------------------------------------------------------
1224
1225In this scenario, the Yocto build tooling, e.g. ``bitbake``
1226is directly accessible to build additional items, and it
1227can simply be executed directly::
1228
1229 $ bitbake mesa
1230 $ bitbake build-sysroots
1231
1232When using a standalone installer for the Extensible SDK
1233--------------------------------------------------------
1234
1235::
1221 1236
1222 $ devtool sdk-install mesa 1237 $ devtool sdk-install mesa
1223 1238
@@ -1244,13 +1259,13 @@ To update your installed SDK, use ``devtool`` as follows::
1244 1259
1245 $ devtool sdk-update 1260 $ devtool sdk-update
1246 1261
1247The previous command assumes your SDK provider has set the 1262The previous command assumes your SDK provider has set the default update URL
1248default update URL for you through the :term:`SDK_UPDATE_URL` 1263for you through the :term:`SDK_UPDATE_URL` variable as described in the
1249variable as described in the
1250":ref:`sdk-manual/appendix-customizing:Providing Updates to the Extensible SDK After Installation`" 1264":ref:`sdk-manual/appendix-customizing:Providing Updates to the Extensible SDK After Installation`"
1251section. If the SDK provider has not set that default URL, you need to 1265section. If the SDK provider has not set that default URL, you need to
1252specify it yourself in the command as follows: $ devtool sdk-update 1266specify it yourself in the command as follows::
1253path_to_update_directory 1267
1268 $ devtool sdk-update path_to_update_directory
1254 1269
1255.. note:: 1270.. note::
1256 1271
@@ -1267,15 +1282,15 @@ those customers need an SDK that has custom libraries. In such a case,
1267you can produce a derivative SDK based on the currently installed SDK 1282you can produce a derivative SDK based on the currently installed SDK
1268fairly easily by following these steps: 1283fairly easily by following these steps:
1269 1284
12701. If necessary, install an extensible SDK that you want to use as a 1285#. If necessary, install an extensible SDK that you want to use as a
1271 base for your derivative SDK. 1286 base for your derivative SDK.
1272 1287
12732. Source the environment script for the SDK. 1288#. Source the environment script for the SDK.
1274 1289
12753. Add the extra libraries or other components you want by using the 1290#. Add the extra libraries or other components you want by using the
1276 ``devtool add`` command. 1291 ``devtool add`` command.
1277 1292
12784. Run the ``devtool build-sdk`` command. 1293#. Run the ``devtool build-sdk`` command.
1279 1294
1280The previous steps take the recipes added to the workspace and construct 1295The previous steps take the recipes added to the workspace and construct
1281a new SDK installer that contains those recipes and the resulting binary 1296a new SDK installer that contains those recipes and the resulting binary