summaryrefslogtreecommitdiffstats
path: root/documentation/ref-manual/classes.rst
diff options
context:
space:
mode:
authorMichael Opdenacker <michael.opdenacker@bootlin.com>2021-04-16 18:27:05 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-04-23 16:39:03 +0100
commitc3c6de21876aad811e08538544c8fe76d22ccd09 (patch)
treee22ee00a9c1ec588965f32050a42e05946bc9f71 /documentation/ref-manual/classes.rst
parent773536c333248214f8f41eff698d8bfd3c687249 (diff)
downloadpoky-c3c6de21876aad811e08538544c8fe76d22ccd09.tar.gz
manuals: code insertion simplification over two lines
This simplifies paragraphs ending with a colon and followed by code insertion. Automatically substituted through the command: sed -i -z "s/:\n\s*::/::/g" file.rst This generates identical HTML output. (From yocto-docs rev: 28e2192a7c12d64b68061138a9f6c796453eebb1) Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/ref-manual/classes.rst')
-rw-r--r--documentation/ref-manual/classes.rst87
1 files changed, 29 insertions, 58 deletions
diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst
index 52a50faf67..9a1fc2c93f 100644
--- a/documentation/ref-manual/classes.rst
+++ b/documentation/ref-manual/classes.rst
@@ -168,8 +168,7 @@ example use for this class.
168 the "subpath" parameter limits the checkout to a specific subpath 168 the "subpath" parameter limits the checkout to a specific subpath
169 of the tree. Here is an example where ``${BP}`` is used so that the files 169 of the tree. Here is an example where ``${BP}`` is used so that the files
170 are extracted into the subdirectory expected by the default value of 170 are extracted into the subdirectory expected by the default value of
171 ``S``: 171 ``S``::
172 ::
173 172
174 SRC_URI = "git://example.com/downloads/somepackage.rpm;subpath=${BP}" 173 SRC_URI = "git://example.com/downloads/somepackage.rpm;subpath=${BP}"
175 174
@@ -221,8 +220,7 @@ each recipe you wish to blacklist. Specify the :term:`PN`
221value as a variable flag (varflag) and provide a reason, which is 220value as a variable flag (varflag) and provide a reason, which is
222reported, if the package is requested to be built as the value. For 221reported, if the package is requested to be built as the value. For
223example, if you want to blacklist a recipe called "exoticware", you add 222example, if you want to blacklist a recipe called "exoticware", you add
224the following to your ``local.conf`` or distribution configuration: 223the following to your ``local.conf`` or distribution configuration::
225::
226 224
227 INHERIT += "blacklist" 225 INHERIT += "blacklist"
228 PNBLACKLIST[exoticware] = "Not supported by our organization." 226 PNBLACKLIST[exoticware] = "Not supported by our organization."
@@ -470,8 +468,7 @@ information about using ``devshell``.
470The ``devupstream`` class uses 468The ``devupstream`` class uses
471:term:`BBCLASSEXTEND` to add a variant of the 469:term:`BBCLASSEXTEND` to add a variant of the
472recipe that fetches from an alternative URI (e.g. Git) instead of a 470recipe that fetches from an alternative URI (e.g. Git) instead of a
473tarball. Following is an example: 471tarball. Following is an example::
474::
475 472
476 BBCLASSEXTEND = "devupstream:target" 473 BBCLASSEXTEND = "devupstream:target"
477 SRC_URI_class-devupstream = "git://git.example.com/example" 474 SRC_URI_class-devupstream = "git://git.example.com/example"
@@ -481,8 +478,7 @@ Adding the above statements to your recipe creates a variant that has
481:term:`DEFAULT_PREFERENCE` set to "-1". 478:term:`DEFAULT_PREFERENCE` set to "-1".
482Consequently, you need to select the variant of the recipe to use it. 479Consequently, you need to select the variant of the recipe to use it.
483Any development-specific adjustments can be done by using the 480Any development-specific adjustments can be done by using the
484``class-devupstream`` override. Here is an example: 481``class-devupstream`` override. Here is an example::
485::
486 482
487 DEPENDS_append_class-devupstream = " gperf-native" 483 DEPENDS_append_class-devupstream = " gperf-native"
488 do_configure_prepend_class-devupstream() { 484 do_configure_prepend_class-devupstream() {
@@ -544,8 +540,7 @@ By default, this class expects the source code to support recipe builds
544that use the :term:`B` variable to point to the directory in 540that use the :term:`B` variable to point to the directory in
545which the OpenEmbedded build system places the generated objects built 541which the OpenEmbedded build system places the generated objects built
546from the recipes. By default, the ``B`` directory is set to the 542from the recipes. By default, the ``B`` directory is set to the
547following, which is separate from the source directory (``S``): 543following, which is separate from the source directory (``S``)::
548::
549 544
550 ${WORKDIR}/${BPN}/{PV}/ 545 ${WORKDIR}/${BPN}/{PV}/
551 546
@@ -581,8 +576,7 @@ be performed using the
581 useradd 576 useradd
582 class to add user and group configuration to a specific recipe. 577 class to add user and group configuration to a specific recipe.
583 578
584Here is an example that uses this class in an image recipe: 579Here is an example that uses this class in an image recipe::
585::
586 580
587 inherit extrausers 581 inherit extrausers
588 EXTRA_USERS_PARAMS = "\ 582 EXTRA_USERS_PARAMS = "\
@@ -595,8 +589,7 @@ Here is an example that uses this class in an image recipe:
595 " 589 "
596 590
597Here is an example that adds two users named "tester-jim" and "tester-sue" and assigns 591Here is an example that adds two users named "tester-jim" and "tester-sue" and assigns
598passwords: 592passwords::
599::
600 593
601 inherit extrausers 594 inherit extrausers
602 EXTRA_USERS_PARAMS = "\ 595 EXTRA_USERS_PARAMS = "\
@@ -604,8 +597,7 @@ passwords:
604 useradd -P tester01 tester-sue; \ 597 useradd -P tester01 tester-sue; \
605 " 598 "
606 599
607Finally, here is an example that sets the root password to "1876*18": 600Finally, here is an example that sets the root password to "1876*18"::
608::
609 601
610 inherit extrausers 602 inherit extrausers
611 EXTRA_USERS_PARAMS = "\ 603 EXTRA_USERS_PARAMS = "\
@@ -867,8 +859,7 @@ system need to either inherit the ``icecc`` class or nobody should.
867At the distribution level, you can inherit the ``icecc`` class to be 859At the distribution level, you can inherit the ``icecc`` class to be
868sure that all builders start with the same sstate signatures. After 860sure that all builders start with the same sstate signatures. After
869inheriting the class, you can then disable the feature by setting the 861inheriting the class, you can then disable the feature by setting the
870:term:`ICECC_DISABLED` variable to "1" as follows: 862:term:`ICECC_DISABLED` variable to "1" as follows::
871::
872 863
873 INHERIT_DISTRO_append = " icecc" 864 INHERIT_DISTRO_append = " icecc"
874 ICECC_DISABLED ??= "1" 865 ICECC_DISABLED ??= "1"
@@ -876,8 +867,7 @@ inheriting the class, you can then disable the feature by setting the
876This practice 867This practice
877makes sure everyone is using the same signatures but also requires 868makes sure everyone is using the same signatures but also requires
878individuals that do want to use Icecream to enable the feature 869individuals that do want to use Icecream to enable the feature
879individually as follows in your ``local.conf`` file: 870individually as follows in your ``local.conf`` file::
880::
881 871
882 ICECC_DISABLED = "" 872 ICECC_DISABLED = ""
883 873
@@ -925,8 +915,7 @@ types.
925 915
926By default, the :ref:`image <ref-classes-image>` class automatically 916By default, the :ref:`image <ref-classes-image>` class automatically
927enables the ``image_types`` class. The ``image`` class uses the 917enables the ``image_types`` class. The ``image`` class uses the
928``IMGCLASSES`` variable as follows: 918``IMGCLASSES`` variable as follows::
929::
930 919
931 IMGCLASSES = "rootfs_${IMAGE_PKGTYPE} image_types ${IMAGE_CLASSES}" 920 IMGCLASSES = "rootfs_${IMAGE_PKGTYPE} image_types ${IMAGE_CLASSES}"
932 IMGCLASSES += "${@['populate_sdk_base', 'populate_sdk_ext']['linux' in d.getVar("SDK_OS")]}" 921 IMGCLASSES += "${@['populate_sdk_base', 'populate_sdk_ext']['linux' in d.getVar("SDK_OS")]}"
@@ -968,8 +957,7 @@ during the :ref:`ref-tasks-rootfs` task, which optimizes
968the size of libraries contained in the image. 957the size of libraries contained in the image.
969 958
970By default, the class is enabled in the ``local.conf.template`` using 959By default, the class is enabled in the ``local.conf.template`` using
971the :term:`USER_CLASSES` variable as follows: 960the :term:`USER_CLASSES` variable as follows::
972::
973 961
974 USER_CLASSES ?= "buildstats image-mklibs image-prelink" 962 USER_CLASSES ?= "buildstats image-mklibs image-prelink"
975 963
@@ -984,8 +972,7 @@ the dynamic linking of shared libraries to reduce executable startup
984time. 972time.
985 973
986By default, the class is enabled in the ``local.conf.template`` using 974By default, the class is enabled in the ``local.conf.template`` using
987the :term:`USER_CLASSES` variable as follows: 975the :term:`USER_CLASSES` variable as follows::
988::
989 976
990 USER_CLASSES ?= "buildstats image-mklibs image-prelink" 977 USER_CLASSES ?= "buildstats image-mklibs image-prelink"
991 978
@@ -1014,8 +1001,7 @@ configuration). However, to skip one or more checks in recipes, you
1014should use :term:`INSANE_SKIP`. For example, to skip 1001should use :term:`INSANE_SKIP`. For example, to skip
1015the check for symbolic link ``.so`` files in the main package of a 1002the check for symbolic link ``.so`` files in the main package of a
1016recipe, add the following to the recipe. You need to realize that the 1003recipe, add the following to the recipe. You need to realize that the
1017package name override, in this example ``${PN}``, must be used: 1004package name override, in this example ``${PN}``, must be used::
1018::
1019 1005
1020 INSANE_SKIP_${PN} += "dev-so" 1006 INSANE_SKIP_${PN} += "dev-so"
1021 1007
@@ -1152,8 +1138,7 @@ The following list shows the tests you can list with the ``WARN_QA`` and
1152 1138
1153- ``invalid-packageconfig:`` Checks that no undefined features are 1139- ``invalid-packageconfig:`` Checks that no undefined features are
1154 being added to :term:`PACKAGECONFIG`. For 1140 being added to :term:`PACKAGECONFIG`. For
1155 example, any name "foo" for which the following form does not exist: 1141 example, any name "foo" for which the following form does not exist::
1156 ::
1157 1142
1158 PACKAGECONFIG[foo] = "..." 1143 PACKAGECONFIG[foo] = "..."
1159 1144
@@ -1636,8 +1621,7 @@ a couple different ways:
1636 .. note:: 1621 .. note::
1637 1622
1638 When creating a recipe this way, the recipe name must follow this 1623 When creating a recipe this way, the recipe name must follow this
1639 naming convention: 1624 naming convention::
1640 ::
1641 1625
1642 myrecipe-native.bb 1626 myrecipe-native.bb
1643 1627
@@ -1645,8 +1629,7 @@ a couple different ways:
1645 Not using this naming convention can lead to subtle problems 1629 Not using this naming convention can lead to subtle problems
1646 caused by existing code that depends on that naming convention. 1630 caused by existing code that depends on that naming convention.
1647 1631
1648- Create or modify a target recipe that contains the following: 1632- Create or modify a target recipe that contains the following::
1649 ::
1650 1633
1651 BBCLASSEXTEND = "native" 1634 BBCLASSEXTEND = "native"
1652 1635
@@ -1677,8 +1660,7 @@ couple different ways:
1677 inherit statement in the recipe after all other inherit statements so 1660 inherit statement in the recipe after all other inherit statements so
1678 that the ``nativesdk`` class is inherited last. 1661 that the ``nativesdk`` class is inherited last.
1679 1662
1680- Create a ``nativesdk`` variant of any recipe by adding the following: 1663- Create a ``nativesdk`` variant of any recipe by adding the following::
1681 ::
1682 1664
1683 BBCLASSEXTEND = "nativesdk" 1665 BBCLASSEXTEND = "nativesdk"
1684 1666
@@ -1689,8 +1671,7 @@ couple different ways:
1689 1671
1690.. note:: 1672.. note::
1691 1673
1692 When creating a recipe, you must follow this naming convention: 1674 When creating a recipe, you must follow this naming convention::
1693 ::
1694 1675
1695 nativesdk-myrecipe.bb 1676 nativesdk-myrecipe.bb
1696 1677
@@ -1753,8 +1734,7 @@ before attempting to fetch it from the upstream specified in
1753:term:`SRC_URI` within each recipe. 1734:term:`SRC_URI` within each recipe.
1754 1735
1755To use this class, inherit it globally and specify 1736To use this class, inherit it globally and specify
1756:term:`SOURCE_MIRROR_URL`. Here is an example: 1737:term:`SOURCE_MIRROR_URL`. Here is an example::
1757::
1758 1738
1759 INHERIT += "own-mirrors" 1739 INHERIT += "own-mirrors"
1760 SOURCE_MIRROR_URL = "http://example.com/my-source-mirror" 1740 SOURCE_MIRROR_URL = "http://example.com/my-source-mirror"
@@ -2017,8 +1997,7 @@ established and then populates the SDK. After populating the SDK, the
2017contains the cross-compiler and associated tooling, and the target, 1997contains the cross-compiler and associated tooling, and the target,
2018which contains a target root filesystem that is configured for the SDK 1998which contains a target root filesystem that is configured for the SDK
2019usage. These two images reside in :term:`SDK_OUTPUT`, 1999usage. These two images reside in :term:`SDK_OUTPUT`,
2020which consists of the following: 2000which consists of the following::
2021::
2022 2001
2023 ${SDK_OUTPUT}/${SDK_ARCH}-nativesdk-pkgs 2002 ${SDK_OUTPUT}/${SDK_ARCH}-nativesdk-pkgs
2024 ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/target-pkgs 2003 ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/target-pkgs
@@ -2180,8 +2159,7 @@ installed by ``libtool``. Removing these files results in them being
2180absent from both the sysroot and target packages. 2159absent from both the sysroot and target packages.
2181 2160
2182If a recipe needs the ``.la`` files to be installed, then the recipe can 2161If a recipe needs the ``.la`` files to be installed, then the recipe can
2183override the removal by setting ``REMOVE_LIBTOOL_LA`` to "0" as follows: 2162override the removal by setting ``REMOVE_LIBTOOL_LA`` to "0" as follows::
2184::
2185 2163
2186 REMOVE_LIBTOOL_LA = "0" 2164 REMOVE_LIBTOOL_LA = "0"
2187 2165
@@ -2231,8 +2209,7 @@ recipe, enabling ``rm_work`` will potentially result in your changes to
2231the source being lost. To exclude some recipes from having their work 2209the source being lost. To exclude some recipes from having their work
2232directories deleted by ``rm_work``, you can add the names of the recipe 2210directories deleted by ``rm_work``, you can add the names of the recipe
2233or recipes you are working on to the ``RM_WORK_EXCLUDE`` variable, which 2211or recipes you are working on to the ``RM_WORK_EXCLUDE`` variable, which
2234can also be set in your ``local.conf`` file. Here is an example: 2212can also be set in your ``local.conf`` file. Here is an example::
2235::
2236 2213
2237 RM_WORK_EXCLUDE += "busybox glibc" 2214 RM_WORK_EXCLUDE += "busybox glibc"
2238 2215
@@ -2531,8 +2508,7 @@ You should set :term:`SYSTEMD_SERVICE` to the
2531name of the service file. You should also use a package name override to 2508name of the service file. You should also use a package name override to
2532indicate the package to which the value applies. If the value applies to 2509indicate the package to which the value applies. If the value applies to
2533the recipe's main package, use ``${``\ :term:`PN`\ ``}``. Here 2510the recipe's main package, use ``${``\ :term:`PN`\ ``}``. Here
2534is an example from the connman recipe: 2511is an example from the connman recipe::
2535::
2536 2512
2537 SYSTEMD_SERVICE_${PN} = "connman.service" 2513 SYSTEMD_SERVICE_${PN} = "connman.service"
2538 2514
@@ -2608,8 +2584,7 @@ The tests are commands that run on the target system over ``ssh``. Each
2608test is written in Python and makes use of the ``unittest`` module. 2584test is written in Python and makes use of the ``unittest`` module.
2609 2585
2610The ``testimage.bbclass`` runs tests on an image when called using the 2586The ``testimage.bbclass`` runs tests on an image when called using the
2611following: 2587following::
2612::
2613 2588
2614 $ bitbake -c testimage image 2589 $ bitbake -c testimage image
2615 2590
@@ -2628,8 +2603,7 @@ section in the Yocto Project Development Tasks Manual.
2628 2603
2629This class supports running automated tests against software development 2604This class supports running automated tests against software development
2630kits (SDKs). The ``testsdk`` class runs tests on an SDK when called 2605kits (SDKs). The ``testsdk`` class runs tests on an SDK when called
2631using the following: 2606using the following::
2632::
2633 2607
2634 $ bitbake -c testsdk image 2608 $ bitbake -c testsdk image
2635 2609
@@ -2684,8 +2658,7 @@ the environment for installed SDKs.
2684The ``typecheck`` class provides support for validating the values of 2658The ``typecheck`` class provides support for validating the values of
2685variables set at the configuration level against their defined types. 2659variables set at the configuration level against their defined types.
2686The OpenEmbedded build system allows you to define the type of a 2660The OpenEmbedded build system allows you to define the type of a
2687variable using the "type" varflag. Here is an example: 2661variable using the "type" varflag. Here is an example::
2688::
2689 2662
2690 IMAGE_FEATURES[type] = "list" 2663 IMAGE_FEATURES[type] = "list"
2691 2664
@@ -2695,14 +2668,12 @@ variable using the "type" varflag. Here is an example:
2695======================== 2668========================
2696 2669
2697The ``uboot-config`` class provides support for U-Boot configuration for 2670The ``uboot-config`` class provides support for U-Boot configuration for
2698a machine. Specify the machine in your recipe as follows: 2671a machine. Specify the machine in your recipe as follows::
2699::
2700 2672
2701 UBOOT_CONFIG ??= <default> 2673 UBOOT_CONFIG ??= <default>
2702 UBOOT_CONFIG[foo] = "config,images" 2674 UBOOT_CONFIG[foo] = "config,images"
2703 2675
2704You can also specify the machine using this method: 2676You can also specify the machine using this method::
2705::
2706 2677
2707 UBOOT_MACHINE = "config" 2678 UBOOT_MACHINE = "config"
2708 2679