diff options
author | Michael Opdenacker <michael.opdenacker@bootlin.com> | 2021-04-16 18:27:05 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-04-23 16:39:03 +0100 |
commit | c3c6de21876aad811e08538544c8fe76d22ccd09 (patch) | |
tree | e22ee00a9c1ec588965f32050a42e05946bc9f71 /documentation/ref-manual/classes.rst | |
parent | 773536c333248214f8f41eff698d8bfd3c687249 (diff) | |
download | poky-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.rst | 87 |
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` | |||
221 | value as a variable flag (varflag) and provide a reason, which is | 220 | value as a variable flag (varflag) and provide a reason, which is |
222 | reported, if the package is requested to be built as the value. For | 221 | reported, if the package is requested to be built as the value. For |
223 | example, if you want to blacklist a recipe called "exoticware", you add | 222 | example, if you want to blacklist a recipe called "exoticware", you add |
224 | the following to your ``local.conf`` or distribution configuration: | 223 | the 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``. | |||
470 | The ``devupstream`` class uses | 468 | The ``devupstream`` class uses |
471 | :term:`BBCLASSEXTEND` to add a variant of the | 469 | :term:`BBCLASSEXTEND` to add a variant of the |
472 | recipe that fetches from an alternative URI (e.g. Git) instead of a | 470 | recipe that fetches from an alternative URI (e.g. Git) instead of a |
473 | tarball. Following is an example: | 471 | tarball. 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". |
482 | Consequently, you need to select the variant of the recipe to use it. | 479 | Consequently, you need to select the variant of the recipe to use it. |
483 | Any development-specific adjustments can be done by using the | 480 | Any 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 | |||
544 | that use the :term:`B` variable to point to the directory in | 540 | that use the :term:`B` variable to point to the directory in |
545 | which the OpenEmbedded build system places the generated objects built | 541 | which the OpenEmbedded build system places the generated objects built |
546 | from the recipes. By default, the ``B`` directory is set to the | 542 | from the recipes. By default, the ``B`` directory is set to the |
547 | following, which is separate from the source directory (``S``): | 543 | following, 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 | ||
584 | Here is an example that uses this class in an image recipe: | 579 | Here 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 | ||
597 | Here is an example that adds two users named "tester-jim" and "tester-sue" and assigns | 591 | Here is an example that adds two users named "tester-jim" and "tester-sue" and assigns |
598 | passwords: | 592 | passwords:: |
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 | ||
607 | Finally, here is an example that sets the root password to "1876*18": | 600 | Finally, 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. | |||
867 | At the distribution level, you can inherit the ``icecc`` class to be | 859 | At the distribution level, you can inherit the ``icecc`` class to be |
868 | sure that all builders start with the same sstate signatures. After | 860 | sure that all builders start with the same sstate signatures. After |
869 | inheriting the class, you can then disable the feature by setting the | 861 | inheriting 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 | |||
876 | This practice | 867 | This practice |
877 | makes sure everyone is using the same signatures but also requires | 868 | makes sure everyone is using the same signatures but also requires |
878 | individuals that do want to use Icecream to enable the feature | 869 | individuals that do want to use Icecream to enable the feature |
879 | individually as follows in your ``local.conf`` file: | 870 | individually 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 | ||
926 | By default, the :ref:`image <ref-classes-image>` class automatically | 916 | By default, the :ref:`image <ref-classes-image>` class automatically |
927 | enables the ``image_types`` class. The ``image`` class uses the | 917 | enables 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 | |||
968 | the size of libraries contained in the image. | 957 | the size of libraries contained in the image. |
969 | 958 | ||
970 | By default, the class is enabled in the ``local.conf.template`` using | 959 | By default, the class is enabled in the ``local.conf.template`` using |
971 | the :term:`USER_CLASSES` variable as follows: | 960 | the :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 | |||
984 | time. | 972 | time. |
985 | 973 | ||
986 | By default, the class is enabled in the ``local.conf.template`` using | 974 | By default, the class is enabled in the ``local.conf.template`` using |
987 | the :term:`USER_CLASSES` variable as follows: | 975 | the :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 | |||
1014 | should use :term:`INSANE_SKIP`. For example, to skip | 1001 | should use :term:`INSANE_SKIP`. For example, to skip |
1015 | the check for symbolic link ``.so`` files in the main package of a | 1002 | the check for symbolic link ``.so`` files in the main package of a |
1016 | recipe, add the following to the recipe. You need to realize that the | 1003 | recipe, add the following to the recipe. You need to realize that the |
1017 | package name override, in this example ``${PN}``, must be used: | 1004 | package 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 | ||
1755 | To use this class, inherit it globally and specify | 1736 | To 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 | |||
2017 | contains the cross-compiler and associated tooling, and the target, | 1997 | contains the cross-compiler and associated tooling, and the target, |
2018 | which contains a target root filesystem that is configured for the SDK | 1998 | which contains a target root filesystem that is configured for the SDK |
2019 | usage. These two images reside in :term:`SDK_OUTPUT`, | 1999 | usage. These two images reside in :term:`SDK_OUTPUT`, |
2020 | which consists of the following: | 2000 | which 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 | |||
2180 | absent from both the sysroot and target packages. | 2159 | absent from both the sysroot and target packages. |
2181 | 2160 | ||
2182 | If a recipe needs the ``.la`` files to be installed, then the recipe can | 2161 | If a recipe needs the ``.la`` files to be installed, then the recipe can |
2183 | override the removal by setting ``REMOVE_LIBTOOL_LA`` to "0" as follows: | 2162 | override 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 | |||
2231 | the source being lost. To exclude some recipes from having their work | 2209 | the source being lost. To exclude some recipes from having their work |
2232 | directories deleted by ``rm_work``, you can add the names of the recipe | 2210 | directories deleted by ``rm_work``, you can add the names of the recipe |
2233 | or recipes you are working on to the ``RM_WORK_EXCLUDE`` variable, which | 2211 | or recipes you are working on to the ``RM_WORK_EXCLUDE`` variable, which |
2234 | can also be set in your ``local.conf`` file. Here is an example: | 2212 | can 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 | |||
2531 | name of the service file. You should also use a package name override to | 2508 | name of the service file. You should also use a package name override to |
2532 | indicate the package to which the value applies. If the value applies to | 2509 | indicate the package to which the value applies. If the value applies to |
2533 | the recipe's main package, use ``${``\ :term:`PN`\ ``}``. Here | 2510 | the recipe's main package, use ``${``\ :term:`PN`\ ``}``. Here |
2534 | is an example from the connman recipe: | 2511 | is 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 | |||
2608 | test is written in Python and makes use of the ``unittest`` module. | 2584 | test is written in Python and makes use of the ``unittest`` module. |
2609 | 2585 | ||
2610 | The ``testimage.bbclass`` runs tests on an image when called using the | 2586 | The ``testimage.bbclass`` runs tests on an image when called using the |
2611 | following: | 2587 | following:: |
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 | ||
2629 | This class supports running automated tests against software development | 2604 | This class supports running automated tests against software development |
2630 | kits (SDKs). The ``testsdk`` class runs tests on an SDK when called | 2605 | kits (SDKs). The ``testsdk`` class runs tests on an SDK when called |
2631 | using the following: | 2606 | using 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. | |||
2684 | The ``typecheck`` class provides support for validating the values of | 2658 | The ``typecheck`` class provides support for validating the values of |
2685 | variables set at the configuration level against their defined types. | 2659 | variables set at the configuration level against their defined types. |
2686 | The OpenEmbedded build system allows you to define the type of a | 2660 | The OpenEmbedded build system allows you to define the type of a |
2687 | variable using the "type" varflag. Here is an example: | 2661 | variable 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 | ||
2697 | The ``uboot-config`` class provides support for U-Boot configuration for | 2670 | The ``uboot-config`` class provides support for U-Boot configuration for |
2698 | a machine. Specify the machine in your recipe as follows: | 2671 | a 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 | ||
2704 | You can also specify the machine using this method: | 2676 | You can also specify the machine using this method:: |
2705 | :: | ||
2706 | 2677 | ||
2707 | UBOOT_MACHINE = "config" | 2678 | UBOOT_MACHINE = "config" |
2708 | 2679 | ||