diff options
author | jmbills <jason.m.bills@intel.com> | 2021-08-03 01:45:08 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-03 01:45:08 +0300 |
commit | 10ad77d5bc86709d8ff7f95e7040e39f1c153903 (patch) | |
tree | 307cedb87f4c0a329740c55ac364ed489d1d8fc2 /poky/documentation/kernel-dev | |
parent | c6b1c6ba7a01b7987d65d61c262c44c320193108 (diff) | |
parent | 67327ddc580cb9a85219a534844832a1682780d4 (diff) | |
download | openbmc-10ad77d5bc86709d8ff7f95e7040e39f1c153903.tar.xz |
Update
Diffstat (limited to 'poky/documentation/kernel-dev')
-rw-r--r-- | poky/documentation/kernel-dev/advanced.rst | 151 | ||||
-rw-r--r-- | poky/documentation/kernel-dev/common.rst | 300 | ||||
-rw-r--r-- | poky/documentation/kernel-dev/concepts-appx.rst | 11 | ||||
-rw-r--r-- | poky/documentation/kernel-dev/faq.rst | 10 | ||||
-rw-r--r-- | poky/documentation/kernel-dev/intro.rst | 6 | ||||
-rw-r--r-- | poky/documentation/kernel-dev/maint-appx.rst | 21 |
6 files changed, 197 insertions, 302 deletions
diff --git a/poky/documentation/kernel-dev/advanced.rst b/poky/documentation/kernel-dev/advanced.rst index fb6dfca85..871ec8ae7 100644 --- a/poky/documentation/kernel-dev/advanced.rst +++ b/poky/documentation/kernel-dev/advanced.rst @@ -21,7 +21,7 @@ is the ``yocto-kernel-cache`` Git repository. You can find this repository grouped under the "Yocto Linux Kernel" heading in the :yocto_git:`Yocto Project Source Repositories <>`. -Kernel development tools ("kern-tools") exist also in the Yocto Project +Kernel development tools ("kern-tools") are also available in the Yocto Project Source Repositories under the "Yocto Linux Kernel" heading in the ``yocto-kernel-tools`` Git repository. The recipe that builds these tools is ``meta/recipes-kernel/kern-tools/kern-tools-native_git.bb`` in @@ -46,15 +46,15 @@ linux-yocto recipe. Every linux-yocto style recipe must define the :term:`KMACHINE` variable. This -variable is typically set to the same value as the ``MACHINE`` variable, +variable is typically set to the same value as the :term:`MACHINE` variable, which is used by :term:`BitBake`. However, in some cases, the variable might instead refer to the -underlying platform of the ``MACHINE``. +underlying platform of the :term:`MACHINE`. -Multiple BSPs can reuse the same ``KMACHINE`` name if they are built +Multiple BSPs can reuse the same :term:`KMACHINE` name if they are built using the same BSP description. Multiple Corei7-based BSPs could share -the same "intel-corei7-64" value for ``KMACHINE``. It is important to -realize that ``KMACHINE`` is just for kernel mapping, while ``MACHINE`` +the same "intel-corei7-64" value for :term:`KMACHINE`. It is important to +realize that :term:`KMACHINE` is just for kernel mapping, while :term:`MACHINE` is the machine type within a BSP Layer. Even with this distinction, however, these two variables can hold the same value. See the ":ref:`kernel-dev/advanced:bsp descriptions`" section for more information. @@ -66,9 +66,8 @@ to indicate the branch. .. note:: - You can use the ``KBRANCH`` value to define an alternate branch typically - with a machine override as shown here from the ``meta-yocto-bsp`` layer: - :: + You can use the :term:`KBRANCH` value to define an alternate branch typically + with a machine override as shown here from the ``meta-yocto-bsp`` layer:: KBRANCH_edgerouter = "standard/edgerouter" @@ -82,8 +81,8 @@ variables: :term:`LINUX_KERNEL_TYPE` defines the kernel type to be used in assembling the configuration. If -you do not specify a ``LINUX_KERNEL_TYPE``, it defaults to "standard". -Together with ``KMACHINE``, ``LINUX_KERNEL_TYPE`` defines the search +you do not specify a :term:`LINUX_KERNEL_TYPE`, it defaults to "standard". +Together with :term:`KMACHINE`, :term:`LINUX_KERNEL_TYPE` defines the search arguments used by the kernel tools to find the appropriate description within the kernel Metadata with which to build out the sources and configuration. The linux-yocto recipes define "standard", "tiny", and @@ -91,35 +90,33 @@ configuration. The linux-yocto recipes define "standard", "tiny", and section for more information on kernel types. During the build, the kern-tools search for the BSP description file -that most closely matches the ``KMACHINE`` and ``LINUX_KERNEL_TYPE`` +that most closely matches the :term:`KMACHINE` and :term:`LINUX_KERNEL_TYPE` variables passed in from the recipe. The tools use the first BSP description they find that matches both variables. If the tools cannot find a match, they issue a warning. -The tools first search for the ``KMACHINE`` and then for the -``LINUX_KERNEL_TYPE``. If the tools cannot find a partial match, they -will use the sources from the ``KBRANCH`` and any configuration +The tools first search for the :term:`KMACHINE` and then for the +:term:`LINUX_KERNEL_TYPE`. If the tools cannot find a partial match, they +will use the sources from the :term:`KBRANCH` and any configuration specified in the :term:`SRC_URI`. You can use the :term:`KERNEL_FEATURES` variable to include features (configuration fragments, patches, or both) -that are not already included by the ``KMACHINE`` and -``LINUX_KERNEL_TYPE`` variable combination. For example, to include a -feature specified as "features/netfilter/netfilter.scc", specify: -:: +that are not already included by the :term:`KMACHINE` and +:term:`LINUX_KERNEL_TYPE` variable combination. For example, to include a +feature specified as "features/netfilter/netfilter.scc", specify:: KERNEL_FEATURES += "features/netfilter/netfilter.scc" To include a feature called "cfg/sound.scc" just for the ``qemux86`` machine, -specify: -:: +specify:: KERNEL_FEATURES_append_qemux86 = " cfg/sound.scc" The value of -the entries in ``KERNEL_FEATURES`` are dependent on their location +the entries in :term:`KERNEL_FEATURES` are dependent on their location within the kernel Metadata itself. The examples here are taken from the ``yocto-kernel-cache`` repository. Each branch of this repository contains "features" and "cfg" subdirectories at the top-level. For more @@ -157,8 +154,7 @@ types to form the final description of what will be assembled and built. While the kernel Metadata syntax does not enforce any logical separation of configuration fragments, patches, features or kernel types, best practices dictate a logical separation of these types of Metadata. The -following Metadata file hierarchy is recommended: -:: +following Metadata file hierarchy is recommended:: base/ bsp/ @@ -222,8 +218,7 @@ used with the ``linux-yocto-4.12`` kernel as defined outside of the recipe space (i.e. ``yocto-kernel-cache``). This Metadata consists of two files: ``smp.scc`` and ``smp.cfg``. You can find these files in the ``cfg`` directory of the ``yocto-4.12`` branch in the -``yocto-kernel-cache`` Git repository: -:: +``yocto-kernel-cache`` Git repository:: cfg/smp.scc: define KFEATURE_DESCRIPTION "Enable SMP for 32 bit builds" @@ -265,8 +260,7 @@ non-hardware fragment. As described in the ":ref:`kernel-dev/common:validating configuration`" section, you can -use the following BitBake command to audit your configuration: -:: +use the following BitBake command to audit your configuration:: $ bitbake linux-yocto -c kernel_configcheck -f @@ -287,8 +281,7 @@ in the ``patches/build`` directory of the ``yocto-4.12`` branch in the ``yocto-kernel-cache`` Git repository. The following listings show the ``build.scc`` file and part of the -``modpost-mask-trivial-warnings.patch`` file: -:: +``modpost-mask-trivial-warnings.patch`` file:: patches/build/build.scc: patch arm-serialize-build-targets.patch @@ -320,7 +313,7 @@ The following listings show the ``build.scc`` file and part of the The description file can include multiple patch statements where each statement handles a single -patch. In the example ``build.scc`` file, five patch statements exist +patch. In the example ``build.scc`` file, there are five patch statements for the five patches in the directory. You can create a typical ``.patch`` file using ``diff -Nurp`` or @@ -334,8 +327,7 @@ Features Features are complex kernel Metadata types that consist of configuration fragments, patches, and possibly other feature description files. As an -example, consider the following generic listing: -:: +example, consider the following generic listing:: features/myfeature.scc define KFEATURE_DESCRIPTION "Enable myfeature" @@ -352,7 +344,7 @@ as how an additional feature description file is included with the Typically, features are less granular than configuration fragments and are more likely than configuration fragments and patches to be the types -of things you want to specify in the ``KERNEL_FEATURES`` variable of the +of things you want to specify in the :term:`KERNEL_FEATURES` variable of the Linux kernel recipe. See the ":ref:`kernel-dev/advanced:using kernel metadata in a recipe`" section earlier in the manual. @@ -371,15 +363,13 @@ the ``linux-yocto_4.12.bb`` kernel recipe found in ``poky/meta/recipes-kernel/linux``, a :ref:`require <bitbake:bitbake-user-manual/bitbake-user-manual-metadata:\`\`require\`\` directive>` directive includes the ``poky/meta/recipes-kernel/linux/linux-yocto.inc`` file, -which has the following statement that defines the default kernel type: -:: +which has the following statement that defines the default kernel type:: LINUX_KERNEL_TYPE ??= "standard" Another example would be the real-time kernel (i.e. ``linux-yocto-rt_4.12.bb``). This kernel recipe directly sets the kernel -type as follows: -:: +type as follows:: LINUX_KERNEL_TYPE = "preempt-rt" @@ -412,8 +402,7 @@ for Linux Yocto kernels: For any given kernel type, the Metadata is defined by the ``.scc`` (e.g. ``standard.scc``). Here is a partial listing for the ``standard.scc`` file, which is found in the ``ktypes/standard`` directory of the -``yocto-kernel-cache`` Git repository: -:: +``yocto-kernel-cache`` Git repository:: # Include this kernel type fragment to get the standard features and # configuration values. @@ -482,15 +471,13 @@ Description Overview For simplicity, consider the following root BSP layer description files for the BeagleBone board. These files employ both a structure and naming convention for consistency. The naming convention for the file is as -follows: -:: +follows:: bsp_root_name-kernel_type.scc Here are some example root layer BSP filenames for the BeagleBone Board BSP, which is supported by the -Yocto Project: -:: +Yocto Project:: beaglebone-standard.scc beaglebone-preempt-rt.scc @@ -498,8 +485,7 @@ Yocto Project: Each file uses the root name (i.e "beaglebone") BSP name followed by the kernel type. -Examine the ``beaglebone-standard.scc`` file: -:: +Examine the ``beaglebone-standard.scc`` file:: define KMACHINE beaglebone define KTYPE standard @@ -523,18 +509,17 @@ description as meeting the criteria set by the recipe being built. This example supports the "beaglebone" machine for the "standard" kernel and the "arm" architecture. -Be aware that a hard link between the ``KTYPE`` variable and a kernel -type description file does not exist. Thus, if you do not have the +Be aware that there is no hard link between the :term:`KTYPE` variable and a kernel +type description file. Thus, if you do not have the kernel type defined in your kernel Metadata as it is here, you only need to ensure that the :term:`LINUX_KERNEL_TYPE` -variable in the kernel recipe and the ``KTYPE`` variable in the BSP +variable in the kernel recipe and the :term:`KTYPE` variable in the BSP description file match. To separate your kernel policy from your hardware configuration, you include a kernel type (``ktype``), such as "standard". In the previous -example, this is done using the following: -:: +example, this is done using the following:: include ktypes/standard/standard.scc @@ -544,13 +529,11 @@ policy. See the ":ref:`kernel-dev/advanced:kernel types`" section for more information. To aggregate common configurations and features specific to the kernel -for `mybsp`, use the following: -:: +for `mybsp`, use the following:: include mybsp.scc -You can see that in the BeagleBone example with the following: -:: +You can see that in the BeagleBone example with the following:: include beaglebone.scc @@ -558,15 +541,13 @@ For information on how to break a complete ``.config`` file into the various configuration fragments, see the ":ref:`kernel-dev/common:creating configuration fragments`" section. Finally, if you have any configurations specific to the hardware that -are not in a ``*.scc`` file, you can include them as follows: -:: +are not in a ``*.scc`` file, you can include them as follows:: kconf hardware mybsp-extra.cfg The BeagleBone example does not include these types of configurations. However, the Malta 32-bit board does -("mti-malta32"). Here is the ``mti-malta32-le-standard.scc`` file: -:: +("mti-malta32"). Here is the ``mti-malta32-le-standard.scc`` file:: define KMACHINE mti-malta32-le define KMACHINE qemumipsel @@ -623,8 +604,7 @@ found on the machine. This ``minnow.scc`` description file is then included in each of the three "minnow" description files for the supported kernel types (i.e. "standard", "preempt-rt", and "tiny"). Consider the "minnow" description for the "standard" kernel type (i.e. -``minnow-standard.scc``): -:: +``minnow-standard.scc``):: define KMACHINE minnow define KTYPE standard @@ -656,8 +636,7 @@ that defines all enabled hardware for the BSP that is common to all kernel types. Using this command significantly reduces duplication. Now consider the "minnow" description for the "tiny" kernel type (i.e. -``minnow-tiny.scc``): -:: +``minnow-tiny.scc``):: define KMACHINE minnow define KTYPE tiny @@ -678,7 +657,7 @@ Notice again the three critical variables: :term:`KMACHINE`, :term:`KTYPE`, and :term:`KARCH`. Of these variables, only -``KTYPE`` has changed to specify the "tiny" kernel type. +:term:`KTYPE` has changed to specify the "tiny" kernel type. Kernel Metadata Location ======================== @@ -714,14 +693,13 @@ directory hierarchy below a linux-yocto recipe or for a Linux kernel recipe derived by copying and modifying ``oe-core/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb`` to -a recipe in your layer, ``FILESEXTRAPATHS`` is typically set to +a recipe in your layer, :term:`FILESEXTRAPATHS` is typically set to ``${``\ :term:`THISDIR`\ ``}/${``\ :term:`PN`\ ``}``. See the ":ref:`kernel-dev/common:modifying an existing recipe`" section for more information. Here is an example that shows a trivial tree of kernel Metadata stored -in recipe-space within a BSP layer: -:: +in recipe-space within a BSP layer:: meta-my_bsp_layer/ `-- recipes-kernel @@ -740,12 +718,11 @@ and fetches any files referenced in the ``.scc`` files by the ``include``, ``patch``, or ``kconf`` commands. Because of this, it is necessary to bump the recipe :term:`PR` value when changing the content of files not explicitly listed in the -``SRC_URI``. +:term:`SRC_URI`. If the BSP description is in recipe space, you cannot simply list the -``*.scc`` in the ``SRC_URI`` statement. You need to use the following -form from your kernel append file: -:: +``*.scc`` in the :term:`SRC_URI` statement. You need to use the following +form from your kernel append file:: SRC_URI_append_myplatform = " \ file://myplatform;type=kmeta;destsuffix=myplatform \ @@ -758,9 +735,8 @@ When stored outside of the recipe-space, the kernel Metadata files reside in a separate repository. The OpenEmbedded build system adds the Metadata to the build as a "type=kmeta" repository through the :term:`SRC_URI` variable. As an -example, consider the following ``SRC_URI`` statement from the -``linux-yocto_4.12.bb`` kernel recipe: -:: +example, consider the following :term:`SRC_URI` statement from the +``linux-yocto_4.12.bb`` kernel recipe:: SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.12.git;name=machine;branch=${KBRANCH}; \ git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.12;destsuffix=${KMETA}" @@ -768,20 +744,20 @@ example, consider the following ``SRC_URI`` statement from the ``${KMETA}``, in this context, is simply used to name the directory into which the Git fetcher places the Metadata. This behavior is no different -than any multi-repository ``SRC_URI`` statement used in a recipe (e.g. +than any multi-repository :term:`SRC_URI` statement used in a recipe (e.g. see the previous section). You can keep kernel Metadata in a "kernel-cache", which is a directory containing configuration fragments. As with any Metadata kept outside -the recipe-space, you simply need to use the ``SRC_URI`` statement with +the recipe-space, you simply need to use the :term:`SRC_URI` statement with the "type=kmeta" attribute. Doing so makes the kernel Metadata available during the configuration phase. -If you modify the Metadata, you must not forget to update the ``SRCREV`` +If you modify the Metadata, you must not forget to update the :term:`SRCREV` statements in the kernel's recipe. In particular, you need to update the ``SRCREV_meta`` variable to match the commit in the ``KMETA`` branch you wish to use. Changing the data in these branches and not updating the -``SRCREV`` statements to match will cause the build to fetch an older +:term:`SRCREV` statements to match will cause the build to fetch an older commit. Organizing Your Source @@ -800,8 +776,8 @@ patches in every kernel you build (i.e. have the patches as part of the lone "master" branch). It is situations like these that give rise to multiple branches used within a Linux kernel sources Git repository. -Repository organization strategies exist that maximize source reuse, -remove redundancy, and logically order your changes. This section +Here are repository organization strategies maximizing source reuse, +removing redundancy, and logically ordering your changes. This section presents strategies for the following cases: - Encapsulating patches in a feature description and only including the @@ -844,14 +820,12 @@ patches into a feature. Once you have a new branch, you can set up your kernel Metadata to use the branch a couple different ways. In the recipe, you can specify the -new branch as the ``KBRANCH`` to use for the board as follows: -:: +new branch as the :term:`KBRANCH` to use for the board as follows:: KBRANCH = "mynewbranch" Another method is to use the ``branch`` command in the BSP -description: -:: +description:: mybsp.scc: define KMACHINE mybsp @@ -865,15 +839,13 @@ description: If you find yourself with numerous branches, you might consider using a hierarchical branching system similar to what the Yocto Linux Kernel Git -repositories use: -:: +repositories use:: common/kernel_type/machine If you had two kernel types, "standard" and "small" for instance, three machines, and common as ``mydir``, the branches in your Git repository -might look like this: -:: +might look like this:: mydir/base mydir/standard/base @@ -905,8 +877,7 @@ that have to be regularly updated. The Yocto Project Linux kernel tools provide for this with the ``git merge`` command. To merge a feature branch into a BSP, insert the ``git merge`` command -after any ``branch`` commands: -:: +after any ``branch`` commands:: mybsp.scc: define KMACHINE mybsp diff --git a/poky/documentation/kernel-dev/common.rst b/poky/documentation/kernel-dev/common.rst index 56217b9d3..de62df5b1 100644 --- a/poky/documentation/kernel-dev/common.rst +++ b/poky/documentation/kernel-dev/common.rst @@ -54,8 +54,7 @@ section: 1. *Initialize the BitBake Environment:* Before building an extensible SDK, you need to initialize the BitBake build environment by sourcing - the build environment script (i.e. :ref:`structure-core-script`): - :: + the build environment script (i.e. :ref:`structure-core-script`):: $ cd poky $ source oe-init-build-env @@ -71,7 +70,7 @@ section: :term:`MACHINE` variable is set to "qemux86-64", which is fine if you are building for the QEMU emulator in 64-bit mode. However, if you are not, you need to set the - ``MACHINE`` variable appropriately in your ``conf/local.conf`` file + :term:`MACHINE` variable appropriately in your ``conf/local.conf`` file found in the :term:`Build Directory` (i.e. ``poky/build`` in this example). @@ -83,16 +82,14 @@ section: In this example we wish to build for qemux86 so we must set the ``MACHINE`` variable to "qemux86" and also add the "kernel-modules". - As described we do this by appending to ``conf/local.conf``: - :: + As described we do this by appending to ``conf/local.conf``:: MACHINE = "qemux86" MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "kernel-modules" 3. *Create a Layer for Patches:* You need to create a layer to hold patches created for the kernel image. You can use the - ``bitbake-layers create-layer`` command as follows: - :: + ``bitbake-layers create-layer`` command as follows:: $ cd poky/build $ bitbake-layers create-layer ../../meta-mylayer @@ -116,8 +113,7 @@ section: 4. *Inform the BitBake Build Environment About Your Layer:* As directed when you created your layer, you need to add the layer to the :term:`BBLAYERS` variable in the - ``bblayers.conf`` file as follows: - :: + ``bblayers.conf`` file as follows:: $ cd poky/build $ bitbake-layers add-layer ../../meta-mylayer @@ -125,16 +121,14 @@ section: $ 5. *Build the Extensible SDK:* Use BitBake to build the extensible SDK - specifically for use with images to be run using QEMU: - :: + specifically for use with images to be run using QEMU:: $ cd poky/build $ bitbake core-image-minimal -c populate_sdk_ext Once the build finishes, you can find the SDK installer file (i.e. - ``*.sh`` file) in the following directory: - :: + ``*.sh`` file) in the following directory:: poky/build/tmp/deploy/sdk @@ -143,8 +137,7 @@ section: 6. *Install the Extensible SDK:* Use the following command to install the SDK. For this example, install the SDK in the default - ``poky_sdk`` directory: - :: + ``poky_sdk`` directory:: $ cd poky/build/tmp/deploy/sdk $ ./poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-&DISTRO;.sh @@ -172,8 +165,7 @@ section: BitBake shell used to build the installer. After opening a new shell, run the SDK environment setup script as - directed by the output from installing the SDK: - :: + directed by the output from installing the SDK:: $ source poky_sdk/environment-setup-i586-poky-linux "SDK environment now set up; additionally you may now run devtool to perform development tasks. @@ -186,8 +178,7 @@ section: 8. *Build the Clean Image:* The final step in preparing to work on the kernel is to build an initial image using ``devtool`` in the new - terminal you just set up and initialized for SDK work: - :: + terminal you just set up and initialized for SDK work:: $ devtool build-image Parsing recipes: 100% |##########################################| Time: 0:00:05 @@ -257,7 +248,7 @@ section: :term:`MACHINE` variable is set to "qemux86-64", which is fine if you are building for the QEMU emulator in 64-bit mode. However, if you are not, you need to set the - ``MACHINE`` variable appropriately in your ``conf/local.conf`` file + :term:`MACHINE` variable appropriately in your ``conf/local.conf`` file found in the :term:`Build Directory` (i.e. ``poky/build`` in this example). @@ -269,16 +260,14 @@ section: In this example we wish to build for qemux86 so we must set the ``MACHINE`` variable to "qemux86" and also add the "kernel-modules". - As described we do this by appending to ``conf/local.conf``: - :: + As described we do this by appending to ``conf/local.conf``:: MACHINE = "qemux86" MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "kernel-modules" 3. *Create a Layer for Patches:* You need to create a layer to hold patches created for the kernel image. You can use the - ``bitbake-layers create-layer`` command as follows: - :: + ``bitbake-layers create-layer`` command as follows:: $ cd poky/build $ bitbake-layers create-layer ../../meta-mylayer @@ -301,8 +290,7 @@ section: 4. *Inform the BitBake Build Environment About Your Layer:* As directed when you created your layer, you need to add the layer to the :term:`BBLAYERS` variable in the - ``bblayers.conf`` file as follows: - :: + ``bblayers.conf`` file as follows:: $ cd poky/build $ bitbake-layers add-layer ../../meta-mylayer @@ -350,8 +338,7 @@ section: the ``yocto-4.12`` branch. The following commands show how to create a local copy of the - ``yocto-kernel-cache`` and be in the ``yocto-4.12`` branch: - :: + ``yocto-kernel-cache`` and switch to the ``yocto-4.12`` branch:: $ cd ~ $ git clone git://git.yoctoproject.org/yocto-kernel-cache --branch yocto-4.12 @@ -394,8 +381,7 @@ following section describes how to create a layer without the aid of tools. These steps assume creation of a layer named ``mylayer`` in your home directory: -1. *Create Structure*: Create the layer's structure: - :: +1. *Create Structure*: Create the layer's structure:: $ mkdir meta-mylayer $ mkdir meta-mylayer/conf @@ -409,8 +395,7 @@ home directory: 2. *Create the Layer Configuration File*: Move to the ``meta-mylayer/conf`` directory and create the ``layer.conf`` file as - follows: - :: + follows:: # We have a conf and classes directory, add to BBPATH BBPATH .= ":${LAYERDIR}" @@ -429,8 +414,7 @@ home directory: ``meta-mylayer/recipes-kernel/linux`` directory and create the kernel's append file. This example uses the ``linux-yocto-4.12`` kernel. Thus, the name of the append file is - ``linux-yocto_4.12.bbappend``: - :: + ``linux-yocto_4.12.bbappend``:: FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" @@ -483,17 +467,15 @@ The append file should initially extend the :term:`FILESPATH` search path by prepending the directory that contains your files to the :term:`FILESEXTRAPATHS` -variable as follows: -:: +variable as follows:: FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" The path ``${``\ :term:`THISDIR`\ ``}/${``\ :term:`PN`\ ``}`` expands to "linux-yocto" in the current directory for this example. If you add any new files that modify the kernel recipe and you have -extended ``FILESPATH`` as described above, you must place the files in -your layer in the following area: -:: +extended :term:`FILESPATH` as described above, you must place the files in +your layer in the following area:: your-layer/recipes-kernel/linux/linux-yocto/ @@ -509,7 +491,7 @@ As an example, consider the following append file used by the BSPs in meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.12.bbappend -The following listing shows the file. Be aware that the actual commit ID +Here are the contents of this file. Be aware that the actual commit ID strings in this example listing might be different than the actual strings in the file from the ``meta-yocto-bsp`` layer upstream. :: @@ -571,7 +553,7 @@ the append file. For example, suppose you had some configuration options in a file called ``network_configs.cfg``. You can place that file inside a directory -named ``linux-yocto`` and then add a ``SRC_URI`` statement such as the +named ``linux-yocto`` and then add a :term:`SRC_URI` statement such as the following to the append file. When the OpenEmbedded build system builds the kernel, the configuration options are picked up and applied. :: @@ -581,9 +563,8 @@ the kernel, the configuration options are picked up and applied. To group related configurations into multiple files, you perform a similar procedure. Here is an example that groups separate configurations specifically for Ethernet and graphics into their own -files and adds the configurations by using a ``SRC_URI`` statement like -the following in your append file: -:: +files and adds the configurations by using a :term:`SRC_URI` statement like +the following in your append file:: SRC_URI += "file://myconfig.cfg \ file://eth.cfg \ @@ -597,7 +578,7 @@ recipe is processed. .. note:: - Other methods exist to accomplish grouping and defining configuration + There are other ways of grouping and defining configuration options. For example, if you are working with a local clone of the kernel repository, you could checkout the kernel's ``meta`` branch, make your changes, and then push the changes to the local bare clone @@ -608,8 +589,8 @@ recipe is processed. In general, however, the Yocto Project maintainers take care of moving the ``SRC_URI``-specified configuration options to the - kernel's ``meta`` branch. Not only is it easier for BSP developers to - not have to worry about putting those configurations in the branch, + kernel's ``meta`` branch. Not only is it easier for BSP developers + not to have to put those configurations in the branch, but having the maintainers do it allows them to apply 'global' knowledge about the kinds of common configuration options multiple BSPs in the tree are typically using. This allows for promotion of @@ -627,8 +608,7 @@ reference them in :term:`SRC_URI` statements. For example, you can apply a three-patch series by adding the following -lines to your linux-yocto ``.bbappend`` file in your layer: -:: +lines to your linux-yocto ``.bbappend`` file in your layer:: SRC_URI += "file://0001-first-change.patch" SRC_URI += "file://0002-second-change.patch" @@ -658,19 +638,27 @@ If you have a complete, working Linux kernel ``.config`` file you want to use for the configuration, as before, copy that file to the appropriate ``${PN}`` directory in your layer's ``recipes-kernel/linux`` directory, and rename the copied file to "defconfig". Then, add the -following lines to the linux-yocto ``.bbappend`` file in your layer: -:: +following lines to the linux-yocto ``.bbappend`` file in your layer:: FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI += "file://defconfig" -The ``SRC_URI`` tells the build system how to search +The :term:`SRC_URI` tells the build system how to search for the file, while the :term:`FILESEXTRAPATHS` extends the :term:`FILESPATH` variable (search directories) to include the ``${PN}`` directory you created to hold the configuration changes. +You can also use a regular ``defconfig`` file, as generated by the +:ref:`ref-tasks-savedefconfig` +task instead of a complete ``.config`` file. This only specifies the +non-default configuration values. You need to additionally set +:term:`KCONFIG_MODE` +in the linux-yocto ``.bbappend`` file in your layer:: + + KCONFIG_MODE = "alldefconfig" + .. note:: The build system applies the configurations from the ``defconfig`` @@ -685,8 +673,7 @@ Generally speaking, the preferred approach is to determine the incremental change you want to make and add that as a configuration fragment. For example, if you want to add support for a basic serial console, create a file named ``8250.cfg`` in the ``${PN}`` directory -with the following content (without indentation): -:: +with the following content (without indentation):: CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y @@ -697,9 +684,8 @@ with the following content (without indentation): CONFIG_SERIAL_CORE_CONSOLE=y Next, include this -configuration fragment and extend the ``FILESPATH`` variable in your -``.bbappend`` file: -:: +configuration fragment and extend the :term:`FILESPATH` variable in your +``.bbappend`` file:: FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI += "file://8250.cfg" @@ -718,8 +704,7 @@ It might be desirable to have kernel configuration fragment support through a ``defconfig`` file that is pulled from the kernel source tree for the configured machine. By default, the OpenEmbedded build system looks for ``defconfig`` files in the layer used for Metadata, which is -"out-of-tree", and then configures them using the following: -:: +"out-of-tree", and then configures them using the following:: SRC_URI += "file://defconfig" @@ -732,16 +717,14 @@ append files, you can direct the OpenEmbedded build system to use a ``defconfig`` file that is "in-tree". To specify an "in-tree" ``defconfig`` file, use the following statement -form: -:: +form:: KBUILD_DEFCONFIG_KMACHINE ?= "defconfig_file" Here is an example -that assigns the ``KBUILD_DEFCONFIG`` variable based on "raspberrypi2" +that assigns the :term:`KBUILD_DEFCONFIG` variable based on "raspberrypi2" and provides the path to the "in-tree" ``defconfig`` file to be used for -a Raspberry Pi 2, which is based on the Broadcom 2708/2709 chipset: -:: +a Raspberry Pi 2, which is based on the Broadcom 2708/2709 chipset:: KBUILD_DEFCONFIG_raspberrypi2 ?= "bcm2709_defconfig" @@ -751,7 +734,7 @@ Aside from modifying your kernel recipe and providing your own a kernel's ``linux-``\ `machine`\ ``.inc`` file). In other words, if the build system detects a statement that identifies an "out-of-tree" ``defconfig`` file, that statement will override your -``KBUILD_DEFCONFIG`` variable. +:term:`KBUILD_DEFCONFIG` variable. See the :term:`KBUILD_DEFCONFIG` @@ -792,15 +775,14 @@ the ":ref:`kernel-dev/common:getting ready to develop using \`\`devtool\`\``" Se ":ref:`kernel-dev/common:getting ready to develop using \`\`devtool\`\``" section for more information. - Use the following ``devtool`` command to check out the code: - :: + Use the following ``devtool`` command to check out the code:: $ devtool modify linux-yocto .. note:: - During the checkout operation, a bug exists that could cause - errors such as the following to appear: + During the checkout operation, there is a bug that could cause + errors such as the following: .. code-block:: none @@ -819,14 +801,12 @@ the ":ref:`kernel-dev/common:getting ready to develop using \`\`devtool\`\``" Se noted where you can find the source files (e.g. ``poky_sdk/workspace/sources/linux-yocto``). Change to where the kernel source code is before making your edits to the - ``calibrate.c`` file: - :: + ``calibrate.c`` file:: $ cd poky_sdk/workspace/sources/linux-yocto 2. *Edit the source file*: Edit the ``init/calibrate.c`` file to have - the following changes: - :: + the following changes:: void calibrate_delay(void) { @@ -846,8 +826,7 @@ the ":ref:`kernel-dev/common:getting ready to develop using \`\`devtool\`\``" Se . 3. *Build the Updated Kernel Source:* To build the updated kernel - source, use ``devtool``: - :: + source, use ``devtool``:: $ devtool build linux-yocto @@ -872,8 +851,7 @@ the ":ref:`kernel-dev/common:getting ready to develop using \`\`devtool\`\``" Se using QEMU to verify your changes: 1. *Boot the image*: Boot the modified image in the QEMU emulator - using this command: - :: + using this command:: $ runqemu qemux86 @@ -891,8 +869,7 @@ the ":ref:`kernel-dev/common:getting ready to develop using \`\`devtool\`\``" Se 6. *Stage and commit your changes*: Within your eSDK terminal, change your working directory to where you modified the ``calibrate.c`` file - and use these Git commands to stage and commit your changes: - :: + and use these Git commands to stage and commit your changes:: $ cd poky_sdk/workspace/sources/linux-yocto $ git status @@ -921,8 +898,7 @@ the ":ref:`kernel-dev/common:getting ready to develop using \`\`devtool\`\``" Se image that includes your kernel patches. Execute the following command from your :term:`Build Directory` in the terminal - set up to run BitBake: - :: + set up to run BitBake:: $ cd poky/build $ bitbake core-image-minimal @@ -966,14 +942,12 @@ Section. 1. *Change the working directory*: You need to locate the source files in the local copy of the kernel Git repository. Change to where the kernel source code is before making your edits to the - ``calibrate.c`` file: - :: + ``calibrate.c`` file:: $ cd ~/linux-yocto-4.12/init 2. *Edit the source file*: Edit the ``calibrate.c`` file to have the - following changes: - :: + following changes:: void calibrate_delay(void) { @@ -993,8 +967,7 @@ Section. . 2. *Stage and Commit Your Changes:* Use standard Git commands to stage - and commit the changes you just made: - :: + and commit the changes you just made:: $ git add calibrate.c $ git commit -m "calibrate.c - Added some printk statements" @@ -1009,13 +982,11 @@ Section. updated kernel source files. Add :term:`SRC_URI` and :term:`SRCREV` statements similar - to the following to your ``local.conf``: - :: + to the following to your ``local.conf``:: $ cd poky/build/conf - Add the following to the ``local.conf``: - :: + Add the following to the ``local.conf``:: SRC_URI_pn-linux-yocto = "git:///path-to/linux-yocto-4.12;protocol=file;name=machine;branch=standard/base; \ git:///path-to/yocto-kernel-cache;protocol=file;type=kmeta;name=meta;branch=yocto-4.12;destsuffix=${KMETA}" @@ -1031,16 +1002,14 @@ Section. 4. *Build the Image:* With the source modified, your changes staged and committed, and the ``local.conf`` file pointing to the kernel files, - you can now use BitBake to build the image: - :: + you can now use BitBake to build the image:: $ cd poky/build $ bitbake core-image-minimal 5. *Boot the image*: Boot the modified image in the QEMU emulator using this command. When prompted to login to the QEMU console, use "root" - with no password: - :: + with no password:: $ cd poky/build $ runqemu qemux86 @@ -1059,8 +1028,7 @@ Section. 7. *Generate the Patch File:* Once you are sure that your patch works correctly, you can generate a ``*.patch`` file in the kernel source - repository: - :: + repository:: $ cd ~/linux-yocto-4.12/init $ git format-patch -1 @@ -1073,8 +1041,7 @@ Section. ``meta-mylayer``. When the layer was created using the ``yocto-create`` script, no additional hierarchy was created to support patches. Before moving the patch file, you need to add - additional structure to your layer using the following commands: - :: + additional structure to your layer using the following commands:: $ cd ~/meta-mylayer $ mkdir recipes-kernel @@ -1083,8 +1050,7 @@ Section. Once you have created this hierarchy in your layer, you can move the patch file using the - following command: - :: + following command:: $ mv ~/linux-yocto-4.12/init/0001-calibrate.c-Added-some-printk-statements.patch ~/meta-mylayer/recipes-kernel/linux/linux-yocto @@ -1093,8 +1059,7 @@ Section. the OpenEmbedded build system to find the patch. The append file needs to be in your layer's ``recipes-kernel/linux`` directory and it must be named ``linux-yocto_4.12.bbappend`` and have the following - contents: - :: + contents:: FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI_append = "file://0001-calibrate.c-Added-some-printk-statements.patch" @@ -1113,8 +1078,7 @@ Section. To build ``core-image-minimal`` again and see the effects of your patch, you can essentially eliminate the temporary source files saved in ``poky/build/tmp/work/...`` and residual effects of the build by entering - the following sequence of commands: - :: + the following sequence of commands:: $ cd poky/build $ bitbake -c cleanall yocto-linux @@ -1160,8 +1124,7 @@ environment, you must do the following: - You must be sure of the state of your build's configuration in the :term:`Source Directory`. -- Your build host must have the following two packages installed: - :: +- Your build host must have the following two packages installed:: libncurses5-dev libtinfo-dev @@ -1169,8 +1132,7 @@ environment, you must do the following: The following commands initialize the BitBake environment, run the :ref:`ref-tasks-kernel_configme` task, and launch ``menuconfig``. These commands assume the Source -Directory's top-level folder is ``poky``: -:: +Directory's top-level folder is ``poky``:: $ cd poky $ source oe-init-build-env @@ -1232,8 +1194,7 @@ the ``.config`` file would be: Within the ``.config`` file, you can see the kernel settings. For example, the following entry shows that symmetric multi-processor -support is not set: -:: +support is not set:: # CONFIG_SMP is not set @@ -1274,8 +1235,7 @@ your layer's ``recipes-kernel/linux`` directory, and rename the copied file to "defconfig" (e.g. ``~/meta-mylayer/recipes-kernel/linux/linux-yocto/defconfig``). Then, add the following lines to the linux-yocto ``.bbappend`` file in your -layer: -:: +layer:: FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI += "file://defconfig" @@ -1323,8 +1283,7 @@ appear in the ``.config`` file, which is in the :term:`Build Directory`. It is simple to create a configuration fragment. One method is to use shell commands. For example, issuing the following from the shell creates a configuration fragment file named ``my_smp.cfg`` that enables -multi-processor support within the kernel: -:: +multi-processor support within the kernel:: $ echo "CONFIG_SMP=y" >> my_smp.cfg @@ -1342,18 +1301,16 @@ To create a configuration fragment using this method, follow these steps: 1. *Complete a Build Through Kernel Configuration:* Complete a build at - least through the kernel configuration task as follows: - :: + least through the kernel configuration task as follows:: $ bitbake linux-yocto -c kernel_configme -f This step ensures that you create a - ``.config`` file from a known state. Because situations exist where + ``.config`` file from a known state. Because there are situations where your build state might become unknown, it is best to run this task prior to starting ``menuconfig``. -2. *Launch menuconfig:* Run the ``menuconfig`` command: - :: +2. *Launch menuconfig:* Run the ``menuconfig`` command:: $ bitbake linux-yocto -c menuconfig @@ -1361,8 +1318,7 @@ steps: to prepare a configuration fragment. The resulting file ``fragment.cfg`` is placed in the ``${``\ :term:`WORKDIR`\ ``}`` - directory: - :: + directory:: $ bitbake linux-yocto -c diffconfig @@ -1387,18 +1343,16 @@ options in a file called ``myconfig.cfg``. If you put that file inside a directory named ``linux-yocto`` that resides in the same directory as the kernel's append file within your layer and then add the following statements to the kernel's append file, those configuration options will -be picked up and applied when the kernel is built: -:: +be picked up and applied when the kernel is built:: FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI += "file://myconfig.cfg" As mentioned earlier, you can group related configurations into multiple -files and name them all in the ``SRC_URI`` statement as well. For +files and name them all in the :term:`SRC_URI` statement as well. For example, you could group separate configurations specifically for Ethernet and graphics into their own files and add those by using a -``SRC_URI`` statement like the following in your append file: -:: +:term:`SRC_URI` statement like the following in your append file:: SRC_URI += "file://myconfig.cfg \ file://eth.cfg \ @@ -1409,8 +1363,7 @@ Validating Configuration You can use the :ref:`ref-tasks-kernel_configcheck` -task to provide configuration validation: -:: +task to provide configuration validation:: $ bitbake linux-yocto -c kernel_configcheck -f @@ -1537,8 +1490,7 @@ To streamline the configuration, do the following: successfully. Use this configuration file as your baseline. 2. *Run Configure and Check Tasks:* Separately run the - ``do_kernel_configme`` and ``do_kernel_configcheck`` tasks: - :: + ``do_kernel_configme`` and ``do_kernel_configcheck`` tasks:: $ bitbake linux-yocto -c kernel_configme -f $ bitbake linux-yocto -c kernel_configcheck -f @@ -1572,8 +1524,7 @@ Expanding Variables Sometimes it is helpful to determine what a variable expands to during a build. You can examine the values of variables by examining the output of the ``bitbake -e`` command. The output is long and is more -easily managed in a text file, which allows for easy searches: -:: +easily managed in a text file, which allows for easy searches:: $ bitbake -e virtual/kernel > some_text_file @@ -1585,20 +1536,18 @@ Working with a "Dirty" Kernel Version String ============================================ If you build a kernel image and the version string has a "+" or a -"-dirty" at the end, uncommitted modifications exist in the kernel's +"-dirty" at the end, it means there are uncommitted modifications in the kernel's source directory. Follow these steps to clean up the version string: 1. *Discover the Uncommitted Changes:* Go to the kernel's locally cloned Git repository (source directory) and use the following Git command - to list the files that have been changed, added, or removed: - :: + to list the files that have been changed, added, or removed:: $ git status 2. *Commit the Changes:* You should commit those changes to the kernel source tree regardless of whether or not you will save, export, or - use the changes: - :: + use the changes:: $ git add $ git commit -s -a -m "getting rid of -dirty" @@ -1633,8 +1582,7 @@ linux-yocto custom recipe (``linux-yocto-custom.bb``) that uses ``kernel.org`` sources and the Yocto Project Linux kernel tools for managing kernel Metadata. You can find this recipe in the ``poky`` Git repository of the Yocto Project :yocto_git:`Source Repository <>` -at: -:: +at:: poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb @@ -1655,8 +1603,7 @@ Here are some basic steps you can use to work with your own sources: ``defconfig`` file or configuration fragment files in your layer. When you use the ``linux-yocto-custom.bb`` recipe, you must specify a configuration. If you do not have a ``defconfig`` file, you can run - the following: - :: + the following:: $ make defconfig @@ -1668,7 +1615,7 @@ Here are some basic steps you can use to work with your own sources: Running the ``make defconfig`` command results in the default configuration for your architecture as defined by your kernel. - However, no guarantee exists that this configuration is valid for + However, there is no guarantee that this configuration is valid for your use case, or that your board will even boot. This is particularly true for non-x86 architectures. @@ -1681,11 +1628,11 @@ Here are some basic steps you can use to work with your own sources: appropriate for your project: - :term:`SRC_URI`: The - ``SRC_URI`` should specify a Git repository that uses one of the + :term:`SRC_URI` should specify a Git repository that uses one of the supported Git fetcher protocols (i.e. ``file``, ``git``, ``http``, - and so forth). The ``SRC_URI`` variable should also specify either + and so forth). The :term:`SRC_URI` variable should also specify either a ``defconfig`` file or some configuration fragment files. The - skeleton recipe provides an example ``SRC_URI`` as a syntax + skeleton recipe provides an example :term:`SRC_URI` as a syntax reference. - :term:`LINUX_VERSION`: @@ -1703,17 +1650,16 @@ Here are some basic steps you can use to work with your own sources: indicate to the OpenEmbedded build system that the recipe has changed. - - :term:`PV`: The default ``PV`` + - :term:`PV`: The default :term:`PV` assignment is typically adequate. It combines the - ``LINUX_VERSION`` with the Source Control Manager (SCM) revision + :term:`LINUX_VERSION` with the Source Control Manager (SCM) revision as derived from the :term:`SRCPV` variable. The combined results are a string with the following - form: - :: + form:: 3.19.11+git1+68a635bf8dfb64b02263c1ac80c948647cc76d5f_1+218bd8d2022b9852c60d32f0d770931e3cf343e2 - While lengthy, the extra verbosity in ``PV`` helps ensure you are + While lengthy, the extra verbosity in :term:`PV` helps ensure you are using the exact sources from which you intend to build. - :term:`COMPATIBLE_MACHINE`: @@ -1723,8 +1669,7 @@ Here are some basic steps you can use to work with your own sources: triggers an explicit build failure. You must change it to match a list of the machines that your new recipe supports. For example, to support the ``qemux86`` and ``qemux86-64`` machines, use the - following form: - :: + following form:: COMPATIBLE_MACHINE = "qemux86|qemux86-64" @@ -1807,8 +1752,7 @@ Typically, you will need to set the following variables: Depending on the build system used by the module sources, you might need to make some adjustments. For example, a typical module ``Makefile`` -looks much like the one provided with the ``hello-mod`` template: -:: +looks much like the one provided with the ``hello-mod`` template:: obj-m := hello.o @@ -1829,7 +1773,7 @@ information to build modules. If your module ``Makefile`` uses a different variable, you might want to override the :ref:`ref-tasks-compile` step, or create a patch to the ``Makefile`` to work with the more typical -``KERNEL_SRC`` or ``KERNEL_PATH`` variables. +:term:`KERNEL_SRC` or :term:`KERNEL_PATH` variables. After you have prepared your recipe, you will likely want to include the module in your images. To do this, see the documentation for the @@ -1845,8 +1789,7 @@ them appropriately for your machine configuration file: - :term:`MACHINE_EXTRA_RRECOMMENDS` Modules are often not required for boot and can be excluded from certain -build configurations. The following allows for the most flexibility: -:: +build configurations. The following allows for the most flexibility:: MACHINE_EXTRA_RRECOMMENDS += "kernel-module-mymodule" @@ -1895,26 +1838,22 @@ branch. $ git whatchanged origin/standard/base..origin/standard/emenlow -To see short, one line summaries of changes use the ``git log`` command: -:: +To see short, one line summaries of changes use the ``git log`` command:: $ git log --oneline origin/standard/base..origin/standard/emenlow -Use this command to see code differences for the changes: -:: +Use this command to see code differences for the changes:: $ git diff origin/standard/base..origin/standard/emenlow Use this command to see the commit log messages and the text -differences: -:: +differences:: $ git show origin/standard/base..origin/standard/emenlow Use this command to create individual patches for each change. Here is an example that creates patch files for each commit and places them -in your ``Documents`` directory: -:: +in your ``Documents`` directory:: $ git format-patch -o $HOME/Documents origin/standard/base..origin/standard/emenlow @@ -1923,15 +1862,13 @@ Showing a Particular Feature or Branch Change Tags in the Yocto Project kernel tree divide changes for significant features or branches. The ``git show`` tag command shows changes based -on a tag. Here is an example that shows ``systemtap`` changes: -:: +on a tag. Here is an example that shows ``systemtap`` changes:: $ git show systemtap You can use the ``git branch --contains`` tag command to show the branches that contain a particular feature. This command shows -the branches that contain the ``systemtap`` feature: -:: +the branches that contain the ``systemtap`` feature:: $ git branch --contains systemtap @@ -1949,23 +1886,23 @@ build stops. Kernel features are the last elements processed for configuring and patching the kernel. Therefore, adding features in this manner is a way to enforce specific features are present and enabled without needing to do a full audit of any other layer's additions to the -``SRC_URI`` statement. +:term:`SRC_URI` statement. You add a kernel feature by providing the feature as part of the -``KERNEL_FEATURES`` variable and by providing the path to the feature's +:term:`KERNEL_FEATURES` variable and by providing the path to the feature's ``.scc`` file, which is relative to the root of the kernel Metadata. The OpenEmbedded build system searches all forms of kernel Metadata on the -``SRC_URI`` statement regardless of whether the Metadata is in the +:term:`SRC_URI` statement regardless of whether the Metadata is in the "kernel-cache", system kernel Metadata, or a recipe-space Metadata (i.e. part of the kernel recipe). See the ":ref:`kernel-dev/advanced:kernel metadata location`" section for additional information. -When you specify the feature's ``.scc`` file on the ``SRC_URI`` +When you specify the feature's ``.scc`` file on the :term:`SRC_URI` statement, the OpenEmbedded build system adds the directory of that ``.scc`` file along with all its subdirectories to the kernel feature search path. Because subdirectories are searched, you can reference a -single ``.scc`` file in the ``SRC_URI`` statement to reference multiple +single ``.scc`` file in the :term:`SRC_URI` statement to reference multiple kernel features. Consider the following example that adds the "test.scc" feature to the @@ -1973,7 +1910,7 @@ build. 1. *Create the Feature File:* Create a ``.scc`` file and locate it just as you would any other patch file, ``.cfg`` file, or fetcher item you - specify in the ``SRC_URI`` statement. + specify in the :term:`SRC_URI` statement. .. note:: @@ -1986,8 +1923,7 @@ build. searched during the build as potential feature directories. Continuing with the example, suppose the "test.scc" feature you are - adding has a ``test.scc`` file in the following directory: - :: + adding has a ``test.scc`` file in the following directory:: my_recipe | @@ -2001,8 +1937,7 @@ build. a similarly named configuration fragment file ``test.cfg``. 2. *Add the Feature File to SRC_URI:* Add the ``.scc`` file to the - recipe's ``SRC_URI`` statement: - :: + recipe's :term:`SRC_URI` statement:: SRC_URI_append = " file://test.scc" @@ -2010,9 +1945,8 @@ build. appended to the existing path. 3. *Specify the Feature as a Kernel Feature:* Use the - ``KERNEL_FEATURES`` statement to specify the feature as a kernel - feature: - :: + :term:`KERNEL_FEATURES` statement to specify the feature as a kernel + feature:: KERNEL_FEATURES_append = " test.scc" diff --git a/poky/documentation/kernel-dev/concepts-appx.rst b/poky/documentation/kernel-dev/concepts-appx.rst index 4b6dbe5ef..cf2e75d85 100644 --- a/poky/documentation/kernel-dev/concepts-appx.rst +++ b/poky/documentation/kernel-dev/concepts-appx.rst @@ -213,7 +213,7 @@ BSP-specific commits. In other words, the divisions of the kernel are transparent and are not relevant to the developer on a day-to-day basis. From the developer's perspective, this path is the "master" branch in Git terms. The developer does not need to be aware of the existence of -any other branches at all. Of course, value exists in the having these +any other branches at all. Of course, it can make sense to have these branches in the tree, should a person decide to explore them. For example, a comparison between two BSPs at either the commit level or at the line-by-line code ``diff`` level is now a trivial operation. @@ -359,8 +359,7 @@ To determine whether or not a given option is "hardware" or "non-hardware", the kernel Metadata in ``yocto-kernel-cache`` contains files that classify individual or groups of options as either hardware or non-hardware. To better show this, consider a situation where the -``yocto-kernel-cache`` contains the following files: -:: +``yocto-kernel-cache`` contains the following files:: yocto-kernel-cache/features/drm-psb/hardware.cfg yocto-kernel-cache/features/kgdb/hardware.cfg @@ -380,8 +379,7 @@ or non-hardware. To better show this, consider a situation where the yocto-kernel-cache/ktypes/base/hardware.kcf yocto-kernel-cache/bsp/qemu-ppc32/hardware.kcf -The following list -provides explanations for the various files: +Here are explanations for the various files: - ``hardware.kcf``: Specifies a list of kernel Kconfig files that contain hardware options only. @@ -400,8 +398,7 @@ provides explanations for the various files: (i.e. ``hardware.kcf`` or ``non-hardware.kcf``). Here is a specific example using the -``kernel-cache/bsp/mti-malta32/hardware.cfg``: -:: +``kernel-cache/bsp/mti-malta32/hardware.cfg``:: CONFIG_SERIAL_8250 CONFIG_SERIAL_8250_CONSOLE diff --git a/poky/documentation/kernel-dev/faq.rst b/poky/documentation/kernel-dev/faq.rst index c2106f81e..f0a7af37b 100644 --- a/poky/documentation/kernel-dev/faq.rst +++ b/poky/documentation/kernel-dev/faq.rst @@ -7,7 +7,7 @@ Kernel Development FAQ Common Questions and Solutions ============================== -The following lists some solutions for common questions. +Here are some solutions for common questions. How do I use my own Linux kernel ``.config`` file? -------------------------------------------------- @@ -57,8 +57,7 @@ These other variables are useful for installing specific modules: For example, set the following in the ``qemux86.conf`` file to include the ``ab123`` kernel modules with images built for the ``qemux86`` -machine: -:: +machine:: MACHINE_EXTRA_RRECOMMENDS += "kernel-module-ab123" @@ -69,10 +68,9 @@ How do I change the Linux kernel command line? ---------------------------------------------- The Linux kernel command line is -typically specified in the machine config using the ``APPEND`` variable. +typically specified in the machine config using the :term:`APPEND` variable. For example, you can add some helpful debug information doing the -following: -:: +following:: APPEND += "printk.time=y initcall_debug debug" diff --git a/poky/documentation/kernel-dev/intro.rst b/poky/documentation/kernel-dev/intro.rst index 5592f74c8..e406f6e47 100644 --- a/poky/documentation/kernel-dev/intro.rst +++ b/poky/documentation/kernel-dev/intro.rst @@ -66,9 +66,9 @@ from the continual kernel integration and testing performed during development of the Yocto Project. If, instead, you have a very specific Linux kernel source tree and are -unable to align with one of the official Yocto Linux kernel recipes, an -alternative exists by which you can use the Yocto Project Linux kernel -tools with your own kernel sources. +unable to align with one of the official Yocto Linux kernel recipes, +you have a way to use the Yocto Project Linux kernel tools with your +own kernel sources. The remainder of this manual provides instructions for completing specific Linux kernel development tasks. These instructions assume you diff --git a/poky/documentation/kernel-dev/maint-appx.rst b/poky/documentation/kernel-dev/maint-appx.rst index 44c43893e..d968c856f 100644 --- a/poky/documentation/kernel-dev/maint-appx.rst +++ b/poky/documentation/kernel-dev/maint-appx.rst @@ -28,8 +28,7 @@ in the Yocto Project Linux kernel in any clone of the Yocto Project Linux kernel source repository and ``yocto-kernel-cache`` Git trees. For example, the following commands clone the Yocto Project baseline Linux kernel that branches off ``linux.org`` version 4.12 and the -``yocto-kernel-cache``, which contains stores of kernel Metadata: -:: +``yocto-kernel-cache``, which contains stores of kernel Metadata:: $ git clone git://git.yoctoproject.org/linux-yocto-4.12 $ git clone git://git.yoctoproject.org/linux-kernel-cache @@ -42,16 +41,14 @@ section. Once you have cloned the kernel Git repository and the cache of Metadata on your local machine, you can discover the branches that are available -in the repository using the following Git command: -:: +in the repository using the following Git command:: $ git branch -a Checking out a branch allows you to work with a particular Yocto Linux kernel. For example, the following commands check out the "standard/beagleboard" branch of the Yocto Linux kernel repository and -the "yocto-4.12" branch of the ``yocto-kernel-cache`` repository: -:: +the "yocto-4.12" branch of the ``yocto-kernel-cache`` repository:: $ cd ~/linux-yocto-4.12 $ git checkout -b my-kernel-4.12 remotes/origin/standard/beagleboard @@ -107,12 +104,11 @@ patch, or BSP: repository organized under the "Yocto Linux Kernel" heading in the :yocto_git:`Yocto Project Source Repositories <>`. - - Areas pointed to by ``SRC_URI`` statements found in kernel recipes. + - Areas pointed to by :term:`SRC_URI` statements found in kernel recipes. For a typical build, the target of the search is a feature description in an ``.scc`` file whose name follows this format (e.g. - ``beaglebone-standard.scc`` and ``beaglebone-preempt-rt.scc``): - :: + ``beaglebone-standard.scc`` and ``beaglebone-preempt-rt.scc``):: bsp_root_name-kernel_type.scc @@ -179,7 +175,7 @@ Build Strategy Once you have cloned a Yocto Linux kernel repository and the cache repository (``yocto-kernel-cache``) onto your development system, you can consider the compilation phase of kernel development, which is -building a kernel image. Some prerequisites exist that are validated by +building a kernel image. Some prerequisites are validated by the build process before compilation starts: - The :term:`SRC_URI` points to the @@ -198,7 +194,7 @@ the build process before compilation starts: In the previous example, the "yocto-4.12" branch is checked out in the ``yocto-kernel-cache`` repository. -The OpenEmbedded build system makes sure these conditions exist before +The OpenEmbedded build system makes sure these conditions are satisfied before attempting compilation. Other means, however, do exist, such as bootstrapping a BSP. @@ -222,8 +218,7 @@ build process generates a build tree that is separate from your kernel's local Git source repository tree. This build tree has a name that uses the following form, where ``${MACHINE}`` is the metadata name of the machine (BSP) and "kernel_type" is one of the Yocto Project supported -kernel types (e.g. "standard"): -:: +kernel types (e.g. "standard"):: linux-${MACHINE}-kernel_type-build |