summaryrefslogtreecommitdiffstats
path: root/documentation/kernel-dev/kernel-dev-common.rst
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/kernel-dev/kernel-dev-common.rst')
-rw-r--r--documentation/kernel-dev/kernel-dev-common.rst134
1 files changed, 67 insertions, 67 deletions
diff --git a/documentation/kernel-dev/kernel-dev-common.rst b/documentation/kernel-dev/kernel-dev-common.rst
index 085c6d396c..b5f794e733 100644
--- a/documentation/kernel-dev/kernel-dev-common.rst
+++ b/documentation/kernel-dev/kernel-dev-common.rst
@@ -72,7 +72,7 @@ section:
72 "poky". 72 "poky".
73 73
742. *Prepare Your ``local.conf`` File:* By default, the 742. *Prepare Your ``local.conf`` File:* By default, the
75 ```MACHINE`` <&YOCTO_DOCS_REF_URL;#var-MACHINE>`__ variable is set to 75 :term:`MACHINE` variable is set to
76 "qemux86-64", which is fine if you are building for the QEMU emulator 76 "qemux86-64", which is fine if you are building for the QEMU emulator
77 in 64-bit mode. However, if you are not, you need to set the 77 in 64-bit mode. However, if you are not, you need to set the
78 ``MACHINE`` variable appropriately in your ``conf/local.conf`` file 78 ``MACHINE`` variable appropriately in your ``conf/local.conf`` file
@@ -82,7 +82,7 @@ section:
82 82
83 Also, since you are preparing to work on the kernel image, you need 83 Also, since you are preparing to work on the kernel image, you need
84 to set the 84 to set the
85 ```MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS`` <&YOCTO_DOCS_REF_URL;#var-MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS>`__ 85 :term:`MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS`
86 variable to include kernel modules. 86 variable to include kernel modules.
87 87
88 In this example we wish to build for qemux86 so we must set the 88 In this example we wish to build for qemux86 so we must set the
@@ -115,7 +115,7 @@ section:
115 115
1164. *Inform the BitBake Build Environment About Your Layer:* As directed 1164. *Inform the BitBake Build Environment About Your Layer:* As directed
117 when you created your layer, you need to add the layer to the 117 when you created your layer, you need to add the layer to the
118 ```BBLAYERS`` <&YOCTO_DOCS_REF_URL;#var-BBLAYERS>`__ variable in the 118 :term:`BBLAYERS` variable in the
119 ``bblayers.conf`` file as follows: $ cd ~/poky/build $ bitbake-layers 119 ``bblayers.conf`` file as follows: $ cd ~/poky/build $ bitbake-layers
120 add-layer ../../meta-mylayer NOTE: Starting bitbake server... $ 120 add-layer ../../meta-mylayer NOTE: Starting bitbake server... $
121 121
@@ -236,7 +236,7 @@ section:
236 "poky". 236 "poky".
237 237
2382. *Prepare Your ``local.conf`` File:* By default, the 2382. *Prepare Your ``local.conf`` File:* By default, the
239 ```MACHINE`` <&YOCTO_DOCS_REF_URL;#var-MACHINE>`__ variable is set to 239 :term:`MACHINE` variable is set to
240 "qemux86-64", which is fine if you are building for the QEMU emulator 240 "qemux86-64", which is fine if you are building for the QEMU emulator
241 in 64-bit mode. However, if you are not, you need to set the 241 in 64-bit mode. However, if you are not, you need to set the
242 ``MACHINE`` variable appropriately in your ``conf/local.conf`` file 242 ``MACHINE`` variable appropriately in your ``conf/local.conf`` file
@@ -246,7 +246,7 @@ section:
246 246
247 Also, since you are preparing to work on the kernel image, you need 247 Also, since you are preparing to work on the kernel image, you need
248 to set the 248 to set the
249 ```MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS`` <&YOCTO_DOCS_REF_URL;#var-MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS>`__ 249 :term:`MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS`
250 variable to include kernel modules. 250 variable to include kernel modules.
251 251
252 In this example we wish to build for qemux86 so we must set the 252 In this example we wish to build for qemux86 so we must set the
@@ -279,7 +279,7 @@ section:
279 279
2804. *Inform the BitBake Build Environment About Your Layer:* As directed 2804. *Inform the BitBake Build Environment About Your Layer:* As directed
281 when you created your layer, you need to add the layer to the 281 when you created your layer, you need to add the layer to the
282 ```BBLAYERS`` <&YOCTO_DOCS_REF_URL;#var-BBLAYERS>`__ variable in the 282 :term:`BBLAYERS` variable in the
283 ``bblayers.conf`` file as follows: $ cd ~/poky/build $ bitbake-layers 283 ``bblayers.conf`` file as follows: $ cd ~/poky/build $ bitbake-layers
284 add-layer ../../meta-mylayer NOTE: Starting bitbake server ... $ 284 add-layer ../../meta-mylayer NOTE: Starting bitbake server ... $
285 285
@@ -343,7 +343,7 @@ Creating and Preparing a Layer
343 343
344If you are going to be modifying kernel recipes, it is recommended that 344If you are going to be modifying kernel recipes, it is recommended that
345you create and prepare your own layer in which to do your work. Your 345you create and prepare your own layer in which to do your work. Your
346layer contains its own `BitBake <&YOCTO_DOCS_REF_URL;#bitbake-term>`__ 346layer contains its own :term:`BitBake`
347append files (``.bbappend``) and provides a convenient mechanism to 347append files (``.bbappend``) and provides a convenient mechanism to
348create your own recipe files (``.bb``) as well as store and use kernel 348create your own recipe files (``.bb``) as well as store and use kernel
349patch files. For background information on working with layers, see the 349patch files. For background information on working with layers, see the
@@ -393,8 +393,8 @@ home directory:
393 "${THISDIR}/${PN}:" SRC_URI_append = " file://patch-file-one" 393 "${THISDIR}/${PN}:" SRC_URI_append = " file://patch-file-one"
394 SRC_URI_append = " file://patch-file-two" SRC_URI_append = " 394 SRC_URI_append = " file://patch-file-two" SRC_URI_append = "
395 file://patch-file-three" The 395 file://patch-file-three" The
396 ```FILESEXTRAPATHS`` <&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS>`__ 396 :term:`FILESEXTRAPATHS`
397 and ```SRC_URI`` <&YOCTO_DOCS_REF_URL;#var-SRC_URI>`__ statements 397 and :term:`SRC_URI` statements
398 enable the OpenEmbedded build system to find patch files. For more 398 enable the OpenEmbedded build system to find patch files. For more
399 information on using append files, see the "`Using .bbappend Files in 399 information on using append files, see the "`Using .bbappend Files in
400 Your Layer <&YOCTO_DOCS_DEV_URL;#using-bbappend-files>`__" section in 400 Your Layer <&YOCTO_DOCS_DEV_URL;#using-bbappend-files>`__" section in
@@ -406,7 +406,7 @@ Modifying an Existing Recipe
406In many cases, you can customize an existing linux-yocto recipe to meet 406In many cases, you can customize an existing linux-yocto recipe to meet
407the needs of your project. Each release of the Yocto Project provides a 407the needs of your project. Each release of the Yocto Project provides a
408few Linux kernel recipes from which you can choose. These are located in 408few Linux kernel recipes from which you can choose. These are located in
409the `Source Directory <&YOCTO_DOCS_REF_URL;#source-directory>`__ in 409the :term:`Source Directory` in
410``meta/recipes-kernel/linux``. 410``meta/recipes-kernel/linux``.
411 411
412Modifying an existing recipe can consist of the following: 412Modifying an existing recipe can consist of the following:
@@ -431,12 +431,12 @@ modifying the ``meta/recipes-kernel/linux/linux-yocto_4.12.bb`` recipe,
431the append file will typically be located as follows within your custom 431the append file will typically be located as follows within your custom
432layer: your-layer/recipes-kernel/linux/linux-yocto_4.12.bbappend The 432layer: your-layer/recipes-kernel/linux/linux-yocto_4.12.bbappend The
433append file should initially extend the 433append file should initially extend the
434```FILESPATH`` <&YOCTO_DOCS_REF_URL;#var-FILESPATH>`__ search path by 434:term:`FILESPATH` search path by
435prepending the directory that contains your files to the 435prepending the directory that contains your files to the
436```FILESEXTRAPATHS`` <&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS>`__ 436:term:`FILESEXTRAPATHS`
437variable as follows: FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" The 437variable as follows: FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" The
438path 438path
439``${``\ ```THISDIR`` <&YOCTO_DOCS_REF_URL;#var-THISDIR>`__\ ``}/${``\ ```PN`` <&YOCTO_DOCS_REF_URL;#var-PN>`__\ ``}`` 439``${``\ :term:`THISDIR`\ ``}/${``\ :term:`PN`\ ``}``
440expands to "linux-yocto" in the current directory for this example. If 440expands to "linux-yocto" in the current directory for this example. If
441you add any new files that modify the kernel recipe and you have 441you add any new files that modify the kernel recipe and you have
442extended ``FILESPATH`` as described above, you must place the files in 442extended ``FILESPATH`` as described above, you must place the files in
@@ -472,16 +472,16 @@ COMPATIBLE_MACHINE_beaglebone = "beaglebone" LINUX_VERSION_genericx86 =
472= "4.12.10" LINUX_VERSION_beaglebone = "4.12.10" This append file 472= "4.12.10" LINUX_VERSION_beaglebone = "4.12.10" This append file
473contains statements used to support several BSPs that ship with the 473contains statements used to support several BSPs that ship with the
474Yocto Project. The file defines machines using the 474Yocto Project. The file defines machines using the
475```COMPATIBLE_MACHINE`` <&YOCTO_DOCS_REF_URL;#var-COMPATIBLE_MACHINE>`__ 475:term:`COMPATIBLE_MACHINE`
476variable and uses the 476variable and uses the
477```KMACHINE`` <&YOCTO_DOCS_REF_URL;#var-KMACHINE>`__ variable to ensure 477:term:`KMACHINE` variable to ensure
478the machine name used by the OpenEmbedded build system maps to the 478the machine name used by the OpenEmbedded build system maps to the
479machine name used by the Linux Yocto kernel. The file also uses the 479machine name used by the Linux Yocto kernel. The file also uses the
480optional ```KBRANCH`` <&YOCTO_DOCS_REF_URL;#var-KBRANCH>`__ variable to 480optional :term:`KBRANCH` variable to
481ensure the build process uses the appropriate kernel branch. 481ensure the build process uses the appropriate kernel branch.
482 482
483Although this particular example does not use it, the 483Although this particular example does not use it, the
484```KERNEL_FEATURES`` <&YOCTO_DOCS_REF_URL;#var-KERNEL_FEATURES>`__ 484:term:`KERNEL_FEATURES`
485variable could be used to enable features specific to the kernel. The 485variable could be used to enable features specific to the kernel. The
486append file points to specific commits in the `Source 486append file points to specific commits in the `Source
487Directory <&YOCTO_DOCS_REF_URL;#source-directory>`__ Git repository and 487Directory <&YOCTO_DOCS_REF_URL;#source-directory>`__ Git repository and
@@ -497,7 +497,7 @@ accomplish this definition by putting the configurations in a file or a
497set of files inside a directory located at the same level as your 497set of files inside a directory located at the same level as your
498kernel's append file and having the same name as the kernel's main 498kernel's append file and having the same name as the kernel's main
499recipe file. With all these conditions met, simply reference those files 499recipe file. With all these conditions met, simply reference those files
500in the ```SRC_URI`` <&YOCTO_DOCS_REF_URL;#var-SRC_URI>`__ statement in 500in the :term:`SRC_URI` statement in
501the append file. 501the append file.
502 502
503For example, suppose you had some configuration options in a file called 503For example, suppose you had some configuration options in a file called
@@ -515,7 +515,7 @@ the following in your append file: SRC_URI += "file://myconfig.cfg \\
515file://eth.cfg \\ file://gfx.cfg" 515file://eth.cfg \\ file://gfx.cfg"
516 516
517Another variable you can use in your kernel recipe append file is the 517Another variable you can use in your kernel recipe append file is the
518```FILESEXTRAPATHS`` <&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS>`__ 518:term:`FILESEXTRAPATHS`
519variable. When you use this statement, you are extending the locations 519variable. When you use this statement, you are extending the locations
520used by the OpenEmbedded system to look for files and patches as the 520used by the OpenEmbedded system to look for files and patches as the
521recipe is processed. 521recipe is processed.
@@ -546,9 +546,9 @@ Applying Patches
546If you have a single patch or a small series of patches that you want to 546If you have a single patch or a small series of patches that you want to
547apply to the Linux kernel source, you can do so just as you would with 547apply to the Linux kernel source, you can do so just as you would with
548any other recipe. You first copy the patches to the path added to 548any other recipe. You first copy the patches to the path added to
549```FILESEXTRAPATHS`` <&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS>`__ in 549:term:`FILESEXTRAPATHS` in
550your ``.bbappend`` file as described in the previous section, and then 550your ``.bbappend`` file as described in the previous section, and then
551reference them in ```SRC_URI`` <&YOCTO_DOCS_REF_URL;#var-SRC_URI>`__ 551reference them in :term:`SRC_URI`
552statements. 552statements.
553 553
554For example, you can apply a three-patch series by adding the following 554For example, you can apply a three-patch series by adding the following
@@ -572,7 +572,7 @@ Changing the Configuration
572You can make wholesale or incremental changes to the final ``.config`` 572You can make wholesale or incremental changes to the final ``.config``
573file used for the eventual Linux kernel configuration by including a 573file used for the eventual Linux kernel configuration by including a
574``defconfig`` file and by specifying configuration fragments in the 574``defconfig`` file and by specifying configuration fragments in the
575```SRC_URI`` <&YOCTO_DOCS_REF_URL;#var-SRC_URI>`__ to be applied to that 575:term:`SRC_URI` to be applied to that
576file. 576file.
577 577
578If you have a complete, working Linux kernel ``.config`` file you want 578If you have a complete, working Linux kernel ``.config`` file you want
@@ -583,8 +583,8 @@ following lines to the linux-yocto ``.bbappend`` file in your layer:
583FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI += 583FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI +=
584"file://defconfig" The ``SRC_URI`` tells the build system how to search 584"file://defconfig" The ``SRC_URI`` tells the build system how to search
585for the file, while the 585for the file, while the
586```FILESEXTRAPATHS`` <&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS>`__ 586:term:`FILESEXTRAPATHS`
587extends the ```FILESPATH`` <&YOCTO_DOCS_REF_URL;#var-FILESPATH>`__ 587extends the :term:`FILESPATH`
588variable (search directories) to include the ``${PN}`` directory you 588variable (search directories) to include the ``${PN}`` directory you
589created to hold the configuration changes. 589created to hold the configuration changes.
590 590
@@ -631,7 +631,7 @@ looks for ``defconfig`` files in the layer used for Metadata, which is
631``defconfig`` files in your layer but would rather allow users to use 631``defconfig`` files in your layer but would rather allow users to use
632the default configuration from the kernel tree and still be able to add 632the default configuration from the kernel tree and still be able to add
633configuration fragments to the 633configuration fragments to the
634```SRC_URI`` <&YOCTO_DOCS_REF_URL;#var-SRC_URI>`__ through, for example, 634:term:`SRC_URI` through, for example,
635append files, you can direct the OpenEmbedded build system to use a 635append files, you can direct the OpenEmbedded build system to use a
636``defconfig`` file that is "in-tree". 636``defconfig`` file that is "in-tree".
637 637
@@ -651,7 +651,7 @@ build system detects a statement that identifies an "out-of-tree"
651``KBUILD_DEFCONFIG`` variable. 651``KBUILD_DEFCONFIG`` variable.
652 652
653See the 653See the
654```KBUILD_DEFCONFIG`` <&YOCTO_DOCS_REF_URL;#var-KBUILD_DEFCONFIG>`__ 654:term:`KBUILD_DEFCONFIG`
655variable description for more information. 655variable description for more information.
656 656
657Using ``devtool`` to Patch the Kernel 657Using ``devtool`` to Patch the Kernel
@@ -844,8 +844,8 @@ Section.
844 addition to your ``local.conf`` file specifying to use 844 addition to your ``local.conf`` file specifying to use
845 "kernel-modules" and the "qemux86" machine, it must also point to the 845 "kernel-modules" and the "qemux86" machine, it must also point to the
846 updated kernel source files. Add 846 updated kernel source files. Add
847 ```SRC_URI`` <&YOCTO_DOCS_REF_URL;#var-SRC_URI>`__ and 847 :term:`SRC_URI` and
848 ```SRCREV`` <&YOCTO_DOCS_REF_URL;#var-SRCREV>`__ statements similar 848 :term:`SRCREV` statements similar
849 to the following to your ``local.conf``: $ cd ~/poky/build/conf Add 849 to the following to your ``local.conf``: $ cd ~/poky/build/conf Add
850 the following to the ``local.conf``: SRC_URI_pn-linux-yocto = 850 the following to the ``local.conf``: SRC_URI_pn-linux-yocto =
851 "git:///path-to/linux-yocto-4.12;protocol=file;name=machine;branch=standard/base; 851 "git:///path-to/linux-yocto-4.12;protocol=file;name=machine;branch=standard/base;
@@ -907,8 +907,8 @@ Section.
907 contents: FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" 907 contents: FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
908 SRC_URI_append = " 908 SRC_URI_append = "
909 file://0001-calibrate.c-Added-some-printk-statements.patch" The 909 file://0001-calibrate.c-Added-some-printk-statements.patch" The
910 ```FILESEXTRAPATHS`` <&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS>`__ 910 :term:`FILESEXTRAPATHS`
911 and ```SRC_URI`` <&YOCTO_DOCS_REF_URL;#var-SRC_URI>`__ statements 911 and :term:`SRC_URI` statements
912 enable the OpenEmbedded build system to find the patch file. 912 enable the OpenEmbedded build system to find the patch file.
913 913
914 For more information on append files and patches, see the "`Creating 914 For more information on append files and patches, see the "`Creating
@@ -968,16 +968,16 @@ environment, you must do the following:
968- Because you launch ``menuconfig`` using BitBake, you must be sure to 968- Because you launch ``menuconfig`` using BitBake, you must be sure to
969 set up your environment by running the 969 set up your environment by running the
970 ````` <&YOCTO_DOCS_REF_URL;#structure-core-script>`__ script found in 970 ````` <&YOCTO_DOCS_REF_URL;#structure-core-script>`__ script found in
971 the `Build Directory <&YOCTO_DOCS_REF_URL;#build-directory>`__. 971 the :term:`Build Directory`.
972 972
973- You must be sure of the state of your build's configuration in the 973- You must be sure of the state of your build's configuration in the
974 `Source Directory <&YOCTO_DOCS_REF_URL;#source-directory>`__. 974 :term:`Source Directory`.
975 975
976- Your build host must have the following two packages installed: 976- Your build host must have the following two packages installed:
977 libncurses5-dev libtinfo-dev 977 libncurses5-dev libtinfo-dev
978 978
979The following commands initialize the BitBake environment, run the 979The following commands initialize the BitBake environment, run the
980```do_kernel_configme`` <&YOCTO_DOCS_REF_URL;#ref-tasks-kernel_configme>`__ 980:ref:`ref-tasks-kernel_configme`
981task, and launch ``menuconfig``. These commands assume the Source 981task, and launch ``menuconfig``. These commands assume the Source
982Directory's top-level folder is ``~/poky``: $ cd poky $ source 982Directory's top-level folder is ``~/poky``: $ cd poky $ source
983oe-init-build-env $ bitbake linux-yocto -c kernel_configme -f $ bitbake 983oe-init-build-env $ bitbake linux-yocto -c kernel_configme -f $ bitbake
@@ -1089,17 +1089,17 @@ which the OpenEmbedded build system can draw to create the final
1089 1089
1090To create a ``defconfig``, start with a complete, working Linux kernel 1090To create a ``defconfig``, start with a complete, working Linux kernel
1091``.config`` file. Copy that file to the appropriate 1091``.config`` file. Copy that file to the appropriate
1092``${``\ ```PN`` <&YOCTO_DOCS_REF_URL;#var-PN>`__\ ``}`` directory in 1092``${``\ :term:`PN`\ ``}`` directory in
1093your layer's ``recipes-kernel/linux`` directory, and rename the copied 1093your layer's ``recipes-kernel/linux`` directory, and rename the copied
1094file to "defconfig" (e.g. 1094file to "defconfig" (e.g.
1095``~/meta-mylayer/recipes-kernel/linux/linux-yocto/defconfig``). Then, 1095``~/meta-mylayer/recipes-kernel/linux/linux-yocto/defconfig``). Then,
1096add the following lines to the linux-yocto ``.bbappend`` file in your 1096add the following lines to the linux-yocto ``.bbappend`` file in your
1097layer: FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI += 1097layer: FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI +=
1098"file://defconfig" The 1098"file://defconfig" The
1099```SRC_URI`` <&YOCTO_DOCS_REF_URL;#var-SRC_URI>`__ tells the build 1099:term:`SRC_URI` tells the build
1100system how to search for the file, while the 1100system how to search for the file, while the
1101```FILESEXTRAPATHS`` <&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS>`__ 1101:term:`FILESEXTRAPATHS`
1102extends the ```FILESPATH`` <&YOCTO_DOCS_REF_URL;#var-FILESPATH>`__ 1102extends the :term:`FILESPATH`
1103variable (search directories) to include the ``${PN}`` directory you 1103variable (search directories) to include the ``${PN}`` directory you
1104created to hold the configuration changes. 1104created to hold the configuration changes.
1105 1105
@@ -1179,7 +1179,7 @@ steps:
11793. *Create the Configuration Fragment:* Run the ``diffconfig`` command 11793. *Create the Configuration Fragment:* Run the ``diffconfig`` command
1180 to prepare a configuration fragment. The resulting file 1180 to prepare a configuration fragment. The resulting file
1181 ``fragment.cfg`` is placed in the 1181 ``fragment.cfg`` is placed in the
1182 ``${``\ ```WORKDIR`` <&YOCTO_DOCS_REF_URL;#var-WORKDIR>`__\ ``}`` 1182 ``${``\ :term:`WORKDIR`\ ``}``
1183 directory: $ bitbake linux-yocto -c diffconfig 1183 directory: $ bitbake linux-yocto -c diffconfig
1184 1184
1185The ``diffconfig`` command creates a file that is a list of Linux kernel 1185The ``diffconfig`` command creates a file that is a list of Linux kernel
@@ -1196,7 +1196,7 @@ information on how to use the output as a configuration fragment.
1196 1196
1197Where do you put your configuration fragment files? You can place these 1197Where do you put your configuration fragment files? You can place these
1198files in an area pointed to by 1198files in an area pointed to by
1199```SRC_URI`` <&YOCTO_DOCS_REF_URL;#var-SRC_URI>`__ as directed by your 1199:term:`SRC_URI` as directed by your
1200``bblayers.conf`` file, which is located in your layer. The OpenEmbedded 1200``bblayers.conf`` file, which is located in your layer. The OpenEmbedded
1201build system picks up the configuration and adds it to the kernel's 1201build system picks up the configuration and adds it to the kernel's
1202configuration. For example, suppose you had a set of configuration 1202configuration. For example, suppose you had a set of configuration
@@ -1219,7 +1219,7 @@ Validating Configuration
1219------------------------ 1219------------------------
1220 1220
1221You can use the 1221You can use the
1222```do_kernel_configcheck`` <&YOCTO_DOCS_REF_URL;#ref-tasks-kernel_configcheck>`__ 1222:ref:`ref-tasks-kernel_configcheck`
1223task to provide configuration validation: $ bitbake linux-yocto -c 1223task to provide configuration validation: $ bitbake linux-yocto -c
1224kernel_configcheck -f Running this task produces warnings for when a 1224kernel_configcheck -f Running this task produces warnings for when a
1225requested configuration does not appear in the final ``.config`` file or 1225requested configuration does not appear in the final ``.config`` file or
@@ -1268,9 +1268,9 @@ The output describes the various problems that you can encounter along
1268with where to find the offending configuration items. You can use the 1268with where to find the offending configuration items. You can use the
1269information in the logs to adjust your configuration files and then 1269information in the logs to adjust your configuration files and then
1270repeat the 1270repeat the
1271```do_kernel_configme`` <&YOCTO_DOCS_REF_URL;#ref-tasks-kernel_configme>`__ 1271:ref:`ref-tasks-kernel_configme`
1272and 1272and
1273```do_kernel_configcheck`` <&YOCTO_DOCS_REF_URL;#ref-tasks-kernel_configcheck>`__ 1273:ref:`ref-tasks-kernel_configcheck`
1274tasks until they produce no warnings. 1274tasks until they produce no warnings.
1275 1275
1276For more information on how to use the ``menuconfig`` tool, see the 1276For more information on how to use the ``menuconfig`` tool, see the
@@ -1395,7 +1395,7 @@ If you cannot work with one of the Linux kernel versions supported by
1395existing linux-yocto recipes, you can still make use of the Yocto 1395existing linux-yocto recipes, you can still make use of the Yocto
1396Project Linux kernel tooling by working with your own sources. When you 1396Project Linux kernel tooling by working with your own sources. When you
1397use your own sources, you will not be able to leverage the existing 1397use your own sources, you will not be able to leverage the existing
1398kernel `Metadata <&YOCTO_DOCS_REF_URL;#metadata>`__ and stabilization 1398kernel :term:`Metadata` and stabilization
1399work of the linux-yocto sources. However, you will be able to manage 1399work of the linux-yocto sources. However, you will be able to manage
1400your own Metadata in the same format as the linux-yocto sources. 1400your own Metadata in the same format as the linux-yocto sources.
1401Maintaining format compatibility facilitates converging with linux-yocto 1401Maintaining format compatibility facilitates converging with linux-yocto
@@ -1428,7 +1428,7 @@ Here are some basic steps you can use to work with your own sources:
1428 the following: $ make defconfig After running the command, copy the 1428 the following: $ make defconfig After running the command, copy the
1429 resulting ``.config`` file to the ``files`` directory in your layer 1429 resulting ``.config`` file to the ``files`` directory in your layer
1430 as "defconfig" and then add it to the 1430 as "defconfig" and then add it to the
1431 ```SRC_URI`` <&YOCTO_DOCS_REF_URL;#var-SRC_URI>`__ variable in the 1431 :term:`SRC_URI` variable in the
1432 recipe. 1432 recipe.
1433 1433
1434 Running the ``make defconfig`` command results in the default 1434 Running the ``make defconfig`` command results in the default
@@ -1445,7 +1445,7 @@ Here are some basic steps you can use to work with your own sources:
14454. *Edit the Recipe:* Edit the following variables in your recipe as 14454. *Edit the Recipe:* Edit the following variables in your recipe as
1446 appropriate for your project: 1446 appropriate for your project:
1447 1447
1448 - ```SRC_URI`` <&YOCTO_DOCS_REF_URL;#var-SRC_URI>`__: The 1448 - :term:`SRC_URI`: The
1449 ``SRC_URI`` should specify a Git repository that uses one of the 1449 ``SRC_URI`` should specify a Git repository that uses one of the
1450 supported Git fetcher protocols (i.e. ``file``, ``git``, ``http``, 1450 supported Git fetcher protocols (i.e. ``file``, ``git``, ``http``,
1451 and so forth). The ``SRC_URI`` variable should also specify either 1451 and so forth). The ``SRC_URI`` variable should also specify either
@@ -1453,32 +1453,32 @@ Here are some basic steps you can use to work with your own sources:
1453 skeleton recipe provides an example ``SRC_URI`` as a syntax 1453 skeleton recipe provides an example ``SRC_URI`` as a syntax
1454 reference. 1454 reference.
1455 1455
1456 - ```LINUX_VERSION`` <&YOCTO_DOCS_REF_URL;#var-LINUX_VERSION>`__: 1456 - :term:`LINUX_VERSION`:
1457 The Linux kernel version you are using (e.g. "4.12"). 1457 The Linux kernel version you are using (e.g. "4.12").
1458 1458
1459 - ```LINUX_VERSION_EXTENSION`` <&YOCTO_DOCS_REF_URL;#var-LINUX_VERSION_EXTENSION>`__: 1459 - :term:`LINUX_VERSION_EXTENSION`:
1460 The Linux kernel ``CONFIG_LOCALVERSION`` that is compiled into the 1460 The Linux kernel ``CONFIG_LOCALVERSION`` that is compiled into the
1461 resulting kernel and visible through the ``uname`` command. 1461 resulting kernel and visible through the ``uname`` command.
1462 1462
1463 - ```SRCREV`` <&YOCTO_DOCS_REF_URL;#var-SRCREV>`__: The commit ID 1463 - :term:`SRCREV`: The commit ID
1464 from which you want to build. 1464 from which you want to build.
1465 1465
1466 - ```PR`` <&YOCTO_DOCS_REF_URL;#var-PR>`__: Treat this variable the 1466 - :term:`PR`: Treat this variable the
1467 same as you would in any other recipe. Increment the variable to 1467 same as you would in any other recipe. Increment the variable to
1468 indicate to the OpenEmbedded build system that the recipe has 1468 indicate to the OpenEmbedded build system that the recipe has
1469 changed. 1469 changed.
1470 1470
1471 - ```PV`` <&YOCTO_DOCS_REF_URL;#var-PV>`__: The default ``PV`` 1471 - :term:`PV`: The default ``PV``
1472 assignment is typically adequate. It combines the 1472 assignment is typically adequate. It combines the
1473 ``LINUX_VERSION`` with the Source Control Manager (SCM) revision 1473 ``LINUX_VERSION`` with the Source Control Manager (SCM) revision
1474 as derived from the ```SRCPV`` <&YOCTO_DOCS_REF_URL;#var-SRCPV>`__ 1474 as derived from the :term:`SRCPV`
1475 variable. The combined results are a string with the following 1475 variable. The combined results are a string with the following
1476 form: 1476 form:
1477 3.19.11+git1+68a635bf8dfb64b02263c1ac80c948647cc76d5f_1+218bd8d2022b9852c60d32f0d770931e3cf343e2 1477 3.19.11+git1+68a635bf8dfb64b02263c1ac80c948647cc76d5f_1+218bd8d2022b9852c60d32f0d770931e3cf343e2
1478 While lengthy, the extra verbosity in ``PV`` helps ensure you are 1478 While lengthy, the extra verbosity in ``PV`` helps ensure you are
1479 using the exact sources from which you intend to build. 1479 using the exact sources from which you intend to build.
1480 1480
1481 - ```COMPATIBLE_MACHINE`` <&YOCTO_DOCS_REF_URL;#var-COMPATIBLE_MACHINE>`__: 1481 - :term:`COMPATIBLE_MACHINE`:
1482 A list of the machines supported by your new recipe. This variable 1482 A list of the machines supported by your new recipe. This variable
1483 in the example recipe is set by default to a regular expression 1483 in the example recipe is set by default to a regular expression
1484 that matches only the empty string, "(^$)". This default setting 1484 that matches only the empty string, "(^$)". This default setting
@@ -1546,13 +1546,13 @@ or other files necessary for building the module that do not come with
1546the sources. Finally, update the recipe as needed for the module. 1546the sources. Finally, update the recipe as needed for the module.
1547Typically, you will need to set the following variables: 1547Typically, you will need to set the following variables:
1548 1548
1549- ```DESCRIPTION`` <&YOCTO_DOCS_REF_URL;#var-DESCRIPTION>`__ 1549- :term:`DESCRIPTION`
1550 1550
1551- ```LICENSE*`` <&YOCTO_DOCS_REF_URL;#var-LICENSE>`__ 1551- ```LICENSE*`` <&YOCTO_DOCS_REF_URL;#var-LICENSE>`__
1552 1552
1553- ```SRC_URI`` <&YOCTO_DOCS_REF_URL;#var-SRC_URI>`__ 1553- :term:`SRC_URI`
1554 1554
1555- ```PV`` <&YOCTO_DOCS_REF_URL;#var-PV>`__ 1555- :term:`PV`
1556 1556
1557Depending on the build system used by the module sources, you might need 1557Depending on the build system used by the module sources, you might need
1558to make some adjustments. For example, a typical module ``Makefile`` 1558to make some adjustments. For example, a typical module ``Makefile``
@@ -1561,14 +1561,14 @@ looks much like the one provided with the ``hello-mod`` template: obj-m
1561modules_install: $(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install ... 1561modules_install: $(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install ...
1562 1562
1563The important point to note here is the 1563The important point to note here is the
1564```KERNEL_SRC`` <&YOCTO_DOCS_REF_URL;#var-KERNEL_SRC>`__ variable. The 1564:term:`KERNEL_SRC` variable. The
1565```module`` <&YOCTO_DOCS_REF_URL;#ref-classes-module>`__ class sets this 1565:ref:`module <ref-classes-module>` class sets this
1566variable and the 1566variable and the
1567```KERNEL_PATH`` <&YOCTO_DOCS_REF_URL;#var-KERNEL_PATH>`__ variable to 1567:term:`KERNEL_PATH` variable to
1568``${STAGING_KERNEL_DIR}`` with the necessary Linux kernel build 1568``${STAGING_KERNEL_DIR}`` with the necessary Linux kernel build
1569information to build modules. If your module ``Makefile`` uses a 1569information to build modules. If your module ``Makefile`` uses a
1570different variable, you might want to override the 1570different variable, you might want to override the
1571```do_compile`` <&YOCTO_DOCS_REF_URL;#ref-tasks-compile>`__ step, or 1571:ref:`ref-tasks-compile` step, or
1572create a patch to the ``Makefile`` to work with the more typical 1572create a patch to the ``Makefile`` to work with the more typical
1573``KERNEL_SRC`` or ``KERNEL_PATH`` variables. 1573``KERNEL_SRC`` or ``KERNEL_PATH`` variables.
1574 1574
@@ -1577,13 +1577,13 @@ module in your images. To do this, see the documentation for the
1577following variables in the Yocto Project Reference Manual and set one of 1577following variables in the Yocto Project Reference Manual and set one of
1578them appropriately for your machine configuration file: 1578them appropriately for your machine configuration file:
1579 1579
1580- ```MACHINE_ESSENTIAL_EXTRA_RDEPENDS`` <&YOCTO_DOCS_REF_URL;#var-MACHINE_ESSENTIAL_EXTRA_RDEPENDS>`__ 1580- :term:`MACHINE_ESSENTIAL_EXTRA_RDEPENDS`
1581 1581
1582- ```MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS`` <&YOCTO_DOCS_REF_URL;#var-MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS>`__ 1582- :term:`MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS`
1583 1583
1584- ```MACHINE_EXTRA_RDEPENDS`` <&YOCTO_DOCS_REF_URL;#var-MACHINE_EXTRA_RDEPENDS>`__ 1584- :term:`MACHINE_EXTRA_RDEPENDS`
1585 1585
1586- ```MACHINE_EXTRA_RRECOMMENDS`` <&YOCTO_DOCS_REF_URL;#var-MACHINE_EXTRA_RRECOMMENDS>`__ 1586- :term:`MACHINE_EXTRA_RRECOMMENDS`
1587 1587
1588Modules are often not required for boot and can be excluded from certain 1588Modules are often not required for boot and can be excluded from certain
1589build configurations. The following allows for the most flexibility: 1589build configurations. The following allows for the most flexibility:
@@ -1592,8 +1592,8 @@ derived by appending the module filename without the ``.ko`` extension
1592to the string "kernel-module-". 1592to the string "kernel-module-".
1593 1593
1594Because the variable is 1594Because the variable is
1595```RRECOMMENDS`` <&YOCTO_DOCS_REF_URL;#var-RRECOMMENDS>`__ and not a 1595:term:`RRECOMMENDS` and not a
1596```RDEPENDS`` <&YOCTO_DOCS_REF_URL;#var-RDEPENDS>`__ variable, the build 1596:term:`RDEPENDS` variable, the build
1597will not fail if this module is not available to include in the image. 1597will not fail if this module is not available to include in the image.
1598 1598
1599Inspecting Changes and Commits 1599Inspecting Changes and Commits
@@ -1661,9 +1661,9 @@ Adding Recipe-Space Kernel Features
1661 1661
1662You can add kernel features in the 1662You can add kernel features in the
1663`recipe-space <#recipe-space-metadata>`__ by using the 1663`recipe-space <#recipe-space-metadata>`__ by using the
1664```KERNEL_FEATURES`` <&YOCTO_DOCS_REF_URL;#var-KERNEL_FEATURES>`__ 1664:term:`KERNEL_FEATURES`
1665variable and by specifying the feature's ``.scc`` file path in the 1665variable and by specifying the feature's ``.scc`` file path in the
1666```SRC_URI`` <&YOCTO_DOCS_REF_URL;#var-SRC_URI>`__ statement. When you 1666:term:`SRC_URI` statement. When you
1667add features using this method, the OpenEmbedded build system checks to 1667add features using this method, the OpenEmbedded build system checks to
1668be sure the features are present. If the features are not present, the 1668be sure the features are present. If the features are not present, the
1669build stops. Kernel features are the last elements processed for 1669build stops. Kernel features are the last elements processed for