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.rst96
1 files changed, 35 insertions, 61 deletions
diff --git a/documentation/kernel-dev/kernel-dev-advanced.rst b/documentation/kernel-dev/kernel-dev-advanced.rst
index eeb8f87924..444037c3a7 100644
--- a/documentation/kernel-dev/kernel-dev-advanced.rst
+++ b/documentation/kernel-dev/kernel-dev-advanced.rst
@@ -44,9 +44,7 @@ linux-yocto recipe.
44.. note:: 44.. note::
45 45
46 A Linux kernel recipe that contains kernel Metadata (e.g. inherits 46 A Linux kernel recipe that contains kernel Metadata (e.g. inherits
47 from the 47 from the ``linux-yocto.inc`` file) is said to be a "linux-yocto style" recipe.
48 linux-yocto.inc
49 file) is said to be a "linux-yocto style" recipe.
50 48
51Every linux-yocto style recipe must define the 49Every linux-yocto style recipe must define the
52:term:`KMACHINE` variable. This 50:term:`KMACHINE` variable. This
@@ -70,12 +68,8 @@ to indicate the branch.
70 68
71.. note:: 69.. note::
72 70
73 You can use the 71 You can use the ``KBRANCH`` value to define an alternate branch typically
74 KBRANCH 72 with a machine override as shown here from the ``meta-yocto-bsp`` layer:
75 value to define an alternate branch typically with a machine override
76 as shown here from the
77 meta-yocto-bsp
78 layer:
79 :: 73 ::
80 74
81 KBRANCH_edgerouter = "standard/edgerouter" 75 KBRANCH_edgerouter = "standard/edgerouter"
@@ -101,7 +95,7 @@ section for more information on kernel types.
101During the build, the kern-tools search for the BSP description file 95During the build, the kern-tools search for the BSP description file
102that most closely matches the ``KMACHINE`` and ``LINUX_KERNEL_TYPE`` 96that most closely matches the ``KMACHINE`` and ``LINUX_KERNEL_TYPE``
103variables passed in from the recipe. The tools use the first BSP 97variables passed in from the recipe. The tools use the first BSP
104description it finds that match both variables. If the tools cannot find 98description they find that matches both variables. If the tools cannot find
105a match, they issue a warning. 99a match, they issue a warning.
106 100
107The tools first search for the ``KMACHINE`` and then for the 101The tools first search for the ``KMACHINE`` and then for the
@@ -251,8 +245,7 @@ two files: ``smp.scc`` and ``smp.cfg``. You can find these files in the
251 CONFIG_X86_BIGSMP=y 245 CONFIG_X86_BIGSMP=y
252 246
253You can find general information on configuration 247You can find general information on configuration
254fragment files in the "`Creating Configuration 248fragment files in the ":ref:`creating-config-fragments`" section.
255Fragments <#creating-config-fragments>`__" section.
256 249
257Within the ``smp.scc`` file, the 250Within the ``smp.scc`` file, the
258:term:`KFEATURE_DESCRIPTION` 251:term:`KFEATURE_DESCRIPTION`
@@ -269,13 +262,12 @@ non-hardware fragment.
269 262
270.. note:: 263.. note::
271 264
272 The description file can include multiple 265 The description file can include multiple ``kconf`` statements, one per
273 kconf 266 fragment.
274 statements, one per fragment.
275 267
276As described in the "`Validating 268As described in the
277Configuration <#validating-configuration>`__" section, you can use the 269":ref:`kernel-dev/kernel-dev-common:validating configuration`" section, you can
278following BitBake command to audit your configuration: 270use the following BitBake command to audit your configuration:
279:: 271::
280 272
281 $ bitbake linux-yocto -c kernel_configcheck -f 273 $ bitbake linux-yocto -c kernel_configcheck -f
@@ -335,10 +327,8 @@ for the five patches in the directory.
335 327
336You can create a typical ``.patch`` file using ``diff -Nurp`` or 328You can create a typical ``.patch`` file using ``diff -Nurp`` or
337``git format-patch`` commands. For information on how to create patches, 329``git format-patch`` commands. For information on how to create patches,
338see the "`Using ``devtool`` to Patch the 330see the ":ref:`kernel-dev/kernel-dev-common:using \`\`devtool\`\` to patch the kernel`"
339Kernel <#using-devtool-to-patch-the-kernel>`__" and "`Using Traditional 331and ":ref:`kernel-dev/kernel-dev-common:using traditional kernel development to patch the kernel`"
340Kernel Development to Patch the
341Kernel <#using-traditional-kernel-development-to-patch-the-kernel>`__"
342sections. 332sections.
343 333
344Features 334Features
@@ -397,15 +387,11 @@ type as follows:
397 387
398.. note:: 388.. note::
399 389
400 You can find kernel recipes in the 390 You can find kernel recipes in the ``meta/recipes-kernel/linux`` directory
401 meta/recipes-kernel/linux 391 of the :ref:`overview-manual/overview-manual-development-environment:yocto project source repositories`
402 directory of the 392 (e.g. ``poky/meta/recipes-kernel/linux/linux-yocto_4.12.bb``). See the
403 Source Directory 393 ":ref:`kernel-dev/kernel-dev-advanced:using kernel metadata in a recipe`"
404 (e.g. 394 section for more information.
405 poky/meta/recipes-kernel/linux/linux-yocto_4.12.bb
406 ). See the "
407 Using Kernel Metadata in a Recipe
408 " section for more information.
409 395
410Three kernel types ("standard", "tiny", and "preempt-rt") are supported 396Three kernel types ("standard", "tiny", and "preempt-rt") are supported
411for Linux Yocto kernels: 397for Linux Yocto kernels:
@@ -466,16 +452,11 @@ and ``patch`` commands, respectively.
466 452
467.. note:: 453.. note::
468 454
469 It is not strictly necessary to create a kernel type 455 It is not strictly necessary to create a kernel type ``.scc``
470 .scc
471 file. The Board Support Package (BSP) file can implicitly define the 456 file. The Board Support Package (BSP) file can implicitly define the
472 kernel type using a 457 kernel type using a ``define`` :term:`KTYPE` ``myktype`` line. See the
473 define 458 ":ref:`kernel-dev/kernel-dev-advanced:bsp descriptions`" section for more
474 KTYPE 459 information.
475 myktype
476 line. See the "
477 BSP Descriptions
478 " section for more information.
479 460
480BSP Descriptions 461BSP Descriptions
481---------------- 462----------------
@@ -488,13 +469,9 @@ supported kernel type.
488.. note:: 469.. note::
489 470
490 For BSPs supported by the Yocto Project, the BSP description files 471 For BSPs supported by the Yocto Project, the BSP description files
491 are located in the 472 are located in the ``bsp`` directory of the ``yocto-kernel-cache``
492 bsp
493 directory of the
494 yocto-kernel-cache
495 repository organized under the "Yocto Linux Kernel" heading in the 473 repository organized under the "Yocto Linux Kernel" heading in the
496 Yocto Project Source Repositories 474 :yocto_git:`Yocto Project Source Repositories </>`.
497 .
498 475
499This section overviews the BSP description structure, the aggregation 476This section overviews the BSP description structure, the aggregation
500concepts, and presents a detailed example using a BSP supported by the 477concepts, and presents a detailed example using a BSP supported by the
@@ -571,7 +548,7 @@ policy. See the "`Kernel Types <#kernel-types>`__" section for more
571information. 548information.
572 549
573To aggregate common configurations and features specific to the kernel 550To aggregate common configurations and features specific to the kernel
574for mybsp, use the following: 551for `mybsp`, use the following:
575:: 552::
576 553
577 include mybsp.scc 554 include mybsp.scc
@@ -582,8 +559,7 @@ You can see that in the BeagleBone example with the following:
582 include beaglebone.scc 559 include beaglebone.scc
583 560
584For information on how to break a complete ``.config`` file into the various 561For information on how to break a complete ``.config`` file into the various
585configuration fragments, see the "`Creating Configuration 562configuration fragments, see the ":ref:`creating-config-fragments`" section.
586Fragments <#creating-config-fragments>`__" section.
587 563
588Finally, if you have any configurations specific to the hardware that 564Finally, if you have any configurations specific to the hardware that
589are not in a ``*.scc`` file, you can include them as follows: 565are not in a ``*.scc`` file, you can include them as follows:
@@ -653,7 +629,7 @@ found on the machine. This ``minnow.scc`` description file is then
653included in each of the three "minnow" description files for the 629included in each of the three "minnow" description files for the
654supported kernel types (i.e. "standard", "preempt-rt", and "tiny"). 630supported kernel types (i.e. "standard", "preempt-rt", and "tiny").
655Consider the "minnow" description for the "standard" kernel type (i.e. 631Consider the "minnow" description for the "standard" kernel type (i.e.
656``minnow-standard.scc``: 632``minnow-standard.scc``):
657:: 633::
658 634
659 define KMACHINE minnow 635 define KMACHINE minnow
@@ -725,8 +701,8 @@ others, the recipe-space method is recommended. This method is also a
725good approach if you are working with Linux kernel sources you do not 701good approach if you are working with Linux kernel sources you do not
726control or if you just do not want to maintain a Linux kernel Git 702control or if you just do not want to maintain a Linux kernel Git
727repository on your own. For partial information on how you can define 703repository on your own. For partial information on how you can define
728kernel Metadata in the recipe-space, see the "`Modifying an Existing 704kernel Metadata in the recipe-space, see the
729Recipe <#modifying-an-existing-recipe>`__" section. 705":ref:`kernel-dev/kernel-dev-common:modifying an existing recipe`" section.
730 706
731Conversely, if you are actively developing a kernel and are already 707Conversely, if you are actively developing a kernel and are already
732maintaining a Linux kernel Git repository of your own, you might find it 708maintaining a Linux kernel Git repository of your own, you might find it
@@ -746,8 +722,8 @@ modifying
746``oe-core/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb`` to 722``oe-core/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb`` to
747a recipe in your layer, ``FILESEXTRAPATHS`` is typically set to 723a recipe in your layer, ``FILESEXTRAPATHS`` is typically set to
748``${``\ :term:`THISDIR`\ ``}/${``\ :term:`PN`\ ``}``. 724``${``\ :term:`THISDIR`\ ``}/${``\ :term:`PN`\ ``}``.
749See the "`Modifying an Existing 725See the ":ref:`kernel-dev/kernel-dev-common:modifying an existing recipe`"
750Recipe <#modifying-an-existing-recipe>`__" section for more information. 726section for more information.
751 727
752Here is an example that shows a trivial tree of kernel Metadata stored 728Here is an example that shows a trivial tree of kernel Metadata stored
753in recipe-space within a BSP layer: 729in recipe-space within a BSP layer:
@@ -849,7 +825,7 @@ best for your development model.
849Encapsulating Patches 825Encapsulating Patches
850--------------------- 826---------------------
851 827
852if you are reusing patches from an external tree and are not working on 828If you are reusing patches from an external tree and are not working on
853the patches, you might find the encapsulated feature to be appropriate. 829the patches, you might find the encapsulated feature to be appropriate.
854Given this scenario, you do not need to create any branches in the 830Given this scenario, you do not need to create any branches in the
855source repository. Rather, you just take the static patches you need and 831source repository. Rather, you just take the static patches you need and
@@ -881,6 +857,7 @@ new branch as the ``KBRANCH`` to use for the board as follows:
881 857
882Another method is to use the ``branch`` command in the BSP 858Another method is to use the ``branch`` command in the BSP
883description: 859description:
860::
884 861
885 mybsp.scc: 862 mybsp.scc:
886 define KMACHINE mybsp 863 define KMACHINE mybsp
@@ -902,7 +879,7 @@ repositories use:
902If you had two kernel types, "standard" and "small" for instance, three 879If you had two kernel types, "standard" and "small" for instance, three
903machines, and common as ``mydir``, the branches in your Git repository 880machines, and common as ``mydir``, the branches in your Git repository
904might look like this: 881might look like this:
905: 882::
906 883
907 mydir/base 884 mydir/base
908 mydir/standard/base 885 mydir/standard/base
@@ -922,11 +899,8 @@ appropriate for the other branches.
922 899
923 The "base" branches are an artifact of the way Git manages its data 900 The "base" branches are an artifact of the way Git manages its data
924 internally on the filesystem: Git will not allow you to use 901 internally on the filesystem: Git will not allow you to use
925 mydir/standard 902 ``mydir/standard`` and ``mydir/standard/machine_a`` because it would have to
926 and 903 create a file and a directory named "standard".
927 mydir/standard/machine_a
928 because it would have to create a file and a directory named
929 "standard".
930 904
931Feature Branches 905Feature Branches
932---------------- 906----------------