summaryrefslogtreecommitdiffstats
path: root/documentation/dev-manual/common-tasks.rst
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/dev-manual/common-tasks.rst')
-rw-r--r--documentation/dev-manual/common-tasks.rst1020
1 files changed, 340 insertions, 680 deletions
diff --git a/documentation/dev-manual/common-tasks.rst b/documentation/dev-manual/common-tasks.rst
index b3ee2b13b4..dcd3a11c3e 100644
--- a/documentation/dev-manual/common-tasks.rst
+++ b/documentation/dev-manual/common-tasks.rst
@@ -49,15 +49,13 @@ Follow these general steps to create your layer without using tools:
49 (e.g. the cloned ``poky`` repository). 49 (e.g. the cloned ``poky`` repository).
50 50
51 While not strictly required, prepend the name of the directory with 51 While not strictly required, prepend the name of the directory with
52 the string "meta-". For example: 52 the string "meta-". For example::
53 ::
54 53
55 meta-mylayer 54 meta-mylayer
56 meta-GUI_xyz 55 meta-GUI_xyz
57 meta-mymachine 56 meta-mymachine
58 57
59 With rare exceptions, a layer's name follows this form: 58 With rare exceptions, a layer's name follows this form::
60 ::
61 59
62 meta-root_name 60 meta-root_name
63 61
@@ -77,8 +75,7 @@ Follow these general steps to create your layer without using tools:
77 :yocto_git:`Source Repositories </poky/tree/meta-yocto-bsp/conf>` 75 :yocto_git:`Source Repositories </poky/tree/meta-yocto-bsp/conf>`
78 demonstrates the required syntax. For your layer, you need to replace 76 demonstrates the required syntax. For your layer, you need to replace
79 "yoctobsp" with a unique identifier for your layer (e.g. "machinexyz" 77 "yoctobsp" with a unique identifier for your layer (e.g. "machinexyz"
80 for a layer named "meta-machinexyz"): 78 for a layer named "meta-machinexyz")::
81 ::
82 79
83 # We have a conf and classes directory, add to BBPATH 80 # We have a conf and classes directory, add to BBPATH
84 BBPATH .= ":${LAYERDIR}" 81 BBPATH .= ":${LAYERDIR}"
@@ -195,8 +192,7 @@ following list:
195 machine "one". To do so, you use an append file named 192 machine "one". To do so, you use an append file named
196 ``base-files.bbappend`` and create a dependency on "foo" by 193 ``base-files.bbappend`` and create a dependency on "foo" by
197 altering the :term:`DEPENDS` 194 altering the :term:`DEPENDS`
198 variable: 195 variable::
199 ::
200 196
201 DEPENDS = "foo" 197 DEPENDS = "foo"
202 198
@@ -209,14 +205,12 @@ following list:
209 ``foo``. 205 ``foo``.
210 206
211 To make sure your changes apply only when building machine "one", 207 To make sure your changes apply only when building machine "one",
212 use a machine override with the ``DEPENDS`` statement: 208 use a machine override with the ``DEPENDS`` statement::
213 ::
214 209
215 DEPENDS_one = "foo" 210 DEPENDS_one = "foo"
216 211
217 You should follow the same strategy when using ``_append`` 212 You should follow the same strategy when using ``_append``
218 and ``_prepend`` operations: 213 and ``_prepend`` operations::
219 ::
220 214
221 DEPENDS_append_one = " foo" 215 DEPENDS_append_one = " foo"
222 DEPENDS_prepend_one = "foo " 216 DEPENDS_prepend_one = "foo "
@@ -224,8 +218,7 @@ following list:
224 As an actual example, here's a 218 As an actual example, here's a
225 snippet from the generic kernel include file ``linux-yocto.inc``, 219 snippet from the generic kernel include file ``linux-yocto.inc``,
226 wherein the kernel compile and link options are adjusted in the 220 wherein the kernel compile and link options are adjusted in the
227 case of a subset of the supported architectures: 221 case of a subset of the supported architectures::
228 ::
229 222
230 DEPENDS_append_aarch64 = " libgcc" 223 DEPENDS_append_aarch64 = " libgcc"
231 KERNEL_CC_append_aarch64 = " ${TOOLCHAIN_OPTIONS}" 224 KERNEL_CC_append_aarch64 = " ${TOOLCHAIN_OPTIONS}"
@@ -252,8 +245,7 @@ following list:
252 file, you can use an append file to cause the build to use your 245 file, you can use an append file to cause the build to use your
253 own version of the file. For example, an append file in your layer 246 own version of the file. For example, an append file in your layer
254 at ``meta-one/recipes-core/base-files/base-files.bbappend`` could 247 at ``meta-one/recipes-core/base-files/base-files.bbappend`` could
255 extend :term:`FILESPATH` using :term:`FILESEXTRAPATHS` as follows: 248 extend :term:`FILESPATH` using :term:`FILESEXTRAPATHS` as follows::
256 ::
257 249
258 FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" 250 FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
259 251
@@ -375,8 +367,7 @@ the COMMON and DISTRO related tests. Furthermore, if your layer is a BSP
375layer, the layer must pass the COMMON and BSP set of tests. 367layer, the layer must pass the COMMON and BSP set of tests.
376 368
377To execute the script, enter the following commands from your build 369To execute the script, enter the following commands from your build
378directory: 370directory::
379::
380 371
381 $ source oe-init-build-env 372 $ source oe-init-build-env
382 $ yocto-check-layer your_layer_directory 373 $ yocto-check-layer your_layer_directory
@@ -432,8 +423,7 @@ enable it. To enable your layer, simply add your layer's path to the
432``BBLAYERS`` variable in your ``conf/bblayers.conf`` file, which is 423``BBLAYERS`` variable in your ``conf/bblayers.conf`` file, which is
433found in the :term:`Build Directory`. 424found in the :term:`Build Directory`.
434The following example shows how to enable a layer named 425The following example shows how to enable a layer named
435``meta-mylayer``: 426``meta-mylayer``::
436::
437 427
438 # POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf 428 # POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
439 # changes incompatibly 429 # changes incompatibly
@@ -488,8 +478,7 @@ As an example, consider the main formfactor recipe and a corresponding
488formfactor append file both from the :term:`Source Directory`. 478formfactor append file both from the :term:`Source Directory`.
489Here is the main 479Here is the main
490formfactor recipe, which is named ``formfactor_0.0.bb`` and located in 480formfactor recipe, which is named ``formfactor_0.0.bb`` and located in
491the "meta" layer at ``meta/recipes-bsp/formfactor``: 481the "meta" layer at ``meta/recipes-bsp/formfactor``::
492::
493 482
494 SUMMARY = "Device formfactor information" 483 SUMMARY = "Device formfactor information"
495 DESCRIPTION = "A formfactor configuration file provides information about the \ 484 DESCRIPTION = "A formfactor configuration file provides information about the \
@@ -521,8 +510,7 @@ during the build.
521 510
522Following is the append file, which is named ``formfactor_0.0.bbappend`` 511Following is the append file, which is named ``formfactor_0.0.bbappend``
523and is from the Raspberry Pi BSP Layer named ``meta-raspberrypi``. The 512and is from the Raspberry Pi BSP Layer named ``meta-raspberrypi``. The
524file is in the layer at ``recipes-bsp/formfactor``: 513file is in the layer at ``recipes-bsp/formfactor``::
525::
526 514
527 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" 515 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
528 516
@@ -570,8 +558,7 @@ build system to calculate it based on the layer's dependencies.
570 558
571To specify the layer's priority manually, use the 559To specify the layer's priority manually, use the
572:term:`BBFILE_PRIORITY` 560:term:`BBFILE_PRIORITY`
573variable and append the layer's root name: 561variable and append the layer's root name::
574::
575 562
576 BBFILE_PRIORITY_mylayer = "1" 563 BBFILE_PRIORITY_mylayer = "1"
577 564
@@ -595,8 +582,7 @@ with their paths and priorities and on ``.bbappend`` files and their
595applicable recipes can help to reveal potential problems. 582applicable recipes can help to reveal potential problems.
596 583
597For help on the BitBake layer management tool, use the following 584For help on the BitBake layer management tool, use the following
598command: 585command::
599::
600 586
601 $ bitbake-layers --help 587 $ bitbake-layers --help
602 NOTE: Starting bitbake server... 588 NOTE: Starting bitbake server...
@@ -676,8 +662,7 @@ The following list describes the available commands:
676 variable values, you need to tidy these up yourself. Consider the 662 variable values, you need to tidy these up yourself. Consider the
677 following example. Here, the ``bitbake-layers`` command adds the 663 following example. Here, the ``bitbake-layers`` command adds the
678 line ``#### bbappended ...`` so that you know where the following 664 line ``#### bbappended ...`` so that you know where the following
679 lines originate: 665 lines originate::
680 ::
681 666
682 ... 667 ...
683 DESCRIPTION = "A useful utility" 668 DESCRIPTION = "A useful utility"
@@ -691,8 +676,7 @@ The following list describes the available commands:
691 EXTRA_OECONF += "--enable-somethingelse" 676 EXTRA_OECONF += "--enable-somethingelse"
692 677
693 678
694 Ideally, you would tidy up these utilities as follows: 679 Ideally, you would tidy up these utilities as follows::
695 ::
696 680
697 ... 681 ...
698 DESCRIPTION = "Customized utility" 682 DESCRIPTION = "Customized utility"
@@ -746,14 +730,12 @@ create a layer with the following:
746 730
747In its simplest form, you can use the following command form to create a 731In its simplest form, you can use the following command form to create a
748layer. The command creates a layer whose name corresponds to 732layer. The command creates a layer whose name corresponds to
749"your_layer_name" in the current directory: 733"your_layer_name" in the current directory::
750::
751 734
752 $ bitbake-layers create-layer your_layer_name 735 $ bitbake-layers create-layer your_layer_name
753 736
754As an example, the following command creates a layer named ``meta-scottrif`` 737As an example, the following command creates a layer named ``meta-scottrif``
755in your home directory: 738in your home directory::
756::
757 739
758 $ cd /usr/home 740 $ cd /usr/home
759 $ bitbake-layers create-layer meta-scottrif 741 $ bitbake-layers create-layer meta-scottrif
@@ -770,8 +752,7 @@ default, you can use the ``--example-recipe-name`` option.
770 752
771The easiest way to see how the ``bitbake-layers create-layer`` command 753The easiest way to see how the ``bitbake-layers create-layer`` command
772works is to experiment with the script. You can also read the usage 754works is to experiment with the script. You can also read the usage
773information by entering the following: 755information by entering the following::
774::
775 756
776 $ bitbake-layers create-layer --help 757 $ bitbake-layers create-layer --help
777 NOTE: Starting bitbake server... 758 NOTE: Starting bitbake server...
@@ -799,16 +780,14 @@ Once you create your general layer, you must add it to your
799makes the OpenEmbedded build system aware of your layer so that it can 780makes the OpenEmbedded build system aware of your layer so that it can
800search it for metadata. 781search it for metadata.
801 782
802Add your layer by using the ``bitbake-layers add-layer`` command: 783Add your layer by using the ``bitbake-layers add-layer`` command::
803::
804 784
805 $ bitbake-layers add-layer your_layer_name 785 $ bitbake-layers add-layer your_layer_name
806 786
807Here is an example that adds a 787Here is an example that adds a
808layer named ``meta-scottrif`` to the configuration file. Following the 788layer named ``meta-scottrif`` to the configuration file. Following the
809command that adds the layer is another ``bitbake-layers`` command that 789command that adds the layer is another ``bitbake-layers`` command that
810shows the layers that are in your ``bblayers.conf`` file: 790shows the layers that are in your ``bblayers.conf`` file::
811::
812 791
813 $ bitbake-layers add-layer meta-scottrif 792 $ bitbake-layers add-layer meta-scottrif
814 NOTE: Starting bitbake server... 793 NOTE: Starting bitbake server...
@@ -851,8 +830,7 @@ variable changes are in effect for every build and consequently affect
851all images, which might not be what you require. 830all images, which might not be what you require.
852 831
853To add a package to your image using the local configuration file, use 832To add a package to your image using the local configuration file, use
854the ``IMAGE_INSTALL`` variable with the ``_append`` operator: 833the ``IMAGE_INSTALL`` variable with the ``_append`` operator::
855::
856 834
857 IMAGE_INSTALL_append = " strace" 835 IMAGE_INSTALL_append = " strace"
858 836
@@ -870,8 +848,7 @@ takes effect.
870 848
871As shown in its simplest use, ``IMAGE_INSTALL_append`` affects all 849As shown in its simplest use, ``IMAGE_INSTALL_append`` affects all
872images. It is possible to extend the syntax so that the variable applies 850images. It is possible to extend the syntax so that the variable applies
873to a specific image only. Here is an example: 851to a specific image only. Here is an example::
874::
875 852
876 IMAGE_INSTALL_append_pn-core-image-minimal = " strace" 853 IMAGE_INSTALL_append_pn-core-image-minimal = " strace"
877 854
@@ -942,8 +919,7 @@ Customizing Images Using Custom .bb Files
942 919
943You can also customize an image by creating a custom recipe that defines 920You can also customize an image by creating a custom recipe that defines
944additional software as part of the image. The following example shows 921additional software as part of the image. The following example shows
945the form for the two lines you need: 922the form for the two lines you need::
946::
947 923
948 IMAGE_INSTALL = "packagegroup-core-x11-base package1 package2" 924 IMAGE_INSTALL = "packagegroup-core-x11-base package1 package2"
949 inherit core-image 925 inherit core-image
@@ -958,8 +934,7 @@ The other method for creating a custom image is to base it on an
958existing image. For example, if you want to create an image based on 934existing image. For example, if you want to create an image based on
959``core-image-sato`` but add the additional package ``strace`` to the 935``core-image-sato`` but add the additional package ``strace`` to the
960image, copy the ``meta/recipes-sato/images/core-image-sato.bb`` to a new 936image, copy the ``meta/recipes-sato/images/core-image-sato.bb`` to a new
961``.bb`` and add the following line to the end of the copy: 937``.bb`` and add the following line to the end of the copy::
962::
963 938
964 IMAGE_INSTALL += "strace" 939 IMAGE_INSTALL += "strace"
965 940
@@ -990,8 +965,7 @@ in the ``packagegroup-base.bb`` recipe.
990Here is a short, fabricated example showing the same basic pieces for a 965Here is a short, fabricated example showing the same basic pieces for a
991hypothetical packagegroup defined in ``packagegroup-custom.bb``, where 966hypothetical packagegroup defined in ``packagegroup-custom.bb``, where
992the variable ``PN`` is the standard way to abbreviate the reference to 967the variable ``PN`` is the standard way to abbreviate the reference to
993the full packagegroup name ``packagegroup-custom``: 968the full packagegroup name ``packagegroup-custom``::
994::
995 969
996 DESCRIPTION = "My Custom Package Groups" 970 DESCRIPTION = "My Custom Package Groups"
997 971
@@ -1033,13 +1007,11 @@ configured hostname written to ``/etc/hostname`` is "qemux86".
1033 1007
1034You can customize this name by altering the value of the "hostname" 1008You can customize this name by altering the value of the "hostname"
1035variable in the ``base-files`` recipe using either an append file or a 1009variable in the ``base-files`` recipe using either an append file or a
1036configuration file. Use the following in an append file: 1010configuration file. Use the following in an append file::
1037::
1038 1011
1039 hostname = "myhostname" 1012 hostname = "myhostname"
1040 1013
1041Use the following in a configuration file: 1014Use the following in a configuration file::
1042::
1043 1015
1044 hostname_pn-base-files = "myhostname" 1016 hostname_pn-base-files = "myhostname"
1045 1017
@@ -1054,8 +1026,7 @@ you can easily reset the default hostname.
1054 1026
1055Another point of interest is that if you unset the variable, the image 1027Another point of interest is that if you unset the variable, the image
1056will have no default hostname in the filesystem. Here is an example that 1028will have no default hostname in the filesystem. Here is an example that
1057unsets the variable in a configuration file: 1029unsets the variable in a configuration file::
1058::
1059 1030
1060 hostname_pn-base-files = "" 1031 hostname_pn-base-files = ""
1061 1032
@@ -1136,8 +1107,7 @@ To run the tool, you just need to be in your
1136:term:`Build Directory` and have sourced the 1107:term:`Build Directory` and have sourced the
1137build environment setup script (i.e. 1108build environment setup script (i.e.
1138:ref:`structure-core-script`). 1109:ref:`structure-core-script`).
1139To get help on the tool, use the following command: 1110To get help on the tool, use the following command::
1140::
1141 1111
1142 $ recipetool -h 1112 $ recipetool -h
1143 NOTE: Starting bitbake server... 1113 NOTE: Starting bitbake server...
@@ -1166,8 +1136,7 @@ locates it properly in the layer that contains your source files.
1166Following are some syntax examples: 1136Following are some syntax examples:
1167 1137
1168 - Use this syntax to generate a recipe based on source. Once generated, 1138 - Use this syntax to generate a recipe based on source. Once generated,
1169 the recipe resides in the existing source code layer: 1139 the recipe resides in the existing source code layer::
1170 ::
1171 1140
1172 recipetool create -o OUTFILE source 1141 recipetool create -o OUTFILE source
1173 1142
@@ -1180,8 +1149,7 @@ Following are some syntax examples:
1180 1149
1181 - Use this syntax to generate a recipe based on source. The options 1150 - Use this syntax to generate a recipe based on source. The options
1182 direct ``recipetool`` to generate debugging information. Once generated, 1151 direct ``recipetool`` to generate debugging information. Once generated,
1183 the recipe resides in the existing source code layer: 1152 the recipe resides in the existing source code layer::
1184 ::
1185 1153
1186 recipetool create -d -o OUTFILE source 1154 recipetool create -d -o OUTFILE source
1187 1155
@@ -1236,8 +1204,7 @@ the recipe.
1236 recipe through the layer's ``conf/layer.conf`` file and the 1204 recipe through the layer's ``conf/layer.conf`` file and the
1237 :term:`BBFILES` variable. This 1205 :term:`BBFILES` variable. This
1238 variable sets up a path from which the build system can locate 1206 variable sets up a path from which the build system can locate
1239 recipes. Here is the typical use: 1207 recipes. Here is the typical use::
1240 ::
1241 1208
1242 BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ 1209 BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
1243 ${LAYERDIR}/recipes-*/*/*.bbappend" 1210 ${LAYERDIR}/recipes-*/*/*.bbappend"
@@ -1249,8 +1216,7 @@ the recipe.
1249 ":ref:`dev-manual/common-tasks:understanding and creating layers`" section. 1216 ":ref:`dev-manual/common-tasks:understanding and creating layers`" section.
1250 1217
1251- *Naming Your Recipe:* When you name your recipe, you need to follow 1218- *Naming Your Recipe:* When you name your recipe, you need to follow
1252 this naming convention: 1219 this naming convention::
1253 ::
1254 1220
1255 basename_version.bb 1221 basename_version.bb
1256 1222
@@ -1276,8 +1242,7 @@ Assuming you have sourced the build environment setup script (i.e.
1276:ref:`structure-core-script`) and you are in 1242:ref:`structure-core-script`) and you are in
1277the :term:`Build Directory`, use 1243the :term:`Build Directory`, use
1278BitBake to process your recipe. All you need to provide is the 1244BitBake to process your recipe. All you need to provide is the
1279``basename`` of the recipe as described in the previous section: 1245``basename`` of the recipe as described in the previous section::
1280::
1281 1246
1282 $ bitbake basename 1247 $ bitbake basename
1283 1248
@@ -1289,8 +1254,7 @@ compilation and packaging files, and so forth.
1289 1254
1290The path to the per-recipe temporary work directory depends on the 1255The path to the per-recipe temporary work directory depends on the
1291context in which it is being built. The quickest way to find this path 1256context in which it is being built. The quickest way to find this path
1292is to have BitBake return it by running the following: 1257is to have BitBake return it by running the following::
1293::
1294 1258
1295 $ bitbake -e basename | grep ^WORKDIR= 1259 $ bitbake -e basename | grep ^WORKDIR=
1296 1260
@@ -1299,8 +1263,7 @@ top-level folder named ``poky``, a default Build Directory at
1299``poky/build``, and a ``qemux86-poky-linux`` machine target system. 1263``poky/build``, and a ``qemux86-poky-linux`` machine target system.
1300Furthermore, suppose your recipe is named ``foo_1.3.0.bb``. In this 1264Furthermore, suppose your recipe is named ``foo_1.3.0.bb``. In this
1301case, the work directory the build system uses to build the package 1265case, the work directory the build system uses to build the package
1302would be as follows: 1266would be as follows::
1303::
1304 1267
1305 poky/build/tmp/work/qemux86-poky-linux/foo/1.3.0-r0 1268 poky/build/tmp/work/qemux86-poky-linux/foo/1.3.0-r0
1306 1269
@@ -1352,8 +1315,7 @@ recipe to match the new version.
1352Here is a simple example from the 1315Here is a simple example from the
1353``meta/recipes-devtools/strace/strace_5.5.bb`` recipe where the source 1316``meta/recipes-devtools/strace/strace_5.5.bb`` recipe where the source
1354comes from a single tarball. Notice the use of the 1317comes from a single tarball. Notice the use of the
1355:term:`PV` variable: 1318:term:`PV` variable::
1356::
1357 1319
1358 SRC_URI = "https://strace.io/files/${PV}/strace-${PV}.tar.xz \ 1320 SRC_URI = "https://strace.io/files/${PV}/strace-${PV}.tar.xz \
1359 1321
@@ -1369,8 +1331,7 @@ you must specify :term:`SRCREV` and
1369you should specify :term:`PV` to include 1331you should specify :term:`PV` to include
1370the revision with :term:`SRCPV`. Here 1332the revision with :term:`SRCPV`. Here
1371is an example from the recipe 1333is an example from the recipe
1372``meta/recipes-kernel/blktrace/blktrace_git.bb``: 1334``meta/recipes-kernel/blktrace/blktrace_git.bb``::
1373::
1374 1335
1375 SRCREV = "d6918c8832793b4205ed3bfede78c2f915c23385" 1336 SRCREV = "d6918c8832793b4205ed3bfede78c2f915c23385"
1376 1337
@@ -1392,8 +1353,7 @@ SCM URLs), you need to provide the ``md5`` and ``sha256`` checksums for
1392each URL. For these cases, you provide a name for each URL as part of 1353each URL. For these cases, you provide a name for each URL as part of
1393the ``SRC_URI`` and then reference that name in the subsequent checksum 1354the ``SRC_URI`` and then reference that name in the subsequent checksum
1394statements. Here is an example combining lines from the files 1355statements. Here is an example combining lines from the files
1395``git.inc`` and ``git_2.24.1.bb``: 1356``git.inc`` and ``git_2.24.1.bb``::
1396::
1397 1357
1398 SRC_URI = "${KERNELORG_MIRROR}/software/scm/git/git-${PV}.tar.gz;name=tarball \ 1358 SRC_URI = "${KERNELORG_MIRROR}/software/scm/git/git-${PV}.tar.gz;name=tarball \
1399 ${KERNELORG_MIRROR}/software/scm/git/git-manpages-${PV}.tar.gz;name=manpages" 1359 ${KERNELORG_MIRROR}/software/scm/git/git-manpages-${PV}.tar.gz;name=manpages"
@@ -1512,8 +1472,7 @@ variables:
1512 include ``COPYING``, ``LICENSE``, and ``README`` files. You could 1472 include ``COPYING``, ``LICENSE``, and ``README`` files. You could
1513 also find the information near the top of a source file. For example, 1473 also find the information near the top of a source file. For example,
1514 given a piece of software licensed under the GNU General Public 1474 given a piece of software licensed under the GNU General Public
1515 License version 2, you would set ``LICENSE`` as follows: 1475 License version 2, you would set ``LICENSE`` as follows::
1516 ::
1517 1476
1518 LICENSE = "GPLv2" 1477 LICENSE = "GPLv2"
1519 1478
@@ -1543,8 +1502,7 @@ variables:
1543 See the ":ref:`dev-manual/common-tasks:fetching code`" section for 1502 See the ":ref:`dev-manual/common-tasks:fetching code`" section for
1544 additional information. 1503 additional information.
1545 1504
1546 Here is an example that assumes the software has a ``COPYING`` file: 1505 Here is an example that assumes the software has a ``COPYING`` file::
1547 ::
1548 1506
1549 LIC_FILES_CHKSUM = "file://COPYING;md5=xxx" 1507 LIC_FILES_CHKSUM = "file://COPYING;md5=xxx"
1550 1508
@@ -1747,8 +1705,7 @@ standard mainline kernel, not your own custom one.
1747When you use custom kernel headers you need to get them from 1705When you use custom kernel headers you need to get them from
1748:term:`STAGING_KERNEL_DIR`, 1706:term:`STAGING_KERNEL_DIR`,
1749which is the directory with kernel headers that are required to build 1707which is the directory with kernel headers that are required to build
1750out-of-tree modules. Your recipe will also need the following: 1708out-of-tree modules. Your recipe will also need the following::
1751::
1752 1709
1753 do_configure[depends] += "virtual/kernel:do_shared_workdir" 1710 do_configure[depends] += "virtual/kernel:do_shared_workdir"
1754 1711
@@ -1779,8 +1736,7 @@ Here are some common issues that cause failures.
1779 1736
1780 To fix the problem, you need to either satisfy the missing dependency 1737 To fix the problem, you need to either satisfy the missing dependency
1781 in the Makefile or whatever script produced the Makefile, or (as a 1738 in the Makefile or whatever script produced the Makefile, or (as a
1782 workaround) set :term:`PARALLEL_MAKE` to an empty string: 1739 workaround) set :term:`PARALLEL_MAKE` to an empty string::
1783 ::
1784 1740
1785 PARALLEL_MAKE = "" 1741 PARALLEL_MAKE = ""
1786 1742
@@ -1889,8 +1845,7 @@ installed correctly.
1889 missing dependencies between targets that can result in race 1845 missing dependencies between targets that can result in race
1890 conditions. If you experience intermittent failures during 1846 conditions. If you experience intermittent failures during
1891 ``do_install``, you might be able to work around them by disabling 1847 ``do_install``, you might be able to work around them by disabling
1892 parallel Makefile installs by adding the following to the recipe: 1848 parallel Makefile installs by adding the following to the recipe::
1893 ::
1894 1849
1895 PARALLEL_MAKEINST = "" 1850 PARALLEL_MAKEINST = ""
1896 1851
@@ -2006,8 +1961,7 @@ take. The following list describes the process:
2006 :term:`MACHINE` value is passed 1961 :term:`MACHINE` value is passed
2007 into the configure script or a patch is applied only for a particular 1962 into the configure script or a patch is applied only for a particular
2008 machine), you should mark them as such by adding the following to the 1963 machine), you should mark them as such by adding the following to the
2009 recipe: 1964 recipe::
2010 ::
2011 1965
2012 PACKAGE_ARCH = "${MACHINE_ARCH}" 1966 PACKAGE_ARCH = "${MACHINE_ARCH}"
2013 1967
@@ -2016,8 +1970,7 @@ take. The following list describes the process:
2016 all (e.g. recipes that simply package script files or configuration 1970 all (e.g. recipes that simply package script files or configuration
2017 files), you should use the 1971 files), you should use the
2018 :ref:`allarch <ref-classes-allarch>` class to 1972 :ref:`allarch <ref-classes-allarch>` class to
2019 do this for you by adding this to your recipe: 1973 do this for you by adding this to your recipe::
2020 ::
2021 1974
2022 inherit allarch 1975 inherit allarch
2023 1976
@@ -2061,8 +2014,7 @@ used by the :ref:`ref-tasks-populate_sysroot` task as defined by the the
2061:term:`SYSROOT_DIRS` variable to automatically populate the sysroot. It 2014:term:`SYSROOT_DIRS` variable to automatically populate the sysroot. It
2062is possible to modify the list of directories that populate the sysroot. 2015is possible to modify the list of directories that populate the sysroot.
2063The following example shows how you could add the ``/opt`` directory to 2016The following example shows how you could add the ``/opt`` directory to
2064the list of directories within a recipe: 2017the list of directories within a recipe::
2065::
2066 2018
2067 SYSROOT_DIRS += "/opt" 2019 SYSROOT_DIRS += "/opt"
2068 2020
@@ -2091,8 +2043,7 @@ kernel recipe. Suppose you have three kernel recipes whose
2091in some way uses a :term:`PROVIDES` 2043in some way uses a :term:`PROVIDES`
2092statement that essentially identifies itself as being able to provide 2044statement that essentially identifies itself as being able to provide
2093``virtual/kernel``. Here is one way through the 2045``virtual/kernel``. Here is one way through the
2094:ref:`kernel <ref-classes-kernel>` class: 2046:ref:`kernel <ref-classes-kernel>` class::
2095::
2096 2047
2097 PROVIDES += "${@ "virtual/kernel" if (d.getVar("KERNEL_PACKAGE_NAME") == "kernel") else "" }" 2048 PROVIDES += "${@ "virtual/kernel" if (d.getVar("KERNEL_PACKAGE_NAME") == "kernel") else "" }"
2098 2049
@@ -2107,8 +2058,7 @@ an example, consider the :yocto_git:`x86-base.inc
2107</poky/tree/meta/conf/machine/include/x86-base.inc>` include file, which is a 2058</poky/tree/meta/conf/machine/include/x86-base.inc>` include file, which is a
2108machine (i.e. :term:`MACHINE`) configuration file. This include file is the 2059machine (i.e. :term:`MACHINE`) configuration file. This include file is the
2109reason all x86-based machines use the ``linux-yocto`` kernel. Here are the 2060reason all x86-based machines use the ``linux-yocto`` kernel. Here are the
2110relevant lines from the include file: 2061relevant lines from the include file::
2111::
2112 2062
2113 PREFERRED_PROVIDER_virtual/kernel ??= "linux-yocto" 2063 PREFERRED_PROVIDER_virtual/kernel ??= "linux-yocto"
2114 PREFERRED_VERSION_linux-yocto ??= "4.15%" 2064 PREFERRED_VERSION_linux-yocto ??= "4.15%"
@@ -2116,8 +2066,7 @@ relevant lines from the include file:
2116When you use a virtual provider, you do not have to "hard code" a recipe 2066When you use a virtual provider, you do not have to "hard code" a recipe
2117name as a build dependency. You can use the 2067name as a build dependency. You can use the
2118:term:`DEPENDS` variable to state the 2068:term:`DEPENDS` variable to state the
2119build is dependent on ``virtual/kernel`` for example: 2069build is dependent on ``virtual/kernel`` for example::
2120::
2121 2070
2122 DEPENDS = "virtual/kernel" 2071 DEPENDS = "virtual/kernel"
2123 2072
@@ -2125,8 +2074,7 @@ During the build, the OpenEmbedded build system picks
2125the correct recipe needed for the ``virtual/kernel`` dependency based on 2074the correct recipe needed for the ``virtual/kernel`` dependency based on
2126the ``PREFERRED_PROVIDER`` variable. If you want to use the small kernel 2075the ``PREFERRED_PROVIDER`` variable. If you want to use the small kernel
2127mentioned at the beginning of this section, configure your build as 2076mentioned at the beginning of this section, configure your build as
2128follows: 2077follows::
2129::
2130 2078
2131 PREFERRED_PROVIDER_virtual/kernel ??= "kernel-small" 2079 PREFERRED_PROVIDER_virtual/kernel ??= "kernel-small"
2132 2080
@@ -2178,8 +2126,7 @@ In order to ensure the versions compare properly, the recommended
2178convention is to set :term:`PV` within the 2126convention is to set :term:`PV` within the
2179recipe to "previous_version+current_version". You can use an additional 2127recipe to "previous_version+current_version". You can use an additional
2180variable so that you can use the current version elsewhere. Here is an 2128variable so that you can use the current version elsewhere. Here is an
2181example: 2129example::
2182::
2183 2130
2184 REALPV = "0.8.16-rc1" 2131 REALPV = "0.8.16-rc1"
2185 PV = "0.8.15+${REALPV}" 2132 PV = "0.8.15+${REALPV}"
@@ -2198,8 +2145,7 @@ required, specify
2198``${``\ :term:`PN`\ ``}`` in place of 2145``${``\ :term:`PN`\ ``}`` in place of
2199PACKAGENAME. 2146PACKAGENAME.
2200 2147
2201A post-installation function has the following structure: 2148A post-installation function has the following structure::
2202::
2203 2149
2204 pkg_postinst_PACKAGENAME() { 2150 pkg_postinst_PACKAGENAME() {
2205 # Commands to carry out 2151 # Commands to carry out
@@ -2352,13 +2298,11 @@ Otherwise, BitBake runs an empty ``do_install`` task by default.
2352Some applications might require extra parameters to be passed to the 2298Some applications might require extra parameters to be passed to the
2353compiler. For example, the application might need an additional header 2299compiler. For example, the application might need an additional header
2354path. You can accomplish this by adding to the ``CFLAGS`` variable. The 2300path. You can accomplish this by adding to the ``CFLAGS`` variable. The
2355following example shows this: 2301following example shows this::
2356::
2357 2302
2358 CFLAGS_prepend = "-I ${S}/include " 2303 CFLAGS_prepend = "-I ${S}/include "
2359 2304
2360In the following example, ``mtd-utils`` is a makefile-based package: 2305In the following example, ``mtd-utils`` is a makefile-based package::
2361::
2362 2306
2363 SUMMARY = "Tools for managing memory technology devices" 2307 SUMMARY = "Tools for managing memory technology devices"
2364 SECTION = "base" 2308 SECTION = "base"
@@ -2403,8 +2347,7 @@ application into multiple packages.
2403Following is an example that uses the ``libxpm`` recipe. By default, 2347Following is an example that uses the ``libxpm`` recipe. By default,
2404this recipe generates a single package that contains the library along 2348this recipe generates a single package that contains the library along
2405with a few binaries. You can modify the recipe to split the binaries 2349with a few binaries. You can modify the recipe to split the binaries
2406into separate packages: 2350into separate packages::
2407::
2408 2351
2409 require xorg-lib-common.inc 2352 require xorg-lib-common.inc
2410 2353
@@ -2498,8 +2441,7 @@ doing the following:
2498 that replaces ``do_configure`` and ``do_compile`` with custom 2441 that replaces ``do_configure`` and ``do_compile`` with custom
2499 versions, then you can use the 2442 versions, then you can use the
2500 ``[``\ :ref:`noexec <bitbake-user-manual/bitbake-user-manual-metadata:variable flags>`\ ``]`` 2443 ``[``\ :ref:`noexec <bitbake-user-manual/bitbake-user-manual-metadata:variable flags>`\ ``]``
2501 flag to turn the tasks into no-ops, as follows: 2444 flag to turn the tasks into no-ops, as follows::
2502 ::
2503 2445
2504 do_configure[noexec] = "1" 2446 do_configure[noexec] = "1"
2505 do_compile[noexec] = "1" 2447 do_compile[noexec] = "1"
@@ -2558,8 +2500,7 @@ chapter of the BitBake User Manual.
2558 supported. 2500 supported.
2559 2501
2560 The following example shows some of the ways you can use variables in 2502 The following example shows some of the ways you can use variables in
2561 recipes: 2503 recipes::
2562 ::
2563 2504
2564 S = "${WORKDIR}/postfix-${PV}" 2505 S = "${WORKDIR}/postfix-${PV}"
2565 CFLAGS += "-DNO_ASM" 2506 CFLAGS += "-DNO_ASM"
@@ -2572,8 +2513,7 @@ chapter of the BitBake User Manual.
2572 syntax, although access to OpenEmbedded variables and internal 2513 syntax, although access to OpenEmbedded variables and internal
2573 methods are also available. 2514 methods are also available.
2574 2515
2575 The following is an example function from the ``sed`` recipe: 2516 The following is an example function from the ``sed`` recipe::
2576 ::
2577 2517
2578 do_install () { 2518 do_install () {
2579 autotools_do_install 2519 autotools_do_install
@@ -2594,16 +2534,14 @@ chapter of the BitBake User Manual.
2594 from other files (``include`` and ``require``) and export variables 2534 from other files (``include`` and ``require``) and export variables
2595 to the environment (``export``). 2535 to the environment (``export``).
2596 2536
2597 The following example shows the use of some of these keywords: 2537 The following example shows the use of some of these keywords::
2598 ::
2599 2538
2600 export POSTCONF = "${STAGING_BINDIR}/postconf" 2539 export POSTCONF = "${STAGING_BINDIR}/postconf"
2601 inherit autoconf 2540 inherit autoconf
2602 require otherfile.inc 2541 require otherfile.inc
2603 2542
2604- *Comments (#):* Any lines that begin with the hash character (``#``) 2543- *Comments (#):* Any lines that begin with the hash character (``#``)
2605 are treated as comment lines and are ignored: 2544 are treated as comment lines and are ignored::
2606 ::
2607 2545
2608 # This is a comment 2546 # This is a comment
2609 2547
@@ -2615,8 +2553,7 @@ in the BitBake User Manual.
2615 2553
2616- *Line Continuation (\\):* Use the backward slash (``\``) character to 2554- *Line Continuation (\\):* Use the backward slash (``\``) character to
2617 split a statement over multiple lines. Place the slash character at 2555 split a statement over multiple lines. Place the slash character at
2618 the end of the line that is to be continued on the next line: 2556 the end of the line that is to be continued on the next line::
2619 ::
2620 2557
2621 VAR = "A really long \ 2558 VAR = "A really long \
2622 line" 2559 line"
@@ -2627,8 +2564,7 @@ in the BitBake User Manual.
2627 slash character. 2564 slash character.
2628 2565
2629- *Using Variables (${VARNAME}):* Use the ``${VARNAME}`` syntax to 2566- *Using Variables (${VARNAME}):* Use the ``${VARNAME}`` syntax to
2630 access the contents of a variable: 2567 access the contents of a variable::
2631 ::
2632 2568
2633 SRC_URI = "${SOURCEFORGE_MIRROR}/libpng/zlib-${PV}.tar.gz" 2569 SRC_URI = "${SOURCEFORGE_MIRROR}/libpng/zlib-${PV}.tar.gz"
2634 2570
@@ -2648,8 +2584,7 @@ in the BitBake User Manual.
2648 when you make the assignment, but this is not generally needed. 2584 when you make the assignment, but this is not generally needed.
2649 2585
2650- *Quote All Assignments ("value"):* Use double quotes around values in 2586- *Quote All Assignments ("value"):* Use double quotes around values in
2651 all variable assignments (e.g. ``"value"``). Following is an example: 2587 all variable assignments (e.g. ``"value"``). Following is an example::
2652 ::
2653 2588
2654 VAR1 = "${OTHERVAR}" 2589 VAR1 = "${OTHERVAR}"
2655 VAR2 = "The version is ${PV}" 2590 VAR2 = "The version is ${PV}"
@@ -2663,13 +2598,11 @@ in the BitBake User Manual.
2663 2598
2664 Here is an example where ``VAR1`` is set to "New value" if it is 2599 Here is an example where ``VAR1`` is set to "New value" if it is
2665 currently empty. However, if ``VAR1`` has already been set, it 2600 currently empty. However, if ``VAR1`` has already been set, it
2666 remains unchanged: 2601 remains unchanged::
2667 ::
2668 2602
2669 VAR1 ?= "New value" 2603 VAR1 ?= "New value"
2670 2604
2671 In this next example, ``VAR1`` is left with the value "Original value": 2605 In this next example, ``VAR1`` is left with the value "Original value"::
2672 ::
2673 2606
2674 VAR1 = "Original value" 2607 VAR1 = "Original value"
2675 VAR1 ?= "New value" 2608 VAR1 ?= "New value"
@@ -2682,8 +2615,7 @@ in the BitBake User Manual.
2682 This operator adds a space between the existing content of the 2615 This operator adds a space between the existing content of the
2683 variable and the new content. 2616 variable and the new content.
2684 2617
2685 Here is an example: 2618 Here is an example::
2686 ::
2687 2619
2688 SRC_URI += "file://fix-makefile.patch" 2620 SRC_URI += "file://fix-makefile.patch"
2689 2621
@@ -2695,8 +2627,7 @@ in the BitBake User Manual.
2695 This operator adds a space between the new content and the 2627 This operator adds a space between the new content and the
2696 existing content of the variable. 2628 existing content of the variable.
2697 2629
2698 Here is an example: 2630 Here is an example::
2699 ::
2700 2631
2701 VAR =+ "Starts" 2632 VAR =+ "Starts"
2702 2633
@@ -2708,15 +2639,13 @@ in the BitBake User Manual.
2708 2639
2709 The following example shows the space being explicitly added to the 2640 The following example shows the space being explicitly added to the
2710 start to ensure the appended value is not merged with the existing 2641 start to ensure the appended value is not merged with the existing
2711 value: 2642 value::
2712 ::
2713 2643
2714 SRC_URI_append = " file://fix-makefile.patch" 2644 SRC_URI_append = " file://fix-makefile.patch"
2715 2645
2716 You can also use 2646 You can also use
2717 the ``_append`` operator with overrides, which results in the actions 2647 the ``_append`` operator with overrides, which results in the actions
2718 only being performed for the specified target or machine: 2648 only being performed for the specified target or machine::
2719 ::
2720 2649
2721 SRC_URI_append_sh4 = " file://fix-makefile.patch" 2650 SRC_URI_append_sh4 = " file://fix-makefile.patch"
2722 2651
@@ -2728,15 +2657,13 @@ in the BitBake User Manual.
2728 2657
2729 The following example shows the space being explicitly added to the 2658 The following example shows the space being explicitly added to the
2730 end to ensure the prepended value is not merged with the existing 2659 end to ensure the prepended value is not merged with the existing
2731 value: 2660 value::
2732 ::
2733 2661
2734 CFLAGS_prepend = "-I${S}/myincludes " 2662 CFLAGS_prepend = "-I${S}/myincludes "
2735 2663
2736 You can also use the 2664 You can also use the
2737 ``_prepend`` operator with overrides, which results in the actions 2665 ``_prepend`` operator with overrides, which results in the actions
2738 only being performed for the specified target or machine: 2666 only being performed for the specified target or machine::
2739 ::
2740 2667
2741 CFLAGS_prepend_sh4 = "-I${S}/myincludes " 2668 CFLAGS_prepend_sh4 = "-I${S}/myincludes "
2742 2669
@@ -2746,8 +2673,7 @@ in the BitBake User Manual.
2746 value to "standard/base" for any target 2673 value to "standard/base" for any target
2747 :term:`MACHINE`, except for 2674 :term:`MACHINE`, except for
2748 qemuarm where it should be set to "standard/arm-versatile-926ejs", 2675 qemuarm where it should be set to "standard/arm-versatile-926ejs",
2749 you would do the following: 2676 you would do the following::
2750 ::
2751 2677
2752 KBRANCH = "standard/base" 2678 KBRANCH = "standard/base"
2753 KBRANCH_qemuarm = "standard/arm-versatile-926ejs" 2679 KBRANCH_qemuarm = "standard/arm-versatile-926ejs"
@@ -2770,8 +2696,7 @@ in the BitBake User Manual.
2770 search and replacement on a variable). 2696 search and replacement on a variable).
2771 2697
2772 You indicate Python code using the ``${@python_code}`` syntax for the 2698 You indicate Python code using the ``${@python_code}`` syntax for the
2773 variable assignment: 2699 variable assignment::
2774 ::
2775 2700
2776 SRC_URI = "ftp://ftp.info-zip.org/pub/infozip/src/zip${@d.getVar('PV',1).replace('.', '')}.tgz 2701 SRC_URI = "ftp://ftp.info-zip.org/pub/infozip/src/zip${@d.getVar('PV',1).replace('.', '')}.tgz
2777 2702
@@ -2861,8 +2786,7 @@ of adding a suitable ``defconfig`` file. The file needs to be added into
2861a location similar to ``defconfig`` files used for other machines in a 2786a location similar to ``defconfig`` files used for other machines in a
2862given kernel recipe. A possible way to do this is by listing the file in 2787given kernel recipe. A possible way to do this is by listing the file in
2863the ``SRC_URI`` and adding the machine to the expression in 2788the ``SRC_URI`` and adding the machine to the expression in
2864``COMPATIBLE_MACHINE``: 2789``COMPATIBLE_MACHINE``::
2865::
2866 2790
2867 COMPATIBLE_MACHINE = '(qemux86|qemumips)' 2791 COMPATIBLE_MACHINE = '(qemux86|qemumips)'
2868 2792
@@ -2889,8 +2813,7 @@ contains directories for specific machines such as ``qemuarm`` and
2889defaults, see the ``meta/recipes-bsp/formfactor/files/config`` file 2813defaults, see the ``meta/recipes-bsp/formfactor/files/config`` file
2890found in the same area. 2814found in the same area.
2891 2815
2892Following is an example for "qemuarm" machine: 2816Following is an example for "qemuarm" machine::
2893::
2894 2817
2895 HAVE_TOUCHSCREEN=1 2818 HAVE_TOUCHSCREEN=1
2896 HAVE_KEYBOARD=1 2819 HAVE_KEYBOARD=1
@@ -2961,22 +2884,19 @@ The following steps describe how to set up the AUH utility:
29612. *Make Sure Git is Configured:* The AUH utility requires Git to be 28842. *Make Sure Git is Configured:* The AUH utility requires Git to be
2962 configured because AUH uses Git to save upgrades. Thus, you must have 2885 configured because AUH uses Git to save upgrades. Thus, you must have
2963 Git user and email configured. The following command shows your 2886 Git user and email configured. The following command shows your
2964 configurations: 2887 configurations::
2965 ::
2966 2888
2967 $ git config --list 2889 $ git config --list
2968 2890
2969 If you do not have the user and 2891 If you do not have the user and
2970 email configured, you can use the following commands to do so: 2892 email configured, you can use the following commands to do so::
2971 ::
2972 2893
2973 $ git config --global user.name some_name 2894 $ git config --global user.name some_name
2974 $ git config --global user.email username@domain.com 2895 $ git config --global user.email username@domain.com
2975 2896
29763. *Clone the AUH Repository:* To use AUH, you must clone the repository 28973. *Clone the AUH Repository:* To use AUH, you must clone the repository
2977 onto your development host. The following command uses Git to create 2898 onto your development host. The following command uses Git to create
2978 a local copy of the repository on your system: 2899 a local copy of the repository on your system::
2979 ::
2980 2900
2981 $ git clone git://git.yoctoproject.org/auto-upgrade-helper 2901 $ git clone git://git.yoctoproject.org/auto-upgrade-helper
2982 Cloning into 'auto-upgrade-helper'... remote: Counting objects: 768, done. 2902 Cloning into 'auto-upgrade-helper'... remote: Counting objects: 768, done.
@@ -2992,8 +2912,7 @@ The following steps describe how to set up the AUH utility:
29924. *Create a Dedicated Build Directory:* Run the 29124. *Create a Dedicated Build Directory:* Run the
2993 :ref:`structure-core-script` 2913 :ref:`structure-core-script`
2994 script to create a fresh build directory that you use exclusively for 2914 script to create a fresh build directory that you use exclusively for
2995 running the AUH utility: 2915 running the AUH utility::
2996 ::
2997 2916
2998 $ cd poky 2917 $ cd poky
2999 $ source oe-init-build-env your_AUH_build_directory 2918 $ source oe-init-build-env your_AUH_build_directory
@@ -3010,8 +2929,7 @@ The following steps describe how to set up the AUH utility:
3010 - If you want to enable :ref:`Build 2929 - If you want to enable :ref:`Build
3011 History <dev-manual/common-tasks:maintaining build output quality>`, 2930 History <dev-manual/common-tasks:maintaining build output quality>`,
3012 which is optional, you need the following lines in the 2931 which is optional, you need the following lines in the
3013 ``conf/local.conf`` file: 2932 ``conf/local.conf`` file::
3014 ::
3015 2933
3016 INHERIT =+ "buildhistory" 2934 INHERIT =+ "buildhistory"
3017 BUILDHISTORY_COMMIT = "1" 2935 BUILDHISTORY_COMMIT = "1"
@@ -3024,23 +2942,20 @@ The following steps describe how to set up the AUH utility:
3024 - If you want to enable testing through the 2942 - If you want to enable testing through the
3025 :ref:`testimage <ref-classes-testimage*>` 2943 :ref:`testimage <ref-classes-testimage*>`
3026 class, which is optional, you need to have the following set in 2944 class, which is optional, you need to have the following set in
3027 your ``conf/local.conf`` file: 2945 your ``conf/local.conf`` file::
3028 ::
3029 2946
3030 INHERIT += "testimage" 2947 INHERIT += "testimage"
3031 2948
3032 .. note:: 2949 .. note::
3033 2950
3034 If your distro does not enable by default ptest, which Poky 2951 If your distro does not enable by default ptest, which Poky
3035 does, you need the following in your ``local.conf`` file: 2952 does, you need the following in your ``local.conf`` file::
3036 ::
3037 2953
3038 DISTRO_FEATURES_append = " ptest" 2954 DISTRO_FEATURES_append = " ptest"
3039 2955
3040 2956
30416. *Optionally Start a vncserver:* If you are running in a server 29576. *Optionally Start a vncserver:* If you are running in a server
3042 without an X11 session, you need to start a vncserver: 2958 without an X11 session, you need to start a vncserver::
3043 ::
3044 2959
3045 $ vncserver :1 2960 $ vncserver :1
3046 $ export DISPLAY=:1 2961 $ export DISPLAY=:1
@@ -3064,45 +2979,38 @@ The following steps describe how to set up the AUH utility:
3064This next set of examples describes how to use the AUH: 2979This next set of examples describes how to use the AUH:
3065 2980
3066- *Upgrading a Specific Recipe:* To upgrade a specific recipe, use the 2981- *Upgrading a Specific Recipe:* To upgrade a specific recipe, use the
3067 following form: 2982 following form::
3068 ::
3069 2983
3070 $ upgrade-helper.py recipe_name 2984 $ upgrade-helper.py recipe_name
3071 2985
3072 For example, this command upgrades the ``xmodmap`` recipe: 2986 For example, this command upgrades the ``xmodmap`` recipe::
3073 ::
3074 2987
3075 $ upgrade-helper.py xmodmap 2988 $ upgrade-helper.py xmodmap
3076 2989
3077- *Upgrading a Specific Recipe to a Particular Version:* To upgrade a 2990- *Upgrading a Specific Recipe to a Particular Version:* To upgrade a
3078 specific recipe to a particular version, use the following form: 2991 specific recipe to a particular version, use the following form::
3079 ::
3080 2992
3081 $ upgrade-helper.py recipe_name -t version 2993 $ upgrade-helper.py recipe_name -t version
3082 2994
3083 For example, this command upgrades the ``xmodmap`` recipe to version 1.2.3: 2995 For example, this command upgrades the ``xmodmap`` recipe to version 1.2.3::
3084 ::
3085 2996
3086 $ upgrade-helper.py xmodmap -t 1.2.3 2997 $ upgrade-helper.py xmodmap -t 1.2.3
3087 2998
3088- *Upgrading all Recipes to the Latest Versions and Suppressing Email 2999- *Upgrading all Recipes to the Latest Versions and Suppressing Email
3089 Notifications:* To upgrade all recipes to their most recent versions 3000 Notifications:* To upgrade all recipes to their most recent versions
3090 and suppress the email notifications, use the following command: 3001 and suppress the email notifications, use the following command::
3091 ::
3092 3002
3093 $ upgrade-helper.py all 3003 $ upgrade-helper.py all
3094 3004
3095- *Upgrading all Recipes to the Latest Versions and Send Email 3005- *Upgrading all Recipes to the Latest Versions and Send Email
3096 Notifications:* To upgrade all recipes to their most recent versions 3006 Notifications:* To upgrade all recipes to their most recent versions
3097 and send email messages to maintainers for each attempted recipe as 3007 and send email messages to maintainers for each attempted recipe as
3098 well as a status email, use the following command: 3008 well as a status email, use the following command::
3099 ::
3100 3009
3101 $ upgrade-helper.py -e all 3010 $ upgrade-helper.py -e all
3102 3011
3103Once you have run the AUH utility, you can find the results in the AUH 3012Once you have run the AUH utility, you can find the results in the AUH
3104build directory: 3013build directory::
3105::
3106 3014
3107 ${BUILDDIR}/upgrade-helper/timestamp 3015 ${BUILDDIR}/upgrade-helper/timestamp
3108 3016
@@ -3127,15 +3035,13 @@ section in the Yocto Project Application Development and the Extensible
3127Software Development Kit (eSDK) Manual. 3035Software Development Kit (eSDK) Manual.
3128 3036
3129To see all the command-line options available with ``devtool upgrade``, 3037To see all the command-line options available with ``devtool upgrade``,
3130use the following help command: 3038use the following help command::
3131::
3132 3039
3133 $ devtool upgrade -h 3040 $ devtool upgrade -h
3134 3041
3135If you want to find out what version a recipe is currently at upstream 3042If you want to find out what version a recipe is currently at upstream
3136without any attempt to upgrade your local version of the recipe, you can 3043without any attempt to upgrade your local version of the recipe, you can
3137use the following command: 3044use the following command::
3138::
3139 3045
3140 $ devtool latest-version recipe_name 3046 $ devtool latest-version recipe_name
3141 3047
@@ -3161,15 +3067,13 @@ could add it easily using the
3161":ref:`bitbake-layers <bsp-guide/bsp:creating a new bsp layer using the \`\`bitbake-layers\`\` script>`" 3067":ref:`bitbake-layers <bsp-guide/bsp:creating a new bsp layer using the \`\`bitbake-layers\`\` script>`"
3162script. For example, suppose you use the ``nano.bb`` recipe from the 3068script. For example, suppose you use the ``nano.bb`` recipe from the
3163``meta-oe`` layer in the ``meta-openembedded`` repository. For this 3069``meta-oe`` layer in the ``meta-openembedded`` repository. For this
3164example, assume that the layer has been cloned into following area: 3070example, assume that the layer has been cloned into following area::
3165::
3166 3071
3167 /home/scottrif/meta-openembedded 3072 /home/scottrif/meta-openembedded
3168 3073
3169The following command from your 3074The following command from your
3170:term:`Build Directory` adds the layer to 3075:term:`Build Directory` adds the layer to
3171your build configuration (i.e. ``${BUILDDIR}/conf/bblayers.conf``): 3076your build configuration (i.e. ``${BUILDDIR}/conf/bblayers.conf``)::
3172::
3173 3077
3174 $ bitbake-layers add-layer /home/scottrif/meta-openembedded/meta-oe 3078 $ bitbake-layers add-layer /home/scottrif/meta-openembedded/meta-oe
3175 NOTE: Starting bitbake server... 3079 NOTE: Starting bitbake server...
@@ -3210,8 +3114,7 @@ directory automatically upgrades the recipe for you:
3210 NOTE: New recipe is /home/scottrif/poky/build/workspace/recipes/nano/nano_2.9.3.bb 3114 NOTE: New recipe is /home/scottrif/poky/build/workspace/recipes/nano/nano_2.9.3.bb
3211 3115
3212Continuing with this example, you can use ``devtool build`` to build the 3116Continuing with this example, you can use ``devtool build`` to build the
3213newly upgraded recipe: 3117newly upgraded recipe::
3214::
3215 3118
3216 $ devtool build nano 3119 $ devtool build nano
3217 NOTE: Starting bitbake server... 3120 NOTE: Starting bitbake server...
@@ -3236,8 +3139,7 @@ and submit commits for the changes generated by the upgrade process.
3236 3139
3237Once the tree is clean, you can clean things up in this example with the 3140Once the tree is clean, you can clean things up in this example with the
3238following command from the ``${BUILDDIR}/workspace/sources/nano`` 3141following command from the ``${BUILDDIR}/workspace/sources/nano``
3239directory: 3142directory::
3240::
3241 3143
3242 $ devtool finish nano meta-oe 3144 $ devtool finish nano meta-oe
3243 NOTE: Starting bitbake server... 3145 NOTE: Starting bitbake server...
@@ -3341,8 +3243,7 @@ build packages is available in the Build Directory as defined by the
3341:term:`S` variable. Below is the default 3243:term:`S` variable. Below is the default
3342value for the ``S`` variable as defined in the 3244value for the ``S`` variable as defined in the
3343``meta/conf/bitbake.conf`` configuration file in the 3245``meta/conf/bitbake.conf`` configuration file in the
3344:term:`Source Directory`: 3246:term:`Source Directory`::
3345::
3346 3247
3347 S = "${WORKDIR}/${BP}" 3248 S = "${WORKDIR}/${BP}"
3348 3249
@@ -3353,16 +3254,14 @@ usually set ``S`` to ``${WORKDIR}/git``.
3353.. note:: 3254.. note::
3354 3255
3355 The :term:`BP` represents the base recipe name, which consists of the name 3256 The :term:`BP` represents the base recipe name, which consists of the name
3356 and version: 3257 and version::
3357 ::
3358 3258
3359 BP = "${BPN}-${PV}" 3259 BP = "${BPN}-${PV}"
3360 3260
3361 3261
3362The path to the work directory for the recipe 3262The path to the work directory for the recipe
3363(:term:`WORKDIR`) is defined as 3263(:term:`WORKDIR`) is defined as
3364follows: 3264follows::
3365::
3366 3265
3367 ${TMPDIR}/work/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR} 3266 ${TMPDIR}/work/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}
3368 3267
@@ -3388,8 +3287,7 @@ As an example, assume a Source Directory top-level folder named
3388``poky``, a default Build Directory at ``poky/build``, and a 3287``poky``, a default Build Directory at ``poky/build``, and a
3389``qemux86-poky-linux`` machine target system. Furthermore, suppose your 3288``qemux86-poky-linux`` machine target system. Furthermore, suppose your
3390recipe is named ``foo_1.3.0.bb``. In this case, the work directory the 3289recipe is named ``foo_1.3.0.bb``. In this case, the work directory the
3391build system uses to build the package would be as follows: 3290build system uses to build the package would be as follows::
3392::
3393 3291
3394 poky/build/tmp/work/qemux86-poky-linux/foo/1.3.0-r0 3292 poky/build/tmp/work/qemux86-poky-linux/foo/1.3.0-r0
3395 3293
@@ -3426,15 +3324,13 @@ Follow these general steps:
3426 3324
34273. *Create a New Patch:* Before modifying source code, you need to 33253. *Create a New Patch:* Before modifying source code, you need to
3428 create a new patch. To create a new patch file, use ``quilt new`` as 3326 create a new patch. To create a new patch file, use ``quilt new`` as
3429 below: 3327 below::
3430 ::
3431 3328
3432 $ quilt new my_changes.patch 3329 $ quilt new my_changes.patch
3433 3330
34344. *Notify Quilt and Add Files:* After creating the patch, you need to 33314. *Notify Quilt and Add Files:* After creating the patch, you need to
3435 notify Quilt about the files you plan to edit. You notify Quilt by 3332 notify Quilt about the files you plan to edit. You notify Quilt by
3436 adding the files to the patch you just created: 3333 adding the files to the patch you just created::
3437 ::
3438 3334
3439 $ quilt add file1.c file2.c file3.c 3335 $ quilt add file1.c file2.c file3.c
3440 3336
@@ -3443,8 +3339,7 @@ Follow these general steps:
3443 3339
34446. *Test Your Changes:* Once you have modified the source code, the 33406. *Test Your Changes:* Once you have modified the source code, the
3445 easiest way to test your changes is by calling the ``do_compile`` 3341 easiest way to test your changes is by calling the ``do_compile``
3446 task as shown in the following example: 3342 task as shown in the following example::
3447 ::
3448 3343
3449 $ bitbake -c compile -f package 3344 $ bitbake -c compile -f package
3450 3345
@@ -3481,8 +3376,7 @@ Follow these general steps:
3481 that holds the recipe (``.bb``) file or the append (``.bbappend``) 3376 that holds the recipe (``.bb``) file or the append (``.bbappend``)
3482 file. Placing the patch here guarantees that the OpenEmbedded build 3377 file. Placing the patch here guarantees that the OpenEmbedded build
3483 system will find the patch. Next, add the patch into the ``SRC_URI`` 3378 system will find the patch. Next, add the patch into the ``SRC_URI``
3484 of the recipe. Here is an example: 3379 of the recipe. Here is an example::
3485 ::
3486 3380
3487 SRC_URI += "file://my_changes.patch" 3381 SRC_URI += "file://my_changes.patch"
3488 3382
@@ -3503,8 +3397,7 @@ this way can be helpful when debugging a build or preparing software to
3503be used with the OpenEmbedded build system. 3397be used with the OpenEmbedded build system.
3504 3398
3505Following is an example that uses ``devshell`` on a target named 3399Following is an example that uses ``devshell`` on a target named
3506``matchbox-desktop``: 3400``matchbox-desktop``::
3507::
3508 3401
3509 $ bitbake matchbox-desktop -c devshell 3402 $ bitbake matchbox-desktop -c devshell
3510 3403
@@ -3533,8 +3426,7 @@ corresponding ``run.*`` script in the
3533directory (e.g., ``run.do_configure.``\ `pid`). If a task's script does 3426directory (e.g., ``run.do_configure.``\ `pid`). If a task's script does
3534not exist, which would be the case if the task was skipped by way of the 3427not exist, which would be the case if the task was skipped by way of the
3535sstate cache, you can create the task by first running it outside of the 3428sstate cache, you can create the task by first running it outside of the
3536``devshell``: 3429``devshell``::
3537::
3538 3430
3539 $ bitbake -c task 3431 $ bitbake -c task
3540 3432
@@ -3581,8 +3473,7 @@ specified target. Then a new terminal is opened. Additionally, key
3581Python objects and code are available in the same way they are to 3473Python objects and code are available in the same way they are to
3582BitBake tasks, in particular, the data store 'd'. So, commands such as 3474BitBake tasks, in particular, the data store 'd'. So, commands such as
3583the following are useful when exploring the data store and running 3475the following are useful when exploring the data store and running
3584functions: 3476functions::
3585::
3586 3477
3587 pydevshell> d.getVar("STAGING_DIR") 3478 pydevshell> d.getVar("STAGING_DIR")
3588 '/media/build1/poky/build/tmp/sysroots' 3479 '/media/build1/poky/build/tmp/sysroots'
@@ -3602,8 +3493,7 @@ helpful when debugging a build or preparing software to be used with the
3602OpenEmbedded build system. 3493OpenEmbedded build system.
3603 3494
3604Following is an example that uses ``devpyshell`` on a target named 3495Following is an example that uses ``devpyshell`` on a target named
3605``matchbox-desktop``: 3496``matchbox-desktop``::
3606::
3607 3497
3608 $ bitbake matchbox-desktop -c devpyshell 3498 $ bitbake matchbox-desktop -c devpyshell
3609 3499
@@ -3664,8 +3554,7 @@ The following figure and list overviews the build process:
3664 3554
36652. *Initialize the Build Environment:* Initialize the build environment 35552. *Initialize the Build Environment:* Initialize the build environment
3666 by sourcing the build environment script (i.e. 3556 by sourcing the build environment script (i.e.
3667 :ref:`structure-core-script`): 3557 :ref:`structure-core-script`)::
3668 ::
3669 3558
3670 $ source oe-init-build-env [build_dir] 3559 $ source oe-init-build-env [build_dir]
3671 3560
@@ -3690,8 +3579,7 @@ The following figure and list overviews the build process:
3690 and a centralized tarball download directory through the 3579 and a centralized tarball download directory through the
3691 :term:`DL_DIR` variable. 3580 :term:`DL_DIR` variable.
3692 3581
36934. *Build the Image:* Build the image using the ``bitbake`` command: 35824. *Build the Image:* Build the image using the ``bitbake`` command::
3694 ::
3695 3583
3696 $ bitbake target 3584 $ bitbake target
3697 3585
@@ -3710,8 +3598,7 @@ The following figure and list overviews the build process:
3710 Project Reference Manual. 3598 Project Reference Manual.
3711 3599
3712 As an example, the following command builds the 3600 As an example, the following command builds the
3713 ``core-image-minimal`` image: 3601 ``core-image-minimal`` image::
3714 ::
3715 3602
3716 $ bitbake core-image-minimal 3603 $ bitbake core-image-minimal
3717 3604
@@ -3763,8 +3650,7 @@ Follow these steps to set up and execute multiple configuration builds:
3763 3650
3764 Here is an example showing the minimal statements needed in a 3651 Here is an example showing the minimal statements needed in a
3765 configuration file for a "qemux86" target whose temporary build 3652 configuration file for a "qemux86" target whose temporary build
3766 directory is ``tmpmultix86``: 3653 directory is ``tmpmultix86``::
3767 ::
3768 3654
3769 MACHINE = "qemux86" 3655 MACHINE = "qemux86"
3770 TMPDIR = "${TOPDIR}/tmpmultix86" 3656 TMPDIR = "${TOPDIR}/tmpmultix86"
@@ -3789,8 +3675,7 @@ Follow these steps to set up and execute multiple configuration builds:
3789 variable in your ``conf/local.conf`` configuration file to specify 3675 variable in your ``conf/local.conf`` configuration file to specify
3790 each multiconfig. Continuing with the example from the previous 3676 each multiconfig. Continuing with the example from the previous
3791 figure, the ``BBMULTICONFIG`` variable needs to enable two 3677 figure, the ``BBMULTICONFIG`` variable needs to enable two
3792 multiconfigs: "x86" and "arm" by specifying each configuration file: 3678 multiconfigs: "x86" and "arm" by specifying each configuration file::
3793 ::
3794 3679
3795 BBMULTICONFIG = "x86 arm" 3680 BBMULTICONFIG = "x86 arm"
3796 3681
@@ -3804,13 +3689,11 @@ Follow these steps to set up and execute multiple configuration builds:
3804 with "". 3689 with "".
3805 3690
3806- *Launch BitBake*: Use the following BitBake command form to launch 3691- *Launch BitBake*: Use the following BitBake command form to launch
3807 the multiple configuration build: 3692 the multiple configuration build::
3808 ::
3809 3693
3810 $ bitbake [mc:multiconfigname:]target [[[mc:multiconfigname:]target] ... ] 3694 $ bitbake [mc:multiconfigname:]target [[[mc:multiconfigname:]target] ... ]
3811 3695
3812 For the example in this section, the following command applies: 3696 For the example in this section, the following command applies::
3813 ::
3814 3697
3815 $ bitbake mc:x86:core-image-minimal mc:arm:core-image-sato mc::core-image-base 3698 $ bitbake mc:x86:core-image-minimal mc:arm:core-image-sato mc::core-image-base
3816 3699
@@ -3844,15 +3727,13 @@ essentially that the
3844 3727
3845To enable dependencies in a multiple configuration build, you must 3728To enable dependencies in a multiple configuration build, you must
3846declare the dependencies in the recipe using the following statement 3729declare the dependencies in the recipe using the following statement
3847form: 3730form::
3848::
3849 3731
3850 task_or_package[mcdepends] = "mc:from_multiconfig:to_multiconfig:recipe_name:task_on_which_to_depend" 3732 task_or_package[mcdepends] = "mc:from_multiconfig:to_multiconfig:recipe_name:task_on_which_to_depend"
3851 3733
3852To better show how to use this statement, consider the example scenario 3734To better show how to use this statement, consider the example scenario
3853from the first paragraph of this section. The following statement needs 3735from the first paragraph of this section. The following statement needs
3854to be added to the recipe that builds the ``core-image-sato`` image: 3736to be added to the recipe that builds the ``core-image-sato`` image::
3855::
3856 3737
3857 do_image[mcdepends] = "mc:x86:arm:core-image-minimal:do_rootfs" 3738 do_image[mcdepends] = "mc:x86:arm:core-image-minimal:do_rootfs"
3858 3739
@@ -3862,8 +3743,7 @@ task on which the ``do_image`` task in the recipe depends is the
3862with the "arm" multiconfig. 3743with the "arm" multiconfig.
3863 3744
3864Once you set up this dependency, you can build the "x86" multiconfig 3745Once you set up this dependency, you can build the "x86" multiconfig
3865using a BitBake command as follows: 3746using a BitBake command as follows::
3866::
3867 3747
3868 $ bitbake mc:x86:core-image-sato 3748 $ bitbake mc:x86:core-image-sato
3869 3749
@@ -3874,8 +3754,7 @@ dependency, BitBake also executes through the ``do_rootfs`` task for the
3874 3754
3875Having a recipe depend on the root filesystem of another build might not 3755Having a recipe depend on the root filesystem of another build might not
3876seem that useful. Consider this change to the statement in the 3756seem that useful. Consider this change to the statement in the
3877``core-image-sato`` recipe: 3757``core-image-sato`` recipe::
3878::
3879 3758
3880 do_image[mcdepends] = "mc:x86:arm:core-image-minimal:do_image" 3759 do_image[mcdepends] = "mc:x86:arm:core-image-minimal:do_image"
3881 3760
@@ -4091,8 +3970,7 @@ happens, which changes the way you build them. You can also modify the
4091filesystem itself or select a different filesystem. 3970filesystem itself or select a different filesystem.
4092 3971
4093First, find out what is hogging your root filesystem by running the 3972First, find out what is hogging your root filesystem by running the
4094``dirsize.py`` script from your root directory: 3973``dirsize.py`` script from your root directory::
4095::
4096 3974
4097 $ cd root-directory-of-image 3975 $ cd root-directory-of-image
4098 $ dirsize.py 100000 > dirsize-100k.log 3976 $ dirsize.py 100000 > dirsize-100k.log
@@ -4107,8 +3985,7 @@ the root filesystem that take up large amounts of memory.
4107 3985
4108You need to be sure that what you eliminate does not cripple the 3986You need to be sure that what you eliminate does not cripple the
4109functionality you need. One way to see how packages relate to each other 3987functionality you need. One way to see how packages relate to each other
4110is by using the Dependency Explorer UI with the BitBake command: 3988is by using the Dependency Explorer UI with the BitBake command::
4111::
4112 3989
4113 $ cd image-directory 3990 $ cd image-directory
4114 $ bitbake -u taskexp -g image 3991 $ bitbake -u taskexp -g image
@@ -4124,8 +4001,7 @@ instead of ``udev``.
4124 4001
4125Use your ``local.conf`` file to make changes. For example, to eliminate 4002Use your ``local.conf`` file to make changes. For example, to eliminate
4126``udev`` and ``glib``, set the following in the local configuration 4003``udev`` and ``glib``, set the following in the local configuration
4127file: 4004file::
4128::
4129 4005
4130 VIRTUAL-RUNTIME_dev_manager = "" 4006 VIRTUAL-RUNTIME_dev_manager = ""
4131 4007
@@ -4153,8 +4029,7 @@ building? Which drivers do you build by default?
4153 You can modify the kernel source if you want to help with boot time. 4029 You can modify the kernel source if you want to help with boot time.
4154 4030
4155Run the ``ksize.py`` script from the top-level Linux build directory to 4031Run the ``ksize.py`` script from the top-level Linux build directory to
4156get an idea of what is making up the kernel: 4032get an idea of what is making up the kernel::
4157::
4158 4033
4159 $ cd top-level-linux-build-directory 4034 $ cd top-level-linux-build-directory
4160 $ ksize.py > ksize.log 4035 $ ksize.py > ksize.log
@@ -4168,8 +4043,7 @@ in a compressed kernel image. Look to reduce the areas that are large
4168and taking up around the "90% rule." 4043and taking up around the "90% rule."
4169 4044
4170To examine, or drill down, into any particular area, use the ``-d`` 4045To examine, or drill down, into any particular area, use the ``-d``
4171option with the script: 4046option with the script::
4172::
4173 4047
4174 $ ksize.py -d > ksize.log 4048 $ ksize.py -d > ksize.log
4175 4049
@@ -4316,8 +4190,7 @@ your tunings to best consider build times and package feed maintenance.
4316 machine-architecture dependent, make sure your recipe enables the 4190 machine-architecture dependent, make sure your recipe enables the
4317 "machine" package architecture through the 4191 "machine" package architecture through the
4318 :term:`MACHINE_ARCH` 4192 :term:`MACHINE_ARCH`
4319 variable: 4193 variable::
4320 ::
4321 4194
4322 PACKAGE_ARCH = "${MACHINE_ARCH}" 4195 PACKAGE_ARCH = "${MACHINE_ARCH}"
4323 4196
@@ -4325,8 +4198,7 @@ your tunings to best consider build times and package feed maintenance.
4325 specifically enable a package architecture through the 4198 specifically enable a package architecture through the
4326 :term:`PACKAGE_ARCH`, The 4199 :term:`PACKAGE_ARCH`, The
4327 OpenEmbedded build system defaults to the 4200 OpenEmbedded build system defaults to the
4328 :term:`TUNE_PKGARCH` setting: 4201 :term:`TUNE_PKGARCH` setting::
4329 ::
4330 4202
4331 PACKAGE_ARCH = "${TUNE_PKGARCH}" 4203 PACKAGE_ARCH = "${TUNE_PKGARCH}"
4332 4204
@@ -4426,15 +4298,13 @@ to do is inherit the
4426and then set the 4298and then set the
4427:term:`EXTERNALSRC` variable to 4299:term:`EXTERNALSRC` variable to
4428point to your external source code. Here are the statements to put in 4300point to your external source code. Here are the statements to put in
4429your ``local.conf`` file: 4301your ``local.conf`` file::
4430::
4431 4302
4432 INHERIT += "externalsrc" 4303 INHERIT += "externalsrc"
4433 EXTERNALSRC_pn-myrecipe = "path-to-your-source-tree" 4304 EXTERNALSRC_pn-myrecipe = "path-to-your-source-tree"
4434 4305
4435This next example shows how to accomplish the same thing by setting 4306This next example shows how to accomplish the same thing by setting
4436``EXTERNALSRC`` in the recipe itself or in the recipe's append file: 4307``EXTERNALSRC`` in the recipe itself or in the recipe's append file::
4437::
4438 4308
4439 EXTERNALSRC = "path" 4309 EXTERNALSRC = "path"
4440 EXTERNALSRC_BUILD = "path" 4310 EXTERNALSRC_BUILD = "path"
@@ -4451,8 +4321,7 @@ directory separate from the external source directory as specified by
4451to have the source built in the same directory in which it resides, or 4321to have the source built in the same directory in which it resides, or
4452some other nominated directory, you can set 4322some other nominated directory, you can set
4453:term:`EXTERNALSRC_BUILD` 4323:term:`EXTERNALSRC_BUILD`
4454to point to that directory: 4324to point to that directory::
4455::
4456 4325
4457 EXTERNALSRC_BUILD_pn-myrecipe = "path-to-your-source-tree" 4326 EXTERNALSRC_BUILD_pn-myrecipe = "path-to-your-source-tree"
4458 4327
@@ -4475,8 +4344,7 @@ Follow these steps to populate your Downloads directory:
4475 an empty location or one that does not yet exist. 4344 an empty location or one that does not yet exist.
4476 4345
44772. *Generate Tarballs of the Source Git Repositories:* Edit your 43462. *Generate Tarballs of the Source Git Repositories:* Edit your
4478 ``local.conf`` configuration file as follows: 4347 ``local.conf`` configuration file as follows::
4479 ::
4480 4348
4481 DL_DIR = "/home/your-download-dir/" 4349 DL_DIR = "/home/your-download-dir/"
4482 BB_GENERATE_MIRROR_TARBALLS = "1" 4350 BB_GENERATE_MIRROR_TARBALLS = "1"
@@ -4489,8 +4357,7 @@ Follow these steps to populate your Downloads directory:
4489 variable for more information. 4357 variable for more information.
4490 4358
44913. *Populate Your Downloads Directory Without Building:* Use BitBake to 43593. *Populate Your Downloads Directory Without Building:* Use BitBake to
4492 fetch your sources but inhibit the build: 4360 fetch your sources but inhibit the build::
4493 ::
4494 4361
4495 $ bitbake target --runonly=fetch 4362 $ bitbake target --runonly=fetch
4496 4363
@@ -4536,8 +4403,7 @@ directory:
4536 ``${``\ :term:`TMPDIR`\ ``}`` 4403 ``${``\ :term:`TMPDIR`\ ``}``
4537 directory or using a new :term:`Build Directory`. 4404 directory or using a new :term:`Build Directory`.
4538 4405
45393. *Build Your Target:* Use BitBake to build your target: 44063. *Build Your Target:* Use BitBake to build your target::
4540 ::
4541 4407
4542 $ bitbake target 4408 $ bitbake target
4543 4409
@@ -4550,8 +4416,7 @@ directory:
4550 The offline build does not work if recipes attempt to find the 4416 The offline build does not work if recipes attempt to find the
4551 latest version of software by setting 4417 latest version of software by setting
4552 :term:`SRCREV` to 4418 :term:`SRCREV` to
4553 ``${``\ :term:`AUTOREV`\ ``}``: 4419 ``${``\ :term:`AUTOREV`\ ``}``::
4554 ::
4555 4420
4556 SRCREV = "${AUTOREV}" 4421 SRCREV = "${AUTOREV}"
4557 4422
@@ -4670,8 +4535,7 @@ that can help you speed up the build:
4670- Disable static library generation for recipes derived from 4535- Disable static library generation for recipes derived from
4671 ``autoconf`` or ``libtool``: Following is an example showing how to 4536 ``autoconf`` or ``libtool``: Following is an example showing how to
4672 disable static libraries and still provide an override to handle 4537 disable static libraries and still provide an override to handle
4673 exceptions: 4538 exceptions::
4674 ::
4675 4539
4676 STATICLIBCONF = "--disable-static" 4540 STATICLIBCONF = "--disable-static"
4677 STATICLIBCONF_sqlite3-native = "" 4541 STATICLIBCONF_sqlite3-native = ""
@@ -4726,8 +4590,7 @@ library files.
4726 static library files through ``${PN}-dev``. 4590 static library files through ``${PN}-dev``.
4727 4591
4728Following is part of the BitBake configuration file, where you can see 4592Following is part of the BitBake configuration file, where you can see
4729how the static library files are defined: 4593how the static library files are defined::
4730::
4731 4594
4732 PACKAGE_BEFORE_PN ?= "" 4595 PACKAGE_BEFORE_PN ?= ""
4733 PACKAGES = "${PN}-dbg ${PN}-staticdev ${PN}-dev ${PN}-doc ${PN}-locale ${PACKAGE_BEFORE_PN} ${PN}" 4596 PACKAGES = "${PN}-dbg ${PN}-staticdev ${PN}-dev ${PN}-doc ${PN}-locale ${PACKAGE_BEFORE_PN} ${PN}"
@@ -4833,8 +4696,7 @@ After you have set up the recipes, you need to define the actual
4833combination of multiple libraries you want to build. You accomplish this 4696combination of multiple libraries you want to build. You accomplish this
4834through your ``local.conf`` configuration file in the 4697through your ``local.conf`` configuration file in the
4835:term:`Build Directory`. An example 4698:term:`Build Directory`. An example
4836configuration would be as follows: 4699configuration would be as follows::
4837::
4838 4700
4839 MACHINE = "qemux86-64" 4701 MACHINE = "qemux86-64"
4840 require conf/multilib.conf 4702 require conf/multilib.conf
@@ -4850,14 +4712,12 @@ on this particular tuning, see
4850 4712
4851The example then includes ``lib32-glib-2.0`` in all the images, which 4713The example then includes ``lib32-glib-2.0`` in all the images, which
4852illustrates one method of including a multiple library dependency. You 4714illustrates one method of including a multiple library dependency. You
4853can use a normal image build to include this dependency, for example: 4715can use a normal image build to include this dependency, for example::
4854::
4855 4716
4856 $ bitbake core-image-sato 4717 $ bitbake core-image-sato
4857 4718
4858You can also build Multilib packages 4719You can also build Multilib packages
4859specifically with a command like this: 4720specifically with a command like this::
4860::
4861 4721
4862 $ bitbake lib32-glib-2.0 4722 $ bitbake lib32-glib-2.0
4863 4723
@@ -4952,8 +4812,7 @@ you have other recipes that depend on a given library, you need to use
4952the :term:`DEPENDS` variable to 4812the :term:`DEPENDS` variable to
4953create the dependency. Continuing with the same example, if you want to 4813create the dependency. Continuing with the same example, if you want to
4954have a recipe depend on the 1.8 version of the ``clutter`` library, use 4814have a recipe depend on the 1.8 version of the ``clutter`` library, use
4955the following in your recipe: 4815the following in your recipe::
4956::
4957 4816
4958 DEPENDS = "clutter-1.8" 4817 DEPENDS = "clutter-1.8"
4959 4818
@@ -4996,8 +4855,7 @@ follows:
4996- Support for large images exists. 4855- Support for large images exists.
4997 4856
4998To use the x32 psABI, you need to edit your ``conf/local.conf`` 4857To use the x32 psABI, you need to edit your ``conf/local.conf``
4999configuration file as follows: 4858configuration file as follows::
5000::
5001 4859
5002 MACHINE = "qemux86-64" 4860 MACHINE = "qemux86-64"
5003 DEFAULTTUNE = "x86-64-x32" 4861 DEFAULTTUNE = "x86-64-x32"
@@ -5006,8 +4864,7 @@ configuration file as follows:
5006 4864
5007Once you have set 4865Once you have set
5008up your configuration file, use BitBake to build an image that supports 4866up your configuration file, use BitBake to build an image that supports
5009the x32 psABI. Here is an example: 4867the x32 psABI. Here is an example::
5010::
5011 4868
5012 $ bitbake core-image-sato 4869 $ bitbake core-image-sato
5013 4870
@@ -5066,8 +4923,7 @@ library package involves the following:
50663. Try to build the recipe. If you encounter build errors that look like 49233. Try to build the recipe. If you encounter build errors that look like
5067 something is unable to find ``.so`` libraries, check where these 4924 something is unable to find ``.so`` libraries, check where these
5068 libraries are located in the source tree and add the following to the 4925 libraries are located in the source tree and add the following to the
5069 recipe: 4926 recipe::
5070 ::
5071 4927
5072 GIR_EXTRA_LIBS_PATH = "${B}/something/.libs" 4928 GIR_EXTRA_LIBS_PATH = "${B}/something/.libs"
5073 4929
@@ -5097,8 +4953,7 @@ perhaps QEMU does not work on your build host and target architecture
5097combination. If so, you can use either of the following methods to 4953combination. If so, you can use either of the following methods to
5098disable GIR file generations: 4954disable GIR file generations:
5099 4955
5100- Add the following to your distro configuration: 4956- Add the following to your distro configuration::
5101 ::
5102 4957
5103 DISTRO_FEATURES_BACKFILL_CONSIDERED = "gobject-introspection-data" 4958 DISTRO_FEATURES_BACKFILL_CONSIDERED = "gobject-introspection-data"
5104 4959
@@ -5106,8 +4961,7 @@ disable GIR file generations:
5106 QEMU but will still enable building introspection tools and libraries 4961 QEMU but will still enable building introspection tools and libraries
5107 (i.e. building them does not require the use of QEMU). 4962 (i.e. building them does not require the use of QEMU).
5108 4963
5109- Add the following to your machine configuration: 4964- Add the following to your machine configuration::
5110 ::
5111 4965
5112 MACHINE_FEATURES_BACKFILL_CONSIDERED = "qemu-usermode" 4966 MACHINE_FEATURES_BACKFILL_CONSIDERED = "qemu-usermode"
5113 4967
@@ -5140,8 +4994,7 @@ working in an image:
5140 4994
51413. Launch a Terminal and then start Python in the terminal. 49953. Launch a Terminal and then start Python in the terminal.
5142 4996
51434. Enter the following in the terminal: 49974. Enter the following in the terminal::
5144 ::
5145 4998
5146 >>> from gi.repository import GLib 4999 >>> from gi.repository import GLib
5147 >>> GLib.get_host_name() 5000 >>> GLib.get_host_name()
@@ -5289,8 +5142,7 @@ system needs to meet the following requirements:
5289 form generated by the OpenEmbedded build system. 5142 form generated by the OpenEmbedded build system.
5290 5143
5291- You must build several native tools, which are built to run on the 5144- You must build several native tools, which are built to run on the
5292 build system: 5145 build system::
5293 ::
5294 5146
5295 $ bitbake parted-native dosfstools-native mtools-native 5147 $ bitbake parted-native dosfstools-native mtools-native
5296 5148
@@ -5306,8 +5158,7 @@ Getting Help
5306 5158
5307You can get general help for the ``wic`` command by entering the ``wic`` 5159You can get general help for the ``wic`` command by entering the ``wic``
5308command by itself or by entering the command with a help argument as 5160command by itself or by entering the command with a help argument as
5309follows: 5161follows::
5310::
5311 5162
5312 $ wic -h 5163 $ wic -h
5313 $ wic --help 5164 $ wic --help
@@ -5315,32 +5166,27 @@ follows:
5315 5166
5316Currently, Wic supports seven commands: ``cp``, ``create``, ``help``, 5167Currently, Wic supports seven commands: ``cp``, ``create``, ``help``,
5317``list``, ``ls``, ``rm``, and ``write``. You can get help for all these 5168``list``, ``ls``, ``rm``, and ``write``. You can get help for all these
5318commands except "help" by using the following form: 5169commands except "help" by using the following form::
5319::
5320 5170
5321 $ wic help command 5171 $ wic help command
5322 5172
5323For example, the following command returns help for the ``write`` 5173For example, the following command returns help for the ``write``
5324command: 5174command::
5325::
5326 5175
5327 $ wic help write 5176 $ wic help write
5328 5177
5329Wic supports help for three topics: ``overview``, ``plugins``, and 5178Wic supports help for three topics: ``overview``, ``plugins``, and
5330``kickstart``. You can get help for any topic using the following form: 5179``kickstart``. You can get help for any topic using the following form::
5331::
5332 5180
5333 $ wic help topic 5181 $ wic help topic
5334 5182
5335For example, the following returns overview help for Wic: 5183For example, the following returns overview help for Wic::
5336::
5337 5184
5338 $ wic help overview 5185 $ wic help overview
5339 5186
5340One additional level of help exists for Wic. You can get help on 5187One additional level of help exists for Wic. You can get help on
5341individual images through the ``list`` command. You can use the ``list`` 5188individual images through the ``list`` command. You can use the ``list``
5342command to return the available Wic images as follows: 5189command to return the available Wic images as follows::
5343::
5344 5190
5345 $ wic list images 5191 $ wic list images
5346 genericx86 Create an EFI disk image for genericx86* 5192 genericx86 Create an EFI disk image for genericx86*
@@ -5359,8 +5205,7 @@ command to return the available Wic images as follows:
5359Once you know the list of available 5205Once you know the list of available
5360Wic images, you can use ``help`` with the command to get help on a 5206Wic images, you can use ``help`` with the command to get help on a
5361particular image. For example, the following command returns help on the 5207particular image. For example, the following command returns help on the
5362"beaglebone-yocto" image: 5208"beaglebone-yocto" image::
5363::
5364 5209
5365 $ wic list beaglebone-yocto help 5210 $ wic list beaglebone-yocto help
5366 5211
@@ -5397,8 +5242,7 @@ can point to arbitrary kernel, root filesystem locations, and so forth.
5397Contrast this behavior with cooked mode where Wic looks in the Build 5242Contrast this behavior with cooked mode where Wic looks in the Build
5398Directory (e.g. ``tmp/deploy/images/``\ machine). 5243Directory (e.g. ``tmp/deploy/images/``\ machine).
5399 5244
5400The general form of the ``wic`` command in raw mode is: 5245The general form of the ``wic`` command in raw mode is::
5401::
5402 5246
5403 $ wic create wks_file options ... 5247 $ wic create wks_file options ...
5404 5248
@@ -5456,8 +5300,7 @@ a kickstart file and the name of the image from which to use artifacts
5456by using the "-e" option. Wic looks in the Build Directory (e.g. 5300by using the "-e" option. Wic looks in the Build Directory (e.g.
5457``tmp/deploy/images/``\ machine) for artifacts. 5301``tmp/deploy/images/``\ machine) for artifacts.
5458 5302
5459The general form of the ``wic`` command using Cooked Mode is as follows: 5303The general form of the ``wic`` command using Cooked Mode is as follows::
5460::
5461 5304
5462 $ wic create wks_file -e IMAGE_NAME 5305 $ wic create wks_file -e IMAGE_NAME
5463 5306
@@ -5480,14 +5323,12 @@ Using an Existing Kickstart File
5480If you do not want to create your own kickstart file, you can use an 5323If you do not want to create your own kickstart file, you can use an
5481existing file provided by the Wic installation. As shipped, kickstart 5324existing file provided by the Wic installation. As shipped, kickstart
5482files can be found in the :ref:`overview-manual/development-environment:yocto project source repositories` in the 5325files can be found in the :ref:`overview-manual/development-environment:yocto project source repositories` in the
5483following two locations: 5326following two locations::
5484::
5485 5327
5486 poky/meta-yocto-bsp/wic 5328 poky/meta-yocto-bsp/wic
5487 poky/scripts/lib/wic/canned-wks 5329 poky/scripts/lib/wic/canned-wks
5488 5330
5489Use the following command to list the available kickstart files: 5331Use the following command to list the available kickstart files::
5490::
5491 5332
5492 $ wic list images 5333 $ wic list images
5493 genericx86 Create an EFI disk image for genericx86* 5334 genericx86 Create an EFI disk image for genericx86*
@@ -5505,15 +5346,13 @@ Use the following command to list the available kickstart files:
5505 5346
5506When you use an existing file, you 5347When you use an existing file, you
5507do not have to use the ``.wks`` extension. Here is an example in Raw 5348do not have to use the ``.wks`` extension. Here is an example in Raw
5508Mode that uses the ``directdisk`` file: 5349Mode that uses the ``directdisk`` file::
5509::
5510 5350
5511 $ wic create directdisk -r rootfs_dir -b bootimg_dir \ 5351 $ wic create directdisk -r rootfs_dir -b bootimg_dir \
5512 -k kernel_dir -n native_sysroot 5352 -k kernel_dir -n native_sysroot
5513 5353
5514Here are the actual partition language commands used in the 5354Here are the actual partition language commands used in the
5515``genericx86.wks`` file to generate an image: 5355``genericx86.wks`` file to generate an image::
5516::
5517 5356
5518 # short-description: Create an EFI disk image for genericx86* 5357 # short-description: Create an EFI disk image for genericx86*
5519 # long-description: Creates a partitioned EFI disk image for genericx86* machines 5358 # long-description: Creates a partitioned EFI disk image for genericx86* machines
@@ -5571,8 +5410,7 @@ When the Wic implementation needs to invoke a partition-specific
5571implementation, it looks for the plugin with the same name as the 5410implementation, it looks for the plugin with the same name as the
5572``--source`` parameter used in the kickstart file given to that 5411``--source`` parameter used in the kickstart file given to that
5573partition. For example, if the partition is set up using the following 5412partition. For example, if the partition is set up using the following
5574command in a kickstart file: 5413command in a kickstart file::
5575::
5576 5414
5577 part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024 5415 part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024
5578 5416
@@ -5583,8 +5421,7 @@ members of the matching source plugin (i.e. ``bootimg-pcbios``) in the
5583To be more concrete, here is the corresponding plugin definition from 5421To be more concrete, here is the corresponding plugin definition from
5584the ``bootimg-pcbios.py`` file for the previous command along with an 5422the ``bootimg-pcbios.py`` file for the previous command along with an
5585example method called by the Wic implementation when it needs to prepare 5423example method called by the Wic implementation when it needs to prepare
5586a partition using an implementation-specific function: 5424a partition using an implementation-specific function::
5587::
5588 5425
5589 . 5426 .
5590 . 5427 .
@@ -5675,8 +5512,7 @@ Generate an Image using an Existing Kickstart File
5675~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5512~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5676 5513
5677This example runs in Cooked Mode and uses the ``mkefidisk`` kickstart 5514This example runs in Cooked Mode and uses the ``mkefidisk`` kickstart
5678file: 5515file::
5679::
5680 5516
5681 $ wic create mkefidisk -e core-image-minimal 5517 $ wic create mkefidisk -e core-image-minimal
5682 INFO: Building wic-tools... 5518 INFO: Building wic-tools...
@@ -5712,8 +5548,7 @@ and kickstart file information.
5712Continuing with the example, you can now write the image from the Build 5548Continuing with the example, you can now write the image from the Build
5713Directory onto a USB stick, or whatever media for which you built your 5549Directory onto a USB stick, or whatever media for which you built your
5714image, and boot from the media. You can write the image by using 5550image, and boot from the media. You can write the image by using
5715``bmaptool`` or ``dd``: 5551``bmaptool`` or ``dd``::
5716::
5717 5552
5718 $ oe-run-native bmaptool copy mkefidisk-201804191017-sda.direct /dev/sdX 5553 $ oe-run-native bmaptool copy mkefidisk-201804191017-sda.direct /dev/sdX
5719 5554
@@ -5761,8 +5596,7 @@ the lines that specify the target disk from which to boot.
5761Next, the example modifies the ``directdisksdb-gpt.wks`` file and 5596Next, the example modifies the ``directdisksdb-gpt.wks`` file and
5762changes all instances of "``--ondisk sda``" to "``--ondisk sdb``". The 5597changes all instances of "``--ondisk sda``" to "``--ondisk sdb``". The
5763example changes the following two lines and leaves the remaining lines 5598example changes the following two lines and leaves the remaining lines
5764untouched: 5599untouched::
5765::
5766 5600
5767 part /boot --source bootimg-pcbios --ondisk sdb --label boot --active --align 1024 5601 part /boot --source bootimg-pcbios --ondisk sdb --label boot --active --align 1024
5768 part / --source rootfs --ondisk sdb --fstype=ext4 --label platform --align 1024 --use-uuid 5602 part / --source rootfs --ondisk sdb --fstype=ext4 --label platform --align 1024 --use-uuid
@@ -5799,8 +5633,7 @@ Computing (nuc) :term:`MACHINE` the
5799 5633
5800Continuing with the example, you can now directly ``dd`` the image to a 5634Continuing with the example, you can now directly ``dd`` the image to a
5801USB stick, or whatever media for which you built your image, and boot 5635USB stick, or whatever media for which you built your image, and boot
5802the resulting media: 5636the resulting media::
5803::
5804 5637
5805 $ sudo dd if=directdisksdb-gpt-201710090938-sdb.direct of=/dev/sdb 5638 $ sudo dd if=directdisksdb-gpt-201710090938-sdb.direct of=/dev/sdb
5806 140966+0 records in 5639 140966+0 records in
@@ -5814,8 +5647,7 @@ Using a Modified Kickstart File and Running in Raw Mode
5814This next example manually specifies each build artifact (runs in Raw 5647This next example manually specifies each build artifact (runs in Raw
5815Mode) and uses a modified kickstart file. The example also uses the 5648Mode) and uses a modified kickstart file. The example also uses the
5816``-o`` option to cause Wic to create the output somewhere other than the 5649``-o`` option to cause Wic to create the output somewhere other than the
5817default output directory, which is the current directory: 5650default output directory, which is the current directory::
5818::
5819 5651
5820 $ wic create /home/stephano/my_yocto/test.wks -o /home/stephano/testwic \ 5652 $ wic create /home/stephano/my_yocto/test.wks -o /home/stephano/testwic \
5821 --rootfs-dir /home/stephano/build/master/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/rootfs \ 5653 --rootfs-dir /home/stephano/build/master/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/rootfs \
@@ -5860,8 +5692,7 @@ The following example examines the contents of the Wic image, deletes
5860the existing kernel, and then inserts a new kernel: 5692the existing kernel, and then inserts a new kernel:
5861 5693
58621. *List the Partitions:* Use the ``wic ls`` command to list all the 56941. *List the Partitions:* Use the ``wic ls`` command to list all the
5863 partitions in the Wic image: 5695 partitions in the Wic image::
5864 ::
5865 5696
5866 $ wic ls tmp/deploy/images/qemux86/core-image-minimal-qemux86.wic 5697 $ wic ls tmp/deploy/images/qemux86/core-image-minimal-qemux86.wic
5867 Num Start End Size Fstype 5698 Num Start End Size Fstype
@@ -5877,8 +5708,7 @@ the existing kernel, and then inserts a new kernel:
5877 .. note:: 5708 .. note::
5878 5709
5879 You can get command usage on any Wic command using the following 5710 You can get command usage on any Wic command using the following
5880 form: 5711 form::
5881 ::
5882 5712
5883 $ wic help command 5713 $ wic help command
5884 5714
@@ -5886,14 +5716,12 @@ the existing kernel, and then inserts a new kernel:
5886 For example, the following command shows you the various ways to 5716 For example, the following command shows you the various ways to
5887 use the 5717 use the
5888 wic ls 5718 wic ls
5889 command: 5719 command::
5890 ::
5891 5720
5892 $ wic help ls 5721 $ wic help ls
5893 5722
5894 5723
5895 The following command shows what is in partition one: 5724 The following command shows what is in partition one::
5896 ::
5897 5725
5898 $ wic ls tmp/deploy/images/qemux86/core-image-minimal-qemux86.wic:1 5726 $ wic ls tmp/deploy/images/qemux86/core-image-minimal-qemux86.wic:1
5899 Volume in drive : is boot 5727 Volume in drive : is boot
@@ -5915,8 +5743,7 @@ the existing kernel, and then inserts a new kernel:
5915 5743
5916 If you see the following error, you need to update or create a 5744 If you see the following error, you need to update or create a
5917 ``~/.mtoolsrc`` file and be sure to have the line "mtools_skip_check=1" 5745 ``~/.mtoolsrc`` file and be sure to have the line "mtools_skip_check=1"
5918 in the file. Then, run the Wic command again: 5746 in the file. Then, run the Wic command again::
5919 ::
5920 5747
5921 ERROR: _exec_cmd: /usr/bin/mdir -i /tmp/wic-parttfokuwra ::/ returned '1' instead of 0 5748 ERROR: _exec_cmd: /usr/bin/mdir -i /tmp/wic-parttfokuwra ::/ returned '1' instead of 0
5922 output: Total number of sectors (47824) not a multiple of sectors per track (32)! 5749 output: Total number of sectors (47824) not a multiple of sectors per track (32)!
@@ -5924,8 +5751,7 @@ the existing kernel, and then inserts a new kernel:
5924 5751
5925 5752
59263. *Remove the Old Kernel:* Use the ``wic rm`` command to remove the 57533. *Remove the Old Kernel:* Use the ``wic rm`` command to remove the
5927 ``vmlinuz`` file (kernel): 5754 ``vmlinuz`` file (kernel)::
5928 ::
5929 5755
5930 $ wic rm tmp/deploy/images/qemux86/core-image-minimal-qemux86.wic:1/vmlinuz 5756 $ wic rm tmp/deploy/images/qemux86/core-image-minimal-qemux86.wic:1/vmlinuz
5931 5757
@@ -5937,8 +5763,7 @@ the existing kernel, and then inserts a new kernel:
5937 kernel will be in the ``workspace/sources`` area. 5763 kernel will be in the ``workspace/sources`` area.
5938 5764
5939 The following example assumes ``devtool`` was used to build the 5765 The following example assumes ``devtool`` was used to build the
5940 kernel: 5766 kernel::
5941 ::
5942 5767
5943 $ wic cp poky_sdk/tmp/work/qemux86-poky-linux/linux-yocto/4.12.12+git999-r0/linux-yocto-4.12.12+git999/arch/x86/boot/bzImage \ 5768 $ wic cp poky_sdk/tmp/work/qemux86-poky-linux/linux-yocto/4.12.12+git999-r0/linux-yocto-4.12.12+git999/arch/x86/boot/bzImage \
5944 poky/build/tmp/deploy/images/qemux86/core-image-minimal-qemux86.wic:1/vmlinuz 5769 poky/build/tmp/deploy/images/qemux86/core-image-minimal-qemux86.wic:1/vmlinuz
@@ -5968,14 +5793,12 @@ system image files much faster.
5968 - If you are using Ubuntu or Debian distributions, you can install 5793 - If you are using Ubuntu or Debian distributions, you can install
5969 the ``bmap-tools`` package using the following command and then 5794 the ``bmap-tools`` package using the following command and then
5970 use the tool without specifying ``PATH`` even from the root 5795 use the tool without specifying ``PATH`` even from the root
5971 account: 5796 account::
5972 ::
5973 5797
5974 $ sudo apt-get install bmap-tools 5798 $ sudo apt-get install bmap-tools
5975 5799
5976 - If you are unable to install the ``bmap-tools`` package, you will 5800 - If you are unable to install the ``bmap-tools`` package, you will
5977 need to build Bmaptool before using it. Use the following command: 5801 need to build Bmaptool before using it. Use the following command::
5978 ::
5979 5802
5980 $ bitbake bmap-tools-native 5803 $ bitbake bmap-tools-native
5981 5804
@@ -5984,15 +5807,13 @@ that while this example uses a Wic image, you can use Bmaptool to flash
5984any type of image. Use these steps to flash an image using Bmaptool: 5807any type of image. Use these steps to flash an image using Bmaptool:
5985 5808
59861. *Update your local.conf File:* You need to have the following set 58091. *Update your local.conf File:* You need to have the following set
5987 in your ``local.conf`` file before building your image: 5810 in your ``local.conf`` file before building your image::
5988 ::
5989 5811
5990 IMAGE_FSTYPES += "wic wic.bmap" 5812 IMAGE_FSTYPES += "wic wic.bmap"
5991 5813
59922. *Get Your Image:* Either have your image ready (pre-built with the 58142. *Get Your Image:* Either have your image ready (pre-built with the
5993 :term:`IMAGE_FSTYPES` 5815 :term:`IMAGE_FSTYPES`
5994 setting previously mentioned) or take the step to build the image: 5816 setting previously mentioned) or take the step to build the image::
5995 ::
5996 5817
5997 $ bitbake image 5818 $ bitbake image
5998 5819
@@ -6000,20 +5821,17 @@ any type of image. Use these steps to flash an image using Bmaptool:
6000 depending on your particular setup. The following commands assume the 5821 depending on your particular setup. The following commands assume the
6001 image resides in the Build Directory's ``deploy/images/`` area: 5822 image resides in the Build Directory's ``deploy/images/`` area:
6002 5823
6003 - If you have write access to the media, use this command form: 5824 - If you have write access to the media, use this command form::
6004 ::
6005 5825
6006 $ oe-run-native bmap-tools-native bmaptool copy build-directory/tmp/deploy/images/machine/image.wic /dev/sdX 5826 $ oe-run-native bmap-tools-native bmaptool copy build-directory/tmp/deploy/images/machine/image.wic /dev/sdX
6007 5827
6008 - If you do not have write access to the media, set your permissions 5828 - If you do not have write access to the media, set your permissions
6009 first and then use the same command form: 5829 first and then use the same command form::
6010 ::
6011 5830
6012 $ sudo chmod 666 /dev/sdX 5831 $ sudo chmod 666 /dev/sdX
6013 $ oe-run-native bmap-tools-native bmaptool copy build-directory/tmp/deploy/images/machine/image.wic /dev/sdX 5832 $ oe-run-native bmap-tools-native bmaptool copy build-directory/tmp/deploy/images/machine/image.wic /dev/sdX
6014 5833
6015For help on the ``bmaptool`` command, use the following command: 5834For help on the ``bmaptool`` command, use the following command::
6016::
6017 5835
6018 $ bmaptool --help 5836 $ bmaptool --help
6019 5837
@@ -6107,8 +5925,7 @@ your build output more secure. The security flags are in the
6107 5925
6108Use the following line in your ``local.conf`` file or in your custom 5926Use the following line in your ``local.conf`` file or in your custom
6109distribution configuration file to enable the security compiler and 5927distribution configuration file to enable the security compiler and
6110linker flags for your build: 5928linker flags for your build::
6111::
6112 5929
6113 require conf/distro/include/security_flags.inc 5930 require conf/distro/include/security_flags.inc
6114 5931
@@ -6123,8 +5940,7 @@ system to make your images more secure:
6123 When creating a new project, the default is to provide you with an 5940 When creating a new project, the default is to provide you with an
6124 initial ``local.conf`` file that enables this feature using the 5941 initial ``local.conf`` file that enables this feature using the
6125 :term:`EXTRA_IMAGE_FEATURES` 5942 :term:`EXTRA_IMAGE_FEATURES`
6126 variable with the line: 5943 variable with the line::
6127 ::
6128 5944
6129 EXTRA_IMAGE_FEATURES = "debug-tweaks" 5945 EXTRA_IMAGE_FEATURES = "debug-tweaks"
6130 5946
@@ -6250,8 +6066,7 @@ layer. The following steps provide some more detail:
6250 :term:`DISTRO` variable to point to 6066 :term:`DISTRO` variable to point to
6251 your distribution's configuration file. For example, if your 6067 your distribution's configuration file. For example, if your
6252 distribution's configuration file is named ``mydistro.conf``, then 6068 distribution's configuration file is named ``mydistro.conf``, then
6253 you point to it as follows: 6069 you point to it as follows::
6254 ::
6255 6070
6256 DISTRO = "mydistro" 6071 DISTRO = "mydistro"
6257 6072
@@ -6292,8 +6107,7 @@ The OpenEmbedded build system uses the environment variable
6292configuration information that ultimately ends up in the 6107configuration information that ultimately ends up in the
6293:term:`Build Directory` ``conf`` directory. 6108:term:`Build Directory` ``conf`` directory.
6294By default, ``TEMPLATECONF`` is set as follows in the ``poky`` 6109By default, ``TEMPLATECONF`` is set as follows in the ``poky``
6295repository: 6110repository::
6296::
6297 6111
6298 TEMPLATECONF=${TEMPLATECONF:-meta-poky/conf} 6112 TEMPLATECONF=${TEMPLATECONF:-meta-poky/conf}
6299 6113
@@ -6335,8 +6149,7 @@ display BitBake targets as part of the script output. Customizing this
6335targets appears as part of the script's output. 6149targets appears as part of the script's output.
6336 6150
6337Here is the default list of targets displayed as a result of running 6151Here is the default list of targets displayed as a result of running
6338either of the setup scripts: 6152either of the setup scripts::
6339::
6340 6153
6341 You can now run 'bitbake <target>' 6154 You can now run 'bitbake <target>'
6342 6155
@@ -6355,8 +6168,7 @@ Conserving Disk Space During Builds
6355 6168
6356To help conserve disk space during builds, you can add the following 6169To help conserve disk space during builds, you can add the following
6357statement to your project's ``local.conf`` configuration file found in 6170statement to your project's ``local.conf`` configuration file found in
6358the :term:`Build Directory`: 6171the :term:`Build Directory`::
6359::
6360 6172
6361 INHERIT += "rm_work" 6173 INHERIT += "rm_work"
6362 6174
@@ -6534,8 +6346,7 @@ The simplest form for a PR Service is for it to exist for a single host
6534development system that builds the package feed (building system). For 6346development system that builds the package feed (building system). For
6535this scenario, you can enable a local PR Service by setting 6347this scenario, you can enable a local PR Service by setting
6536:term:`PRSERV_HOST` in your 6348:term:`PRSERV_HOST` in your
6537``local.conf`` file in the :term:`Build Directory`: 6349``local.conf`` file in the :term:`Build Directory`::
6538::
6539 6350
6540 PRSERV_HOST = "localhost:0" 6351 PRSERV_HOST = "localhost:0"
6541 6352
@@ -6546,8 +6357,7 @@ stopping the server.
6546If you have a more complex setup where multiple host development systems 6357If you have a more complex setup where multiple host development systems
6547work against a common, shared package feed, you have a single PR Service 6358work against a common, shared package feed, you have a single PR Service
6548running and it is connected to each building system. For this scenario, 6359running and it is connected to each building system. For this scenario,
6549you need to start the PR Service using the ``bitbake-prserv`` command: 6360you need to start the PR Service using the ``bitbake-prserv`` command::
6550::
6551 6361
6552 bitbake-prserv --host ip --port port --start 6362 bitbake-prserv --host ip --port port --start
6553 6363
@@ -6559,8 +6369,7 @@ server and port.
6559It is also recommended you use build history, which adds some sanity 6369It is also recommended you use build history, which adds some sanity
6560checks to binary package versions, in conjunction with the server that 6370checks to binary package versions, in conjunction with the server that
6561is running the PR Service. To enable build history, add the following to 6371is running the PR Service. To enable build history, add the following to
6562each building system's ``local.conf`` file: 6372each building system's ``local.conf`` file::
6563::
6564 6373
6565 # It is recommended to activate "buildhistory" for testing the PR service 6374 # It is recommended to activate "buildhistory" for testing the PR service
6566 INHERIT += "buildhistory" 6375 INHERIT += "buildhistory"
@@ -6629,15 +6438,13 @@ the specific source code revision from which to build. You set the
6629``SRCREV`` variable to 6438``SRCREV`` variable to
6630:term:`AUTOREV` to cause the 6439:term:`AUTOREV` to cause the
6631OpenEmbedded build system to automatically use the latest revision of 6440OpenEmbedded build system to automatically use the latest revision of
6632the software: 6441the software::
6633::
6634 6442
6635 SRCREV = "${AUTOREV}" 6443 SRCREV = "${AUTOREV}"
6636 6444
6637Furthermore, you need to reference ``SRCPV`` in ``PV`` in order to 6445Furthermore, you need to reference ``SRCPV`` in ``PV`` in order to
6638automatically update the version whenever the revision of the source 6446automatically update the version whenever the revision of the source
6639code changes. Here is an example: 6447code changes. Here is an example::
6640::
6641 6448
6642 PV = "1.0+git${SRCPV}" 6449 PV = "1.0+git${SRCPV}"
6643 6450
@@ -6707,8 +6514,7 @@ package for each one it finds by appending to the
6707:term:`PACKAGES` variable and 6514:term:`PACKAGES` variable and
6708setting the appropriate values for ``FILES_packagename``, 6515setting the appropriate values for ``FILES_packagename``,
6709``RDEPENDS_packagename``, ``DESCRIPTION_packagename``, and so forth. 6516``RDEPENDS_packagename``, ``DESCRIPTION_packagename``, and so forth.
6710Here is an example from the ``lighttpd`` recipe: 6517Here is an example from the ``lighttpd`` recipe::
6711::
6712 6518
6713 python populate_packages_prepend () { 6519 python populate_packages_prepend () {
6714 lighttpd_libdir = d.expand('${libdir}') 6520 lighttpd_libdir = d.expand('${libdir}')
@@ -6751,8 +6557,7 @@ directory of the ``poky`` :ref:`source repository <overview-manual/development-e
6751also find examples in ``meta/classes/kernel.bbclass``. 6557also find examples in ``meta/classes/kernel.bbclass``.
6752 6558
6753Following is a reference that shows ``do_split_packages`` mandatory and 6559Following is a reference that shows ``do_split_packages`` mandatory and
6754optional arguments: 6560optional arguments::
6755::
6756 6561
6757 Mandatory arguments 6562 Mandatory arguments
6758 6563
@@ -6840,8 +6645,7 @@ any dependencies on optional modules from other recipes are satisfied by
6840your recipe. You can be sure these dependencies are satisfied by using 6645your recipe. You can be sure these dependencies are satisfied by using
6841the :term:`PACKAGES_DYNAMIC` 6646the :term:`PACKAGES_DYNAMIC`
6842variable. Here is an example that continues with the ``lighttpd`` recipe 6647variable. Here is an example that continues with the ``lighttpd`` recipe
6843shown earlier: 6648shown earlier::
6844::
6845 6649
6846 PACKAGES_DYNAMIC = "lighttpd-module-.*" 6650 PACKAGES_DYNAMIC = "lighttpd-module-.*"
6847 6651
@@ -6933,8 +6737,7 @@ variable to specify the format:
6933 :term:`Build Directory` (e.g. 6737 :term:`Build Directory` (e.g.
6934 ``poky/build/conf/local.conf``). 6738 ``poky/build/conf/local.conf``).
6935 6739
69362. Select the desired package format as follows: 67402. Select the desired package format as follows::
6937 ::
6938 6741
6939 PACKAGE_CLASSES ?= "package_packageformat" 6742 PACKAGE_CLASSES ?= "package_packageformat"
6940 6743
@@ -6968,15 +6771,13 @@ target's package database(s) later once your image is up and running.
6968Whenever you perform any sort of build step that can potentially 6771Whenever you perform any sort of build step that can potentially
6969generate a package or modify existing package, it is always a good idea 6772generate a package or modify existing package, it is always a good idea
6970to re-generate the package index after the build by using the following 6773to re-generate the package index after the build by using the following
6971command: 6774command::
6972::
6973 6775
6974 $ bitbake package-index 6776 $ bitbake package-index
6975 6777
6976It might be tempting to build the 6778It might be tempting to build the
6977package and the package index at the same time with a command such as 6779package and the package index at the same time with a command such as
6978the following: 6780the following::
6979::
6980 6781
6981 $ bitbake some-package package-index 6782 $ bitbake some-package package-index
6982 6783
@@ -7024,8 +6825,7 @@ your packaging choice (i.e. the
7024:term:`PACKAGE_CLASSES` 6825:term:`PACKAGE_CLASSES`
7025setting), simply start the server. The following example assumes a build 6826setting), simply start the server. The following example assumes a build
7026directory of ``poky/build/tmp/deploy/rpm`` and a ``PACKAGE_CLASSES`` 6827directory of ``poky/build/tmp/deploy/rpm`` and a ``PACKAGE_CLASSES``
7027setting of "package_rpm": 6828setting of "package_rpm"::
7028::
7029 6829
7030 $ cd poky/build/tmp/deploy/rpm 6830 $ cd poky/build/tmp/deploy/rpm
7031 $ python3 -m http.server 6831 $ python3 -m http.server
@@ -7091,8 +6891,7 @@ for all architectures. You cannot do both:
7091 architectures. 6891 architectures.
7092 6892
7093- *Create a Single (Full) Package Index:* Define a single base URL that 6893- *Create a Single (Full) Package Index:* Define a single base URL that
7094 identifies where a full package database is located: 6894 identifies where a full package database is located::
7095 ::
7096 6895
7097 [oe-packages] 6896 [oe-packages]
7098 baseurl=http://my.server/rpm 6897 baseurl=http://my.server/rpm
@@ -7210,8 +7009,7 @@ Signing RPM Packages
7210 7009
7211To enable signing RPM packages, you must set up the following 7010To enable signing RPM packages, you must set up the following
7212configurations in either your ``local.config`` or ``distro.config`` 7011configurations in either your ``local.config`` or ``distro.config``
7213file: 7012file::
7214::
7215 7013
7216 # Inherit sign_rpm.bbclass to enable signing functionality 7014 # Inherit sign_rpm.bbclass to enable signing functionality
7217 INHERIT += " sign_rpm" 7015 INHERIT += " sign_rpm"
@@ -7242,8 +7040,7 @@ signed package feeds for IPK and RPM packages.
7242 7040
7243The steps you need to take to enable signed package feed use are similar 7041The steps you need to take to enable signed package feed use are similar
7244to the steps used to sign RPM packages. You must define the following in 7042to the steps used to sign RPM packages. You must define the following in
7245your ``local.config`` or ``distro.config`` file: 7043your ``local.config`` or ``distro.config`` file::
7246::
7247 7044
7248 INHERIT += "sign_package_feed" 7045 INHERIT += "sign_package_feed"
7249 PACKAGE_FEED_GPG_NAME = "key_name" 7046 PACKAGE_FEED_GPG_NAME = "key_name"
@@ -7282,8 +7079,7 @@ hand, the test can be anything from a simple shell script that runs a
7282binary and checks the output to an elaborate system of test binaries and 7079binary and checks the output to an elaborate system of test binaries and
7283data files. 7080data files.
7284 7081
7285The test generates output in the format used by Automake: 7082The test generates output in the format used by Automake::
7286::
7287 7083
7288 result: testname 7084 result: testname
7289 7085
@@ -7305,8 +7101,7 @@ To add package testing to your build, add the
7305:term:`DISTRO_FEATURES` and 7101:term:`DISTRO_FEATURES` and
7306:term:`EXTRA_IMAGE_FEATURES` 7102:term:`EXTRA_IMAGE_FEATURES`
7307variables to your ``local.conf`` file, which is found in the 7103variables to your ``local.conf`` file, which is found in the
7308:term:`Build Directory`: 7104:term:`Build Directory`::
7309::
7310 7105
7311 DISTRO_FEATURES_append = " ptest" 7106 DISTRO_FEATURES_append = " ptest"
7312 EXTRA_IMAGE_FEATURES += "ptest-pkgs" 7107 EXTRA_IMAGE_FEATURES += "ptest-pkgs"
@@ -7331,16 +7126,14 @@ test. Here is what you have to do for each recipe:
7331 7126
7332- *Be sure the recipe inherits 7127- *Be sure the recipe inherits
7333 the* :ref:`ptest <ref-classes-ptest>` *class:* 7128 the* :ref:`ptest <ref-classes-ptest>` *class:*
7334 Include the following line in each recipe: 7129 Include the following line in each recipe::
7335 ::
7336 7130
7337 inherit ptest 7131 inherit ptest
7338 7132
7339- *Create run-ptest:* This script starts your test. Locate the 7133- *Create run-ptest:* This script starts your test. Locate the
7340 script where you will refer to it using 7134 script where you will refer to it using
7341 :term:`SRC_URI`. Here is an 7135 :term:`SRC_URI`. Here is an
7342 example that starts a test for ``dbus``: 7136 example that starts a test for ``dbus``::
7343 ::
7344 7137
7345 #!/bin/sh 7138 #!/bin/sh
7346 cd test 7139 cd test
@@ -7352,8 +7145,7 @@ test. Here is what you have to do for each recipe:
7352 :term:`DEPENDS` and 7145 :term:`DEPENDS` and
7353 :term:`RDEPENDS` variables in 7146 :term:`RDEPENDS` variables in
7354 your recipe in order for the package to meet the dependencies. Here 7147 your recipe in order for the package to meet the dependencies. Here
7355 is an example where the package has a runtime dependency on "make": 7148 is an example where the package has a runtime dependency on "make"::
7356 ::
7357 7149
7358 RDEPENDS_${PN}-ptest += "make" 7150 RDEPENDS_${PN}-ptest += "make"
7359 7151
@@ -7374,8 +7166,7 @@ test. Here is what you have to do for each recipe:
7374 7166
7375 Regardless, you still must add a ``do_compile_ptest`` function to 7167 Regardless, you still must add a ``do_compile_ptest`` function to
7376 build the test suite. Add a function similar to the following to your 7168 build the test suite. Add a function similar to the following to your
7377 recipe: 7169 recipe::
7378 ::
7379 7170
7380 do_compile_ptest() { 7171 do_compile_ptest() {
7381 oe_runmake buildtest-TESTS 7172 oe_runmake buildtest-TESTS
@@ -7457,8 +7248,7 @@ which is a file browser web application.
7457 You must know the ``cute-files`` module version. 7248 You must know the ``cute-files`` module version.
7458 7249
7459The first thing you need to do is use ``devtool`` and the NPM fetcher to 7250The first thing you need to do is use ``devtool`` and the NPM fetcher to
7460create the recipe: 7251create the recipe::
7461::
7462 7252
7463 $ devtool add "npm://registry.npmjs.org;package=cute-files;version=1.0.2" 7253 $ devtool add "npm://registry.npmjs.org;package=cute-files;version=1.0.2"
7464 7254
@@ -7486,8 +7276,7 @@ runs.
7486 practical way to have the licenses for all of the dependencies 7276 practical way to have the licenses for all of the dependencies
7487 represented in the license manifest of the image. 7277 represented in the license manifest of the image.
7488 7278
7489The ``devtool edit-recipe`` command lets you take a look at the recipe: 7279The ``devtool edit-recipe`` command lets you take a look at the recipe::
7490::
7491 7280
7492 $ devtool edit-recipe cute-files 7281 $ devtool edit-recipe cute-files
7493 SUMMARY = "Turn any folder on your computer into a cute file browser, available on the local network." 7282 SUMMARY = "Turn any folder on your computer into a cute file browser, available on the local network."
@@ -7520,8 +7309,7 @@ Three key points exist in the previous example:
7520 :ref:`npm <ref-classes-npm>` class to package 7309 :ref:`npm <ref-classes-npm>` class to package
7521 up all the modules. 7310 up all the modules.
7522 7311
7523You can run the following command to build the ``cute-files`` package: 7312You can run the following command to build the ``cute-files`` package::
7524::
7525 7313
7526 $ devtool build cute-files 7314 $ devtool build cute-files
7527 7315
@@ -7529,8 +7317,7 @@ Remember that ``nodejs`` must be installed on
7529the target before your package. 7317the target before your package.
7530 7318
7531Assuming 192.168.7.2 for the target's IP address, use the following 7319Assuming 192.168.7.2 for the target's IP address, use the following
7532command to deploy your package: 7320command to deploy your package::
7533::
7534 7321
7535 $ devtool deploy-target -s cute-files root@192.168.7.2 7322 $ devtool deploy-target -s cute-files root@192.168.7.2
7536 7323
@@ -7569,15 +7356,13 @@ projects method, you provide ``devtool`` with an URL that points to the
7569source files. 7356source files.
7570 7357
7571Replicating the same example, (i.e. ``cute-files``) use the following 7358Replicating the same example, (i.e. ``cute-files``) use the following
7572command: 7359command::
7573::
7574 7360
7575 $ devtool add https://github.com/martinaglv/cute-files.git 7361 $ devtool add https://github.com/martinaglv/cute-files.git
7576 7362
7577The 7363The
7578recipe this command generates is very similar to the recipe created in 7364recipe this command generates is very similar to the recipe created in
7579the previous section. However, the ``SRC_URI`` looks like the following: 7365the previous section. However, the ``SRC_URI`` looks like the following::
7580::
7581 7366
7582 SRC_URI = " \ 7367 SRC_URI = " \
7583 git://github.com/martinaglv/cute-files.git;protocol=https \ 7368 git://github.com/martinaglv/cute-files.git;protocol=https \
@@ -7629,8 +7414,7 @@ by the literal sequence '\\n'. The separator can be redefined using the
7629variable flag ``separator``. 7414variable flag ``separator``.
7630 7415
7631The following is an example that adds two custom fields for ipk 7416The following is an example that adds two custom fields for ipk
7632packages: 7417packages::
7633::
7634 7418
7635 PACKAGE_ADD_METADATA_IPK = "Vendor: CustomIpk\nGroup:Applications/Spreadsheets" 7419 PACKAGE_ADD_METADATA_IPK = "Vendor: CustomIpk\nGroup:Applications/Spreadsheets"
7636 7420
@@ -7660,8 +7444,7 @@ adding statements to your configuration file so that the build process
7660checks local directories first for existing tarballs before checking the 7444checks local directories first for existing tarballs before checking the
7661Internet. 7445Internet.
7662 7446
7663Here is an efficient way to set it up in your ``local.conf`` file: 7447Here is an efficient way to set it up in your ``local.conf`` file::
7664::
7665 7448
7666 SOURCE_MIRROR_URL ?= "file:///home/you/your-download-dir/" 7449 SOURCE_MIRROR_URL ?= "file:///home/you/your-download-dir/"
7667 INHERIT += "own-mirrors" 7450 INHERIT += "own-mirrors"
@@ -7692,8 +7475,7 @@ download directory :ref:`structure-build-downloads`,
7692which is located with :term:`DL_DIR`. 7475which is located with :term:`DL_DIR`.
7693 7476
7694Use the following BitBake command form to fetch all the necessary 7477Use the following BitBake command form to fetch all the necessary
7695sources without starting the build: 7478sources without starting the build::
7696::
7697 7479
7698 $ bitbake target --runall=fetch 7480 $ bitbake target --runall=fetch
7699 7481
@@ -7740,15 +7522,13 @@ following sections.
7740Using systemd Exclusively 7522Using systemd Exclusively
7741------------------------- 7523-------------------------
7742 7524
7743Set these variables in your distribution configuration file as follows: 7525Set these variables in your distribution configuration file as follows::
7744::
7745 7526
7746 DISTRO_FEATURES_append = " systemd" 7527 DISTRO_FEATURES_append = " systemd"
7747 VIRTUAL-RUNTIME_init_manager = "systemd" 7528 VIRTUAL-RUNTIME_init_manager = "systemd"
7748 7529
7749You can also prevent the SysVinit distribution feature from 7530You can also prevent the SysVinit distribution feature from
7750being automatically enabled as follows: 7531being automatically enabled as follows::
7751::
7752 7532
7753 DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit" 7533 DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
7754 7534
@@ -7756,8 +7536,7 @@ Doing so removes any
7756redundant SysVinit scripts. 7536redundant SysVinit scripts.
7757 7537
7758To remove initscripts from your image altogether, set this variable 7538To remove initscripts from your image altogether, set this variable
7759also: 7539also::
7760::
7761 7540
7762 VIRTUAL-RUNTIME_initscripts = "" 7541 VIRTUAL-RUNTIME_initscripts = ""
7763 7542
@@ -7767,8 +7546,7 @@ For information on the backfill variable, see
7767Using systemd for the Main Image and Using SysVinit for the Rescue Image 7546Using systemd for the Main Image and Using SysVinit for the Rescue Image
7768------------------------------------------------------------------------ 7547------------------------------------------------------------------------
7769 7548
7770Set these variables in your distribution configuration file as follows: 7549Set these variables in your distribution configuration file as follows::
7771::
7772 7550
7773 DISTRO_FEATURES_append = " systemd" 7551 DISTRO_FEATURES_append = " systemd"
7774 VIRTUAL-RUNTIME_init_manager = "systemd" 7552 VIRTUAL-RUNTIME_init_manager = "systemd"
@@ -7800,8 +7578,7 @@ Using Persistent and Pre-Populated\ ``/dev``
7800 7578
7801To use the static method for device population, you need to set the 7579To use the static method for device population, you need to set the
7802:term:`USE_DEVFS` variable to "0" 7580:term:`USE_DEVFS` variable to "0"
7803as follows: 7581as follows::
7804::
7805 7582
7806 USE_DEVFS = "0" 7583 USE_DEVFS = "0"
7807 7584
@@ -7813,8 +7590,7 @@ machine or distro configuration file. Alternatively, you can set this
7813variable in your ``local.conf`` configuration file. 7590variable in your ``local.conf`` configuration file.
7814 7591
7815If you do not define the ``IMAGE_DEVICE_TABLES`` variable, the default 7592If you do not define the ``IMAGE_DEVICE_TABLES`` variable, the default
7816``device_table-minimal.txt`` is used: 7593``device_table-minimal.txt`` is used::
7817::
7818 7594
7819 IMAGE_DEVICE_TABLES = "device_table-mymachine.txt" 7595 IMAGE_DEVICE_TABLES = "device_table-mymachine.txt"
7820 7596
@@ -7826,8 +7602,7 @@ Using ``devtmpfs`` and a Device Manager
7826 7602
7827To use the dynamic method for device population, you need to use (or be 7603To use the dynamic method for device population, you need to use (or be
7828sure to set) the :term:`USE_DEVFS` 7604sure to set) the :term:`USE_DEVFS`
7829variable to "1", which is the default: 7605variable to "1", which is the default::
7830::
7831 7606
7832 USE_DEVFS = "1" 7607 USE_DEVFS = "1"
7833 7608
@@ -7844,8 +7619,7 @@ To have more control over the device nodes, you can use a device manager
7844like ``udev`` or ``busybox-mdev``. You choose the device manager by 7619like ``udev`` or ``busybox-mdev``. You choose the device manager by
7845defining the ``VIRTUAL-RUNTIME_dev_manager`` variable in your machine or 7620defining the ``VIRTUAL-RUNTIME_dev_manager`` variable in your machine or
7846distro configuration file. Alternatively, you can set this variable in 7621distro configuration file. Alternatively, you can set this variable in
7847your ``local.conf`` configuration file: 7622your ``local.conf`` configuration file::
7848::
7849 7623
7850 VIRTUAL-RUNTIME_dev_manager = "udev" 7624 VIRTUAL-RUNTIME_dev_manager = "udev"
7851 7625
@@ -7866,14 +7640,12 @@ Subversion (SVN), Git, and Bazaar (BZR) repositories.
7866 7640
7867To enable this behavior, the :term:`PV` of 7641To enable this behavior, the :term:`PV` of
7868the recipe needs to reference 7642the recipe needs to reference
7869:term:`SRCPV`. Here is an example: 7643:term:`SRCPV`. Here is an example::
7870::
7871 7644
7872 PV = "1.2.3+git${SRCPV}" 7645 PV = "1.2.3+git${SRCPV}"
7873 7646
7874Then, you can add the following to your 7647Then, you can add the following to your
7875``local.conf``: 7648``local.conf``::
7876::
7877 7649
7878 SRCREV_pn-PN = "${AUTOREV}" 7650 SRCREV_pn-PN = "${AUTOREV}"
7879 7651
@@ -7881,20 +7653,17 @@ Then, you can add the following to your
7881which you want to enable automatic source revision updating. 7653which you want to enable automatic source revision updating.
7882 7654
7883If you do not want to update your local configuration file, you can add 7655If you do not want to update your local configuration file, you can add
7884the following directly to the recipe to finish enabling the feature: 7656the following directly to the recipe to finish enabling the feature::
7885::
7886 7657
7887 SRCREV = "${AUTOREV}" 7658 SRCREV = "${AUTOREV}"
7888 7659
7889The Yocto Project provides a distribution named ``poky-bleeding``, whose 7660The Yocto Project provides a distribution named ``poky-bleeding``, whose
7890configuration file contains the line: 7661configuration file contains the line::
7891::
7892 7662
7893 require conf/distro/include/poky-floating-revisions.inc 7663 require conf/distro/include/poky-floating-revisions.inc
7894 7664
7895This line pulls in the 7665This line pulls in the
7896listed include file that contains numerous lines of exactly that form: 7666listed include file that contains numerous lines of exactly that form::
7897::
7898 7667
7899 #SRCREV_pn-opkg-native ?= "${AUTOREV}" 7668 #SRCREV_pn-opkg-native ?= "${AUTOREV}"
7900 #SRCREV_pn-opkg-sdk ?= "${AUTOREV}" 7669 #SRCREV_pn-opkg-sdk ?= "${AUTOREV}"
@@ -7946,15 +7715,13 @@ Creating the Root Filesystem
7946To create the read-only root filesystem, simply add the 7715To create the read-only root filesystem, simply add the
7947"read-only-rootfs" feature to your image, normally in one of two ways. 7716"read-only-rootfs" feature to your image, normally in one of two ways.
7948The first way is to add the "read-only-rootfs" image feature in the 7717The first way is to add the "read-only-rootfs" image feature in the
7949image's recipe file via the ``IMAGE_FEATURES`` variable: 7718image's recipe file via the ``IMAGE_FEATURES`` variable::
7950::
7951 7719
7952 IMAGE_FEATURES += "read-only-rootfs" 7720 IMAGE_FEATURES += "read-only-rootfs"
7953 7721
7954As an alternative, you can add the same feature 7722As an alternative, you can add the same feature
7955from within your build directory's ``local.conf`` file with the 7723from within your build directory's ``local.conf`` file with the
7956associated ``EXTRA_IMAGE_FEATURES`` variable, as in: 7724associated ``EXTRA_IMAGE_FEATURES`` variable, as in::
7957::
7958 7725
7959 EXTRA_IMAGE_FEATURES = "read-only-rootfs" 7726 EXTRA_IMAGE_FEATURES = "read-only-rootfs"
7960 7727
@@ -8051,8 +7818,7 @@ Build history is disabled by default. To enable it, add the following
8051``INHERIT`` statement and set the 7818``INHERIT`` statement and set the
8052:term:`BUILDHISTORY_COMMIT` 7819:term:`BUILDHISTORY_COMMIT`
8053variable to "1" at the end of your ``conf/local.conf`` file found in the 7820variable to "1" at the end of your ``conf/local.conf`` file found in the
8054:term:`Build Directory`: 7821:term:`Build Directory`::
8055::
8056 7822
8057 INHERIT += "buildhistory" 7823 INHERIT += "buildhistory"
8058 BUILDHISTORY_COMMIT = "1" 7824 BUILDHISTORY_COMMIT = "1"
@@ -8140,8 +7906,7 @@ and actual revisions might differ when
8140:term:`SRCREV` is set to 7906:term:`SRCREV` is set to
8141${:term:`AUTOREV`}. Here is an 7907${:term:`AUTOREV`}. Here is an
8142example assuming 7908example assuming
8143``buildhistory/packages/qemux86-poky-linux/linux-yocto/latest_srcrev``): 7909``buildhistory/packages/qemux86-poky-linux/linux-yocto/latest_srcrev``)::
8144::
8145 7910
8146 # SRCREV_machine = "38cd560d5022ed2dbd1ab0dca9642e47c98a0aa1" 7911 # SRCREV_machine = "38cd560d5022ed2dbd1ab0dca9642e47c98a0aa1"
8147 SRCREV_machine = "38cd560d5022ed2dbd1ab0dca9642e47c98a0aa1" 7912 SRCREV_machine = "38cd560d5022ed2dbd1ab0dca9642e47c98a0aa1"
@@ -8154,8 +7919,7 @@ collect the stored ``SRCREV`` values from build history and report them
8154in a format suitable for use in global configuration (e.g., 7919in a format suitable for use in global configuration (e.g.,
8155``local.conf`` or a distro include file) to override floating 7920``local.conf`` or a distro include file) to override floating
8156``AUTOREV`` values to a fixed set of revisions. Here is some example 7921``AUTOREV`` values to a fixed set of revisions. Here is some example
8157output from this command: 7922output from this command::
8158::
8159 7923
8160 $ buildhistory-collect-srcrevs -a 7924 $ buildhistory-collect-srcrevs -a
8161 # i586-poky-linux 7925 # i586-poky-linux
@@ -8270,8 +8034,7 @@ image. If you are just interested in this information and not interested
8270in collecting specific package or SDK information, you can enable 8034in collecting specific package or SDK information, you can enable
8271writing only image information without any history by adding the 8035writing only image information without any history by adding the
8272following to your ``conf/local.conf`` file found in the 8036following to your ``conf/local.conf`` file found in the
8273:term:`Build Directory`: 8037:term:`Build Directory`::
8274::
8275 8038
8276 INHERIT += "buildhistory" 8039 INHERIT += "buildhistory"
8277 BUILDHISTORY_COMMIT = "0" 8040 BUILDHISTORY_COMMIT = "0"
@@ -8370,8 +8133,7 @@ interface.
8370To see any changes that have occurred (assuming you have 8133To see any changes that have occurred (assuming you have
8371:term:`BUILDHISTORY_COMMIT` = "1"), 8134:term:`BUILDHISTORY_COMMIT` = "1"),
8372you can simply use any Git command that allows you to view the history 8135you can simply use any Git command that allows you to view the history
8373of a repository. Here is one method: 8136of a repository. Here is one method::
8374::
8375 8137
8376 $ git log -p 8138 $ git log -p
8377 8139
@@ -8381,8 +8143,7 @@ however, that this method does show changes that are not significant
8381 8143
8382A command-line tool called ``buildhistory-diff`` does exist, though, 8144A command-line tool called ``buildhistory-diff`` does exist, though,
8383that queries the Git repository and prints just the differences that 8145that queries the Git repository and prints just the differences that
8384might be significant in human-readable form. Here is an example: 8146might be significant in human-readable form. Here is an example::
8385::
8386 8147
8387 $ poky/poky/scripts/buildhistory-diff . HEAD^ 8148 $ poky/poky/scripts/buildhistory-diff . HEAD^
8388 Changes to images/qemux86_64/glibc/core-image-minimal (files-in-image.txt): 8149 Changes to images/qemux86_64/glibc/core-image-minimal (files-in-image.txt):
@@ -8402,8 +8163,7 @@ might be significant in human-readable form. Here is an example:
8402.. note:: 8163.. note::
8403 8164
8404 The ``buildhistory-diff`` tool requires the ``GitPython`` 8165 The ``buildhistory-diff`` tool requires the ``GitPython``
8405 package. Be sure to install it using Pip3 as follows: 8166 package. Be sure to install it using Pip3 as follows::
8406 ::
8407 8167
8408 $ pip3 install GitPython --user 8168 $ pip3 install GitPython --user
8409 8169
@@ -8473,8 +8233,7 @@ In order to run tests, you need to do the following:
8473 with sudo. 8233 with sudo.
8474 8234
8475 - The package recipe ``qemu-helper-native`` is required to run 8235 - The package recipe ``qemu-helper-native`` is required to run
8476 this script. Build the package using the following command: 8236 this script. Build the package using the following command::
8477 ::
8478 8237
8479 $ bitbake qemu-helper-native 8238 $ bitbake qemu-helper-native
8480 8239
@@ -8609,8 +8368,7 @@ not need any information in this section. You can skip down to the
8609If you did set ``TEST_TARGET`` to "SystemdbootTarget", you also need to 8368If you did set ``TEST_TARGET`` to "SystemdbootTarget", you also need to
8610perform a one-time setup of your master image by doing the following: 8369perform a one-time setup of your master image by doing the following:
8611 8370
86121. *Set EFI_PROVIDER:* Be sure that ``EFI_PROVIDER`` is as follows: 83711. *Set EFI_PROVIDER:* Be sure that ``EFI_PROVIDER`` is as follows::
8613 ::
8614 8372
8615 EFI_PROVIDER = "systemd-boot" 8373 EFI_PROVIDER = "systemd-boot"
8616 8374
@@ -8648,16 +8406,14 @@ The final thing you need to do when setting ``TEST_TARGET`` to
8648"SystemdbootTarget" is to set up the test image: 8406"SystemdbootTarget" is to set up the test image:
8649 8407
86501. *Set up your local.conf file:* Make sure you have the following 84081. *Set up your local.conf file:* Make sure you have the following
8651 statements in your ``local.conf`` file: 8409 statements in your ``local.conf`` file::
8652 ::
8653 8410
8654 IMAGE_FSTYPES += "tar.gz" 8411 IMAGE_FSTYPES += "tar.gz"
8655 INHERIT += "testimage" 8412 INHERIT += "testimage"
8656 TEST_TARGET = "SystemdbootTarget" 8413 TEST_TARGET = "SystemdbootTarget"
8657 TEST_TARGET_IP = "192.168.2.3" 8414 TEST_TARGET_IP = "192.168.2.3"
8658 8415
86592. *Build your test image:* Use BitBake to build the image: 84162. *Build your test image:* Use BitBake to build the image::
8660 ::
8661 8417
8662 $ bitbake core-image-sato 8418 $ bitbake core-image-sato
8663 8419
@@ -8671,8 +8427,7 @@ power:
8671 ``TEST_POWERCONTROL_EXTRA_ARGS`` as a command that runs on the host 8427 ``TEST_POWERCONTROL_EXTRA_ARGS`` as a command that runs on the host
8672 and does power cycling. The test code passes one argument to that 8428 and does power cycling. The test code passes one argument to that
8673 command: off, on or cycle (off then on). Here is an example that 8429 command: off, on or cycle (off then on). Here is an example that
8674 could appear in your ``local.conf`` file: 8430 could appear in your ``local.conf`` file::
8675 ::
8676 8431
8677 TEST_POWERCONTROL_CMD = "powercontrol.exp test 10.11.12.1 nuc1" 8432 TEST_POWERCONTROL_CMD = "powercontrol.exp test 10.11.12.1 nuc1"
8678 8433
@@ -8705,8 +8460,7 @@ wish to experiment with automated hardware testing, you can use the
8705the required power action. This script requires either KDialog or Zenity 8460the required power action. This script requires either KDialog or Zenity
8706to be installed. To use this script, set the 8461to be installed. To use this script, set the
8707:term:`TEST_POWERCONTROL_CMD` 8462:term:`TEST_POWERCONTROL_CMD`
8708variable as follows: 8463variable as follows::
8709::
8710 8464
8711 TEST_POWERCONTROL_CMD = "${COREBASE}/scripts/contrib/dialog-power-control" 8465 TEST_POWERCONTROL_CMD = "${COREBASE}/scripts/contrib/dialog-power-control"
8712 8466
@@ -8728,8 +8482,7 @@ connecting to a remote console server. Regardless of the case, the
8728command simply needs to connect to the serial console and forward that 8482command simply needs to connect to the serial console and forward that
8729connection to standard input and output as any normal terminal program 8483connection to standard input and output as any normal terminal program
8730does. For example, to use the picocom terminal program on serial device 8484does. For example, to use the picocom terminal program on serial device
8731``/dev/ttyUSB0`` at 115200bps, you would set the variable as follows: 8485``/dev/ttyUSB0`` at 115200bps, you would set the variable as follows::
8732::
8733 8486
8734 TEST_SERIALCONTROL_CMD = "picocom /dev/ttyUSB0 -b 115200" 8487 TEST_SERIALCONTROL_CMD = "picocom /dev/ttyUSB0 -b 115200"
8735 8488
@@ -8737,8 +8490,7 @@ For local
8737devices where the serial port device disappears when the device reboots, 8490devices where the serial port device disappears when the device reboots,
8738an additional "serdevtry" wrapper script is provided. To use this 8491an additional "serdevtry" wrapper script is provided. To use this
8739wrapper, simply prefix the terminal command with 8492wrapper, simply prefix the terminal command with
8740``${COREBASE}/scripts/contrib/serdevtry``: 8493``${COREBASE}/scripts/contrib/serdevtry``::
8741::
8742 8494
8743 TEST_SERIALCONTROL_CMD = "${COREBASE}/scripts/contrib/serdevtry picocom -b 115200 /dev/ttyUSB0" 8495 TEST_SERIALCONTROL_CMD = "${COREBASE}/scripts/contrib/serdevtry picocom -b 115200 /dev/ttyUSB0"
8744 8496
@@ -8752,27 +8504,23 @@ You can start the tests automatically or manually:
8752 set the 8504 set the
8753 :term:`TESTIMAGE_AUTO` 8505 :term:`TESTIMAGE_AUTO`
8754 variable to "1" in your ``local.conf`` file in the 8506 variable to "1" in your ``local.conf`` file in the
8755 :term:`Build Directory`: 8507 :term:`Build Directory`::
8756 ::
8757 8508
8758 TESTIMAGE_AUTO = "1" 8509 TESTIMAGE_AUTO = "1"
8759 8510
8760 Next, build your image. If the image successfully builds, the 8511 Next, build your image. If the image successfully builds, the
8761 tests run: 8512 tests run::
8762 ::
8763 8513
8764 bitbake core-image-sato 8514 bitbake core-image-sato
8765 8515
8766- *Manually running tests:* To manually run the tests, first globally 8516- *Manually running tests:* To manually run the tests, first globally
8767 inherit the 8517 inherit the
8768 :ref:`testimage <ref-classes-testimage*>` class 8518 :ref:`testimage <ref-classes-testimage*>` class
8769 by editing your ``local.conf`` file: 8519 by editing your ``local.conf`` file::
8770 ::
8771 8520
8772 INHERIT += "testimage" 8521 INHERIT += "testimage"
8773 8522
8774 Next, use BitBake to run the tests: 8523 Next, use BitBake to run the tests::
8775 ::
8776 8524
8777 bitbake -c testimage image 8525 bitbake -c testimage image
8778 8526
@@ -8815,18 +8563,15 @@ handling.
8815 8563
8816Here are some things to keep in mind when running tests: 8564Here are some things to keep in mind when running tests:
8817 8565
8818- The default tests for the image are defined as: 8566- The default tests for the image are defined as::
8819 ::
8820 8567
8821 DEFAULT_TEST_SUITES_pn-image = "ping ssh df connman syslog xorg scp vnc date rpm dnf dmesg" 8568 DEFAULT_TEST_SUITES_pn-image = "ping ssh df connman syslog xorg scp vnc date rpm dnf dmesg"
8822 8569
8823- Add your own test to the list of the by using the following: 8570- Add your own test to the list of the by using the following::
8824 ::
8825 8571
8826 TEST_SUITES_append = " mytest" 8572 TEST_SUITES_append = " mytest"
8827 8573
8828- Run a specific list of tests as follows: 8574- Run a specific list of tests as follows::
8829 ::
8830 8575
8831 TEST_SUITES = "test1 test2 test3" 8576 TEST_SUITES = "test1 test2 test3"
8832 8577
@@ -8842,16 +8587,14 @@ test execution off to a scheduler. You can only export tests that are
8842defined in :term:`TEST_SUITES`. 8587defined in :term:`TEST_SUITES`.
8843 8588
8844If your image is already built, make sure the following are set in your 8589If your image is already built, make sure the following are set in your
8845``local.conf`` file: 8590``local.conf`` file::
8846::
8847 8591
8848 INHERIT += "testexport" 8592 INHERIT += "testexport"
8849 TEST_TARGET_IP = "IP-address-for-the-test-target" 8593 TEST_TARGET_IP = "IP-address-for-the-test-target"
8850 TEST_SERVER_IP = "IP-address-for-the-test-server" 8594 TEST_SERVER_IP = "IP-address-for-the-test-server"
8851 8595
8852You can then export the tests with the 8596You can then export the tests with the
8853following BitBake command form: 8597following BitBake command form::
8854::
8855 8598
8856 $ bitbake image -c testexport 8599 $ bitbake image -c testexport
8857 8600
@@ -8860,28 +8603,24 @@ Exporting the tests places them in the
8860``tmp/testexport/``\ image, which is controlled by the 8603``tmp/testexport/``\ image, which is controlled by the
8861``TEST_EXPORT_DIR`` variable. 8604``TEST_EXPORT_DIR`` variable.
8862 8605
8863You can now run the tests outside of the build environment: 8606You can now run the tests outside of the build environment::
8864::
8865 8607
8866 $ cd tmp/testexport/image 8608 $ cd tmp/testexport/image
8867 $ ./runexported.py testdata.json 8609 $ ./runexported.py testdata.json
8868 8610
8869Here is a complete example that shows IP addresses and uses the 8611Here is a complete example that shows IP addresses and uses the
8870``core-image-sato`` image: 8612``core-image-sato`` image::
8871::
8872 8613
8873 INHERIT += "testexport" 8614 INHERIT += "testexport"
8874 TEST_TARGET_IP = "192.168.7.2" 8615 TEST_TARGET_IP = "192.168.7.2"
8875 TEST_SERVER_IP = "192.168.7.1" 8616 TEST_SERVER_IP = "192.168.7.1"
8876 8617
8877Use BitBake to export the tests: 8618Use BitBake to export the tests::
8878::
8879 8619
8880 $ bitbake core-image-sato -c testexport 8620 $ bitbake core-image-sato -c testexport
8881 8621
8882Run the tests outside of 8622Run the tests outside of
8883the build environment using the following: 8623the build environment using the following::
8884::
8885 8624
8886 $ cd tmp/testexport/core-image-sato 8625 $ cd tmp/testexport/core-image-sato
8887 $ ./runexported.py testdata.json 8626 $ ./runexported.py testdata.json
@@ -9157,14 +8896,12 @@ variables>` did not work out as expected.
9157BitBake's ``-e`` option is used to display variable values after 8896BitBake's ``-e`` option is used to display variable values after
9158parsing. The following command displays the variable values after the 8897parsing. The following command displays the variable values after the
9159configuration files (i.e. ``local.conf``, ``bblayers.conf``, 8898configuration files (i.e. ``local.conf``, ``bblayers.conf``,
9160``bitbake.conf`` and so forth) have been parsed: 8899``bitbake.conf`` and so forth) have been parsed::
9161::
9162 8900
9163 $ bitbake -e 8901 $ bitbake -e
9164 8902
9165The following command displays variable values after a specific recipe has 8903The following command displays variable values after a specific recipe has
9166been parsed. The variables include those from the configuration as well: 8904been parsed. The variables include those from the configuration as well::
9167::
9168 8905
9169 $ bitbake -e recipename 8906 $ bitbake -e recipename
9170 8907
@@ -9187,8 +8924,7 @@ variable flags (varflags) set on the variable. The output can be very
9187helpful during debugging. 8924helpful during debugging.
9188 8925
9189Variables that are exported to the environment are preceded by 8926Variables that are exported to the environment are preceded by
9190``export`` in the output of ``bitbake -e``. See the following example: 8927``export`` in the output of ``bitbake -e``. See the following example::
9191::
9192 8928
9193 export CC="i586-poky-linux-gcc -m32 -march=i586 --sysroot=/home/ulf/poky/build/tmp/sysroots/qemux86" 8929 export CC="i586-poky-linux-gcc -m32 -march=i586 --sysroot=/home/ulf/poky/build/tmp/sysroots/qemux86"
9194 8930
@@ -9250,8 +8986,7 @@ Following are a few of the available ``oe-pkgdata-util`` subcommands.
9250- ``oe-pkgdata-util find-path path ...``: Lists the names of 8986- ``oe-pkgdata-util find-path path ...``: Lists the names of
9251 the packages that contain the given paths. For example, the following 8987 the packages that contain the given paths. For example, the following
9252 tells us that ``/usr/share/man/man1/make.1`` is contained in the 8988 tells us that ``/usr/share/man/man1/make.1`` is contained in the
9253 ``make-doc`` package: 8989 ``make-doc`` package::
9254 ::
9255 8990
9256 $ oe-pkgdata-util find-path /usr/share/man/man1/make.1 8991 $ oe-pkgdata-util find-path /usr/share/man/man1/make.1
9257 make-doc: /usr/share/man/man1/make.1 8992 make-doc: /usr/share/man/man1/make.1
@@ -9260,8 +8995,7 @@ Following are a few of the available ``oe-pkgdata-util`` subcommands.
9260 of the recipes that produce the given packages. 8995 of the recipes that produce the given packages.
9261 8996
9262For more information on the ``oe-pkgdata-util`` command, use the help 8997For more information on the ``oe-pkgdata-util`` command, use the help
9263facility: 8998facility::
9264::
9265 8999
9266 $ oe-pkgdata-util --help 9000 $ oe-pkgdata-util --help
9267 $ oe-pkgdata-util subcommand --help 9001 $ oe-pkgdata-util subcommand --help
@@ -9274,8 +9008,7 @@ before the one you have specified. Dependency information can help you
9274understand why a recipe is built. 9008understand why a recipe is built.
9275 9009
9276To generate dependency information for a recipe, run the following 9010To generate dependency information for a recipe, run the following
9277command: 9011command::
9278::
9279 9012
9280 $ bitbake -g recipename 9013 $ bitbake -g recipename
9281 9014
@@ -9305,8 +9038,7 @@ format and can be converted to images (e.g. using the ``dot`` tool from
9305 provide useful information. 9038 provide useful information.
9306 9039
9307 As an example, the ``task-depends.dot`` file contains lines such 9040 As an example, the ``task-depends.dot`` file contains lines such
9308 as the following: 9041 as the following::
9309 ::
9310 9042
9311 "libxslt.do_configure" -> "libxml2.do_populate_sysroot" 9043 "libxslt.do_configure" -> "libxml2.do_populate_sysroot"
9312 9044
@@ -9323,8 +9055,7 @@ format and can be converted to images (e.g. using the ``dot`` tool from
9323 displays paths between graph nodes. 9055 displays paths between graph nodes.
9324 9056
9325You can use a different method to view dependency information by using 9057You can use a different method to view dependency information by using
9326the following command: 9058the following command::
9327::
9328 9059
9329 $ bitbake -g -u taskexp recipename 9060 $ bitbake -g -u taskexp recipename
9330 9061
@@ -9350,8 +9081,7 @@ If you are unsure whether a variable dependency is being picked up
9350automatically for a given task, you can list the variable dependencies 9081automatically for a given task, you can list the variable dependencies
9351BitBake has determined by doing the following: 9082BitBake has determined by doing the following:
9352 9083
93531. Build the recipe containing the task: 90841. Build the recipe containing the task::
9354 ::
9355 9085
9356 $ bitbake recipename 9086 $ bitbake recipename
9357 9087
@@ -9362,8 +9092,7 @@ BitBake has determined by doing the following:
9362 checksum for the task. As an example, for the 9092 checksum for the task. As an example, for the
9363 :ref:`ref-tasks-fetch` task of the 9093 :ref:`ref-tasks-fetch` task of the
9364 ``db`` recipe, the ``sigdata`` file might be found in the following 9094 ``db`` recipe, the ``sigdata`` file might be found in the following
9365 location: 9095 location::
9366 ::
9367 9096
9368 ${BUILDDIR}/tmp/stamps/i586-poky-linux/db/6.0.30-r1.do_fetch.sigdata.7c048c18222b16ff0bcee2000ef648b1 9097 ${BUILDDIR}/tmp/stamps/i586-poky-linux/db/6.0.30-r1.do_fetch.sigdata.7c048c18222b16ff0bcee2000ef648b1
9369 9098
@@ -9375,8 +9104,7 @@ BitBake has determined by doing the following:
9375 same information as ``sigdata`` files. 9104 same information as ``sigdata`` files.
9376 9105
93773. Run ``bitbake-dumpsig`` on the ``sigdata`` or ``siginfo`` file. Here 91063. Run ``bitbake-dumpsig`` on the ``sigdata`` or ``siginfo`` file. Here
9378 is an example: 9107 is an example::
9379 ::
9380 9108
9381 $ bitbake-dumpsig ${BUILDDIR}/tmp/stamps/i586-poky-linux/db/6.0.30-r1.do_fetch.sigdata.7c048c18222b16ff0bcee2000ef648b1 9109 $ bitbake-dumpsig ${BUILDDIR}/tmp/stamps/i586-poky-linux/db/6.0.30-r1.do_fetch.sigdata.7c048c18222b16ff0bcee2000ef648b1
9382 9110
@@ -9406,8 +9134,7 @@ call ``bitbake-diffsigs`` with just one file, the command behaves like
9406 9134
9407You can also use BitBake to dump out the signature construction 9135You can also use BitBake to dump out the signature construction
9408information without executing tasks by using either of the following 9136information without executing tasks by using either of the following
9409BitBake command-line options: 9137BitBake command-line options::
9410::
9411 9138
9412 ‐‐dump-signatures=SIGNATURE_HANDLER 9139 ‐‐dump-signatures=SIGNATURE_HANDLER
9413 -S SIGNATURE_HANDLER 9140 -S SIGNATURE_HANDLER
@@ -9494,8 +9221,7 @@ behavior in most cases is: ``do_fetch``, ``do_unpack``, ``do_patch``,
9494``do_build`` and any tasks on which it depends build first. Some tasks, 9221``do_build`` and any tasks on which it depends build first. Some tasks,
9495such as ``do_devshell``, are not part of the default build chain. If you 9222such as ``do_devshell``, are not part of the default build chain. If you
9496wish to run a task that is not part of the default build chain, you can 9223wish to run a task that is not part of the default build chain, you can
9497use the ``-c`` option in BitBake. Here is an example: 9224use the ``-c`` option in BitBake. Here is an example::
9498::
9499 9225
9500 $ bitbake matchbox-desktop -c devshell 9226 $ bitbake matchbox-desktop -c devshell
9501 9227
@@ -9520,8 +9246,7 @@ out), then you can use the ``-f`` option.
9520 [\ :ref:`nostamp <bitbake:bitbake-user-manual/bitbake-user-manual-metadata:variable flags>`\ ] 9246 [\ :ref:`nostamp <bitbake:bitbake-user-manual/bitbake-user-manual-metadata:variable flags>`\ ]
9521 variable flag is already set for the task. 9247 variable flag is already set for the task.
9522 9248
9523The following example shows one way you can use the ``-f`` option: 9249The following example shows one way you can use the ``-f`` option::
9524::
9525 9250
9526 $ bitbake matchbox-desktop 9251 $ bitbake matchbox-desktop
9527 . 9252 .
@@ -9550,8 +9275,7 @@ Using this option invalidates the given task and then runs the
9550:ref:`ref-tasks-build` task, which is 9275:ref:`ref-tasks-build` task, which is
9551the default task if no task is given, and the tasks on which it depends. 9276the default task if no task is given, and the tasks on which it depends.
9552You could replace the final two commands in the previous example with 9277You could replace the final two commands in the previous example with
9553the following single command: 9278the following single command::
9554::
9555 9279
9556 $ bitbake matchbox-desktop -C compile 9280 $ bitbake matchbox-desktop -C compile
9557 9281
@@ -9575,16 +9299,14 @@ task dependency mechanisms.
9575 and build output might not be in the clean state they would be in for 9299 and build output might not be in the clean state they would be in for
9576 a "normal" build, depending on what actions you took. To get rid of 9300 a "normal" build, depending on what actions you took. To get rid of
9577 such warnings, you can remove the work directory and rebuild the 9301 such warnings, you can remove the work directory and rebuild the
9578 recipe, as follows: 9302 recipe, as follows::
9579 ::
9580 9303
9581 $ bitbake matchbox-desktop -c clean 9304 $ bitbake matchbox-desktop -c clean
9582 $ bitbake matchbox-desktop 9305 $ bitbake matchbox-desktop
9583 9306
9584 9307
9585You can view a list of tasks in a given package by running the 9308You can view a list of tasks in a given package by running the
9586``do_listtasks`` task as follows: 9309``do_listtasks`` task as follows::
9587::
9588 9310
9589 $ bitbake matchbox-desktop -c listtasks 9311 $ bitbake matchbox-desktop -c listtasks
9590 9312
@@ -9608,8 +9330,7 @@ Building with No Dependencies
9608----------------------------- 9330-----------------------------
9609 9331
9610To build a specific recipe (``.bb`` file), you can use the following 9332To build a specific recipe (``.bb`` file), you can use the following
9611command form: 9333command form::
9612::
9613 9334
9614 $ bitbake -b somepath/somerecipe.bb 9335 $ bitbake -b somepath/somerecipe.bb
9615 9336
@@ -9678,8 +9399,7 @@ in the log, use the "debug" loglevel.
9678Following is an example written in Python. The code handles logging for 9399Following is an example written in Python. The code handles logging for
9679a function that determines the number of tasks needed to be run. See the 9400a function that determines the number of tasks needed to be run. See the
9680":ref:`ref-tasks-listtasks`" 9401":ref:`ref-tasks-listtasks`"
9681section for additional information: 9402section for additional information::
9682::
9683 9403
9684 python do_listtasks() { 9404 python do_listtasks() {
9685 bb.debug(2, "Starting to figure out the task list") 9405 bb.debug(2, "Starting to figure out the task list")
@@ -9841,21 +9561,18 @@ build, set the
9841:term:`PARALLEL_MAKE` variable 9561:term:`PARALLEL_MAKE` variable
9842in your ``local.conf`` file to a high number (e.g. "-j 20"). Using a 9562in your ``local.conf`` file to a high number (e.g. "-j 20"). Using a
9843high value for ``PARALLEL_MAKE`` increases the chances of the race 9563high value for ``PARALLEL_MAKE`` increases the chances of the race
9844condition showing up: 9564condition showing up::
9845::
9846 9565
9847 $ bitbake neard 9566 $ bitbake neard
9848 9567
9849Once the local build for "neard" completes, start a ``devshell`` build: 9568Once the local build for "neard" completes, start a ``devshell`` build::
9850::
9851 9569
9852 $ bitbake neard -c devshell 9570 $ bitbake neard -c devshell
9853 9571
9854For information on how to use a ``devshell``, see the 9572For information on how to use a ``devshell``, see the
9855":ref:`dev-manual/common-tasks:using a development shell`" section. 9573":ref:`dev-manual/common-tasks:using a development shell`" section.
9856 9574
9857In the ``devshell``, do the following: 9575In the ``devshell``, do the following::
9858::
9859 9576
9860 $ make clean 9577 $ make clean
9861 $ make tools/snep-send.o 9578 $ make tools/snep-send.o
@@ -9863,8 +9580,7 @@ In the ``devshell``, do the following:
9863The ``devshell`` commands cause the failure to clearly 9580The ``devshell`` commands cause the failure to clearly
9864be visible. In this case, a missing dependency exists for the "neard" 9581be visible. In this case, a missing dependency exists for the "neard"
9865Makefile target. Here is some abbreviated, sample output with the 9582Makefile target. Here is some abbreviated, sample output with the
9866missing dependency clearly visible at the end: 9583missing dependency clearly visible at the end::
9867::
9868 9584
9869 i586-poky-linux-gcc -m32 -march=i586 --sysroot=/home/scott-lenovo/...... 9585 i586-poky-linux-gcc -m32 -march=i586 --sysroot=/home/scott-lenovo/......
9870 . 9586 .
@@ -9885,8 +9601,7 @@ Creating a Patch for the Fix
9885 9601
9886Because there is a missing dependency for the Makefile target, you need 9602Because there is a missing dependency for the Makefile target, you need
9887to patch the ``Makefile.am`` file, which is generated from 9603to patch the ``Makefile.am`` file, which is generated from
9888``Makefile.in``. You can use Quilt to create the patch: 9604``Makefile.in``. You can use Quilt to create the patch::
9889::
9890 9605
9891 $ quilt new parallelmake.patch 9606 $ quilt new parallelmake.patch
9892 Patch patches/parallelmake.patch is now on top 9607 Patch patches/parallelmake.patch is now on top
@@ -9898,14 +9613,12 @@ For more information on using Quilt, see the
9898 9613
9899At this point you need to make the edits to ``Makefile.am`` to add the 9614At this point you need to make the edits to ``Makefile.am`` to add the
9900missing dependency. For our example, you have to add the following line 9615missing dependency. For our example, you have to add the following line
9901to the file: 9616to the file::
9902::
9903 9617
9904 tools/snep-send.$(OBJEXT): include/near/dbus.h 9618 tools/snep-send.$(OBJEXT): include/near/dbus.h
9905 9619
9906Once you have edited the file, use the ``refresh`` command to create the 9620Once you have edited the file, use the ``refresh`` command to create the
9907patch: 9621patch::
9908::
9909 9622
9910 $ quilt refresh 9623 $ quilt refresh
9911 Refreshed patch patches/parallelmake.patch 9624 Refreshed patch patches/parallelmake.patch
@@ -9913,8 +9626,7 @@ patch:
9913Once 9626Once
9914the patch file exists, you need to add it back to the originating recipe 9627the patch file exists, you need to add it back to the originating recipe
9915folder. Here is an example assuming a top-level 9628folder. Here is an example assuming a top-level
9916:term:`Source Directory` named ``poky``: 9629:term:`Source Directory` named ``poky``::
9917::
9918 9630
9919 $ cp patches/parallelmake.patch poky/meta/recipes-connectivity/neard/neard 9631 $ cp patches/parallelmake.patch poky/meta/recipes-connectivity/neard/neard
9920 9632
@@ -9922,8 +9634,7 @@ The final thing you need to do to implement the fix in the build is to
9922update the "neard" recipe (i.e. ``neard-0.14.bb``) so that the 9634update the "neard" recipe (i.e. ``neard-0.14.bb``) so that the
9923:term:`SRC_URI` statement includes 9635:term:`SRC_URI` statement includes
9924the patch file. The recipe file is in the folder above the patch. Here 9636the patch file. The recipe file is in the folder above the patch. Here
9925is what the edited ``SRC_URI`` statement would look like: 9637is what the edited ``SRC_URI`` statement would look like::
9926::
9927 9638
9928 SRC_URI = "${KERNELORG_MIRROR}/linux/network/nfc/${BPN}-${PV}.tar.xz \ 9639 SRC_URI = "${KERNELORG_MIRROR}/linux/network/nfc/${BPN}-${PV}.tar.xz \
9929 file://neard.in \ 9640 file://neard.in \
@@ -9932,8 +9643,7 @@ is what the edited ``SRC_URI`` statement would look like:
9932 " 9643 "
9933 9644
9934With the patch complete and moved to the correct folder and the 9645With the patch complete and moved to the correct folder and the
9935``SRC_URI`` statement updated, you can exit the ``devshell``: 9646``SRC_URI`` statement updated, you can exit the ``devshell``::
9936::
9937 9647
9938 $ exit 9648 $ exit
9939 9649
@@ -9941,16 +9651,14 @@ Testing the Build
9941~~~~~~~~~~~~~~~~~ 9651~~~~~~~~~~~~~~~~~
9942 9652
9943With everything in place, you can get back to trying the build again 9653With everything in place, you can get back to trying the build again
9944locally: 9654locally::
9945::
9946 9655
9947 $ bitbake neard 9656 $ bitbake neard
9948 9657
9949This build should succeed. 9658This build should succeed.
9950 9659
9951Now you can open up a ``devshell`` again and repeat the clean and make 9660Now you can open up a ``devshell`` again and repeat the clean and make
9952operations as follows: 9661operations as follows::
9953::
9954 9662
9955 $ bitbake neard -c devshell 9663 $ bitbake neard -c devshell
9956 $ make clean 9664 $ make clean
@@ -10005,24 +9713,21 @@ debug symbols from the server.
10005 9713
10006To run a debuginfod server, you need to do the following: 9714To run a debuginfod server, you need to do the following:
10007 9715
10008- Ensure that this variable is set in your ``local.conf`` file: 9716- Ensure that this variable is set in your ``local.conf`` file::
10009 ::
10010 9717
10011 PACKAGECONFIG_pn-elfutils-native = "debuginfod libdebuginfod" 9718 PACKAGECONFIG_pn-elfutils-native = "debuginfod libdebuginfod"
10012 9719
10013 This :term:`PACKAGECONFIG` option enables debuginfod and libdebuginfod for 9720 This :term:`PACKAGECONFIG` option enables debuginfod and libdebuginfod for
10014 "elfutils-native". 9721 "elfutils-native".
10015 9722
10016- Run the following commands to set up the "debuginfod" server: 9723- Run the following commands to set up the "debuginfod" server::
10017 ::
10018 9724
10019 $ oe-debuginfod 9725 $ oe-debuginfod
10020 9726
10021 9727
10022To use debuginfod on the target, you need the following: 9728To use debuginfod on the target, you need the following:
10023 9729
10024- Ensure that this variable is set in your ``local.conf`` file: 9730- Ensure that this variable is set in your ``local.conf`` file::
10025 ::
10026 9731
10027 DEBUGINFOD_URLS = "http://localhost:8002/" 9732 DEBUGINFOD_URLS = "http://localhost:8002/"
10028 9733
@@ -10069,8 +9774,7 @@ debugger.
100691. *Configure your build system to construct the companion debug 97741. *Configure your build system to construct the companion debug
10070 filesystem:* 9775 filesystem:*
10071 9776
10072 In your ``local.conf`` file, set the following: 9777 In your ``local.conf`` file, set the following::
10073 ::
10074 9778
10075 IMAGE_GEN_DEBUGFS = "1" 9779 IMAGE_GEN_DEBUGFS = "1"
10076 IMAGE_FSTYPES_DEBUGFS = "tar.bz2" 9780 IMAGE_FSTYPES_DEBUGFS = "tar.bz2"
@@ -10090,8 +9794,7 @@ debugger.
100902. *Configure the system to include gdbserver in the target filesystem:* 97942. *Configure the system to include gdbserver in the target filesystem:*
10091 9795
10092 Make the following addition in either your ``local.conf`` file or in 9796 Make the following addition in either your ``local.conf`` file or in
10093 an image recipe: 9797 an image recipe::
10094 ::
10095 9798
10096 IMAGE_INSTALL_append = " gdbserver" 9799 IMAGE_INSTALL_append = " gdbserver"
10097 9800
@@ -10101,29 +9804,25 @@ debugger.
101013. *Build the environment:* 98043. *Build the environment:*
10102 9805
10103 Use the following command to construct the image and the companion 9806 Use the following command to construct the image and the companion
10104 Debug Filesystem: 9807 Debug Filesystem::
10105 ::
10106 9808
10107 $ bitbake image 9809 $ bitbake image
10108 9810
10109 Build the cross GDB component and 9811 Build the cross GDB component and
10110 make it available for debugging. Build the SDK that matches the 9812 make it available for debugging. Build the SDK that matches the
10111 image. Building the SDK is best for a production build that can be 9813 image. Building the SDK is best for a production build that can be
10112 used later for debugging, especially during long term maintenance: 9814 used later for debugging, especially during long term maintenance::
10113 ::
10114 9815
10115 $ bitbake -c populate_sdk image 9816 $ bitbake -c populate_sdk image
10116 9817
10117 Alternatively, you can build the minimal toolchain components that 9818 Alternatively, you can build the minimal toolchain components that
10118 match the target. Doing so creates a smaller than typical SDK and 9819 match the target. Doing so creates a smaller than typical SDK and
10119 only contains a minimal set of components with which to build simple 9820 only contains a minimal set of components with which to build simple
10120 test applications, as well as run the debugger: 9821 test applications, as well as run the debugger::
10121 ::
10122 9822
10123 $ bitbake meta-toolchain 9823 $ bitbake meta-toolchain
10124 9824
10125 A final method is to build Gdb itself within the build system: 9825 A final method is to build Gdb itself within the build system::
10126 ::
10127 9826
10128 $ bitbake gdb-cross-<architecture> 9827 $ bitbake gdb-cross-<architecture>
10129 9828
@@ -10140,8 +9839,7 @@ debugger.
10140 9839
101414. *Set up the* ``debugfs``\ *:* 98404. *Set up the* ``debugfs``\ *:*
10142 9841
10143 Run the following commands to set up the ``debugfs``: 9842 Run the following commands to set up the ``debugfs``::
10144 ::
10145 9843
10146 $ mkdir debugfs 9844 $ mkdir debugfs
10147 $ cd debugfs 9845 $ cd debugfs
@@ -10180,8 +9878,7 @@ debugger.
10180 Documentation <https://www.gnu.org/software/gdb/documentation/>`__. 9878 Documentation <https://www.gnu.org/software/gdb/documentation/>`__.
10181 9879
10182 After running gdbserver on the target, you need to run Gdb on the 9880 After running gdbserver on the target, you need to run Gdb on the
10183 host and configure it and connect to the target. Use these commands: 9881 host and configure it and connect to the target. Use these commands::
10184 ::
10185 9882
10186 $ cd directory-holding-the-debugfs-directory 9883 $ cd directory-holding-the-debugfs-directory
10187 $ arch-gdb 9884 $ arch-gdb
@@ -10212,8 +9909,7 @@ debugger.
10212 If the binary is processed through the debug splitting in 9909 If the binary is processed through the debug splitting in
10213 OpenEmbedded, you should also copy the debug items (i.e. ``.debug`` 9910 OpenEmbedded, you should also copy the debug items (i.e. ``.debug``
10214 contents and corresponding ``/usr/src/debug`` files) from the work 9911 contents and corresponding ``/usr/src/debug`` files) from the work
10215 directory. Here is an example: 9912 directory. Here is an example::
10216 ::
10217 9913
10218 $ bitbake bash 9914 $ bitbake bash
10219 $ bitbake -c devshell bash 9915 $ bitbake -c devshell bash
@@ -10234,25 +9930,21 @@ debug on the target hardware.
10234To support this kind of debugging, you need do the following: 9930To support this kind of debugging, you need do the following:
10235 9931
10236- Ensure that GDB is on the target. You can do this by adding "gdb" to 9932- Ensure that GDB is on the target. You can do this by adding "gdb" to
10237 :term:`IMAGE_INSTALL`: 9933 :term:`IMAGE_INSTALL`::
10238 ::
10239 9934
10240 IMAGE_INSTALL_append = " gdb" 9935 IMAGE_INSTALL_append = " gdb"
10241 9936
10242 Alternatively, you can add "tools-debug" to :term:`IMAGE_FEATURES`: 9937 Alternatively, you can add "tools-debug" to :term:`IMAGE_FEATURES`::
10243 ::
10244 9938
10245 IMAGE_FEATURES_append = " tools-debug" 9939 IMAGE_FEATURES_append = " tools-debug"
10246 9940
10247- Ensure that debug symbols are present. You can make sure these 9941- Ensure that debug symbols are present. You can make sure these
10248 symbols are present by installing ``-dbg``: 9942 symbols are present by installing ``-dbg``::
10249 ::
10250 9943
10251 IMAGE_INSTALL_append = "packagename-dbg" 9944 IMAGE_INSTALL_append = "packagename-dbg"
10252 9945
10253 Alternatively, you can do the following to include 9946 Alternatively, you can do the following to include
10254 all the debug symbols: 9947 all the debug symbols::
10255 ::
10256 9948
10257 IMAGE_FEATURES_append = " dbg-pkgs" 9949 IMAGE_FEATURES_append = " dbg-pkgs"
10258 9950
@@ -10262,8 +9954,7 @@ To support this kind of debugging, you need do the following:
10262 of optimization used by the compiler. For example, when adding the 9954 of optimization used by the compiler. For example, when adding the
10263 following line to your ``local.conf`` file, you will reduce optimization 9955 following line to your ``local.conf`` file, you will reduce optimization
10264 from :term:`FULL_OPTIMIZATION` of "-O2" to :term:`DEBUG_OPTIMIZATION` 9956 from :term:`FULL_OPTIMIZATION` of "-O2" to :term:`DEBUG_OPTIMIZATION`
10265 of "-O -fno-omit-frame-pointer": 9957 of "-O -fno-omit-frame-pointer"::
10266 ::
10267 9958
10268 DEBUG_BUILD = "1" 9959 DEBUG_BUILD = "1"
10269 9960
@@ -10307,8 +9998,7 @@ Here are some other tips that you might find useful:
10307 Using GNU Grep, you can use the following shell function to 9998 Using GNU Grep, you can use the following shell function to
10308 recursively search through common recipe-related files, skipping 9999 recursively search through common recipe-related files, skipping
10309 binary files, ``.git`` directories, and the Build Directory (assuming 10000 binary files, ``.git`` directories, and the Build Directory (assuming
10310 its name starts with "build"): 10001 its name starts with "build")::
10311 ::
10312 10002
10313 g() { 10003 g() {
10314 grep -Ir \ 10004 grep -Ir \
@@ -10321,8 +10011,7 @@ Here are some other tips that you might find useful:
10321 "$@" 10011 "$@"
10322 } 10012 }
10323 10013
10324 Following are some usage examples: 10014 Following are some usage examples::
10325 ::
10326 10015
10327 $ g FOO # Search recursively for "FOO" 10016 $ g FOO # Search recursively for "FOO"
10328 $ g -i foo # Search recursively for "foo", ignoring case 10017 $ g -i foo # Search recursively for "foo", ignoring case
@@ -10581,8 +10270,7 @@ Preparing Changes for Submission
10581 specific convention for bug references - any commit that addresses 10270 specific convention for bug references - any commit that addresses
10582 a specific bug should use the following form for the detailed 10271 a specific bug should use the following form for the detailed
10583 description. Be sure to use the actual bug-tracking ID from 10272 description. Be sure to use the actual bug-tracking ID from
10584 Bugzilla for bug-id: 10273 Bugzilla for bug-id::
10585 ::
10586 10274
10587 Fixes [YOCTO #bug-id] 10275 Fixes [YOCTO #bug-id]
10588 10276
@@ -10608,8 +10296,7 @@ without using the scripts once the steps in
10608 provide the command, you must include a revision list or a number of 10296 provide the command, you must include a revision list or a number of
10609 patches as part of the command. For example, either of these two 10297 patches as part of the command. For example, either of these two
10610 commands takes your most recent single commit and formats it as an 10298 commands takes your most recent single commit and formats it as an
10611 email message in the current directory: 10299 email message in the current directory::
10612 ::
10613 10300
10614 $ git format-patch -1 10301 $ git format-patch -1
10615 10302
@@ -10701,8 +10388,7 @@ been followed:
10701 10388
107021. *Push Your Commits to a "Contrib" Upstream:* If you have arranged for 103891. *Push Your Commits to a "Contrib" Upstream:* If you have arranged for
10703 permissions to push to an upstream contrib repository, push the 10390 permissions to push to an upstream contrib repository, push the
10704 change to that repository: 10391 change to that repository::
10705 ::
10706 10392
10707 $ git push upstream_remote_repo local_branch_name 10393 $ git push upstream_remote_repo local_branch_name
10708 10394
@@ -10711,8 +10397,7 @@ been followed:
10711 working in a local branch named `your_name`\ ``/README``. The following 10397 working in a local branch named `your_name`\ ``/README``. The following
10712 command pushes your local commits to the ``meta-intel-contrib`` 10398 command pushes your local commits to the ``meta-intel-contrib``
10713 upstream repository and puts the commit in a branch named 10399 upstream repository and puts the commit in a branch named
10714 `your_name`\ ``/README``: 10400 `your_name`\ ``/README``::
10715 ::
10716 10401
10717 $ git push meta-intel-contrib your_name/README 10402 $ git push meta-intel-contrib your_name/README
10718 10403
@@ -10729,8 +10414,7 @@ been followed:
10729 10414
10730 - *Search by File:* Using :ref:`overview-manual/development-environment:git`, you can 10415 - *Search by File:* Using :ref:`overview-manual/development-environment:git`, you can
10731 enter the following command to bring up a short list of all 10416 enter the following command to bring up a short list of all
10732 commits against a specific file: 10417 commits against a specific file::
10733 ::
10734 10418
10735 git shortlog -- filename 10419 git shortlog -- filename
10736 10420
@@ -10764,8 +10448,7 @@ been followed:
10764 First, create the pull request. For example, the following command 10448 First, create the pull request. For example, the following command
10765 runs the script, specifies the upstream repository in the contrib 10449 runs the script, specifies the upstream repository in the contrib
10766 directory into which you pushed the change, and provides a subject 10450 directory into which you pushed the change, and provides a subject
10767 line in the created patch files: 10451 line in the created patch files::
10768 ::
10769 10452
10770 $ poky/scripts/create-pull-request -u meta-intel-contrib -s "Updated Manual Section Reference in README" 10453 $ poky/scripts/create-pull-request -u meta-intel-contrib -s "Updated Manual Section Reference in README"
10771 10454
@@ -10778,8 +10461,7 @@ been followed:
10778 editing the cover letter, send the pull request. For example, the 10461 editing the cover letter, send the pull request. For example, the
10779 following command runs the script and specifies the patch directory 10462 following command runs the script and specifies the patch directory
10780 and email address. In this example, the email address is a mailing 10463 and email address. In this example, the email address is a mailing
10781 list: 10464 list::
10782 ::
10783 10465
10784 $ poky/scripts/send-pull-request -p ~/meta-intel/pull-10565 -t meta-intel@yoctoproject.org 10466 $ poky/scripts/send-pull-request -p ~/meta-intel/pull-10565 -t meta-intel@yoctoproject.org
10785 10467
@@ -10788,8 +10470,7 @@ been followed:
10788 .. note:: 10470 .. note::
10789 10471
10790 For help on using these scripts, simply provide the ``-h`` 10472 For help on using these scripts, simply provide the ``-h``
10791 argument as follows: 10473 argument as follows::
10792 ::
10793 10474
10794 $ poky/scripts/create-pull-request -h 10475 $ poky/scripts/create-pull-request -h
10795 $ poky/scripts/send-pull-request -h 10476 $ poky/scripts/send-pull-request -h
@@ -10901,8 +10582,7 @@ Specifying the ``LIC_FILES_CHKSUM`` Variable
10901 10582
10902The ``LIC_FILES_CHKSUM`` variable contains checksums of the license text 10583The ``LIC_FILES_CHKSUM`` variable contains checksums of the license text
10903in the source code for the recipe. Following is an example of how to 10584in the source code for the recipe. Following is an example of how to
10904specify ``LIC_FILES_CHKSUM``: 10585specify ``LIC_FILES_CHKSUM``::
10905::
10906 10586
10907 LIC_FILES_CHKSUM = "file://COPYING;md5=xxxx \ 10587 LIC_FILES_CHKSUM = "file://COPYING;md5=xxxx \
10908 file://licfile1.txt;beginline=5;endline=29;md5=yyyy \ 10588 file://licfile1.txt;beginline=5;endline=29;md5=yyyy \
@@ -10925,8 +10605,7 @@ variable as the default directory when searching files listed in
10925``LIC_FILES_CHKSUM``. The previous example employs the default 10605``LIC_FILES_CHKSUM``. The previous example employs the default
10926directory. 10606directory.
10927 10607
10928Consider this next example: 10608Consider this next example::
10929::
10930 10609
10931 LIC_FILES_CHKSUM = "file://src/ls.c;beginline=5;endline=16;\ 10610 LIC_FILES_CHKSUM = "file://src/ls.c;beginline=5;endline=16;\
10932 md5=bb14ed3c4cda583abc85401304b5cd4e" 10611 md5=bb14ed3c4cda583abc85401304b5cd4e"
@@ -10988,15 +10667,13 @@ are defined on a recipe-by-recipe basis through the
10988:term:`LICENSE_FLAGS` variable 10667:term:`LICENSE_FLAGS` variable
10989definition in the affected recipe. For instance, the 10668definition in the affected recipe. For instance, the
10990``poky/meta/recipes-multimedia/gstreamer/gst-plugins-ugly`` recipe 10669``poky/meta/recipes-multimedia/gstreamer/gst-plugins-ugly`` recipe
10991contains the following statement: 10670contains the following statement::
10992::
10993 10671
10994 LICENSE_FLAGS = "commercial" 10672 LICENSE_FLAGS = "commercial"
10995 10673
10996Here is a 10674Here is a
10997slightly more complicated example that contains both an explicit recipe 10675slightly more complicated example that contains both an explicit recipe
10998name and version (after variable expansion): 10676name and version (after variable expansion)::
10999::
11000 10677
11001 LICENSE_FLAGS = "license_${PN}_${PV}" 10678 LICENSE_FLAGS = "license_${PN}_${PV}"
11002 10679
@@ -11011,8 +10688,7 @@ could add either the string "commercial_gst-plugins-ugly" or the more
11011general string "commercial" to ``LICENSE_FLAGS_WHITELIST``. See the 10688general string "commercial" to ``LICENSE_FLAGS_WHITELIST``. See the
11012":ref:`dev-manual/common-tasks:license flag matching`" section for a full 10689":ref:`dev-manual/common-tasks:license flag matching`" section for a full
11013explanation of how ``LICENSE_FLAGS`` matching works. Here is the 10690explanation of how ``LICENSE_FLAGS`` matching works. Here is the
11014example: 10691example::
11015::
11016 10692
11017 LICENSE_FLAGS_WHITELIST = "commercial_gst-plugins-ugly" 10693 LICENSE_FLAGS_WHITELIST = "commercial_gst-plugins-ugly"
11018 10694
@@ -11020,8 +10696,7 @@ Likewise, to additionally enable the package built from the recipe
11020containing ``LICENSE_FLAGS = "license_${PN}_${PV}"``, and assuming that 10696containing ``LICENSE_FLAGS = "license_${PN}_${PV}"``, and assuming that
11021the actual recipe name was ``emgd_1.10.bb``, the following string would 10697the actual recipe name was ``emgd_1.10.bb``, the following string would
11022enable that package as well as the original ``gst-plugins-ugly`` 10698enable that package as well as the original ``gst-plugins-ugly``
11023package: 10699package::
11024::
11025 10700
11026 LICENSE_FLAGS_WHITELIST = "commercial_gst-plugins-ugly license_emgd_1.10" 10701 LICENSE_FLAGS_WHITELIST = "commercial_gst-plugins-ugly license_emgd_1.10"
11027 10702
@@ -11077,8 +10752,7 @@ matches any expanded ``LICENSE_FLAGS`` definition that starts with the
11077string "commercial" such as "commercial_foo" and "commercial_bar", which 10752string "commercial" such as "commercial_foo" and "commercial_bar", which
11078are the strings the build system automatically generates for 10753are the strings the build system automatically generates for
11079hypothetical recipes named "foo" and "bar" assuming those recipes simply 10754hypothetical recipes named "foo" and "bar" assuming those recipes simply
11080specify the following: 10755specify the following::
11081::
11082 10756
11083 LICENSE_FLAGS = "commercial" 10757 LICENSE_FLAGS = "commercial"
11084 10758
@@ -11116,8 +10790,7 @@ Other Variables Related to Commercial Licenses
11116 10790
11117Other helpful variables related to commercial license handling exist and 10791Other helpful variables related to commercial license handling exist and
11118are defined in the 10792are defined in the
11119``poky/meta/conf/distro/include/default-distrovars.inc`` file: 10793``poky/meta/conf/distro/include/default-distrovars.inc`` file::
11120::
11121 10794
11122 COMMERCIAL_AUDIO_PLUGINS ?= "" 10795 COMMERCIAL_AUDIO_PLUGINS ?= ""
11123 COMMERCIAL_VIDEO_PLUGINS ?= "" 10796 COMMERCIAL_VIDEO_PLUGINS ?= ""
@@ -11125,8 +10798,7 @@ are defined in the
11125If you 10798If you
11126want to enable these components, you can do so by making sure you have 10799want to enable these components, you can do so by making sure you have
11127statements similar to the following in your ``local.conf`` configuration 10800statements similar to the following in your ``local.conf`` configuration
11128file: 10801file::
11129::
11130 10802
11131 COMMERCIAL_AUDIO_PLUGINS = "gst-plugins-ugly-mad \ 10803 COMMERCIAL_AUDIO_PLUGINS = "gst-plugins-ugly-mad \
11132 gst-plugins-ugly-mpegaudioparse" 10804 gst-plugins-ugly-mpegaudioparse"
@@ -11138,8 +10810,7 @@ file:
11138Of course, you could also create a matching whitelist for those 10810Of course, you could also create a matching whitelist for those
11139components using the more general "commercial" in the whitelist, but 10811components using the more general "commercial" in the whitelist, but
11140that would also enable all the other packages with ``LICENSE_FLAGS`` 10812that would also enable all the other packages with ``LICENSE_FLAGS``
11141containing "commercial", which you may or may not want: 10813containing "commercial", which you may or may not want::
11142::
11143 10814
11144 LICENSE_FLAGS_WHITELIST = "commercial" 10815 LICENSE_FLAGS_WHITELIST = "commercial"
11145 10816
@@ -11219,8 +10890,7 @@ of compliance in mind.
11219One way of doing this (but certainly not the only way) is to release 10890One way of doing this (but certainly not the only way) is to release
11220just the source as a tarball. You can do this by adding the following to 10891just the source as a tarball. You can do this by adding the following to
11221the ``local.conf`` file found in the 10892the ``local.conf`` file found in the
11222:term:`Build Directory`: 10893:term:`Build Directory`::
11223::
11224 10894
11225 INHERIT += "archiver" 10895 INHERIT += "archiver"
11226 ARCHIVER_MODE[src] = "original" 10896 ARCHIVER_MODE[src] = "original"
@@ -11276,8 +10946,7 @@ One requirement that is often overlooked is inclusion of license text.
11276This requirement also needs to be dealt with prior to generating the 10946This requirement also needs to be dealt with prior to generating the
11277final image. Some licenses require the license text to accompany the 10947final image. Some licenses require the license text to accompany the
11278binary. You can achieve this by adding the following to your 10948binary. You can achieve this by adding the following to your
11279``local.conf`` file: 10949``local.conf`` file::
11280::
11281 10950
11282 COPY_LIC_MANIFEST = "1" 10951 COPY_LIC_MANIFEST = "1"
11283 COPY_LIC_DIRS = "1" 10952 COPY_LIC_DIRS = "1"
@@ -11344,8 +11013,7 @@ thing a development organization might want to consider for end-user
11344convenience is to modify ``meta-poky/conf/bblayers.conf.sample`` to 11013convenience is to modify ``meta-poky/conf/bblayers.conf.sample`` to
11345ensure that when the end user utilizes the released build system to 11014ensure that when the end user utilizes the released build system to
11346build an image, the development organization's layers are included in 11015build an image, the development organization's layers are included in
11347the ``bblayers.conf`` file automatically: 11016the ``bblayers.conf`` file automatically::
11348::
11349 11017
11350 # POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf 11018 # POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
11351 # changes incompatibly 11019 # changes incompatibly
@@ -11413,8 +11081,7 @@ variable. Using this variable also avoids QA errors when you use a
11413non-common, non-CLOSED license in a recipe. 11081non-common, non-CLOSED license in a recipe.
11414 11082
11415The following is an example that uses the ``LICENSE.Abilis.txt`` file as 11083The following is an example that uses the ``LICENSE.Abilis.txt`` file as
11416the license from the fetched source: 11084the license from the fetched source::
11417::
11418 11085
11419 NO_GENERIC_LICENSE[Firmware-Abilis] = "LICENSE.Abilis.txt" 11086 NO_GENERIC_LICENSE[Firmware-Abilis] = "LICENSE.Abilis.txt"
11420 11087
@@ -11457,8 +11124,7 @@ class by adding the following statement to the end of your
11457By default, the error reporting feature stores information in 11124By default, the error reporting feature stores information in
11458``${``\ :term:`LOG_DIR`\ ``}/error-report``. 11125``${``\ :term:`LOG_DIR`\ ``}/error-report``.
11459However, you can specify a directory to use by adding the following to 11126However, you can specify a directory to use by adding the following to
11460your ``local.conf`` file: 11127your ``local.conf`` file::
11461::
11462 11128
11463 ERR_REPORT_DIR = "path" 11129 ERR_REPORT_DIR = "path"
11464 11130
@@ -11467,8 +11133,7 @@ reporting causes the build process to collect the errors and store them
11467in a file as previously described. When the build system encounters an 11133in a file as previously described. When the build system encounters an
11468error, it includes a command as part of the console output. You can run 11134error, it includes a command as part of the console output. You can run
11469the command to send the error file to the server. For example, the 11135the command to send the error file to the server. For example, the
11470following command sends the errors to an upstream server: 11136following command sends the errors to an upstream server::
11471::
11472 11137
11473 $ send-error-report /home/brandusa/project/poky/build/tmp/log/error-report/error_report_201403141617.txt 11138 $ send-error-report /home/brandusa/project/poky/build/tmp/log/error-report/error_report_201403141617.txt
11474 11139
@@ -11476,8 +11141,7 @@ In the previous example, the errors are sent to a public database
11476available at https://errors.yoctoproject.org, which is used by the 11141available at https://errors.yoctoproject.org, which is used by the
11477entire community. If you specify a particular server, you can send the 11142entire community. If you specify a particular server, you can send the
11478errors to a different database. Use the following command for more 11143errors to a different database. Use the following command for more
11479information on available options: 11144information on available options::
11480::
11481 11145
11482 $ send-error-report --help 11146 $ send-error-report --help
11483 11147
@@ -11557,8 +11221,7 @@ Wayland with Kernel Mode Setting
11557(`KMS <https://wiki.archlinux.org/index.php/Kernel_Mode_Setting>`__) 11221(`KMS <https://wiki.archlinux.org/index.php/Kernel_Mode_Setting>`__)
11558support, include the "wayland" flag in the 11222support, include the "wayland" flag in the
11559:term:`DISTRO_FEATURES` 11223:term:`DISTRO_FEATURES`
11560statement in your ``local.conf`` file: 11224statement in your ``local.conf`` file::
11561::
11562 11225
11563 DISTRO_FEATURES_append = " wayland" 11226 DISTRO_FEATURES_append = " wayland"
11564 11227
@@ -11573,8 +11236,7 @@ Installing Wayland and Weston
11573To install the Wayland feature into an image, you must include the 11236To install the Wayland feature into an image, you must include the
11574following 11237following
11575:term:`CORE_IMAGE_EXTRA_INSTALL` 11238:term:`CORE_IMAGE_EXTRA_INSTALL`
11576statement in your ``local.conf`` file: 11239statement in your ``local.conf`` file::
11577::
11578 11240
11579 CORE_IMAGE_EXTRA_INSTALL += "wayland weston" 11241 CORE_IMAGE_EXTRA_INSTALL += "wayland weston"
11580 11242
@@ -11589,14 +11251,12 @@ Alternatively, you can run Weston through the command-line interpretor
11589(CLI), which is better suited for development work. To run Weston under 11251(CLI), which is better suited for development work. To run Weston under
11590the CLI, you need to do the following after your image is built: 11252the CLI, you need to do the following after your image is built:
11591 11253
115921. Run these commands to export ``XDG_RUNTIME_DIR``: 112541. Run these commands to export ``XDG_RUNTIME_DIR``::
11593 ::
11594 11255
11595 mkdir -p /tmp/$USER-weston 11256 mkdir -p /tmp/$USER-weston
11596 chmod 0700 /tmp/$USER-weston 11257 chmod 0700 /tmp/$USER-weston
11597 export XDG_RUNTIME_DIR=/tmp/$USER-weston 11258 export XDG_RUNTIME_DIR=/tmp/$USER-weston
11598 11259
115992. Launch Weston in the shell: 112602. Launch Weston in the shell::
11600 ::
11601 11261
11602 weston 11262 weston