summaryrefslogtreecommitdiffstats
path: root/documentation/dev-manual/new-recipe.rst
diff options
context:
space:
mode:
authorMichael Opdenacker <michael.opdenacker@bootlin.com>2023-01-05 08:34:26 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-01-06 17:39:09 +0000
commit8b1909aa6f7a51a878dc3d4a9223403ad3e164a9 (patch)
treee1418f545ad6640afb5fde004696eef2a9e6e67b /documentation/dev-manual/new-recipe.rst
parentae280972ffba62d7ed839b692957f61b0955cbca (diff)
downloadpoky-8b1909aa6f7a51a878dc3d4a9223403ad3e164a9.tar.gz
manuals: simplify references to classes
Now that .bbclass is removed from class section titles. We can now have, for example, :ref:`ref-classes-insane` instead of :ref:`insane <ref-classes-insane>`. Then, when necessary, rework paragraphs so that they have lines of even length, not exceeding 80 characters. (From yocto-docs rev: e76190e3be78c1e483bec0469f1e437dbf8f3791) Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com> Suggested-by: Quentin Schulz <foss+yocto@0leil.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/dev-manual/new-recipe.rst')
-rw-r--r--documentation/dev-manual/new-recipe.rst85
1 files changed, 37 insertions, 48 deletions
diff --git a/documentation/dev-manual/new-recipe.rst b/documentation/dev-manual/new-recipe.rst
index 3adebf2746..4751f64b7e 100644
--- a/documentation/dev-manual/new-recipe.rst
+++ b/documentation/dev-manual/new-recipe.rst
@@ -565,7 +565,7 @@ your software is built:
565 need to modify the configuration. 565 need to modify the configuration.
566 566
567 When using Autotools, your recipe needs to inherit the 567 When using Autotools, your recipe needs to inherit the
568 :ref:`autotools <ref-classes-autotools>` class and it does not have to 568 :ref:`ref-classes-autotools` class and it does not have to
569 contain a :ref:`ref-tasks-configure` task. However, you might still want to 569 contain a :ref:`ref-tasks-configure` task. However, you might still want to
570 make some adjustments. For example, you can set :term:`EXTRA_OECONF` or 570 make some adjustments. For example, you can set :term:`EXTRA_OECONF` or
571 :term:`PACKAGECONFIG_CONFARGS` to pass any needed configure options that 571 :term:`PACKAGECONFIG_CONFARGS` to pass any needed configure options that
@@ -576,7 +576,7 @@ your software is built:
576 need to modify the configuration. 576 need to modify the configuration.
577 577
578 When you use CMake, your recipe needs to inherit the 578 When you use CMake, your recipe needs to inherit the
579 :ref:`cmake <ref-classes-cmake>` class and it does not have to contain a 579 :ref:`ref-classes-cmake` class and it does not have to contain a
580 :ref:`ref-tasks-configure` task. You can make some adjustments by setting 580 :ref:`ref-tasks-configure` task. You can make some adjustments by setting
581 :term:`EXTRA_OECMAKE` to pass any needed configure options that are 581 :term:`EXTRA_OECMAKE` to pass any needed configure options that are
582 specific to the recipe. 582 specific to the recipe.
@@ -712,7 +712,7 @@ Here are some common issues that cause failures.
712 ":ref:`dev-manual/debugging:debugging parallel make races`" section. 712 ":ref:`dev-manual/debugging:debugging parallel make races`" section.
713 713
714- *Improper host path usage:* This failure applies to recipes building 714- *Improper host path usage:* This failure applies to recipes building
715 for the target or ":ref:`nativesdk <ref-classes-nativesdk>`" only. The 715 for the target or ":ref:`ref-classes-nativesdk`" only. The
716 failure occurs when the compilation process uses improper headers, 716 failure occurs when the compilation process uses improper headers,
717 libraries, or other files from the host system when cross-compiling for 717 libraries, or other files from the host system when cross-compiling for
718 the target. 718 the target.
@@ -807,14 +807,13 @@ installed correctly.
807 re-execute :ref:`ref-tasks-install` if needed. 807 re-execute :ref:`ref-tasks-install` if needed.
808 808
809 - ``oe_runmake install``, which can be run directly or can be run 809 - ``oe_runmake install``, which can be run directly or can be run
810 indirectly by the 810 indirectly by the :ref:`ref-classes-autotools` and
811 :ref:`autotools <ref-classes-autotools>` and 811 :ref:`ref-classes-cmake` classes, runs ``make install`` in parallel.
812 :ref:`cmake <ref-classes-cmake>` classes, 812 Sometimes, a Makefile can have missing dependencies between targets that
813 runs ``make install`` in parallel. Sometimes, a Makefile can have 813 can result in race conditions. If you experience intermittent failures
814 missing dependencies between targets that can result in race 814 during :ref:`ref-tasks-install`, you might be able to work around them by
815 conditions. If you experience intermittent failures during 815 disabling parallel Makefile installs by adding the following to the
816 :ref:`ref-tasks-install`, you might be able to work around them by disabling 816 recipe::
817 parallel Makefile installs by adding the following to the recipe::
818 817
819 PARALLEL_MAKEINST = "" 818 PARALLEL_MAKEINST = ""
820 819
@@ -854,7 +853,7 @@ different ways:
854 shutdown of all other programs. 853 shutdown of all other programs.
855 854
856 To enable a service using SysVinit, your recipe needs to inherit the 855 To enable a service using SysVinit, your recipe needs to inherit the
857 :ref:`update-rc.d <ref-classes-update-rc.d>` class. The class helps 856 :ref:`ref-classes-update-rc.d` class. The class helps
858 facilitate safely installing the package on the target. 857 facilitate safely installing the package on the target.
859 858
860 You will need to set the 859 You will need to set the
@@ -870,7 +869,7 @@ different ways:
870 https://freedesktop.org/wiki/Software/systemd/. 869 https://freedesktop.org/wiki/Software/systemd/.
871 870
872 To enable a service using systemd, your recipe needs to inherit the 871 To enable a service using systemd, your recipe needs to inherit the
873 :ref:`systemd <ref-classes-systemd>` class. See the ``systemd.bbclass`` file 872 :ref:`ref-classes-systemd` class. See the ``systemd.bbclass`` file
874 located in your :term:`Source Directory` section for more information. 873 located in your :term:`Source Directory` section for more information.
875 874
876Packaging 875Packaging
@@ -886,14 +885,12 @@ take. The following list describes the process:
886 other logical components that should be split out. The :ref:`ref-tasks-package` 885 other logical components that should be split out. The :ref:`ref-tasks-package`
887 task ensures that files are split up and packaged correctly. 886 task ensures that files are split up and packaged correctly.
888 887
889- *Running QA Checks*: The 888- *Running QA Checks*: The :ref:`ref-classes-insane` class adds a
890 :ref:`insane <ref-classes-insane>` class adds a
891 step to the package generation process so that output quality 889 step to the package generation process so that output quality
892 assurance checks are generated by the OpenEmbedded build system. This 890 assurance checks are generated by the OpenEmbedded build system. This
893 step performs a range of checks to be sure the build's output is free 891 step performs a range of checks to be sure the build's output is free
894 of common problems that show up during runtime. For information on 892 of common problems that show up during runtime. For information on
895 these checks, see the 893 these checks, see the :ref:`ref-classes-insane` class and
896 :ref:`insane <ref-classes-insane>` class and
897 the ":ref:`ref-manual/qa-checks:qa error and warning messages`" 894 the ":ref:`ref-manual/qa-checks:qa error and warning messages`"
898 chapter in the Yocto Project Reference Manual. 895 chapter in the Yocto Project Reference Manual.
899 896
@@ -934,8 +931,7 @@ take. The following list describes the process:
934 On the other hand, if the recipe produces packages that do not 931 On the other hand, if the recipe produces packages that do not
935 contain anything specific to the target machine or architecture at 932 contain anything specific to the target machine or architecture at
936 all (e.g. recipes that simply package script files or configuration 933 all (e.g. recipes that simply package script files or configuration
937 files), you should use the 934 files), you should use the :ref:`ref-classes-allarch` class to
938 :ref:`allarch <ref-classes-allarch>` class to
939 do this for you by adding this to your recipe:: 935 do this for you by adding this to your recipe::
940 936
941 inherit allarch 937 inherit allarch
@@ -1002,18 +998,16 @@ same functionality, you can use a virtual provider (i.e. ``virtual/*``)
1002as a placeholder for the actual provider. The actual provider is 998as a placeholder for the actual provider. The actual provider is
1003determined at build-time. 999determined at build-time.
1004 1000
1005A common scenario where a virtual provider is used would be for the 1001A common scenario where a virtual provider is used would be for the kernel
1006kernel recipe. Suppose you have three kernel recipes whose 1002recipe. Suppose you have three kernel recipes whose :term:`PN` values map to
1007:term:`PN` values map to ``kernel-big``, 1003``kernel-big``, ``kernel-mid``, and ``kernel-small``. Furthermore, each of
1008``kernel-mid``, and ``kernel-small``. Furthermore, each of these recipes 1004these recipes in some way uses a :term:`PROVIDES` statement that essentially
1009in some way uses a :term:`PROVIDES` 1005identifies itself as being able to provide ``virtual/kernel``. Here is one way
1010statement that essentially identifies itself as being able to provide 1006through the :ref:`ref-classes-kernel` class::
1011``virtual/kernel``. Here is one way through the
1012:ref:`kernel <ref-classes-kernel>` class::
1013 1007
1014 PROVIDES += "virtual/kernel" 1008 PROVIDES += "virtual/kernel"
1015 1009
1016Any recipe that inherits the :ref:`kernel <ref-classes-kernel>` class is 1010Any recipe that inherits the :ref:`ref-classes-kernel` class is
1017going to utilize a :term:`PROVIDES` statement that identifies that recipe as 1011going to utilize a :term:`PROVIDES` statement that identifies that recipe as
1018being able to provide the ``virtual/kernel`` item. 1012being able to provide the ``virtual/kernel`` item.
1019 1013
@@ -1223,7 +1217,7 @@ Autotooled Package
1223 1217
1224Applications that use Autotools such as ``autoconf`` and ``automake`` 1218Applications that use Autotools such as ``autoconf`` and ``automake``
1225require a recipe that has a source archive listed in :term:`SRC_URI` and 1219require a recipe that has a source archive listed in :term:`SRC_URI` and
1226also inherit the :ref:`autotools <ref-classes-autotools>` class, 1220also inherit the :ref:`ref-classes-autotools` class,
1227which contains the definitions of all the steps needed to build an 1221which contains the definitions of all the steps needed to build an
1228Autotool-based application. The result of the build is automatically 1222Autotool-based application. The result of the build is automatically
1229packaged. And, if the application uses NLS for localization, packages 1223packaged. And, if the application uses NLS for localization, packages
@@ -1353,24 +1347,19 @@ could lead to compatibility problems with ABI in the future. However,
1353sometimes you have no choice. 1347sometimes you have no choice.
1354 1348
1355The easiest solution is to create a recipe that uses the 1349The easiest solution is to create a recipe that uses the
1356:ref:`bin_package <ref-classes-bin-package>` class 1350:ref:`ref-classes-bin-package` class and to be sure that you are using default
1357and to be sure that you are using default locations for build artifacts. 1351locations for build artifacts. In most cases, the
1358In most cases, the :ref:`bin_package <ref-classes-bin-package>` class handles "skipping" the 1352:ref:`ref-classes-bin-package` class handles "skipping" the configure and
1359configure and compile steps as well as sets things up to grab packages 1353compile steps as well as sets things up to grab packages from the appropriate
1360from the appropriate area. In particular, this class sets ``noexec`` on 1354area. In particular, this class sets ``noexec`` on both the
1361both the :ref:`ref-tasks-configure` 1355:ref:`ref-tasks-configure` and :ref:`ref-tasks-compile` tasks, sets
1362and :ref:`ref-tasks-compile` tasks, 1356``FILES:${PN}`` to "/" so that it picks up all files, and sets up a
1363sets ``FILES:${PN}`` to "/" so that it picks up all files, and sets up a 1357:ref:`ref-tasks-install` task, which effectively copies all files from ``${S}``
1364:ref:`ref-tasks-install` task, which 1358to ``${D}``. The :ref:`ref-classes-bin-package` class works well when the files
1365effectively copies all files from ``${S}`` to ``${D}``. The 1359extracted into ``${S}`` are already laid out in the way they should be laid out
1366:ref:`bin_package <ref-classes-bin-package>` class works well when the files extracted into ``${S}`` 1360on the target. For more information on these variables, see the :term:`FILES`,
1367are already laid out in the way they should be laid out on the target. 1361:term:`PN`, :term:`S`, and :term:`D` variables in the Yocto Project Reference
1368For more information on these variables, see the 1362Manual's variable glossary.
1369:term:`FILES`,
1370:term:`PN`,
1371:term:`S`, and
1372:term:`D` variables in the Yocto Project
1373Reference Manual's variable glossary.
1374 1363
1375.. note:: 1364.. note::
1376 1365
@@ -1388,7 +1377,7 @@ Reference Manual's variable glossary.
1388 section in the Yocto Project Overview and Concepts Manual for more 1377 section in the Yocto Project Overview and Concepts Manual for more
1389 information. 1378 information.
1390 1379
1391If you cannot use the :ref:`bin_package <ref-classes-bin-package>` class, you need to be sure you are 1380If you cannot use the :ref:`ref-classes-bin-package` class, you need to be sure you are
1392doing the following: 1381doing the following:
1393 1382
1394- Create a recipe where the 1383- Create a recipe where the