summaryrefslogtreecommitdiffstats
path: root/documentation/kernel-dev/kernel-dev-advanced.rst
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/kernel-dev/kernel-dev-advanced.rst')
-rw-r--r--documentation/kernel-dev/kernel-dev-advanced.rst54
1 files changed, 27 insertions, 27 deletions
diff --git a/documentation/kernel-dev/kernel-dev-advanced.rst b/documentation/kernel-dev/kernel-dev-advanced.rst
index 90323d3e2a..36a34ca28c 100644
--- a/documentation/kernel-dev/kernel-dev-advanced.rst
+++ b/documentation/kernel-dev/kernel-dev-advanced.rst
@@ -11,7 +11,7 @@ Overview
11 11
12In addition to supporting configuration fragments and patches, the Yocto 12In addition to supporting configuration fragments and patches, the Yocto
13Project kernel tools also support rich 13Project kernel tools also support rich
14`Metadata <&YOCTO_DOCS_REF_URL;#metadata>`__ that you can use to define 14:term:`Metadata` that you can use to define
15complex policies and Board Support Package (BSP) support. The purpose of 15complex policies and Board Support Package (BSP) support. The purpose of
16the Metadata and the tools that manage it is to help you manage the 16the Metadata and the tools that manage it is to help you manage the
17complexity of the configuration and sources used to support multiple 17complexity of the configuration and sources used to support multiple
@@ -27,7 +27,7 @@ Kernel development tools ("kern-tools") exist also in the Yocto Project
27Source Repositories under the "Yocto Linux Kernel" heading in the 27Source Repositories under the "Yocto Linux Kernel" heading in the
28``yocto-kernel-tools`` Git repository. The recipe that builds these 28``yocto-kernel-tools`` Git repository. The recipe that builds these
29tools is ``meta/recipes-kernel/kern-tools/kern-tools-native_git.bb`` in 29tools is ``meta/recipes-kernel/kern-tools/kern-tools-native_git.bb`` in
30the `Source Directory <&YOCTO_DOCS_REF_URL;#source-directory>`__ (e.g. 30the :term:`Source Directory` (e.g.
31``poky``). 31``poky``).
32 32
33Using Kernel Metadata in a Recipe 33Using Kernel Metadata in a Recipe
@@ -49,9 +49,9 @@ linux-yocto recipe.
49 file) is said to be a "linux-yocto style" recipe. 49 file) is said to be a "linux-yocto style" recipe.
50 50
51Every linux-yocto style recipe must define the 51Every linux-yocto style recipe must define the
52```KMACHINE`` <&YOCTO_DOCS_REF_URL;#var-KMACHINE>`__ variable. This 52:term:`KMACHINE` variable. This
53variable is typically set to the same value as the ``MACHINE`` variable, 53variable is typically set to the same value as the ``MACHINE`` variable,
54which is used by `BitBake <&YOCTO_DOCS_REF_URL;#bitbake-term>`__. 54which is used by :term:`BitBake`.
55However, in some cases, the variable might instead refer to the 55However, in some cases, the variable might instead refer to the
56underlying platform of the ``MACHINE``. 56underlying platform of the ``MACHINE``.
57 57
@@ -65,7 +65,7 @@ Descriptions <#bsp-descriptions>`__ section for more information.
65 65
66Every linux-yocto style recipe must also indicate the Linux kernel 66Every linux-yocto style recipe must also indicate the Linux kernel
67source repository branch used to build the Linux kernel. The 67source repository branch used to build the Linux kernel. The
68```KBRANCH`` <&YOCTO_DOCS_REF_URL;#var-KBRANCH>`__ variable must be set 68:term:`KBRANCH` variable must be set
69to indicate the branch. 69to indicate the branch.
70 70
71.. note:: 71.. note::
@@ -84,7 +84,7 @@ to indicate the branch.
84The linux-yocto style recipes can optionally define the following 84The linux-yocto style recipes can optionally define the following
85variables: KERNEL_FEATURES LINUX_KERNEL_TYPE 85variables: KERNEL_FEATURES LINUX_KERNEL_TYPE
86 86
87```LINUX_KERNEL_TYPE`` <&YOCTO_DOCS_REF_URL;#var-LINUX_KERNEL_TYPE>`__ 87:term:`LINUX_KERNEL_TYPE`
88defines the kernel type to be used in assembling the configuration. If 88defines the kernel type to be used in assembling the configuration. If
89you do not specify a ``LINUX_KERNEL_TYPE``, it defaults to "standard". 89you do not specify a ``LINUX_KERNEL_TYPE``, it defaults to "standard".
90Together with ``KMACHINE``, ``LINUX_KERNEL_TYPE`` defines the search 90Together with ``KMACHINE``, ``LINUX_KERNEL_TYPE`` defines the search
@@ -103,10 +103,10 @@ a match, they issue a warning.
103The tools first search for the ``KMACHINE`` and then for the 103The tools first search for the ``KMACHINE`` and then for the
104``LINUX_KERNEL_TYPE``. If the tools cannot find a partial match, they 104``LINUX_KERNEL_TYPE``. If the tools cannot find a partial match, they
105will use the sources from the ``KBRANCH`` and any configuration 105will use the sources from the ``KBRANCH`` and any configuration
106specified in the ```SRC_URI`` <&YOCTO_DOCS_REF_URL;#var-SRC_URI>`__. 106specified in the :term:`SRC_URI`.
107 107
108You can use the 108You can use the
109```KERNEL_FEATURES`` <&YOCTO_DOCS_REF_URL;#var-KERNEL_FEATURES>`__ 109:term:`KERNEL_FEATURES`
110variable to include features (configuration fragments, patches, or both) 110variable to include features (configuration fragments, patches, or both)
111that are not already included by the ``KMACHINE`` and 111that are not already included by the ``KMACHINE`` and
112``LINUX_KERNEL_TYPE`` variable combination. For example, to include a 112``LINUX_KERNEL_TYPE`` variable combination. For example, to include a
@@ -185,7 +185,7 @@ contain "features" as far as the kernel tools are concerned.
185 185
186Paths used in kernel Metadata files are relative to base, which is 186Paths used in kernel Metadata files are relative to base, which is
187either 187either
188```FILESEXTRAPATHS`` <&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS>`__ if 188:term:`FILESEXTRAPATHS` if
189you are creating Metadata in `recipe-space <#recipe-space-metadata>`__, 189you are creating Metadata in `recipe-space <#recipe-space-metadata>`__,
190or the top level of 190or the top level of
191```yocto-kernel-cache`` <&YOCTO_GIT_URL;/cgit/cgit.cgi/yocto-kernel-cache/tree/>`__ 191```yocto-kernel-cache`` <&YOCTO_GIT_URL;/cgit/cgit.cgi/yocto-kernel-cache/tree/>`__
@@ -218,7 +218,7 @@ fragment files in the "`Creating Configuration
218Fragments <#creating-config-fragments>`__" section. 218Fragments <#creating-config-fragments>`__" section.
219 219
220Within the ``smp.scc`` file, the 220Within the ``smp.scc`` file, the
221```KFEATURE_DESCRIPTION`` <&YOCTO_DOCS_REF_URL;#var-KFEATURE_DESCRIPTION>`__ 221:term:`KFEATURE_DESCRIPTION`
222statement provides a short description of the fragment. Higher level 222statement provides a short description of the fragment. Higher level
223kernel tools use this description. 223kernel tools use this description.
224 224
@@ -312,7 +312,7 @@ non-hardware configuration fragments with patches you want to use when
312building a Linux kernel of a specific type (e.g. a real-time kernel). 312building a Linux kernel of a specific type (e.g. a real-time kernel).
313Syntactically, kernel types are no different than features as described 313Syntactically, kernel types are no different than features as described
314in the "`Features <#features>`__" section. The 314in the "`Features <#features>`__" section. The
315```LINUX_KERNEL_TYPE`` <&YOCTO_DOCS_REF_URL;#var-LINUX_KERNEL_TYPE>`__ 315:term:`LINUX_KERNEL_TYPE`
316variable in the kernel recipe selects the kernel type. For example, in 316variable in the kernel recipe selects the kernel type. For example, in
317the ``linux-yocto_4.12.bb`` kernel recipe found in 317the ``linux-yocto_4.12.bb`` kernel recipe found in
318``poky/meta/recipes-kernel/linux``, a 318``poky/meta/recipes-kernel/linux``, a
@@ -432,9 +432,9 @@ ktypes/standard/standard.scc branch beaglebone include beaglebone.scc #
432default policy for standard kernels include 432default policy for standard kernels include
433features/latencytop/latencytop.scc include 433features/latencytop/latencytop.scc include
434features/profiling/profiling.scc Every top-level BSP description file 434features/profiling/profiling.scc Every top-level BSP description file
435should define the ```KMACHINE`` <&YOCTO_DOCS_REF_URL;#var-KMACHINE>`__, 435should define the :term:`KMACHINE`,
436```KTYPE`` <&YOCTO_DOCS_REF_URL;#var-KTYPE>`__, and 436:term:`KTYPE`, and
437```KARCH`` <&YOCTO_DOCS_REF_URL;#var-KARCH>`__ variables. These 437:term:`KARCH` variables. These
438variables allow the OpenEmbedded build system to identify the 438variables allow the OpenEmbedded build system to identify the
439description as meeting the criteria set by the recipe being built. This 439description as meeting the criteria set by the recipe being built. This
440example supports the "beaglebone" machine for the "standard" kernel and 440example supports the "beaglebone" machine for the "standard" kernel and
@@ -444,7 +444,7 @@ Be aware that a hard link between the ``KTYPE`` variable and a kernel
444type description file does not exist. Thus, if you do not have the 444type description file does not exist. Thus, if you do not have the
445kernel type defined in your kernel Metadata as it is here, you only need 445kernel type defined in your kernel Metadata as it is here, you only need
446to ensure that the 446to ensure that the
447```LINUX_KERNEL_TYPE`` <&YOCTO_DOCS_REF_URL;#var-LINUX_KERNEL_TYPE>`__ 447:term:`LINUX_KERNEL_TYPE`
448variable in the kernel recipe and the ``KTYPE`` variable in the BSP 448variable in the kernel recipe and the ``KTYPE`` variable in the BSP
449description file match. 449description file match.
450 450
@@ -529,9 +529,9 @@ with the most basic functionality of the system as defined in the base
529"minnow" description file. 529"minnow" description file.
530 530
531Notice again the three critical variables: 531Notice again the three critical variables:
532```KMACHINE`` <&YOCTO_DOCS_REF_URL;#var-KMACHINE>`__, 532:term:`KMACHINE`,
533```KTYPE`` <&YOCTO_DOCS_REF_URL;#var-KTYPE>`__, and 533:term:`KTYPE`, and
534```KARCH`` <&YOCTO_DOCS_REF_URL;#var-KARCH>`__. Of these variables, only 534:term:`KARCH`. Of these variables, only
535``KTYPE`` has changed to specify the "tiny" kernel type. 535``KTYPE`` has changed to specify the "tiny" kernel type.
536 536
537Kernel Metadata Location 537Kernel Metadata Location
@@ -564,12 +564,12 @@ Recipe-Space Metadata
564 564
565When stored in recipe-space, the kernel Metadata files reside in a 565When stored in recipe-space, the kernel Metadata files reside in a
566directory hierarchy below 566directory hierarchy below
567```FILESEXTRAPATHS`` <&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS>`__. For 567:term:`FILESEXTRAPATHS`. For
568a linux-yocto recipe or for a Linux kernel recipe derived by copying and 568a linux-yocto recipe or for a Linux kernel recipe derived by copying and
569modifying 569modifying
570``oe-core/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb`` to 570``oe-core/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb`` to
571a recipe in your layer, ``FILESEXTRAPATHS`` is typically set to 571a recipe in your layer, ``FILESEXTRAPATHS`` is typically set to
572``${``\ ```THISDIR`` <&YOCTO_DOCS_REF_URL;#var-THISDIR>`__\ ``}/${``\ ```PN`` <&YOCTO_DOCS_REF_URL;#var-PN>`__\ ``}``. 572``${``\ :term:`THISDIR`\ ``}/${``\ :term:`PN`\ ``}``.
573See the "`Modifying an Existing 573See the "`Modifying an Existing
574Recipe <#modifying-an-existing-recipe>`__" section for more information. 574Recipe <#modifying-an-existing-recipe>`__" section for more information.
575 575
@@ -582,10 +582,10 @@ When the Metadata is stored in recipe-space, you must take steps to
582ensure BitBake has the necessary information to decide what files to 582ensure BitBake has the necessary information to decide what files to
583fetch and when they need to be fetched again. It is only necessary to 583fetch and when they need to be fetched again. It is only necessary to
584specify the ``.scc`` files on the 584specify the ``.scc`` files on the
585```SRC_URI`` <&YOCTO_DOCS_REF_URL;#var-SRC_URI>`__. BitBake parses them 585:term:`SRC_URI`. BitBake parses them
586and fetches any files referenced in the ``.scc`` files by the 586and fetches any files referenced in the ``.scc`` files by the
587``include``, ``patch``, or ``kconf`` commands. Because of this, it is 587``include``, ``patch``, or ``kconf`` commands. Because of this, it is
588necessary to bump the recipe ```PR`` <&YOCTO_DOCS_REF_URL;#var-PR>`__ 588necessary to bump the recipe :term:`PR`
589value when changing the content of files not explicitly listed in the 589value when changing the content of files not explicitly listed in the
590``SRC_URI``. 590``SRC_URI``.
591 591
@@ -600,7 +600,7 @@ Metadata Outside the Recipe-Space
600When stored outside of the recipe-space, the kernel Metadata files 600When stored outside of the recipe-space, the kernel Metadata files
601reside in a separate repository. The OpenEmbedded build system adds the 601reside in a separate repository. The OpenEmbedded build system adds the
602Metadata to the build as a "type=kmeta" repository through the 602Metadata to the build as a "type=kmeta" repository through the
603```SRC_URI`` <&YOCTO_DOCS_REF_URL;#var-SRC_URI>`__ variable. As an 603:term:`SRC_URI` variable. As an
604example, consider the following ``SRC_URI`` statement from the 604example, consider the following ``SRC_URI`` statement from the
605``linux-yocto_4.12.bb`` kernel recipe: SRC_URI = 605``linux-yocto_4.12.bb`` kernel recipe: SRC_URI =
606"git://git.yoctoproject.org/linux-yocto-4.12.git;name=machine;branch=${KBRANCH}; 606"git://git.yoctoproject.org/linux-yocto-4.12.git;name=machine;branch=${KBRANCH};
@@ -742,10 +742,10 @@ within an SCC description file (``.scc``):
742 "ref" if specified. 742 "ref" if specified.
743 743
744- ``define``: Defines variables, such as 744- ``define``: Defines variables, such as
745 ```KMACHINE`` <&YOCTO_DOCS_REF_URL;#var-KMACHINE>`__, 745 :term:`KMACHINE`,
746 ```KTYPE`` <&YOCTO_DOCS_REF_URL;#var-KTYPE>`__, 746 :term:`KTYPE`,
747 ```KARCH`` <&YOCTO_DOCS_REF_URL;#var-KARCH>`__, and 747 :term:`KARCH`, and
748 ```KFEATURE_DESCRIPTION`` <&YOCTO_DOCS_REF_URL;#var-KFEATURE_DESCRIPTION>`__. 748 :term:`KFEATURE_DESCRIPTION`.
749 749
750- ``include SCC_FILE``: Includes an SCC file in the current file. The 750- ``include SCC_FILE``: Includes an SCC file in the current file. The
751 file is parsed as if you had inserted it inline. 751 file is parsed as if you had inserted it inline.