Lines Matching full:kernel
8 with the Yocto Project Linux kernel. These tasks include preparing your
9 host development system for kernel development, preparing a layer,
10 modifying an existing recipe, patching the kernel, configuring the
11 kernel, iterative development, working with your own sources, and
19 Preparing the Build Host to Work on the Kernel
22 Before you can do any kernel development, you need to be sure your build
41 Kernel development is best accomplished using
43 and not through traditional kernel workflow methods. The remainder of
49 Follow these steps to prepare to update the kernel image using
50 ``devtool``. Completing this procedure leaves you with a clean kernel
52 ":ref:`kernel-dev/common:using \`\`devtool\`\` to patch the kernel`"
78 Also, since you are preparing to work on the kernel image, you need
81 variable to include kernel modules.
84 :term:`MACHINE` variable to "qemux86" and also add the "kernel-modules".
88 MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "kernel-modules"
91 patches created for the kernel image. You can use the
180 kernel is to build an initial image using ``devtool`` in the new
205 kernel by using the extensible SDK. For a continued example, see the
206 ":ref:`kernel-dev/common:using \`\`devtool\`\` to patch the kernel`"
209 Getting Ready for Traditional Kernel Development
212 Getting ready for traditional kernel development using the Yocto Project
214 However, you need to establish a local copy of the kernel source since
217 Follow these steps to prepare to update the kernel image using
218 traditional kernel development flow with the Yocto Project. Completing
219 this procedure leaves you ready to make modifications to the kernel
220 source as described in the ":ref:`kernel-dev/common:using traditional kernel development to patch t…
256 Also, since you are preparing to work on the kernel image, you need
259 variable to include kernel modules.
262 :term:`MACHINE` variable to "qemux86" and also add the "kernel-modules".
266 MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "kernel-modules"
269 patches created for the kernel image. You can use the
300 5. *Create a Local Copy of the Kernel Git Repository:* You can find Git
302 "Yocto Linux Kernel" in the Yocto Project Source Repositories at
306 kernel Git repository outside of the
312 ``linux-yocto-4.12`` kernel and be in the ``standard/base`` branch.
316 The ``linux-yocto-4.12`` kernel can be used with the Yocto Project 2.4
318 You cannot use the ``linux-yocto-4.12`` kernel with releases prior to
333 6. *Create a Local Copy of the Kernel Cache Git Repository:* For
334 simplicity, it is recommended that you create your copy of the kernel
341 ``yocto-kernel-cache`` and switch to the ``yocto-4.12`` branch::
344 $ git clone git://git.yoctoproject.org/yocto-kernel-cache --branch yocto-4.12
345 Cloning into 'yocto-kernel-cache'...
353 At this point, you are ready to start making modifications to the kernel
354 using traditional kernel development steps. For a continued example, see
355 the ":ref:`kernel-dev/common:using traditional kernel development to patch the kernel`"
361 If you are going to be modifying kernel recipes, it is recommended that
365 create your own recipe files (``.bb``) as well as store and use kernel
379 To better understand the layer you create for kernel development, the
388 $ mkdir meta-mylayer/recipes-kernel
389 $ mkdir meta-mylayer/recipes-kernel/linux
390 $ mkdir meta-mylayer/recipes-kernel/linux/linux-yocto
393 ``recipes-kernel`` directory holds your append file and eventual
413 3. *Create the Kernel Recipe Append File*: Move to the
414 ``meta-mylayer/recipes-kernel/linux`` directory and create the
415 kernel's append file. This example uses the ``linux-yocto-4.12``
416 kernel. Thus, the name of the append file is
436 few Linux kernel recipes from which you can choose. These are located in
438 ``meta/recipes-kernel/linux``.
442 - :ref:`kernel-dev/common:creating the append file`
444 - :ref:`kernel-dev/common:applying patches`
446 - :ref:`kernel-dev/common:changing the configuration`
450 ":ref:`kernel-dev/common:creating and preparing a layer`" section for
458 modifying the ``meta/recipes-kernel/linux/linux-yocto_4.12.bb`` recipe,
464 your-layer/recipes-kernel/linux/linux-yocto_4.12.bbappend
476 you add any new files that modify the kernel recipe and you have
480 your-layer/recipes-kernel/linux/linux-yocto/
492 meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.12.bbappend
530 machine name used by the Linux Yocto kernel. The file also uses the
532 ensure the build process uses the appropriate kernel branch.
536 variable could be used to enable features specific to the kernel. The
539 the ``meta`` Git repository branches to identify the exact kernel needed
543 when developing a BSP, is the kernel configuration file (``.config``)
544 for your BSP. When developing a BSP, you probably have a kernel
545 configuration file or a set of kernel configuration files that, when
546 taken together, define the kernel configuration for your BSP. You can
549 kernel's append file and having the same name as the kernel's main
558 the kernel, the configuration options are picked up and applied.
573 Another variable you can use in your kernel recipe append file is the
583 kernel repository, you could checkout the kernel's ``meta`` branch,
585 of the kernel. The result is that you directly add configuration
592 kernel's ``meta`` branch. Not only is it easier for BSP developers
603 apply to the Linux kernel source, you can do so just as you would with
618 the Linux kernel, BitBake detects the change in the recipe and fetches
619 and applies the patches before building the kernel.
621 For a detailed example showing how to patch the kernel using
623 ":ref:`kernel-dev/common:using \`\`devtool\`\` to patch the kernel`"
625 ":ref:`kernel-dev/common:using traditional kernel development to patch the kernel`"
632 file used for the eventual Linux kernel configuration by including a
637 If you have a complete, working Linux kernel ``.config`` file you want
639 appropriate ``${PN}`` directory in your layer's ``recipes-kernel/linux``
666 final kernel configuration is a combination of the configurations in
694 Linux kernel, BitBake detects the change in the recipe and fetches and
695 applies the new configuration before building the kernel.
697 For a detailed example showing how to configure the kernel, see the
698 ":ref:`kernel-dev/common:configuring the kernel`" section.
703 It might be desirable to have kernel configuration fragment support
704 through a ``defconfig`` file that is pulled from the kernel source tree
713 the default configuration from the kernel tree and still be able to add
731 Aside from modifying your kernel recipe and providing your own
734 a kernel's ``linux-``\ `machine`\ ``.inc`` file). In other words, if the
743 Using ``devtool`` to Patch the Kernel
746 The steps in this procedure show you how you can patch the kernel using
752 steps to get ready for updating the kernel as described in the
753 ":ref:`kernel-dev/common:getting ready to develop using \`\`devtool\`\``"
756 Patching the kernel involves changing or adding configurations to an
757 existing kernel, changing or adding recipes to the kernel that are
762 output at boot time through ``printk`` statements in the kernel's
766 the ":ref:`kernel-dev/common:getting ready to develop using \`\`devtool\`\``" Section.
768 1. *Check Out the Kernel Source Files:* First you must use ``devtool``
769 to checkout the kernel source code in its workspace. Be sure you are
775 ":ref:`kernel-dev/common:getting ready to develop using \`\`devtool\`\``"
791 … /path/to/esdk/layers/poky/meta/recipes-kernel/linux/linux-yocto_4.10.bb.do_unpack
803 kernel source code is before making your edits to the
819 printk("* HELLO YOCTO KERNEL *\n");
828 3. *Build the Updated Kernel Source:* To build the updated kernel
833 4. *Create the Image With the New Kernel:* Use the
835 new kernel.
841 updated kernel. For an example, see the steps in the
890 ":ref:`kernel-dev/common:getting ready to develop using \`\`devtool\`\``"
895 ``~/meta-mylayer/recipes-kernel/linux`` directory.
897 8. *Build the Image With Your Modified Kernel:* You can now build an
898 image that includes your kernel patches. Execute the following
906 Using Traditional Kernel Development to Patch the Kernel
909 The steps in this procedure show you how you can patch the kernel using
910 traditional kernel development (i.e. not using ``devtool`` and the
912 ":ref:`kernel-dev/common:using \`\`devtool\`\` to patch the kernel`"
918 steps to get ready for updating the kernel as described in the
919 ":ref:`kernel-dev/common:getting ready for traditional kernel development`"
922 Patching the kernel involves changing or adding configurations to an
923 existing kernel, changing or adding recipes to the kernel that are
929 the kernel's ``calibrate.c`` source code file. Applying the patch and
933 ":ref:`kernel-dev/common:getting ready for traditional kernel development`"
937 to create a local copy of the repository for your kernel. Assuming
939 ":ref:`kernel-dev/common:getting ready for traditional kernel development`"
943 files in the local copy of the kernel Git repository. Change to
944 where the kernel source code is before making your edits to the
960 printk("* HELLO YOCTO KERNEL *\n");
981 "kernel-modules" and the "qemux86" machine, it must also point to the
982 updated kernel source files. Add
992 …git:///path-to/yocto-kernel-cache;protocol=file;type=kmeta;name=meta;branch=yocto-4.12;destsuffix=…
1004 committed, and the ``local.conf`` file pointing to the kernel files,
1030 correctly, you can generate a ``*.patch`` file in the kernel source
1047 $ mkdir recipes-kernel
1048 $ mkdir recipes-kernel/linux
1049 $ mkdir recipes-kernel/linux/linux-yocto
1055 …0001-calibrate.c-Added-some-printk-statements.patch ~/meta-mylayer/recipes-kernel/linux/linux-yocto
1060 needs to be in your layer's ``recipes-kernel/linux`` directory and it
1071 ":ref:`kernel-dev/common:creating the append file`" and
1072 ":ref:`kernel-dev/common:applying patches`" sections. You can also see the
1090 Configuring the Kernel
1093 Configuring the Yocto Project kernel consists of making sure the
1098 build system can use for kernel configuration.
1102 ``.config`` file to create the leanest kernel configuration file
1105 For more information on kernel configuration, see the
1106 ":ref:`kernel-dev/common:changing the configuration`" section.
1111 The easiest way to define kernel configurations is to set them through
1113 which to set kernel configurations. For general information on
1144 kernel configuration parameters. After making your changes, simply exit
1152 ":ref:`kernel-dev/common:changing the configuration`",
1153 ":ref:`kernel-dev/common:using an "in-tree" \`\`defconfig\`\` file`",
1154 and ":ref:`kernel-dev/common:creating a \`\`defconfig\`\` file`"
1158 ``linux-yocto-4.12`` kernel.
1162 The OpenEmbedded build system recognizes this kernel as ``linux-yocto``
1176 kernel during the build. You can find and examine this file in the Build
1178 area where the specific kernel is built. For example, if you were
1179 building a Linux Yocto kernel based on the ``linux-yocto-4.12`` kernel
1192 more readable. Also, depending on the kernel you are using, the exact
1195 Within the ``.config`` file, you can see the kernel settings. For
1208 kernel layer.
1220 from the kernel tree and moved into recipe space. You can use a
1221 ``defconfig`` file to retain a known set of kernel configurations from
1229 to configure the kernel.
1231 To create a ``defconfig``, start with a complete, working Linux kernel
1234 your layer's ``recipes-kernel/linux`` directory, and rename the copied
1236 ``~/meta-mylayer/recipes-kernel/linux/linux-yocto/defconfig``). Then,
1252 final kernel configuration is a combination of the configurations in
1258 For more information on configuring the kernel, see the
1259 ":ref:`kernel-dev/common:changing the configuration`" section.
1264 Configuration fragments are simply kernel options that appear in a file
1267 configurations from a ``defconfig`` file. Thus, the final kernel
1280 ":ref:`kernel-dev/common:using \`\`menuconfig\`\``"
1286 multi-processor support within the kernel::
1303 1. *Complete a Build Through Kernel Configuration:* Complete a build at
1304 least through the kernel configuration task as follows::
1325 The ``diffconfig`` command creates a file that is a list of Linux kernel
1327 ":ref:`kernel-dev/common:changing the configuration`" section for additional
1333 BSP. See the ":ref:`kernel-dev/advanced:bsp descriptions`"
1340 build system picks up the configuration and adds it to the kernel's
1344 the kernel's append file within your layer and then add the following
1345 statements to the kernel's append file, those configuration options will
1346 be picked up and applied when the kernel is built::
1376 See the ":ref:`kernel-dev/common:using \`\`menuconfig\`\``" section for
1395 [kernel config]: specified values did not make it into the kernel's final configuration:
1399 …From: /home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standar…
1406 …From: /home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standar…
1407 …/home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standard/defc…
1414 …From: /home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standar…
1415 …/home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standard/bsp/…
1416 …/home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standard/defc…
1423 …From: /home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standar…
1424 …/home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standard/defc…
1449 :ref:`kernel-dev/common:using \`\`menuconfig\`\`` section.
1451 Fine-Tuning the Kernel Configuration File
1455 possible by reading the output of the kernel configuration fragment
1459 As part of the kernel build process, the ``do_kernel_configcheck`` task
1460 runs. This task validates the kernel configuration by checking the final
1473 - Listed options not valid for the kernel being processed. In other
1512 output of the kernel configuration audit, you can re-run the
1519 ``.config``, you can build the Linux Yocto kernel.
1529 $ bitbake -e virtual/kernel > some_text_file
1535 Working with a "Dirty" Kernel Version String
1538 If you build a kernel image and the version string has a "+" or a
1539 "-dirty" at the end, it means there are uncommitted modifications in the kernel's
1542 1. *Discover the Uncommitted Changes:* Go to the kernel's locally cloned
1548 2. *Commit the Changes:* You should commit those changes to the kernel
1555 3. *Rebuild the Kernel Image:* Once you commit the changes, rebuild the
1556 kernel.
1558 Depending on your particular kernel development workflow, the
1559 commands you use to rebuild the kernel might differ. For information
1560 on building the kernel image when using ``devtool``, see the
1561 ":ref:`kernel-dev/common:using \`\`devtool\`\` to patch the kernel`"
1563 information on building the kernel image when using Bitbake, see the
1564 ":ref:`kernel-dev/common:using traditional kernel development to patch the kernel`"
1570 If you cannot work with one of the Linux kernel versions supported by
1572 Project Linux kernel tooling by working with your own sources. When you
1574 kernel :term:`Metadata` and stabilization
1578 on a future, mutually-supported kernel version.
1581 linux-yocto custom recipe that uses ``kernel.org`` sources and
1582 the Yocto Project Linux kernel tools for managing kernel Metadata.
1584 :yocto_git:`meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb
1585 </poky/tree/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb>`.
1589 1. *Create a Copy of the Kernel Recipe:* Copy the
1592 Linux kernel you are using (e.g. ``linux-yocto-myproject_4.12.bb``,
1593 where "4.12" is the base version of the Linux kernel with which you
1615 configuration for your architecture as defined by your kernel.
1637 The Linux kernel version you are using (e.g. "4.12").
1640 The Linux kernel ``CONFIG_LOCALVERSION`` that is compiled into the
1641 resulting kernel and visible through the ``uname`` command.
1690 include kernel modules as part of the normal build process, you might
1699 image. Briefly, the ``kernel-dev`` package is installed by default on
1700 all ``*.sdk`` images and the ``kernel-devsrc`` package is installed on
1706 the target as root and you need to change to the ``/usr/src/kernel``
1711 # cd /usr/src/kernel
1715 ``kernel-dev`` packages will be installed as part of the SDK image and
1716 the ``kernel-devsrc`` packages will be installed as part of applicable
1725 Linux kernel sources, if you need an external kernel module, the
1727 create your own out-of-tree Linux kernel module recipe.
1731 :yocto_git:`meta-skeleton/recipes-kernel/hello-mod/hello-mod_0.1.bb
1732 </poky/tree/meta-skeleton/recipes-kernel/hello-mod/hello-mod_0.1.bb>`.
1767 ``${STAGING_KERNEL_DIR}`` with the necessary Linux kernel build
1790 MACHINE_EXTRA_RRECOMMENDS += "kernel-module-mymodule"
1794 to the string "kernel-module-".
1804 A common question when working with a kernel is: "What changes have been
1806 see what has changed, you can use Git to inspect or search the kernel
1809 What Changed in a Kernel?
1818 In the following examples, unless you provide a commit range, ``kernel.org``
1819 history is blended with Yocto Project kernel changes. You can form
1820 ranges by using branch names from the kernel tree as the upper and
1829 branch of the ``linux-yocto-3.19`` kernel. The lower commit range is the
1859 Tags in the Yocto Project kernel tree divide changes for significant
1871 Adding Recipe-Space Kernel Features
1874 You can add kernel features in the
1875 :ref:`recipe-space <kernel-dev/advanced:recipe-space metadata>`
1881 build stops. Kernel features are the last elements processed for
1882 configuring and patching the kernel. Therefore, adding features in this
1887 You add a kernel feature by providing the feature as part of the
1889 ``.scc`` file, which is relative to the root of the kernel Metadata. The
1890 OpenEmbedded build system searches all forms of kernel Metadata on the
1892 "kernel-cache", system kernel Metadata, or a recipe-space Metadata (i.e.
1893 part of the kernel recipe). See the
1894 ":ref:`kernel-dev/advanced:kernel metadata location`" section for
1899 ``.scc`` file along with all its subdirectories to the kernel feature
1902 kernel features.
1943 3. *Specify the Feature as a Kernel Feature:* Use the
1944 :term:`KERNEL_FEATURES` statement to specify the feature as a kernel
1950 system processes the kernel feature when it builds the kernel.