summaryrefslogtreecommitdiffstats
path: root/documentation
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2020-09-14 16:19:23 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-09-17 10:09:35 +0100
commitcb37a15cf5a150489ceaf55dc6cb014f0e787f6e (patch)
tree2df2f45981d11b46d34ca860a9582365f3efef10 /documentation
parentde89b5a0b6ecb9a5b6a3e5a862cf4cee32dc8a94 (diff)
downloadpoky-cb37a15cf5a150489ceaf55dc6cb014f0e787f6e.tar.gz
sphinx: kernel-dev: Various URL, code block and other fixes to imported data
(From yocto-docs rev: 4888b49ccc5d133b4096e5a9b808f14d1afc7deb) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation')
-rw-r--r--documentation/kernel-dev/kernel-dev-advanced.rst463
-rw-r--r--documentation/kernel-dev/kernel-dev-common.rst1017
-rw-r--r--documentation/kernel-dev/kernel-dev-concepts-appx.rst113
-rw-r--r--documentation/kernel-dev/kernel-dev-faq.rst70
-rw-r--r--documentation/kernel-dev/kernel-dev-intro.rst40
-rw-r--r--documentation/kernel-dev/kernel-dev-maint-appx.rst35
6 files changed, 1182 insertions, 556 deletions
diff --git a/documentation/kernel-dev/kernel-dev-advanced.rst b/documentation/kernel-dev/kernel-dev-advanced.rst
index 6d7f4c91d3..36133caae3 100644
--- a/documentation/kernel-dev/kernel-dev-advanced.rst
+++ b/documentation/kernel-dev/kernel-dev-advanced.rst
@@ -17,9 +17,9 @@ the Metadata and the tools that manage it is to help you manage the
17complexity of the configuration and sources used to support multiple 17complexity of the configuration and sources used to support multiple
18BSPs and Linux kernel types. 18BSPs and Linux kernel types.
19 19
20Kernel Metadata exists in many places. One area in the Yocto Project 20Kernel Metadata exists in many places. One area in the
21`Source Repositories <&YOCTO_DOCS_OM_URL;#source-repositories>`__ is the 21:ref:`overview-manual/overview-manual-development-environment:yocto project source repositories`
22``yocto-kernel-cache`` Git repository. You can find this repository 22is the ``yocto-kernel-cache`` Git repository. You can find this repository
23grouped under the "Yocto Linux Kernel" heading in the 23grouped under the "Yocto Linux Kernel" heading in the
24:yocto_git:`Yocto Project Source Repositories <>`. 24:yocto_git:`Yocto Project Source Repositories <>`.
25 25
@@ -79,10 +79,14 @@ to indicate the branch.
79 :: 79 ::
80 80
81 KBRANCH_edgerouter = "standard/edgerouter" 81 KBRANCH_edgerouter = "standard/edgerouter"
82 82
83 83
84The linux-yocto style recipes can optionally define the following 84The linux-yocto style recipes can optionally define the following
85variables: KERNEL_FEATURES LINUX_KERNEL_TYPE 85variables:
86
87 - :term:`KERNEL_FEATURES`
88
89 - :term:`LINUX_KERNEL_TYPE`
86 90
87:term:`LINUX_KERNEL_TYPE` 91:term:`LINUX_KERNEL_TYPE`
88defines the kernel type to be used in assembling the configuration. If 92defines the kernel type to be used in assembling the configuration. If
@@ -111,9 +115,18 @@ variable to include features (configuration fragments, patches, or both)
111that are not already included by the ``KMACHINE`` and 115that are not already included by the ``KMACHINE`` and
112``LINUX_KERNEL_TYPE`` variable combination. For example, to include a 116``LINUX_KERNEL_TYPE`` variable combination. For example, to include a
113feature specified as "features/netfilter/netfilter.scc", specify: 117feature specified as "features/netfilter/netfilter.scc", specify:
114KERNEL_FEATURES += "features/netfilter/netfilter.scc" To include a 118::
119
120 KERNEL_FEATURES += "features/netfilter/netfilter.scc"
121
122To include a
115feature called "cfg/sound.scc" just for the ``qemux86`` machine, 123feature called "cfg/sound.scc" just for the ``qemux86`` machine,
116specify: KERNEL_FEATURES_append_qemux86 = " cfg/sound.scc" The value of 124specify:
125::
126
127 KERNEL_FEATURES_append_qemux86 = " cfg/sound.scc"
128
129The value of
117the entries in ``KERNEL_FEATURES`` are dependent on their location 130the entries in ``KERNEL_FEATURES`` are dependent on their location
118within the kernel Metadata itself. The examples here are taken from the 131within the kernel Metadata itself. The examples here are taken from the
119``yocto-kernel-cache`` repository. Each branch of this repository 132``yocto-kernel-cache`` repository. Each branch of this repository
@@ -125,7 +138,7 @@ Kernel Metadata Syntax
125====================== 138======================
126 139
127The kernel Metadata consists of three primary types of files: ``scc`` 140The kernel Metadata consists of three primary types of files: ``scc``
128 [1]_ description files, configuration fragments, and patches. The 141[1]_ description files, configuration fragments, and patches. The
129``scc`` files define variables and include or otherwise reference any of 142``scc`` files define variables and include or otherwise reference any of
130the three file types. The description files are used to aggregate all 143the three file types. The description files are used to aggregate all
131types of kernel Metadata into what ultimately describes the sources and 144types of kernel Metadata into what ultimately describes the sources and
@@ -152,8 +165,15 @@ types to form the final description of what will be assembled and built.
152While the kernel Metadata syntax does not enforce any logical separation 165While the kernel Metadata syntax does not enforce any logical separation
153of configuration fragments, patches, features or kernel types, best 166of configuration fragments, patches, features or kernel types, best
154practices dictate a logical separation of these types of Metadata. The 167practices dictate a logical separation of these types of Metadata. The
155following Metadata file hierarchy is recommended: base/ bsp/ cfg/ 168following Metadata file hierarchy is recommended:
156features/ ktypes/ patches/ 169::
170
171 base/
172 bsp/
173 cfg/
174 features/
175 ktypes/
176 patches/
157 177
158The ``bsp`` directory contains the `BSP 178The ``bsp`` directory contains the `BSP
159descriptions <#bsp-descriptions>`__. The remaining directories all 179descriptions <#bsp-descriptions>`__. The remaining directories all
@@ -192,6 +212,11 @@ or the top level of
192if you are creating `Metadata outside of the 212if you are creating `Metadata outside of the
193recipe-space <#metadata-outside-the-recipe-space>`__. 213recipe-space <#metadata-outside-the-recipe-space>`__.
194 214
215.. [1]
216 ``scc`` stands for Series Configuration Control, but the naming has
217 less significance in the current implementation of the tooling than
218 it had in the past. Consider ``scc`` files to be description files.
219
195Configuration 220Configuration
196------------- 221-------------
197 222
@@ -205,15 +230,27 @@ used with the ``linux-yocto-4.12`` kernel as defined outside of the
205recipe space (i.e. ``yocto-kernel-cache``). This Metadata consists of 230recipe space (i.e. ``yocto-kernel-cache``). This Metadata consists of
206two files: ``smp.scc`` and ``smp.cfg``. You can find these files in the 231two files: ``smp.scc`` and ``smp.cfg``. You can find these files in the
207``cfg`` directory of the ``yocto-4.12`` branch in the 232``cfg`` directory of the ``yocto-4.12`` branch in the
208``yocto-kernel-cache`` Git repository: cfg/smp.scc: define 233``yocto-kernel-cache`` Git repository:
209KFEATURE_DESCRIPTION "Enable SMP for 32 bit builds" define 234::
210KFEATURE_COMPATIBILITY all kconf hardware smp.cfg cfg/smp.cfg: 235
211CONFIG_SMP=y CONFIG_SCHED_SMT=y # Increase default NR_CPUS from 8 to 64 236 cfg/smp.scc:
212so that platform with # more than 8 processors can be all activated at 237 define KFEATURE_DESCRIPTION "Enable SMP for 32 bit builds"
213boot time CONFIG_NR_CPUS=64 # The following is needed when setting 238 define KFEATURE_COMPATIBILITY all
214NR_CPUS to something # greater than 8 on x86 architectures, it should be 239
215automatically # disregarded by Kconfig when using a different arch 240 kconf hardware smp.cfg
216CONFIG_X86_BIGSMP=y You can find general information on configuration 241
242 cfg/smp.cfg:
243 CONFIG_SMP=y
244 CONFIG_SCHED_SMT=y
245 # Increase default NR_CPUS from 8 to 64 so that platform with
246 # more than 8 processors can be all activated at boot time
247 CONFIG_NR_CPUS=64
248 # The following is needed when setting NR_CPUS to something
249 # greater than 8 on x86 architectures, it should be automatically
250 # disregarded by Kconfig when using a different arch
251 CONFIG_X86_BIGSMP=y
252
253You can find general information on configuration
217fragment files in the "`Creating Configuration 254fragment files in the "`Creating Configuration
218Fragments <#creating-config-fragments>`__" section. 255Fragments <#creating-config-fragments>`__" section.
219 256
@@ -238,8 +275,10 @@ non-hardware fragment.
238 275
239As described in the "`Validating 276As described in the "`Validating
240Configuration <#validating-configuration>`__" section, you can use the 277Configuration <#validating-configuration>`__" section, you can use the
241following BitBake command to audit your configuration: $ bitbake 278following BitBake command to audit your configuration:
242linux-yocto -c kernel_configcheck -f 279::
280
281 $ bitbake linux-yocto -c kernel_configcheck -f
243 282
244Patches 283Patches
245------- 284-------
@@ -258,20 +297,38 @@ in the ``patches/build`` directory of the ``yocto-4.12`` branch in the
258``yocto-kernel-cache`` Git repository. 297``yocto-kernel-cache`` Git repository.
259 298
260The following listings show the ``build.scc`` file and part of the 299The following listings show the ``build.scc`` file and part of the
261``modpost-mask-trivial-warnings.patch`` file: patches/build/build.scc: 300``modpost-mask-trivial-warnings.patch`` file:
262patch arm-serialize-build-targets.patch patch 301::
263powerpc-serialize-image-targets.patch patch 302
264kbuild-exclude-meta-directory-from-distclean-processi.patch # applied by 303 patches/build/build.scc:
265kgit # patch kbuild-add-meta-files-to-the-ignore-li.patch patch 304 patch arm-serialize-build-targets.patch
266modpost-mask-trivial-warnings.patch patch 305 patch powerpc-serialize-image-targets.patch
267menuconfig-check-lxdiaglog.sh-Allow-specification-of.patch 306 patch kbuild-exclude-meta-directory-from-distclean-processi.patch
268patches/build/modpost-mask-trivial-warnings.patch: From 307
269bd48931bc142bdd104668f3a062a1f22600aae61 Mon Sep 17 00:00:00 2001 From: 308 # applied by kgit
270Paul Gortmaker <paul.gortmaker@windriver.com> Date: Sun, 25 Jan 2009 309 # patch kbuild-add-meta-files-to-the-ignore-li.patch
27117:58:09 -0500 Subject: [PATCH] modpost: mask trivial warnings Newer 310
272HOSTCC will complain about various stdio fcns because . . . char 311 patch modpost-mask-trivial-warnings.patch
273\*dump_write = NULL, \*files_source = NULL; int opt; -- 2.10.1 generated 312 patch menuconfig-check-lxdiaglog.sh-Allow-specification-of.patch
274by cgit v0.10.2 at 2017-09-28 15:23:23 (GMT) The description file can 313
314 patches/build/modpost-mask-trivial-warnings.patch:
315 From bd48931bc142bdd104668f3a062a1f22600aae61 Mon Sep 17 00:00:00 2001
316 From: Paul Gortmaker <paul.gortmaker@windriver.com>
317 Date: Sun, 25 Jan 2009 17:58:09 -0500
318 Subject: [PATCH] modpost: mask trivial warnings
319
320 Newer HOSTCC will complain about various stdio fcns because
321 .
322 .
323 .
324 char *dump_write = NULL, *files_source = NULL;
325 int opt;
326 --
327 2.10.1
328
329 generated by cgit v0.10.2 at 2017-09-28 15:23:23 (GMT)
330
331The description file can
275include multiple patch statements where each statement handles a single 332include multiple patch statements where each statement handles a single
276patch. In the example ``build.scc`` file, five patch statements exist 333patch. In the example ``build.scc`` file, five patch statements exist
277for the five patches in the directory. 334for the five patches in the directory.
@@ -289,11 +346,19 @@ Features
289 346
290Features are complex kernel Metadata types that consist of configuration 347Features are complex kernel Metadata types that consist of configuration
291fragments, patches, and possibly other feature description files. As an 348fragments, patches, and possibly other feature description files. As an
292example, consider the following generic listing: features/myfeature.scc 349example, consider the following generic listing:
293define KFEATURE_DESCRIPTION "Enable myfeature" patch 350::
2940001-myfeature-core.patch patch 0002-myfeature-interface.patch include 351
295cfg/myfeature_dependency.scc kconf non-hardware myfeature.cfg This 352 features/myfeature.scc
296example shows how the ``patch`` and ``kconf`` commands are used as well 353 define KFEATURE_DESCRIPTION "Enable myfeature"
354
355 patch 0001-myfeature-core.patch
356 patch 0002-myfeature-interface.patch
357
358 include cfg/myfeature_dependency.scc
359 kconf non-hardware myfeature.cfg
360
361This example shows how the ``patch`` and ``kconf`` commands are used as well
297as how an additional feature description file is included with the 362as how an additional feature description file is included with the
298``include`` command. 363``include`` command.
299 364
@@ -319,11 +384,16 @@ the ``linux-yocto_4.12.bb`` kernel recipe found in
319:ref:`require <bitbake:require-inclusion>` directive 384:ref:`require <bitbake:require-inclusion>` directive
320includes the ``poky/meta/recipes-kernel/linux/linux-yocto.inc`` file, 385includes the ``poky/meta/recipes-kernel/linux/linux-yocto.inc`` file,
321which has the following statement that defines the default kernel type: 386which has the following statement that defines the default kernel type:
322LINUX_KERNEL_TYPE ??= "standard" 387::
388
389 LINUX_KERNEL_TYPE ??= "standard"
323 390
324Another example would be the real-time kernel (i.e. 391Another example would be the real-time kernel (i.e.
325``linux-yocto-rt_4.12.bb``). This kernel recipe directly sets the kernel 392``linux-yocto-rt_4.12.bb``). This kernel recipe directly sets the kernel
326type as follows: LINUX_KERNEL_TYPE = "preempt-rt" 393type as follows:
394::
395
396 LINUX_KERNEL_TYPE = "preempt-rt"
327 397
328.. note:: 398.. note::
329 399
@@ -358,16 +428,36 @@ for Linux Yocto kernels:
358For any given kernel type, the Metadata is defined by the ``.scc`` (e.g. 428For any given kernel type, the Metadata is defined by the ``.scc`` (e.g.
359``standard.scc``). Here is a partial listing for the ``standard.scc`` 429``standard.scc``). Here is a partial listing for the ``standard.scc``
360file, which is found in the ``ktypes/standard`` directory of the 430file, which is found in the ``ktypes/standard`` directory of the
361``yocto-kernel-cache`` Git repository: # Include this kernel type 431``yocto-kernel-cache`` Git repository:
362fragment to get the standard features and # configuration values. # 432::
363Note: if only the features are desired, but not the configuration # then 433
364this should be included as: # include ktypes/standard/standard.scc nocfg 434 # Include this kernel type fragment to get the standard features and
365# if no chained configuration is desired, include it as: # include 435 # configuration values.
366ktypes/standard/standard.scc nocfg inherit include ktypes/base/base.scc 436
367branch standard kconf non-hardware standard.cfg include 437 # Note: if only the features are desired, but not the configuration
368features/kgdb/kgdb.scc . . . include cfg/net/ip6_nf.scc include 438 # then this should be included as:
369cfg/net/bridge.scc include cfg/systemd.scc include 439 # include ktypes/standard/standard.scc nocfg
370features/rfkill/rfkill.scc 440 # if no chained configuration is desired, include it as:
441 # include ktypes/standard/standard.scc nocfg inherit
442
443
444
445 include ktypes/base/base.scc
446 branch standard
447
448 kconf non-hardware standard.cfg
449
450 include features/kgdb/kgdb.scc
451 .
452 .
453 .
454
455 include cfg/net/ip6_nf.scc
456 include cfg/net/bridge.scc
457
458 include cfg/systemd.scc
459
460 include features/rfkill/rfkill.scc
371 461
372As with any ``.scc`` file, a kernel type definition can aggregate other 462As with any ``.scc`` file, a kernel type definition can aggregate other
373``.scc`` files with ``include`` commands. These definitions can also 463``.scc`` files with ``include`` commands. These definitions can also
@@ -409,29 +499,49 @@ supported kernel type.
409This section overviews the BSP description structure, the aggregation 499This section overviews the BSP description structure, the aggregation
410concepts, and presents a detailed example using a BSP supported by the 500concepts, and presents a detailed example using a BSP supported by the
411Yocto Project (i.e. BeagleBone Board). For complete information on BSP 501Yocto Project (i.e. BeagleBone Board). For complete information on BSP
412layer file hierarchy, see the `Yocto Project Board Support Package (BSP) 502layer file hierarchy, see the :doc:`../bsp-guide/bsp-guide`.
413Developer's Guide <&YOCTO_DOCS_BSP_URL;>`__.
414 503
415.. _bsp-description-file-overview: 504.. _bsp-description-file-overview:
416 505
417Overview 506Description Overview
418~~~~~~~~ 507~~~~~~~~~~~~~~~~~~~~
419 508
420For simplicity, consider the following root BSP layer description files 509For simplicity, consider the following root BSP layer description files
421for the BeagleBone board. These files employ both a structure and naming 510for the BeagleBone board. These files employ both a structure and naming
422convention for consistency. The naming convention for the file is as 511convention for consistency. The naming convention for the file is as
423follows: bsp_root_name-kernel_type.scc Here are some example root layer 512follows:
513::
514
515 bsp_root_name-kernel_type.scc
516
517Here are some example root layer
424BSP filenames for the BeagleBone Board BSP, which is supported by the 518BSP filenames for the BeagleBone Board BSP, which is supported by the
425Yocto Project: beaglebone-standard.scc beaglebone-preempt-rt.scc Each 519Yocto Project:
426file uses the root name (i.e "beaglebone") BSP name followed by the 520::
521
522 beaglebone-standard.scc
523 beaglebone-preempt-rt.scc
524
525Each file uses the root name (i.e "beaglebone") BSP name followed by the
427kernel type. 526kernel type.
428 527
429Examine the ``beaglebone-standard.scc`` file: define KMACHINE beaglebone 528Examine the ``beaglebone-standard.scc`` file:
430define KTYPE standard define KARCH arm include 529::
431ktypes/standard/standard.scc branch beaglebone include beaglebone.scc # 530
432default policy for standard kernels include 531 define KMACHINE beaglebone
433features/latencytop/latencytop.scc include 532 define KTYPE standard
434features/profiling/profiling.scc Every top-level BSP description file 533 define KARCH arm
534
535 include ktypes/standard/standard.scc
536 branch beaglebone
537
538 include beaglebone.scc
539
540 # default policy for standard kernels
541 include features/latencytop/latencytop.scc
542 include features/profiling/profiling.scc
543
544Every top-level BSP description file
435should define the :term:`KMACHINE`, 545should define the :term:`KMACHINE`,
436:term:`KTYPE`, and 546:term:`KTYPE`, and
437:term:`KARCH` variables. These 547:term:`KARCH` variables. These
@@ -450,27 +560,52 @@ description file match.
450 560
451To separate your kernel policy from your hardware configuration, you 561To separate your kernel policy from your hardware configuration, you
452include a kernel type (``ktype``), such as "standard". In the previous 562include a kernel type (``ktype``), such as "standard". In the previous
453example, this is done using the following: include 563example, this is done using the following:
454ktypes/standard/standard.scc This file aggregates all the configuration 564::
565
566 include ktypes/standard/standard.scc
567
568This file aggregates all the configuration
455fragments, patches, and features that make up your standard kernel 569fragments, patches, and features that make up your standard kernel
456policy. See the "`Kernel Types <#kernel-types>`__" section for more 570policy. See the "`Kernel Types <#kernel-types>`__" section for more
457information. 571information.
458 572
459To aggregate common configurations and features specific to the kernel 573To aggregate common configurations and features specific to the kernel
460for mybsp, use the following: include mybsp.scc You can see that in the 574for mybsp, use the following:
461BeagleBone example with the following: include beaglebone.scc For 575::
462information on how to break a complete ``.config`` file into the various 576
577 include mybsp.scc
578
579You can see that in the BeagleBone example with the following:
580::
581
582 include beaglebone.scc
583
584For information on how to break a complete ``.config`` file into the various
463configuration fragments, see the "`Creating Configuration 585configuration fragments, see the "`Creating Configuration
464Fragments <#creating-config-fragments>`__" section. 586Fragments <#creating-config-fragments>`__" section.
465 587
466Finally, if you have any configurations specific to the hardware that 588Finally, if you have any configurations specific to the hardware that
467are not in a ``*.scc`` file, you can include them as follows: kconf 589are not in a ``*.scc`` file, you can include them as follows:
468hardware mybsp-extra.cfg The BeagleBone example does not include these 590::
591
592 kconf hardware mybsp-extra.cfg
593
594The BeagleBone example does not include these
469types of configurations. However, the Malta 32-bit board does 595types of configurations. However, the Malta 32-bit board does
470("mti-malta32"). Here is the ``mti-malta32-le-standard.scc`` file: 596("mti-malta32"). Here is the ``mti-malta32-le-standard.scc`` file:
471define KMACHINE mti-malta32-le define KMACHINE qemumipsel define KTYPE 597::
472standard define KARCH mips include ktypes/standard/standard.scc branch 598
473mti-malta32 include mti-malta32.scc kconf hardware mti-malta32-le.cfg 599 define KMACHINE mti-malta32-le
600 define KMACHINE qemumipsel
601 define KTYPE standard
602 define KARCH mips
603
604 include ktypes/standard/standard.scc
605 branch mti-malta32
606
607 include mti-malta32.scc
608 kconf hardware mti-malta32-le.cfg
474 609
475.. _bsp-description-file-example-minnow: 610.. _bsp-description-file-example-minnow:
476 611
@@ -488,15 +623,28 @@ definition given the ``linux-yocto-4.4`` branch of the
488 Although the Minnow Board BSP is unused, the Metadata remains and is 623 Although the Minnow Board BSP is unused, the Metadata remains and is
489 being used here just as an example. 624 being used here just as an example.
490 625
491include cfg/x86.scc include features/eg20t/eg20t.scc include 626::
492cfg/dmaengine.scc include features/power/intel.scc include cfg/efi.scc 627
493include features/usb/ehci-hcd.scc include features/usb/ohci-hcd.scc 628 include cfg/x86.scc
494include features/usb/usb-gadgets.scc include 629 include features/eg20t/eg20t.scc
495features/usb/touchscreen-composite.scc include cfg/timer/hpet.scc 630 include cfg/dmaengine.scc
496include features/leds/leds.scc include features/spi/spidev.scc include 631 include features/power/intel.scc
497features/i2c/i2cdev.scc include features/mei/mei-txe.scc # Earlyprintk 632 include cfg/efi.scc
498and port debug requires 8250 kconf hardware cfg/8250.cfg kconf hardware 633 include features/usb/ehci-hcd.scc
499minnow.cfg kconf hardware minnow-dev.cfg 634 include features/usb/ohci-hcd.scc
635 include features/usb/usb-gadgets.scc
636 include features/usb/touchscreen-composite.scc
637 include cfg/timer/hpet.scc
638 include features/leds/leds.scc
639 include features/spi/spidev.scc
640 include features/i2c/i2cdev.scc
641 include features/mei/mei-txe.scc
642
643 # Earlyprintk and port debug requires 8250
644 kconf hardware cfg/8250.cfg
645
646 kconf hardware minnow.cfg
647 kconf hardware minnow-dev.cfg
500 648
501The ``minnow.scc`` description file includes a hardware configuration 649The ``minnow.scc`` description file includes a hardware configuration
502fragment (``minnow.cfg``) specific to the Minnow BSP as well as several 650fragment (``minnow.cfg``) specific to the Minnow BSP as well as several
@@ -505,23 +653,51 @@ found on the machine. This ``minnow.scc`` description file is then
505included in each of the three "minnow" description files for the 653included in each of the three "minnow" description files for the
506supported kernel types (i.e. "standard", "preempt-rt", and "tiny"). 654supported kernel types (i.e. "standard", "preempt-rt", and "tiny").
507Consider the "minnow" description for the "standard" kernel type (i.e. 655Consider the "minnow" description for the "standard" kernel type (i.e.
508``minnow-standard.scc``: define KMACHINE minnow define KTYPE standard 656``minnow-standard.scc``:
509define KARCH i386 include ktypes/standard include minnow.scc # Extra 657::
510minnow configs above the minimal defined in minnow.scc include 658
511cfg/efi-ext.scc include features/media/media-all.scc include 659 define KMACHINE minnow
512features/sound/snd_hda_intel.scc # The following should really be in 660 define KTYPE standard
513standard.scc # USB live-image support include cfg/usb-mass-storage.scc 661 define KARCH i386
514include cfg/boot-live.scc # Basic profiling include 662
515features/latencytop/latencytop.scc include 663 include ktypes/standard
516features/profiling/profiling.scc # Requested drivers that don't have an 664
517existing scc kconf hardware minnow-drivers-extra.cfg The ``include`` 665 include minnow.scc
518command midway through the file includes the ``minnow.scc`` description 666
667 # Extra minnow configs above the minimal defined in minnow.scc
668 include cfg/efi-ext.scc
669 include features/media/media-all.scc
670 include features/sound/snd_hda_intel.scc
671
672 # The following should really be in standard.scc
673 # USB live-image support
674 include cfg/usb-mass-storage.scc
675 include cfg/boot-live.scc
676
677 # Basic profiling
678 include features/latencytop/latencytop.scc
679 include features/profiling/profiling.scc
680
681 # Requested drivers that don't have an existing scc
682 kconf hardware minnow-drivers-extra.cfg
683
684The ``include`` command midway through the file includes the ``minnow.scc`` description
519that defines all enabled hardware for the BSP that is common to all 685that defines all enabled hardware for the BSP that is common to all
520kernel types. Using this command significantly reduces duplication. 686kernel types. Using this command significantly reduces duplication.
521 687
522Now consider the "minnow" description for the "tiny" kernel type (i.e. 688Now consider the "minnow" description for the "tiny" kernel type (i.e.
523``minnow-tiny.scc``): define KMACHINE minnow define KTYPE tiny define 689``minnow-tiny.scc``):
524KARCH i386 include ktypes/tiny include minnow.scc As you might expect, 690::
691
692 define KMACHINE minnow
693 define KTYPE tiny
694 define KARCH i386
695
696 include ktypes/tiny
697
698 include minnow.scc
699
700As you might expect,
525the "tiny" description includes quite a bit less. In fact, it includes 701the "tiny" description includes quite a bit less. In fact, it includes
526only the minimal policy defined by the "tiny" kernel type and the 702only the minimal policy defined by the "tiny" kernel type and the
527hardware-specific configuration required for booting the machine along 703hardware-specific configuration required for booting the machine along
@@ -574,9 +750,16 @@ See the "`Modifying an Existing
574Recipe <#modifying-an-existing-recipe>`__" section for more information. 750Recipe <#modifying-an-existing-recipe>`__" section for more information.
575 751
576Here is an example that shows a trivial tree of kernel Metadata stored 752Here is an example that shows a trivial tree of kernel Metadata stored
577in recipe-space within a BSP layer: meta-my_bsp_layer/ \`-- 753in recipe-space within a BSP layer:
578recipes-kernel \`-- linux \`-- linux-yocto \|-- bsp-standard.scc \|-- 754::
579bsp.cfg \`-- standard.cfg 755
756 meta-my_bsp_layer/
757 `-- recipes-kernel
758 `-- linux
759 `-- linux-yocto
760 |-- bsp-standard.scc
761 |-- bsp.cfg
762 `-- standard.cfg
580 763
581When the Metadata is stored in recipe-space, you must take steps to 764When the Metadata is stored in recipe-space, you must take steps to
582ensure BitBake has the necessary information to decide what files to 765ensure BitBake has the necessary information to decide what files to
@@ -591,8 +774,12 @@ value when changing the content of files not explicitly listed in the
591 774
592If the BSP description is in recipe space, you cannot simply list the 775If the BSP description is in recipe space, you cannot simply list the
593``*.scc`` in the ``SRC_URI`` statement. You need to use the following 776``*.scc`` in the ``SRC_URI`` statement. You need to use the following
594form from your kernel append file: SRC_URI_append_myplatform = " \\ 777form from your kernel append file:
595file://myplatform;type=kmeta;destsuffix=myplatform \\ " 778::
779
780 SRC_URI_append_myplatform = " \
781 file://myplatform;type=kmeta;destsuffix=myplatform \
782 "
596 783
597Metadata Outside the Recipe-Space 784Metadata Outside the Recipe-Space
598--------------------------------- 785---------------------------------
@@ -602,10 +789,13 @@ reside in a separate repository. The OpenEmbedded build system adds the
602Metadata to the build as a "type=kmeta" repository through the 789Metadata to the build as a "type=kmeta" repository through the
603:term:`SRC_URI` variable. As an 790:term:`SRC_URI` variable. As an
604example, consider the following ``SRC_URI`` statement from the 791example, consider the following ``SRC_URI`` statement from the
605``linux-yocto_4.12.bb`` kernel recipe: SRC_URI = 792``linux-yocto_4.12.bb`` kernel recipe:
606"git://git.yoctoproject.org/linux-yocto-4.12.git;name=machine;branch=${KBRANCH}; 793::
607\\ 794
608git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.12;destsuffix=${KMETA}" 795 SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.12.git;name=machine;branch=${KBRANCH}; \
796 git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.12;destsuffix=${KMETA}"
797
798
609``${KMETA}``, in this context, is simply used to name the directory into 799``${KMETA}``, in this context, is simply used to name the directory into
610which the Git fetcher places the Metadata. This behavior is no different 800which the Git fetcher places the Metadata. This behavior is no different
611than any multi-repository ``SRC_URI`` statement used in a recipe (e.g. 801than any multi-repository ``SRC_URI`` statement used in a recipe (e.g.
@@ -684,21 +874,43 @@ patches into a feature.
684 874
685Once you have a new branch, you can set up your kernel Metadata to use 875Once you have a new branch, you can set up your kernel Metadata to use
686the branch a couple different ways. In the recipe, you can specify the 876the branch a couple different ways. In the recipe, you can specify the
687new branch as the ``KBRANCH`` to use for the board as follows: KBRANCH = 877new branch as the ``KBRANCH`` to use for the board as follows:
688"mynewbranch" Another method is to use the ``branch`` command in the BSP 878::
689description: mybsp.scc: define KMACHINE mybsp define KTYPE standard 879
690define KARCH i386 include standard.scc branch mynewbranch include 880 KBRANCH = "mynewbranch"
691mybsp-hw.scc 881
882Another method is to use the ``branch`` command in the BSP
883description:
884
885 mybsp.scc:
886 define KMACHINE mybsp
887 define KTYPE standard
888 define KARCH i386
889 include standard.scc
890
891 branch mynewbranch
892
893 include mybsp-hw.scc
692 894
693If you find yourself with numerous branches, you might consider using a 895If you find yourself with numerous branches, you might consider using a
694hierarchical branching system similar to what the Yocto Linux Kernel Git 896hierarchical branching system similar to what the Yocto Linux Kernel Git
695repositories use: common/kernel_type/machine 897repositories use:
898::
899
900 common/kernel_type/machine
696 901
697If you had two kernel types, "standard" and "small" for instance, three 902If you had two kernel types, "standard" and "small" for instance, three
698machines, and common as ``mydir``, the branches in your Git repository 903machines, and common as ``mydir``, the branches in your Git repository
699might look like this: mydir/base mydir/standard/base 904might look like this:
700mydir/standard/machine_a mydir/standard/machine_b 905:
701mydir/standard/machine_c mydir/small/base mydir/small/machine_a 906
907 mydir/base
908 mydir/standard/base
909 mydir/standard/machine_a
910 mydir/standard/machine_b
911 mydir/standard/machine_c
912 mydir/small/base
913 mydir/small/machine_a
702 914
703This organization can help clarify the branch relationships. In this 915This organization can help clarify the branch relationships. In this
704case, ``mydir/standard/machine_a`` includes everything in ``mydir/base`` 916case, ``mydir/standard/machine_a`` includes everything in ``mydir/base``
@@ -725,9 +937,19 @@ that have to be regularly updated. The Yocto Project Linux kernel tools
725provide for this with the ``git merge`` command. 937provide for this with the ``git merge`` command.
726 938
727To merge a feature branch into a BSP, insert the ``git merge`` command 939To merge a feature branch into a BSP, insert the ``git merge`` command
728after any ``branch`` commands: mybsp.scc: define KMACHINE mybsp define 940after any ``branch`` commands:
729KTYPE standard define KARCH i386 include standard.scc branch mynewbranch 941::
730git merge myfeature include mybsp-hw.scc 942
943 mybsp.scc:
944 define KMACHINE mybsp
945 define KTYPE standard
946 define KARCH i386
947 include standard.scc
948
949 branch mynewbranch
950 git merge myfeature
951
952 include mybsp-hw.scc
731 953
732.. _scc-reference: 954.. _scc-reference:
733 955
@@ -758,7 +980,4 @@ within an SCC description file (``.scc``):
758 980
759- ``patch PATCH_FILE``: Applies the patch to the current Git branch. 981- ``patch PATCH_FILE``: Applies the patch to the current Git branch.
760 982
761.. [1] 983
762 ``scc`` stands for Series Configuration Control, but the naming has
763 less significance in the current implementation of the tooling than
764 it had in the past. Consider ``scc`` files to be description files.
diff --git a/documentation/kernel-dev/kernel-dev-common.rst b/documentation/kernel-dev/kernel-dev-common.rst
index ef3a9f710a..d4b60a9dc9 100644
--- a/documentation/kernel-dev/kernel-dev-common.rst
+++ b/documentation/kernel-dev/kernel-dev-common.rst
@@ -21,13 +21,11 @@ Preparing the Build Host to Work on the Kernel
21 21
22Before you can do any kernel development, you need to be sure your build 22Before you can do any kernel development, you need to be sure your build
23host is set up to use the Yocto Project. For information on how to get 23host is set up to use the Yocto Project. For information on how to get
24set up, see the "`Preparing the Build 24set up, see the ":doc:`../dev-manual/dev-manual-start`" section in
25Host <&YOCTO_DOCS_DEV_URL;#dev-preparing-the-build-host>`__" section in
26the Yocto Project Development Tasks Manual. Part of preparing the system 25the Yocto Project Development Tasks Manual. Part of preparing the system
27is creating a local Git repository of the 26is creating a local Git repository of the
28:term:`Source Directory` (``poky``) on your 27:term:`Source Directory` (``poky``) on your system. Follow the steps in the
29system. Follow the steps in the "`Cloning the ``poky`` 28":ref:`dev-manual/dev-manual-start:cloning the \`\`poky\`\` repository`"
30Repository <&YOCTO_DOCS_DEV_URL;#cloning-the-poky-repository>`__"
31section in the Yocto Project Development Tasks Manual to set up your 29section in the Yocto Project Development Tasks Manual to set up your
32Source Directory. 30Source Directory.
33 31
@@ -43,7 +41,7 @@ Source Directory.
43 information. 41 information.
44 42
45Kernel development is best accomplished using 43Kernel development is best accomplished using
46```devtool`` <&YOCTO_DOCS_SDK_URL;#using-devtool-in-your-sdk-workflow>`__ 44:ref:`devtool <sdk-manual/sdk-extensible:using \`\`devtool\`\` in your sdk workflow>`
47and not through traditional kernel workflow methods. The remainder of 45and not through traditional kernel workflow methods. The remainder of
48this section provides information for both scenarios. 46this section provides information for both scenarios.
49 47
@@ -52,15 +50,17 @@ Getting Ready to Develop Using ``devtool``
52 50
53Follow these steps to prepare to update the kernel image using 51Follow these steps to prepare to update the kernel image using
54``devtool``. Completing this procedure leaves you with a clean kernel 52``devtool``. Completing this procedure leaves you with a clean kernel
55image and ready to make modifications as described in the "`Using 53image and ready to make modifications as described in the "
56``devtool`` to Patch the Kernel <#using-devtool-to-patch-the-kernel>`__" 54:ref:`kernel-dev/kernel-dev-common:using \`\`devtool\`\` to patch the kernel`"
57section: 55section:
58 56
591. *Initialize the BitBake Environment:* Before building an extensible 571. *Initialize the BitBake Environment:* Before building an extensible
60 SDK, you need to initialize the BitBake build environment by sourcing 58 SDK, you need to initialize the BitBake build environment by sourcing
61 the build environment script (i.e. 59 the build environment script (i.e. :ref:`structure-core-script`):
62 ```oe-init-build-env`` <&YOCTO_DOCS_REF_URL;#structure-core-script>`__): 60 ::
63 $ cd ~/poky $ source oe-init-build-env 61
62 $ cd ~/poky
63 $ source oe-init-build-env
64 64
65 .. note:: 65 .. note::
66 66
@@ -71,7 +71,7 @@ section:
71 ) have been cloned using Git and the local repository is named 71 ) have been cloned using Git and the local repository is named
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 :term:`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
@@ -87,15 +87,22 @@ section:
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
89 ``MACHINE`` variable to "qemux86" and also add the "kernel-modules". 89 ``MACHINE`` variable to "qemux86" and also add the "kernel-modules".
90 As described we do this by appending to ``conf/local.conf``: MACHINE 90 As described we do this by appending to ``conf/local.conf``:
91 = "qemux86" MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "kernel-modules" 91 ::
92
93 MACHINE = "qemux86"
94 MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "kernel-modules"
92 95
933. *Create a Layer for Patches:* You need to create a layer to hold 963. *Create a Layer for Patches:* You need to create a layer to hold
94 patches created for the kernel image. You can use the 97 patches created for the kernel image. You can use the
95 ``bitbake-layers create-layer`` command as follows: $ cd ~/poky/build 98 ``bitbake-layers create-layer`` command as follows:
96 $ bitbake-layers create-layer ../../meta-mylayer NOTE: Starting 99 ::
97 bitbake server... Add your new layer with 'bitbake-layers add-layer 100
98 ../../meta-mylayer' $ 101 $ cd ~/poky/build
102 $ bitbake-layers create-layer ../../meta-mylayer
103 NOTE: Starting bitbake server...
104 Add your new layer with 'bitbake-layers add-layer ../../meta-mylayer'
105 $
99 106
100 .. note:: 107 .. note::
101 108
@@ -116,12 +123,22 @@ section:
1164. *Inform the BitBake Build Environment About Your Layer:* As directed 1234. *Inform the BitBake Build Environment About Your Layer:* As directed
117 when you created your layer, you need to add the layer to the 124 when you created your layer, you need to add the layer to the
118 :term:`BBLAYERS` variable in the 125 :term:`BBLAYERS` variable in the
119 ``bblayers.conf`` file as follows: $ cd ~/poky/build $ bitbake-layers 126 ``bblayers.conf`` file as follows:
120 add-layer ../../meta-mylayer NOTE: Starting bitbake server... $ 127 ::
128
129 $ cd ~/poky/build
130 $ bitbake-layers add-layer ../../meta-mylayer
131 NOTE: Starting bitbake server...
132 $
121 133
1225. *Build the Extensible SDK:* Use BitBake to build the extensible SDK 1345. *Build the Extensible SDK:* Use BitBake to build the extensible SDK
123 specifically for use with images to be run using QEMU: $ cd 135 specifically for use with images to be run using QEMU:
124 ~/poky/build $ bitbake core-image-minimal -c populate_sdk_ext Once 136 ::
137
138 $ cd ~/poky/build
139 $ bitbake core-image-minimal -c populate_sdk_ext
140
141 Once
125 the build finishes, you can find the SDK installer file (i.e. 142 the build finishes, you can find the SDK installer file (i.e.
126 ``*.sh`` file) in the following directory: 143 ``*.sh`` file) in the following directory:
127 ~/poky/build/tmp/deploy/sdk For this example, the installer file is 144 ~/poky/build/tmp/deploy/sdk For this example, the installer file is
@@ -130,39 +147,41 @@ section:
130 147
1316. *Install the Extensible SDK:* Use the following command to install 1486. *Install the Extensible SDK:* Use the following command to install
132 the SDK. For this example, install the SDK in the default 149 the SDK. For this example, install the SDK in the default
133 ``~/poky_sdk`` directory: $ cd ~/poky/build/tmp/deploy/sdk $ 150 ``~/poky_sdk`` directory:
134 ./poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-DISTRO.sh 151 ::
135 Poky (Yocto Project Reference Distro) Extensible SDK installer 152
136 version DISTRO 153 $ cd ~/poky/build/tmp/deploy/sdk
137 ============================================================================ 154 $ ./poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-3.1.2.sh
138 Enter target directory for SDK (default: ~/poky_sdk): You are about 155 Poky (Yocto Project Reference Distro) Extensible SDK installer version 3.1.2
139 to install the SDK to "/home/scottrif/poky_sdk". Proceed [Y/n]? Y 156 ============================================================================
140 Extracting SDK......................................done Setting it 157 Enter target directory for SDK (default: ~/poky_sdk):
141 up... Extracting buildtools... Preparing build system... Parsing 158 You are about to install the SDK to "/home/scottrif/poky_sdk". Proceed [Y/n]? Y
142 recipes: 100% 159 Extracting SDK......................................done
143 \|#################################################################\| 160 Setting it up...
144 Time: 0:00:52 Initializing tasks: 100% \|############## 161 Extracting buildtools...
145 ###############################################\| Time: 0:00:04 162 Preparing build system...
146 Checking sstate mirror object availability: 100% 163 Parsing recipes: 100% |#################################################################| Time: 0:00:52
147 \|######################################\| Time: 0:00:00 Parsing 164 Initializing tasks: 100% |############## ###############################################| Time: 0:00:04
148 recipes: 100% 165 Checking sstate mirror object availability: 100% |######################################| Time: 0:00:00
149 \|#################################################################\| 166 Parsing recipes: 100% |#################################################################| Time: 0:00:33
150 Time: 0:00:33 Initializing tasks: 100% 167 Initializing tasks: 100% |##############################################################| Time: 0:00:00
151 \|##############################################################\| 168 done
152 Time: 0:00:00 done SDK has been successfully set up and is ready to 169 SDK has been successfully set up and is ready to be used.
153 be used. Each time you wish to use the SDK in a new shell session, 170 Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
154 you need to source the environment setup script e.g. $ . 171 $ . /home/scottrif/poky_sdk/environment-setup-i586-poky-linux
155 /home/scottrif/poky_sdk/environment-setup-i586-poky-linux 172
156 173
1577. *Set Up a New Terminal to Work With the Extensible SDK:* You must set 1747. *Set Up a New Terminal to Work With the Extensible SDK:* You must set
158 up a new terminal to work with the SDK. You cannot use the same 175 up a new terminal to work with the SDK. You cannot use the same
159 BitBake shell used to build the installer. 176 BitBake shell used to build the installer.
160 177
161 After opening a new shell, run the SDK environment setup script as 178 After opening a new shell, run the SDK environment setup script as
162 directed by the output from installing the SDK: $ source 179 directed by the output from installing the SDK:
163 ~/poky_sdk/environment-setup-i586-poky-linux "SDK environment now set 180 ::
164 up; additionally you may now run devtool to perform development 181
165 tasks. Run devtool --help for further details. 182 $ source ~/poky_sdk/environment-setup-i586-poky-linux
183 "SDK environment now set up; additionally you may now run devtool to perform development tasks.
184 Run devtool --help for further details.
166 185
167 .. note:: 186 .. note::
168 187
@@ -171,22 +190,24 @@ section:
171 190
1728. *Build the Clean Image:* The final step in preparing to work on the 1918. *Build the Clean Image:* The final step in preparing to work on the
173 kernel is to build an initial image using ``devtool`` in the new 192 kernel is to build an initial image using ``devtool`` in the new
174 terminal you just set up and initialized for SDK work: $ devtool 193 terminal you just set up and initialized for SDK work:
175 build-image Parsing recipes: 100% 194 ::
176 \|##########################################\| Time: 0:00:05 Parsing 195
177 of 830 .bb files complete (0 cached, 830 parsed). 1299 targets, 47 196 $ devtool build-image
178 skipped, 0 masked, 0 errors. WARNING: No packages to add, building 197 Parsing recipes: 100% |##########################################| Time: 0:00:05
179 image core-image-minimal unmodified Loading cache: 100% 198 Parsing of 830 .bb files complete (0 cached, 830 parsed). 1299 targets, 47 skipped, 0 masked, 0 errors.
180 \|############################################\| Time: 0:00:00 Loaded 199 WARNING: No packages to add, building image core-image-minimal unmodified
181 1299 entries from dependency cache. NOTE: Resolving any missing task 200 Loading cache: 100% |############################################| Time: 0:00:00
182 queue dependencies Initializing tasks: 100% 201 Loaded 1299 entries from dependency cache.
183 \|#######################################\| Time: 0:00:07 Checking 202 NOTE: Resolving any missing task queue dependencies
184 sstate mirror object availability: 100% \|###############\| Time: 203 Initializing tasks: 100% |#######################################| Time: 0:00:07
185 0:00:00 NOTE: Executing SetScene Tasks NOTE: Executing RunQueue Tasks 204 Checking sstate mirror object availability: 100% |###############| Time: 0:00:00
186 NOTE: Tasks Summary: Attempted 2866 tasks of which 2604 didn't need 205 NOTE: Executing SetScene Tasks
187 to be rerun and all succeeded. NOTE: Successfully built 206 NOTE: Executing RunQueue Tasks
188 core-image-minimal. You can find output files in 207 NOTE: Tasks Summary: Attempted 2866 tasks of which 2604 didn't need to be rerun and all succeeded.
189 /home/scottrif/poky_sdk/tmp/deploy/images/qemux86 If you were 208 NOTE: Successfully built core-image-minimal. You can find output files in /home/scottrif/poky_sdk/tmp/deploy/images/qemux86
209
210 If you were
190 building for actual hardware and not for emulation, you could flash 211 building for actual hardware and not for emulation, you could flash
191 the image to a USB stick on ``/dev/sdd`` and boot your device. For an 212 the image to a USB stick on ``/dev/sdd`` and boot your device. For an
192 example that uses a Minnowboard, see the 213 example that uses a Minnowboard, see the
@@ -195,8 +216,8 @@ section:
195 216
196At this point you have set up to start making modifications to the 217At this point you have set up to start making modifications to the
197kernel by using the extensible SDK. For a continued example, see the 218kernel by using the extensible SDK. For a continued example, see the
198"`Using ``devtool`` to Patch the 219":ref:`kernel-dev/kernel-dev-common:using \`\`devtool\`\` to patch the kernel`"
199Kernel <#using-devtool-to-patch-the-kernel>`__" section. 220section.
200 221
201Getting Ready for Traditional Kernel Development 222Getting Ready for Traditional Kernel Development
202------------------------------------------------ 223------------------------------------------------
@@ -209,22 +230,25 @@ you will be editing these files.
209Follow these steps to prepare to update the kernel image using 230Follow these steps to prepare to update the kernel image using
210traditional kernel development flow with the Yocto Project. Completing 231traditional kernel development flow with the Yocto Project. Completing
211this procedure leaves you ready to make modifications to the kernel 232this procedure leaves you ready to make modifications to the kernel
212source as described in the "`Using Traditional Kernel Development to 233source as described in the ":ref:`kernel-dev/kernel-dev-common:using traditional kernel development to patch the kernel`"
213Patch the
214Kernel <#using-traditional-kernel-development-to-patch-the-kernel>`__"
215section: 234section:
216 235
2171. *Initialize the BitBake Environment:* Before you can do anything 2361. *Initialize the BitBake Environment:* Before you can do anything
218 using BitBake, you need to initialize the BitBake build environment 237 using BitBake, you need to initialize the BitBake build environment
219 by sourcing the build environment script (i.e. 238 by sourcing the build environment script (i.e.
220 ```oe-init-build-env`` <&YOCTO_DOCS_REF_URL;#structure-core-script>`__). 239 :ref:`structure-core-script`).
221 Also, for this example, be sure that the local branch you have 240 Also, for this example, be sure that the local branch you have
222 checked out for ``poky`` is the Yocto Project DISTRO_NAME branch. If 241 checked out for ``poky`` is the Yocto Project &DISTRO_NAME; branch. If
223 you need to checkout out the DISTRO_NAME branch, see the "`Checking 242 you need to checkout out the &DISTRO_NAME; branch, see the
224 out by Branch in 243 ":ref:`dev-manual/dev-manual-start:checking out by branch in poky`"
225 Poky <&YOCTO_DOCS_DEV_URL;#checking-out-by-branch-in-poky>`__" 244 section in the Yocto Project Development Tasks Manual.
226 section in the Yocto Project Development Tasks Manual. $ cd ~/poky $ 245 ::
227 git branch master \* DISTRO_NAME $ source oe-init-build-env 246
247 $ cd ~/poky
248 $ git branch
249 master
250 * &DISTRO_NAME;
251 $ source oe-init-build-env
228 252
229 .. note:: 253 .. note::
230 254
@@ -235,7 +259,7 @@ section:
235 ) have been cloned using Git and the local repository is named 259 ) have been cloned using Git and the local repository is named
236 "poky". 260 "poky".
237 261
2382. *Prepare Your ``local.conf`` File:* By default, the 2622. *Prepare Your local.conf File:* By default, the
239 :term:`MACHINE` variable is set to 263 :term:`MACHINE` variable is set to
240 "qemux86-64", which is fine if you are building for the QEMU emulator 264 "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 265 in 64-bit mode. However, if you are not, you need to set the
@@ -251,15 +275,21 @@ section:
251 275
252 In this example we wish to build for qemux86 so we must set the 276 In this example we wish to build for qemux86 so we must set the
253 ``MACHINE`` variable to "qemux86" and also add the "kernel-modules". 277 ``MACHINE`` variable to "qemux86" and also add the "kernel-modules".
254 As described we do this by appending to ``conf/local.conf``: MACHINE 278 As described we do this by appending to ``conf/local.conf``:
255 = "qemux86" MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "kernel-modules" 279 ::
280
281 MACHINE = "qemux86"
282 MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "kernel-modules"
256 283
2573. *Create a Layer for Patches:* You need to create a layer to hold 2843. *Create a Layer for Patches:* You need to create a layer to hold
258 patches created for the kernel image. You can use the 285 patches created for the kernel image. You can use the
259 ``bitbake-layers create-layer`` command as follows: $ cd ~/poky/build 286 ``bitbake-layers create-layer`` command as follows:
260 $ bitbake-layers create-layer ../../meta-mylayer NOTE: Starting 287 ::
261 bitbake server... Add your new layer with 'bitbake-layers add-layer 288
262 ../../meta-mylayer' 289 $ cd ~/poky/build
290 $ bitbake-layers create-layer ../../meta-mylayer
291 NOTE: Starting bitbake server...
292 Add your new layer with 'bitbake-layers add-layer ../../meta-mylayer'
263 293
264 .. note:: 294 .. note::
265 295
@@ -280,8 +310,13 @@ section:
2804. *Inform the BitBake Build Environment About Your Layer:* As directed 3104. *Inform the BitBake Build Environment About Your Layer:* As directed
281 when you created your layer, you need to add the layer to the 311 when you created your layer, you need to add the layer to the
282 :term:`BBLAYERS` variable in the 312 :term:`BBLAYERS` variable in the
283 ``bblayers.conf`` file as follows: $ cd ~/poky/build $ bitbake-layers 313 ``bblayers.conf`` file as follows:
284 add-layer ../../meta-mylayer NOTE: Starting bitbake server ... $ 314 ::
315
316 $ cd ~/poky/build
317 $ bitbake-layers add-layer ../../meta-mylayer
318 NOTE: Starting bitbake server ...
319 $
285 320
2865. *Create a Local Copy of the Kernel Git Repository:* You can find Git 3215. *Create a Local Copy of the Kernel Git Repository:* You can find Git
287 repositories of supported Yocto Project kernels organized under 322 repositories of supported Yocto Project kernels organized under
@@ -306,14 +341,17 @@ section:
306 linux-yocto-4.12 341 linux-yocto-4.12
307 kernel with releases prior to Yocto Project 2.4: 342 kernel with releases prior to Yocto Project 2.4:
308 343
309 $ cd ~ $ git clone git://git.yoctoproject.org/linux-yocto-4.12 344 ::
310 --branch standard/base Cloning into 'linux-yocto-4.12'... remote: 345
311 Counting objects: 6097195, done. remote: Compressing objects: 100% 346 $ cd ~
312 (901026/901026), done. remote: Total 6097195 (delta 5152604), reused 347 $ git clone git://git.yoctoproject.org/linux-yocto-4.12 --branch standard/base
313 6096847 (delta 5152256) Receiving objects: 100% (6097195/6097195), 348 Cloning into 'linux-yocto-4.12'...
314 1.24 GiB \| 7.81 MiB/s, done. Resolving deltas: 100% 349 remote: Counting objects: 6097195, done.
315 (5152604/5152604), done. Checking connectivity... done. Checking out 350 remote: Compressing objects: 100% (901026/901026), done.
316 files: 100% (59846/59846), done. 351 remote: Total 6097195 (delta 5152604), reused 6096847 (delta 5152256)
352 Receiving objects: 100% (6097195/6097195), 1.24 GiB | 7.81 MiB/s, done.
353 Resolving deltas: 100% (5152604/5152604), done. Checking connectivity... done.
354 Checking out files: 100% (59846/59846), done.
317 355
3186. *Create a Local Copy of the Kernel Cache Git Repository:* For 3566. *Create a Local Copy of the Kernel Cache Git Repository:* For
319 simplicity, it is recommended that you create your copy of the kernel 357 simplicity, it is recommended that you create your copy of the kernel
@@ -323,14 +361,18 @@ section:
323 the ``yocto-4.12`` branch. 361 the ``yocto-4.12`` branch.
324 362
325 The following commands show how to create a local copy of the 363 The following commands show how to create a local copy of the
326 ``yocto-kernel-cache`` and be in the ``yocto-4.12`` branch: $ cd ~ $ 364 ``yocto-kernel-cache`` and be in the ``yocto-4.12`` branch:
327 git clone git://git.yoctoproject.org/yocto-kernel-cache --branch 365 ::
328 yocto-4.12 Cloning into 'yocto-kernel-cache'... remote: Counting 366
329 objects: 22639, done. remote: Compressing objects: 100% (9761/9761), 367 $ cd ~
330 done. remote: Total 22639 (delta 12400), reused 22586 (delta 12347) 368 $ git clone git://git.yoctoproject.org/yocto-kernel-cache --branch yocto-4.12
331 Receiving objects: 100% (22639/22639), 22.34 MiB \| 6.27 MiB/s, done. 369 Cloning into 'yocto-kernel-cache'...
332 Resolving deltas: 100% (12400/12400), done. Checking connectivity... 370 remote: Counting objects: 22639, done.
333 done. 371 remote: Compressing objects: 100% (9761/9761), done.
372 remote: Total 22639 (delta 12400), reused 22586 (delta 12347)
373 Receiving objects: 100% (22639/22639), 22.34 MiB | 6.27 MiB/s, done.
374 Resolving deltas: 100% (12400/12400), done.
375 Checking connectivity... done.
334 376
335At this point, you are ready to start making modifications to the kernel 377At this point, you are ready to start making modifications to the kernel
336using traditional kernel development steps. For a continued example, see 378using traditional kernel development steps. For a continued example, see
@@ -347,8 +389,7 @@ layer contains its own :term:`BitBake`
347append files (``.bbappend``) and provides a convenient mechanism to 389append files (``.bbappend``) and provides a convenient mechanism to
348create your own recipe files (``.bb``) as well as store and use kernel 390create your own recipe files (``.bb``) as well as store and use kernel
349patch files. For background information on working with layers, see the 391patch files. For background information on working with layers, see the
350"`Understanding and Creating 392":ref:`dev-manual/dev-manual-common-tasks:understanding and creating layers`"
351Layers <&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers>`__"
352section in the Yocto Project Development Tasks Manual. 393section in the Yocto Project Development Tasks Manual.
353 394
354.. note:: 395.. note::
@@ -368,37 +409,56 @@ following section describes how to create a layer without the aid of
368tools. These steps assume creation of a layer named ``mylayer`` in your 409tools. These steps assume creation of a layer named ``mylayer`` in your
369home directory: 410home directory:
370 411
3711. *Create Structure*: Create the layer's structure: $ cd $HOME $ mkdir 4121. *Create Structure*: Create the layer's structure:
372 meta-mylayer $ mkdir meta-mylayer/conf $ mkdir 413 ::
373 meta-mylayer/recipes-kernel $ mkdir meta-mylayer/recipes-kernel/linux 414
374 $ mkdir meta-mylayer/recipes-kernel/linux/linux-yocto The ``conf`` 415 $ cd $HOME
375 directory holds your configuration files, while the 416 $ mkdir meta-mylayer
417 $ mkdir meta-mylayer/conf
418 $ mkdir meta-mylayer/recipes-kernel
419 $ mkdir meta-mylayer/recipes-kernel/linux
420 $ mkdir meta-mylayer/recipes-kernel/linux/linux-yocto
421
422 The ``conf`` directory holds your configuration files, while the
376 ``recipes-kernel`` directory holds your append file and eventual 423 ``recipes-kernel`` directory holds your append file and eventual
377 patch files. 424 patch files.
378 425
3792. *Create the Layer Configuration File*: Move to the 4262. *Create the Layer Configuration File*: Move to the
380 ``meta-mylayer/conf`` directory and create the ``layer.conf`` file as 427 ``meta-mylayer/conf`` directory and create the ``layer.conf`` file as
381 follows: # We have a conf and classes directory, add to BBPATH BBPATH 428 follows:
382 .= ":${LAYERDIR}" # We have recipes-\* directories, add to BBFILES 429 ::
383 BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \\ 430
384 ${LAYERDIR}/recipes-*/*/*.bbappend" BBFILE_COLLECTIONS += "mylayer" 431 # We have a conf and classes directory, add to BBPATH
385 BBFILE_PATTERN_mylayer = "^${LAYERDIR}/" BBFILE_PRIORITY_mylayer = 432 BBPATH .= ":${LAYERDIR}"
386 "5" Notice ``mylayer`` as part of the last three statements. 433
434 # We have recipes-* directories, add to BBFILES
435 BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
436 ${LAYERDIR}/recipes-*/*/*.bbappend"
437
438 BBFILE_COLLECTIONS += "mylayer"
439 BBFILE_PATTERN_mylayer = "^${LAYERDIR}/"
440 BBFILE_PRIORITY_mylayer = "5"
441
442 Notice ``mylayer`` as part of the last three statements.
387 443
3883. *Create the Kernel Recipe Append File*: Move to the 4443. *Create the Kernel Recipe Append File*: Move to the
389 ``meta-mylayer/recipes-kernel/linux`` directory and create the 445 ``meta-mylayer/recipes-kernel/linux`` directory and create the
390 kernel's append file. This example uses the ``linux-yocto-4.12`` 446 kernel's append file. This example uses the ``linux-yocto-4.12``
391 kernel. Thus, the name of the append file is 447 kernel. Thus, the name of the append file is
392 ``linux-yocto_4.12.bbappend``: FILESEXTRAPATHS_prepend := 448 ``linux-yocto_4.12.bbappend``:
393 "${THISDIR}/${PN}:" SRC_URI_append = " file://patch-file-one" 449 ::
394 SRC_URI_append = " file://patch-file-two" SRC_URI_append = " 450
395 file://patch-file-three" The 451 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
396 :term:`FILESEXTRAPATHS` 452
397 and :term:`SRC_URI` statements 453 SRC_URI_append = " file://patch-file-one"
454 SRC_URI_append = " file://patch-file-two"
455 SRC_URI_append = " file://patch-file-three"
456
457 The :term:`FILESEXTRAPATHS` and :term:`SRC_URI` statements
398 enable the OpenEmbedded build system to find patch files. For more 458 enable the OpenEmbedded build system to find patch files. For more
399 information on using append files, see the "`Using .bbappend Files in 459 information on using append files, see the
400 Your Layer <&YOCTO_DOCS_DEV_URL;#using-bbappend-files>`__" section in 460 ":ref:`dev-manual/dev-manual-common-tasks:using .bbappend files in your layer`"
401 the Yocto Project Development Tasks Manual. 461 section in the Yocto Project Development Tasks Manual.
402 462
403Modifying an Existing Recipe 463Modifying an Existing Recipe
404============================ 464============================
@@ -429,19 +489,28 @@ You create this file in your custom layer. You also name it accordingly
429based on the linux-yocto recipe you are using. For example, if you are 489based on the linux-yocto recipe you are using. For example, if you are
430modifying the ``meta/recipes-kernel/linux/linux-yocto_4.12.bb`` recipe, 490modifying the ``meta/recipes-kernel/linux/linux-yocto_4.12.bb`` recipe,
431the append file will typically be located as follows within your custom 491the append file will typically be located as follows within your custom
432layer: your-layer/recipes-kernel/linux/linux-yocto_4.12.bbappend The 492layer:
433append file should initially extend the 493::
494
495 your-layer/recipes-kernel/linux/linux-yocto_4.12.bbappend
496
497The append file should initially extend the
434:term:`FILESPATH` search path by 498:term:`FILESPATH` search path by
435prepending the directory that contains your files to the 499prepending the directory that contains your files to the
436:term:`FILESEXTRAPATHS` 500:term:`FILESEXTRAPATHS`
437variable as follows: FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" The 501variable as follows:
438path 502::
439``${``\ :term:`THISDIR`\ ``}/${``\ :term:`PN`\ ``}`` 503
504 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
505
506The path ``${``\ :term:`THISDIR`\ ``}/${``\ :term:`PN`\ ``}``
440expands to "linux-yocto" in the current directory for this example. If 507expands to "linux-yocto" in the current directory for this example. If
441you add any new files that modify the kernel recipe and you have 508you add any new files that modify the kernel recipe and you have
442extended ``FILESPATH`` as described above, you must place the files in 509extended ``FILESPATH`` as described above, you must place the files in
443your layer in the following area: 510your layer in the following area:
444your-layer/recipes-kernel/linux/linux-yocto/ 511::
512
513 your-layer/recipes-kernel/linux/linux-yocto/
445 514
446.. note:: 515.. note::
447 516
@@ -452,24 +521,40 @@ your-layer/recipes-kernel/linux/linux-yocto/
452 521
453As an example, consider the following append file used by the BSPs in 522As an example, consider the following append file used by the BSPs in
454``meta-yocto-bsp``: 523``meta-yocto-bsp``:
455meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.12.bbappend The 524::
456following listing shows the file. Be aware that the actual commit ID 525
526 meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.12.bbappend
527
528The following listing shows the file. Be aware that the actual commit ID
457strings in this example listing might be different than the actual 529strings in this example listing might be different than the actual
458strings in the file from the ``meta-yocto-bsp`` layer upstream. 530strings in the file from the ``meta-yocto-bsp`` layer upstream.
459KBRANCH_genericx86 = "standard/base" KBRANCH_genericx86-64 = 531::
460"standard/base" KMACHINE_genericx86 ?= "common-pc" 532
461KMACHINE_genericx86-64 ?= "common-pc-64" KBRANCH_edgerouter = 533 KBRANCH_genericx86 = "standard/base"
462"standard/edgerouter" KBRANCH_beaglebone = "standard/beaglebone" 534 KBRANCH_genericx86-64 = "standard/base"
463SRCREV_machine_genericx86 ?= "d09f2ce584d60ecb7890550c22a80c48b83c2e19" 535
464SRCREV_machine_genericx86-64 ?= 536 KMACHINE_genericx86 ?= "common-pc"
465"d09f2ce584d60ecb7890550c22a80c48b83c2e19" SRCREV_machine_edgerouter ?= 537 KMACHINE_genericx86-64 ?= "common-pc-64"
466"b5c8cfda2dfe296410d51e131289fb09c69e1e7d" SRCREV_machine_beaglebone ?= 538 KBRANCH_edgerouter = "standard/edgerouter"
467"b5c8cfda2dfe296410d51e131289fb09c69e1e7d" COMPATIBLE_MACHINE_genericx86 539 KBRANCH_beaglebone = "standard/beaglebone"
468= "genericx86" COMPATIBLE_MACHINE_genericx86-64 = "genericx86-64" 540
469COMPATIBLE_MACHINE_edgerouter = "edgerouter" 541 SRCREV_machine_genericx86 ?= "d09f2ce584d60ecb7890550c22a80c48b83c2e19"
470COMPATIBLE_MACHINE_beaglebone = "beaglebone" LINUX_VERSION_genericx86 = 542 SRCREV_machine_genericx86-64 ?= "d09f2ce584d60ecb7890550c22a80c48b83c2e19"
471"4.12.7" LINUX_VERSION_genericx86-64 = "4.12.7" LINUX_VERSION_edgerouter 543 SRCREV_machine_edgerouter ?= "b5c8cfda2dfe296410d51e131289fb09c69e1e7d"
472= "4.12.10" LINUX_VERSION_beaglebone = "4.12.10" This append file 544 SRCREV_machine_beaglebone ?= "b5c8cfda2dfe296410d51e131289fb09c69e1e7d"
545
546
547 COMPATIBLE_MACHINE_genericx86 = "genericx86"
548 COMPATIBLE_MACHINE_genericx86-64 = "genericx86-64"
549 COMPATIBLE_MACHINE_edgerouter = "edgerouter"
550 COMPATIBLE_MACHINE_beaglebone = "beaglebone"
551
552 LINUX_VERSION_genericx86 = "4.12.7"
553 LINUX_VERSION_genericx86-64 = "4.12.7"
554 LINUX_VERSION_edgerouter = "4.12.10"
555 LINUX_VERSION_beaglebone = "4.12.10"
556
557This append file
473contains statements used to support several BSPs that ship with the 558contains statements used to support several BSPs that ship with the
474Yocto Project. The file defines machines using the 559Yocto Project. The file defines machines using the
475:term:`COMPATIBLE_MACHINE` 560:term:`COMPATIBLE_MACHINE`
@@ -504,15 +589,21 @@ For example, suppose you had some configuration options in a file called
504``network_configs.cfg``. You can place that file inside a directory 589``network_configs.cfg``. You can place that file inside a directory
505named ``linux-yocto`` and then add a ``SRC_URI`` statement such as the 590named ``linux-yocto`` and then add a ``SRC_URI`` statement such as the
506following to the append file. When the OpenEmbedded build system builds 591following to the append file. When the OpenEmbedded build system builds
507the kernel, the configuration options are picked up and applied. SRC_URI 592the kernel, the configuration options are picked up and applied.
508+= "file://network_configs.cfg" 593::
594
595 SRC_URI += "file://network_configs.cfg"
509 596
510To group related configurations into multiple files, you perform a 597To group related configurations into multiple files, you perform a
511similar procedure. Here is an example that groups separate 598similar procedure. Here is an example that groups separate
512configurations specifically for Ethernet and graphics into their own 599configurations specifically for Ethernet and graphics into their own
513files and adds the configurations by using a ``SRC_URI`` statement like 600files and adds the configurations by using a ``SRC_URI`` statement like
514the following in your append file: SRC_URI += "file://myconfig.cfg \\ 601the following in your append file:
515file://eth.cfg \\ file://gfx.cfg" 602::
603
604 SRC_URI += "file://myconfig.cfg \
605 file://eth.cfg \
606 file://gfx.cfg"
516 607
517Another variable you can use in your kernel recipe append file is the 608Another variable you can use in your kernel recipe append file is the
518:term:`FILESEXTRAPATHS` 609:term:`FILESEXTRAPATHS`
@@ -552,18 +643,22 @@ reference them in :term:`SRC_URI`
552statements. 643statements.
553 644
554For example, you can apply a three-patch series by adding the following 645For example, you can apply a three-patch series by adding the following
555lines to your linux-yocto ``.bbappend`` file in your layer: SRC_URI += 646lines to your linux-yocto ``.bbappend`` file in your layer:
556"file://0001-first-change.patch" SRC_URI += 647::
557"file://0002-second-change.patch" SRC_URI += 648
558"file://0003-third-change.patch" The next time you run BitBake to build 649 SRC_URI += "file://0001-first-change.patch"
650 SRC_URI += "file://0002-second-change.patch"
651 SRC_URI += "file://0003-third-change.patch"
652
653The next time you run BitBake to build
559the Linux kernel, BitBake detects the change in the recipe and fetches 654the Linux kernel, BitBake detects the change in the recipe and fetches
560and applies the patches before building the kernel. 655and applies the patches before building the kernel.
561 656
562For a detailed example showing how to patch the kernel using 657For a detailed example showing how to patch the kernel using
563``devtool``, see the "`Using ``devtool`` to Patch the 658``devtool``, see the
564Kernel <#using-devtool-to-patch-the-kernel>`__" and "`Using Traditional 659":ref:`kernel-dev/kernel-dev-common:using \`\`devtool\`\` to patch the kernel`"
565Kernel Development to Patch the 660and
566Kernel <#using-traditional-kernel-development-to-patch-the-kernel>`__" 661":ref:`kernel-dev/kernel-dev-common:using traditional kernel development to patch the kernel`"
567sections. 662sections.
568 663
569Changing the Configuration 664Changing the Configuration
@@ -580,8 +675,12 @@ to use for the configuration, as before, copy that file to the
580appropriate ``${PN}`` directory in your layer's ``recipes-kernel/linux`` 675appropriate ``${PN}`` directory in your layer's ``recipes-kernel/linux``
581directory, and rename the copied file to "defconfig". Then, add the 676directory, and rename the copied file to "defconfig". Then, add the
582following lines to the linux-yocto ``.bbappend`` file in your layer: 677following lines to the linux-yocto ``.bbappend`` file in your layer:
583FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI += 678::
584"file://defconfig" The ``SRC_URI`` tells the build system how to search 679
680 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
681 SRC_URI += "file://defconfig"
682
683The ``SRC_URI`` tells the build system how to search
585for the file, while the 684for the file, while the
586:term:`FILESEXTRAPATHS` 685:term:`FILESEXTRAPATHS`
587extends the :term:`FILESPATH` 686extends the :term:`FILESPATH`
@@ -606,13 +705,26 @@ Generally speaking, the preferred approach is to determine the
606incremental change you want to make and add that as a configuration 705incremental change you want to make and add that as a configuration
607fragment. For example, if you want to add support for a basic serial 706fragment. For example, if you want to add support for a basic serial
608console, create a file named ``8250.cfg`` in the ``${PN}`` directory 707console, create a file named ``8250.cfg`` in the ``${PN}`` directory
609with the following content (without indentation): CONFIG_SERIAL_8250=y 708with the following content (without indentation):
610CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_PCI=y 709::
611CONFIG_SERIAL_8250_NR_UARTS=4 CONFIG_SERIAL_8250_RUNTIME_UARTS=4 710
612CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y Next, include this 711 CONFIG_SERIAL_8250=y
712 CONFIG_SERIAL_8250_CONSOLE=y
713 CONFIG_SERIAL_8250_PCI=y
714 CONFIG_SERIAL_8250_NR_UARTS=4
715 CONFIG_SERIAL_8250_RUNTIME_UARTS=4
716 CONFIG_SERIAL_CORE=y
717 CONFIG_SERIAL_CORE_CONSOLE=y
718
719Next, include this
613configuration fragment and extend the ``FILESPATH`` variable in your 720configuration fragment and extend the ``FILESPATH`` variable in your
614``.bbappend`` file: FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" 721``.bbappend`` file:
615SRC_URI += "file://8250.cfg" The next time you run BitBake to build the 722::
723
724 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
725 SRC_URI += "file://8250.cfg"
726
727The next time you run BitBake to build the
616Linux kernel, BitBake detects the change in the recipe and fetches and 728Linux kernel, BitBake detects the change in the recipe and fetches and
617applies the new configuration before building the kernel. 729applies the new configuration before building the kernel.
618 730
@@ -626,8 +738,12 @@ It might be desirable to have kernel configuration fragment support
626through a ``defconfig`` file that is pulled from the kernel source tree 738through a ``defconfig`` file that is pulled from the kernel source tree
627for the configured machine. By default, the OpenEmbedded build system 739for the configured machine. By default, the OpenEmbedded build system
628looks for ``defconfig`` files in the layer used for Metadata, which is 740looks for ``defconfig`` files in the layer used for Metadata, which is
629"out-of-tree", and then configures them using the following: SRC_URI += 741"out-of-tree", and then configures them using the following:
630"file://defconfig" If you do not want to maintain copies of 742::
743
744 SRC_URI += "file://defconfig"
745
746If you do not want to maintain copies of
631``defconfig`` files in your layer but would rather allow users to use 747``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 748the default configuration from the kernel tree and still be able to add
633configuration fragments to the 749configuration fragments to the
@@ -636,11 +752,18 @@ append files, you can direct the OpenEmbedded build system to use a
636``defconfig`` file that is "in-tree". 752``defconfig`` file that is "in-tree".
637 753
638To specify an "in-tree" ``defconfig`` file, use the following statement 754To specify an "in-tree" ``defconfig`` file, use the following statement
639form: KBUILD_DEFCONFIG_KMACHINE ?= defconfig_file Here is an example 755form:
756::
757
758 KBUILD_DEFCONFIG_KMACHINE ?= defconfig_file
759
760Here is an example
640that assigns the ``KBUILD_DEFCONFIG`` variable based on "raspberrypi2" 761that assigns the ``KBUILD_DEFCONFIG`` variable based on "raspberrypi2"
641and provides the path to the "in-tree" ``defconfig`` file to be used for 762and provides the path to the "in-tree" ``defconfig`` file to be used for
642a Raspberry Pi 2, which is based on the Broadcom 2708/2709 chipset: 763a Raspberry Pi 2, which is based on the Broadcom 2708/2709 chipset:
643KBUILD_DEFCONFIG_raspberrypi2 ?= "bcm2709_defconfig" 764::
765
766 KBUILD_DEFCONFIG_raspberrypi2 ?= "bcm2709_defconfig"
644 767
645Aside from modifying your kernel recipe and providing your own 768Aside from modifying your kernel recipe and providing your own
646``defconfig`` file, you need to be sure no files or statements set 769``defconfig`` file, you need to be sure no files or statements set
@@ -678,8 +801,7 @@ output at boot time through ``printk`` statements in the kernel's
678``calibrate.c`` source code file. Applying the patch and booting the 801``calibrate.c`` source code file. Applying the patch and booting the
679modified image causes the added messages to appear on the emulator's 802modified image causes the added messages to appear on the emulator's
680console. The example is a continuation of the setup procedure found in 803console. The example is a continuation of the setup procedure found in
681the "`Getting Ready to Develop Using 804the ":ref:`kernel-dev/kernel-dev-common:getting ready to develop using \`\`devtool\`\``" Section.
682``devtool`` <#getting-ready-to-develop-using-devtool>`__" Section.
683 805
6841. *Check Out the Kernel Source Files:* First you must use ``devtool`` 8061. *Check Out the Kernel Source Files:* First you must use ``devtool``
685 to checkout the kernel source code in its workspace. Be sure you are 807 to checkout the kernel source code in its workspace. Be sure you are
@@ -694,8 +816,10 @@ the "`Getting Ready to Develop Using
694 devtool 816 devtool
695 " section for more information. 817 " section for more information.
696 818
697 Use the following ``devtool`` command to check out the code: $ 819 Use the following ``devtool`` command to check out the code:
698 devtool modify linux-yocto 820 ::
821
822 $ devtool modify linux-yocto
699 823
700 .. note:: 824 .. note::
701 825
@@ -706,7 +830,7 @@ the "`Getting Ready to Develop Using
706 ERROR: Taskhash mismatch 2c793438c2d9f8c3681fd5f7bc819efa versus 830 ERROR: Taskhash mismatch 2c793438c2d9f8c3681fd5f7bc819efa versus
707 be3a89ce7c47178880ba7bf6293d7404 for 831 be3a89ce7c47178880ba7bf6293d7404 for
708 /path/to/esdk/layers/poky/meta/recipes-kernel/linux/linux-yocto_4.10.bb.do_unpack 832 /path/to/esdk/layers/poky/meta/recipes-kernel/linux/linux-yocto_4.10.bb.do_unpack
709 833
710 834
711 You can safely ignore these messages. The source code is correctly 835 You can safely ignore these messages. The source code is correctly
712 checked out. 836 checked out.
@@ -718,19 +842,37 @@ the "`Getting Ready to Develop Using
718 noted where you can find the source files (e.g. 842 noted where you can find the source files (e.g.
719 ``~/poky_sdk/workspace/sources/linux-yocto``). Change to where the 843 ``~/poky_sdk/workspace/sources/linux-yocto``). Change to where the
720 kernel source code is before making your edits to the 844 kernel source code is before making your edits to the
721 ``calibrate.c`` file: $ cd 845 ``calibrate.c`` file:
722 ~/poky_sdk/workspace/sources/linux-yocto 846 ::
847
848 $ cd ~/poky_sdk/workspace/sources/linux-yocto
723 849
724 2. *Edit the source file*: Edit the ``init/calibrate.c`` file to have 850 2. *Edit the source file*: Edit the ``init/calibrate.c`` file to have
725 the following changes: void calibrate_delay(void) { unsigned long 851 the following changes:
726 lpj; static bool printed; int this_cpu = smp_processor_id(); 852 ::
727 printk("*************************************\n"); printk("\* 853
728 \*\n"); printk("\* HELLO YOCTO KERNEL \*\n"); printk("\* \*\n"); 854 void calibrate_delay(void)
729 printk("*************************************\n"); if 855 {
730 (per_cpu(cpu_loops_per_jiffy, this_cpu)) { . . . 856 unsigned long lpj;
857 static bool printed;
858 int this_cpu = smp_processor_id();
859
860 printk("*************************************\n");
861 printk("* *\n");
862 printk("* HELLO YOCTO KERNEL *\n");
863 printk("* *\n");
864 printk("*************************************\n");
865
866 if (per_cpu(cpu_loops_per_jiffy, this_cpu)) {
867 .
868 .
869 .
731 870
7323. *Build the Updated Kernel Source:* To build the updated kernel 8713. *Build the Updated Kernel Source:* To build the updated kernel
733 source, use ``devtool``: $ devtool build linux-yocto 872 source, use ``devtool``:
873 ::
874
875 $ devtool build linux-yocto
734 876
7354. *Create the Image With the New Kernel:* Use the 8774. *Create the Image With the New Kernel:* Use the
736 ``devtool build-image`` command to create a new image that has the 878 ``devtool build-image`` command to create a new image that has the
@@ -744,25 +886,40 @@ the "`Getting Ready to Develop Using
744 TipsAndTricks/KernelDevelopmentWithEsdk 886 TipsAndTricks/KernelDevelopmentWithEsdk
745 Wiki Page. 887 Wiki Page.
746 888
747 $ cd ~ $ devtool build-image core-image-minimal 889 ::
890
891 $ cd ~
892 $ devtool build-image core-image-minimal
748 893
7495. *Test the New Image:* For this example, you can run the new image 8945. *Test the New Image:* For this example, you can run the new image
750 using QEMU to verify your changes: 895 using QEMU to verify your changes:
751 896
752 1. *Boot the image*: Boot the modified image in the QEMU emulator 897 1. *Boot the image*: Boot the modified image in the QEMU emulator
753 using this command: $ runqemu qemux86 898 using this command:
899 ::
900
901 $ runqemu qemux86
754 902
755 2. *Verify the changes*: Log into the machine using ``root`` with no 903 2. *Verify the changes*: Log into the machine using ``root`` with no
756 password and then use the following shell command to scroll 904 password and then use the following shell command to scroll
757 through the console's boot output. # dmesg \| less You should see 905 through the console's boot output.
906 ::
907
908 # dmesg | less
909
910 You should see
758 the results of your ``printk`` statements as part of the output 911 the results of your ``printk`` statements as part of the output
759 when you scroll down the console window. 912 when you scroll down the console window.
760 913
7616. *Stage and commit your changes*: Within your eSDK terminal, change 9146. *Stage and commit your changes*: Within your eSDK terminal, change
762 your working directory to where you modified the ``calibrate.c`` file 915 your working directory to where you modified the ``calibrate.c`` file
763 and use these Git commands to stage and commit your changes: $ cd 916 and use these Git commands to stage and commit your changes:
764 ~/poky_sdk/workspace/sources/linux-yocto $ git status $ git add 917 ::
765 init/calibrate.c $ git commit -m "calibrate: Add printk example" 918
919 $ cd ~/poky_sdk/workspace/sources/linux-yocto
920 $ git status
921 $ git add init/calibrate.c
922 $ git commit -m "calibrate: Add printk example"
766 923
7677. *Export the Patches and Create an Append File:* To export your 9247. *Export the Patches and Create an Append File:* To export your
768 commits as patches and create a ``.bbappend`` file, use the following 925 commits as patches and create a ``.bbappend`` file, use the following
@@ -775,7 +932,9 @@ the "`Getting Ready to Develop Using
775 Getting Ready to Develop Using devtool 932 Getting Ready to Develop Using devtool
776 " section for information on setting up this layer. 933 " section for information on setting up this layer.
777 934
778 $ devtool finish linux-yocto ~/meta-mylayer Once the command 935 $ devtool finish linux-yocto ~/meta-mylayer
936
937 Once the command
779 finishes, the patches and the ``.bbappend`` file are located in the 938 finishes, the patches and the ``.bbappend`` file are located in the
780 ``~/meta-mylayer/recipes-kernel/linux`` directory. 939 ``~/meta-mylayer/recipes-kernel/linux`` directory.
781 940
@@ -783,15 +942,20 @@ the "`Getting Ready to Develop Using
783 image that includes your kernel patches. Execute the following 942 image that includes your kernel patches. Execute the following
784 command from your 943 command from your
785 :term:`Build Directory` in the terminal 944 :term:`Build Directory` in the terminal
786 set up to run BitBake: $ cd ~/poky/build $ bitbake core-image-minimal 945 set up to run BitBake:
946 ::
947
948 $ cd ~/poky/build
949 $ bitbake core-image-minimal
787 950
788Using Traditional Kernel Development to Patch the Kernel 951Using Traditional Kernel Development to Patch the Kernel
789======================================================== 952========================================================
790 953
791The steps in this procedure show you how you can patch the kernel using 954The steps in this procedure show you how you can patch the kernel using
792traditional kernel development (i.e. not using ``devtool`` and the 955traditional kernel development (i.e. not using ``devtool`` and the
793extensible SDK as described in the "`Using ``devtool`` to Patch the 956extensible SDK as described in the
794Kernel <#using-devtool-to-patch-the-kernel>`__" section). 957":ref:`kernel-dev/kernel-dev-common:using \`\`devtool\`\` to patch the kernel`"
958section).
795 959
796.. note:: 960.. note::
797 961
@@ -824,35 +988,61 @@ Section.
824 1. *Change the working directory*: You need to locate the source 988 1. *Change the working directory*: You need to locate the source
825 files in the local copy of the kernel Git repository: Change to 989 files in the local copy of the kernel Git repository: Change to
826 where the kernel source code is before making your edits to the 990 where the kernel source code is before making your edits to the
827 ``calibrate.c`` file: $ cd ~/linux-yocto-4.12/init 991 ``calibrate.c`` file:
992 ::
993
994 $ cd ~/linux-yocto-4.12/init
828 995
829 2. *Edit the source file*: Edit the ``calibrate.c`` file to have the 996 2. *Edit the source file*: Edit the ``calibrate.c`` file to have the
830 following changes: void calibrate_delay(void) { unsigned long lpj; 997 following changes:
831 static bool printed; int this_cpu = smp_processor_id(); 998 ::
832 printk("*************************************\n"); printk("\* 999
833 \*\n"); printk("\* HELLO YOCTO KERNEL \*\n"); printk("\* \*\n"); 1000 void calibrate_delay(void)
834 printk("*************************************\n"); if 1001 {
835 (per_cpu(cpu_loops_per_jiffy, this_cpu)) { . . . 1002 unsigned long lpj;
1003 static bool printed;
1004 int this_cpu = smp_processor_id();
1005
1006 printk("*************************************\n");
1007 printk("* *\n");
1008 printk("* HELLO YOCTO KERNEL *\n");
1009 printk("* *\n");
1010 printk("*************************************\n");
1011
1012 if (per_cpu(cpu_loops_per_jiffy, this_cpu)) {
1013 .
1014 .
1015 .
836 1016
8372. *Stage and Commit Your Changes:* Use standard Git commands to stage 10172. *Stage and Commit Your Changes:* Use standard Git commands to stage
838 and commit the changes you just made: $ git add calibrate.c $ git 1018 and commit the changes you just made:
839 commit -m "calibrate.c - Added some printk statements" If you do not 1019 ::
1020
1021 $ git add calibrate.c
1022 $ git commit -m "calibrate.c - Added some printk statements"
1023
1024 If you do not
840 stage and commit your changes, the OpenEmbedded Build System will not 1025 stage and commit your changes, the OpenEmbedded Build System will not
841 pick up the changes. 1026 pick up the changes.
842 1027
8433. *Update Your ``local.conf`` File to Point to Your Source Files:* In 10283. *Update Your local.conf File to Point to Your Source Files:* In
844 addition to your ``local.conf`` file specifying to use 1029 addition to your ``local.conf`` file specifying to use
845 "kernel-modules" and the "qemux86" machine, it must also point to the 1030 "kernel-modules" and the "qemux86" machine, it must also point to the
846 updated kernel source files. Add 1031 updated kernel source files. Add
847 :term:`SRC_URI` and 1032 :term:`SRC_URI` and
848 :term:`SRCREV` statements similar 1033 :term:`SRCREV` statements similar
849 to the following to your ``local.conf``: $ cd ~/poky/build/conf Add 1034 to the following to your ``local.conf``:
850 the following to the ``local.conf``: SRC_URI_pn-linux-yocto = 1035 ::
851 "git:///path-to/linux-yocto-4.12;protocol=file;name=machine;branch=standard/base; 1036
852 \\ 1037 $ cd ~/poky/build/conf
853 git:///path-to/yocto-kernel-cache;protocol=file;type=kmeta;name=meta;branch=yocto-4.12;destsuffix=${KMETA}" 1038
854 SRCREV_meta_qemux86 = "${AUTOREV}" SRCREV_machine_qemux86 = 1039 Add the following to the ``local.conf``:
855 "${AUTOREV}" 1040 ::
1041
1042 SRC_URI_pn-linux-yocto = "git:///path-to/linux-yocto-4.12;protocol=file;name=machine;branch=standard/base; \
1043 git:///path-to/yocto-kernel-cache;protocol=file;type=kmeta;name=meta;branch=yocto-4.12;destsuffix=${KMETA}"
1044 SRCREV_meta_qemux86 = "${AUTOREV}"
1045 SRCREV_machine_qemux86 = "${AUTOREV}"
856 1046
857 .. note:: 1047 .. note::
858 1048
@@ -866,23 +1056,39 @@ Section.
866 1056
8674. *Build the Image:* With the source modified, your changes staged and 10574. *Build the Image:* With the source modified, your changes staged and
868 committed, and the ``local.conf`` file pointing to the kernel files, 1058 committed, and the ``local.conf`` file pointing to the kernel files,
869 you can now use BitBake to build the image: $ cd ~/poky/build $ 1059 you can now use BitBake to build the image:
870 bitbake core-image-minimal 1060 ::
1061
1062 $ cd ~/poky/build
1063 $ bitbake core-image-minimal
871 1064
8725. *Boot the image*: Boot the modified image in the QEMU emulator using 10655. *Boot the image*: Boot the modified image in the QEMU emulator using
873 this command. When prompted to login to the QEMU console, use "root" 1066 this command. When prompted to login to the QEMU console, use "root"
874 with no password: $ cd ~/poky/build $ runqemu qemux86 1067 with no password:
1068 ::
1069
1070 $ cd ~/poky/build
1071 $ runqemu qemux86
875 1072
8766. *Look for Your Changes:* As QEMU booted, you might have seen your 10736. *Look for Your Changes:* As QEMU booted, you might have seen your
877 changes rapidly scroll by. If not, use these commands to see your 1074 changes rapidly scroll by. If not, use these commands to see your
878 changes: # dmesg \| less You should see the results of your 1075 changes:
1076 ::
1077
1078 # dmesg | less
1079
1080 You should see the results of your
879 ``printk`` statements as part of the output when you scroll down the 1081 ``printk`` statements as part of the output when you scroll down the
880 console window. 1082 console window.
881 1083
8827. *Generate the Patch File:* Once you are sure that your patch works 10847. *Generate the Patch File:* Once you are sure that your patch works
883 correctly, you can generate a ``*.patch`` file in the kernel source 1085 correctly, you can generate a ``*.patch`` file in the kernel source
884 repository: $ cd ~/linux-yocto-4.12/init $ git format-patch -1 1086 repository:
885 0001-calibrate.c-Added-some-printk-statements.patch 1087 ::
1088
1089 $ cd ~/linux-yocto-4.12/init
1090 $ git format-patch -1
1091 0001-calibrate.c-Added-some-printk-statements.patch
886 1092
8878. *Move the Patch File to Your Layer:* In order for subsequent builds 10938. *Move the Patch File to Your Layer:* In order for subsequent builds
888 to pick up patches, you need to move the patch file you created in 1094 to pick up patches, you need to move the patch file you created in
@@ -891,32 +1097,40 @@ Section.
891 ``meta-mylayer``. When the layer was created using the 1097 ``meta-mylayer``. When the layer was created using the
892 ``yocto-create`` script, no additional hierarchy was created to 1098 ``yocto-create`` script, no additional hierarchy was created to
893 support patches. Before moving the patch file, you need to add 1099 support patches. Before moving the patch file, you need to add
894 additional structure to your layer using the following commands: $ cd 1100 additional structure to your layer using the following commands:
895 ~/meta-mylayer $ mkdir recipes-kernel $ mkdir recipes-kernel/linux $ 1101 ::
896 mkdir recipes-kernel/linux/linux-yocto Once you have created this 1102
1103 $ cd ~/meta-mylayer
1104 $ mkdir recipes-kernel
1105 $ mkdir recipes-kernel/linux
1106 $ mkdir recipes-kernel/linux/linux-yocto
1107
1108 Once you have created this
897 hierarchy in your layer, you can move the patch file using the 1109 hierarchy in your layer, you can move the patch file using the
898 following command: $ mv 1110 following command:
899 ~/linux-yocto-4.12/init/0001-calibrate.c-Added-some-printk-statements.patch 1111 ::
900 ~/meta-mylayer/recipes-kernel/linux/linux-yocto 1112
1113 $ mv ~/linux-yocto-4.12/init/0001-calibrate.c-Added-some-printk-statements.patch ~/meta-mylayer/recipes-kernel/linux/linux-yocto
901 1114
9029. *Create the Append File:* Finally, you need to create the 11159. *Create the Append File:* Finally, you need to create the
903 ``linux-yocto_4.12.bbappend`` file and insert statements that allow 1116 ``linux-yocto_4.12.bbappend`` file and insert statements that allow
904 the OpenEmbedded build system to find the patch. The append file 1117 the OpenEmbedded build system to find the patch. The append file
905 needs to be in your layer's ``recipes-kernel/linux`` directory and it 1118 needs to be in your layer's ``recipes-kernel/linux`` directory and it
906 must be named ``linux-yocto_4.12.bbappend`` and have the following 1119 must be named ``linux-yocto_4.12.bbappend`` and have the following
907 contents: FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" 1120 contents:
908 SRC_URI_append = " 1121 ::
909 file://0001-calibrate.c-Added-some-printk-statements.patch" The 1122
910 :term:`FILESEXTRAPATHS` 1123 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
911 and :term:`SRC_URI` statements 1124 SRC_URI_append = "file://0001-calibrate.c-Added-some-printk-statements.patch"
1125
1126 The :term:`FILESEXTRAPATHS` and :term:`SRC_URI` statements
912 enable the OpenEmbedded build system to find the patch file. 1127 enable the OpenEmbedded build system to find the patch file.
913 1128
914 For more information on append files and patches, see the "`Creating 1129 For more information on append files and patches, see the "`Creating
915 the Append File <#creating-the-append-file>`__" and "`Applying 1130 the Append File <#creating-the-append-file>`__" and "`Applying
916 Patches <#applying-patches>`__" sections. You can also see the 1131 Patches <#applying-patches>`__" sections. You can also see the
917 "`Using .bbappend Files in Your 1132 ":ref:`dev-manual/dev-manual-common-tasks:using .bbappend files in your layer`"
918 Layer" <&YOCTO_DOCS_DEV_URL;#using-bbappend-files>`__" section in the 1133 section in the Yocto Project Development Tasks Manual.
919 Yocto Project Development Tasks Manual.
920 1134
921 .. note:: 1135 .. note::
922 1136
@@ -934,7 +1148,7 @@ Section.
934 $ bitbake core-image-minimal -c cleanall 1148 $ bitbake core-image-minimal -c cleanall
935 $ bitbake core-image-minimal 1149 $ bitbake core-image-minimal
936 $ runqemu qemux86 1150 $ runqemu qemux86
937 1151
938 1152
939Configuring the Kernel 1153Configuring the Kernel
940====================== 1154======================
@@ -967,21 +1181,30 @@ environment, you must do the following:
967 1181
968- Because you launch ``menuconfig`` using BitBake, you must be sure to 1182- Because you launch ``menuconfig`` using BitBake, you must be sure to
969 set up your environment by running the 1183 set up your environment by running the
970 ````` <&YOCTO_DOCS_REF_URL;#structure-core-script>`__ script found in 1184 :ref:`structure-core-script` script found in
971 the :term:`Build Directory`. 1185 the :term:`Build Directory`.
972 1186
973- You must be sure of the state of your build's configuration in the 1187- You must be sure of the state of your build's configuration in the
974 :term:`Source Directory`. 1188 :term:`Source Directory`.
975 1189
976- Your build host must have the following two packages installed: 1190- Your build host must have the following two packages installed:
977 libncurses5-dev libtinfo-dev 1191 ::
1192
1193 libncurses5-dev
1194 libtinfo-dev
978 1195
979The following commands initialize the BitBake environment, run the 1196The following commands initialize the BitBake environment, run the
980:ref:`ref-tasks-kernel_configme` 1197:ref:`ref-tasks-kernel_configme`
981task, and launch ``menuconfig``. These commands assume the Source 1198task, and launch ``menuconfig``. These commands assume the Source
982Directory's top-level folder is ``~/poky``: $ cd poky $ source 1199Directory's top-level folder is ``~/poky``:
983oe-init-build-env $ bitbake linux-yocto -c kernel_configme -f $ bitbake 1200::
984linux-yocto -c menuconfig Once ``menuconfig`` comes up, its standard 1201
1202 $ cd poky
1203 $ source oe-init-build-env
1204 $ bitbake linux-yocto -c kernel_configme -f
1205 $ bitbake linux-yocto -c menuconfig
1206
1207Once ``menuconfig`` comes up, its standard
985interface allows you to interactively examine and configure all the 1208interface allows you to interactively examine and configure all the
986kernel configuration parameters. After making your changes, simply exit 1209kernel configuration parameters. After making your changes, simply exit
987the tool and save your changes to create an updated version of the 1210the tool and save your changes to create an updated version of the
@@ -1036,8 +1259,10 @@ area where the specific kernel is built. For example, if you were
1036building a Linux Yocto kernel based on the ``linux-yocto-4.12`` kernel 1259building a Linux Yocto kernel based on the ``linux-yocto-4.12`` kernel
1037and you were building a QEMU image targeted for ``x86`` architecture, 1260and you were building a QEMU image targeted for ``x86`` architecture,
1038the ``.config`` file would be: 1261the ``.config`` file would be:
1039poky/build/tmp/work/qemux86-poky-linux/linux-yocto/4.12.12+gitAUTOINC+eda4d18... 1262::
1040...967-r0/linux-qemux86-standard-build/.config 1263
1264 poky/build/tmp/work/qemux86-poky-linux/linux-yocto/4.12.12+gitAUTOINC+eda4d18...
1265 ...967-r0/linux-qemux86-standard-build/.config
1041 1266
1042.. note:: 1267.. note::
1043 1268
@@ -1048,7 +1273,10 @@ poky/build/tmp/work/qemux86-poky-linux/linux-yocto/4.12.12+gitAUTOINC+eda4d18...
1048 1273
1049Within the ``.config`` file, you can see the kernel settings. For 1274Within the ``.config`` file, you can see the kernel settings. For
1050example, the following entry shows that symmetric multi-processor 1275example, the following entry shows that symmetric multi-processor
1051support is not set: # CONFIG_SMP is not set 1276support is not set:
1277::
1278
1279 # CONFIG_SMP is not set
1052 1280
1053A good method to isolate changed configurations is to use a combination 1281A good method to isolate changed configurations is to use a combination
1054of the ``menuconfig`` tool and simple shell commands. Before changing 1282of the ``menuconfig`` tool and simple shell commands. Before changing
@@ -1094,12 +1322,14 @@ your layer's ``recipes-kernel/linux`` directory, and rename the copied
1094file to "defconfig" (e.g. 1322file to "defconfig" (e.g.
1095``~/meta-mylayer/recipes-kernel/linux/linux-yocto/defconfig``). Then, 1323``~/meta-mylayer/recipes-kernel/linux/linux-yocto/defconfig``). Then,
1096add the following lines to the linux-yocto ``.bbappend`` file in your 1324add the following lines to the linux-yocto ``.bbappend`` file in your
1097layer: FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI += 1325layer:
1098"file://defconfig" The 1326::
1099:term:`SRC_URI` tells the build 1327
1100system how to search for the file, while the 1328 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
1101:term:`FILESEXTRAPATHS` 1329 SRC_URI += "file://defconfig"
1102extends the :term:`FILESPATH` 1330
1331The :term:`SRC_URI` tells the build system how to search for the file, while the
1332:term:`FILESEXTRAPATHS` extends the :term:`FILESPATH`
1103variable (search directories) to include the ``${PN}`` directory you 1333variable (search directories) to include the ``${PN}`` directory you
1104created to hold the configuration changes. 1334created to hold the configuration changes.
1105 1335
@@ -1140,16 +1370,17 @@ appear in the ``.config`` file, which is in the :term:`Build Directory`.
1140 1370
1141 For more information about where the 1371 For more information about where the
1142 .config 1372 .config
1143 file is located, see the example in the " 1373 file is located, see the example in the
1144 Using 1374 ":ref:`kernel-dev/kernel-dev-common:using \`\`menuconfig\`\``"
1145 menuconfig 1375 section.
1146 " section.
1147 1376
1148It is simple to create a configuration fragment. One method is to use 1377It is simple to create a configuration fragment. One method is to use
1149shell commands. For example, issuing the following from the shell 1378shell commands. For example, issuing the following from the shell
1150creates a configuration fragment file named ``my_smp.cfg`` that enables 1379creates a configuration fragment file named ``my_smp.cfg`` that enables
1151multi-processor support within the kernel: $ echo "CONFIG_SMP=y" >> 1380multi-processor support within the kernel:
1152my_smp.cfg 1381::
1382
1383 $ echo "CONFIG_SMP=y" >> my_smp.cfg
1153 1384
1154.. note:: 1385.. note::
1155 1386
@@ -1166,20 +1397,29 @@ To create a configuration fragment using this method, follow these
1166steps: 1397steps:
1167 1398
11681. *Complete a Build Through Kernel Configuration:* Complete a build at 13991. *Complete a Build Through Kernel Configuration:* Complete a build at
1169 least through the kernel configuration task as follows: $ bitbake 1400 least through the kernel configuration task as follows:
1170 linux-yocto -c kernel_configme -f This step ensures that you create a 1401 ::
1402
1403 $ bitbake linux-yocto -c kernel_configme -f
1404
1405 This step ensures that you create a
1171 ``.config`` file from a known state. Because situations exist where 1406 ``.config`` file from a known state. Because situations exist where
1172 your build state might become unknown, it is best to run this task 1407 your build state might become unknown, it is best to run this task
1173 prior to starting ``menuconfig``. 1408 prior to starting ``menuconfig``.
1174 1409
11752. *Launch ``menuconfig``:* Run the ``menuconfig`` command: $ bitbake 14102. *Launch menuconfig:* Run the ``menuconfig`` command:
1176 linux-yocto -c menuconfig 1411 ::
1412
1413 $ bitbake linux-yocto -c menuconfig
1177 1414
11783. *Create the Configuration Fragment:* Run the ``diffconfig`` command 14153. *Create the Configuration Fragment:* Run the ``diffconfig`` command
1179 to prepare a configuration fragment. The resulting file 1416 to prepare a configuration fragment. The resulting file
1180 ``fragment.cfg`` is placed in the 1417 ``fragment.cfg`` is placed in the
1181 ``${``\ :term:`WORKDIR`\ ``}`` 1418 ``${``\ :term:`WORKDIR`\ ``}``
1182 directory: $ bitbake linux-yocto -c diffconfig 1419 directory:
1420 ::
1421
1422 $ bitbake linux-yocto -c diffconfig
1183 1423
1184The ``diffconfig`` command creates a file that is a list of Linux kernel 1424The ``diffconfig`` command creates a file that is a list of Linux kernel
1185``CONFIG_`` assignments. See the "`Changing the 1425``CONFIG_`` assignments. See the "`Changing the
@@ -1204,59 +1444,94 @@ directory named ``linux-yocto`` that resides in the same directory as
1204the kernel's append file within your layer and then add the following 1444the kernel's append file within your layer and then add the following
1205statements to the kernel's append file, those configuration options will 1445statements to the kernel's append file, those configuration options will
1206be picked up and applied when the kernel is built: 1446be picked up and applied when the kernel is built:
1207FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI += 1447::
1208"file://myconfig.cfg" 1448
1449 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
1450 SRC_URI += "file://myconfig.cfg"
1209 1451
1210As mentioned earlier, you can group related configurations into multiple 1452As mentioned earlier, you can group related configurations into multiple
1211files and name them all in the ``SRC_URI`` statement as well. For 1453files and name them all in the ``SRC_URI`` statement as well. For
1212example, you could group separate configurations specifically for 1454example, you could group separate configurations specifically for
1213Ethernet and graphics into their own files and add those by using a 1455Ethernet and graphics into their own files and add those by using a
1214``SRC_URI`` statement like the following in your append file: SRC_URI += 1456``SRC_URI`` statement like the following in your append file:
1215"file://myconfig.cfg \\ file://eth.cfg \\ file://gfx.cfg" 1457::
1458
1459 SRC_URI += "file://myconfig.cfg \
1460 file://eth.cfg \
1461 file://gfx.cfg"
1216 1462
1217Validating Configuration 1463Validating Configuration
1218------------------------ 1464------------------------
1219 1465
1220You can use the 1466You can use the
1221:ref:`ref-tasks-kernel_configcheck` 1467:ref:`ref-tasks-kernel_configcheck`
1222task to provide configuration validation: $ bitbake linux-yocto -c 1468task to provide configuration validation:
1223kernel_configcheck -f Running this task produces warnings for when a 1469::
1470
1471 $ bitbake linux-yocto -c kernel_configcheck -f
1472
1473Running this task produces warnings for when a
1224requested configuration does not appear in the final ``.config`` file or 1474requested configuration does not appear in the final ``.config`` file or
1225when you override a policy configuration in a hardware configuration 1475when you override a policy configuration in a hardware configuration
1226fragment. 1476fragment.
1227 1477
1228In order to run this task, you must have an existing ``.config`` file. 1478In order to run this task, you must have an existing ``.config`` file.
1229See the "`Using ``menuconfig`` <#using-menuconfig>`__" section for 1479See the ":ref:`kernel-dev/kernel-dev-common:using \`\`menuconfig\`\``" section for
1230information on how to create a configuration file. 1480information on how to create a configuration file.
1231 1481
1232Following is sample output from the ``do_kernel_configcheck`` task: 1482Following is sample output from the ``do_kernel_configcheck`` task:
1233Loading cache: 100% 1483::
1234\|########################################################\| Time: 1484
12350:00:00 Loaded 1275 entries from dependency cache. NOTE: Resolving any 1485 Loading cache: 100% |########################################################| Time: 0:00:00
1236missing task queue dependencies Build Configuration: . . . NOTE: 1486 Loaded 1275 entries from dependency cache.
1237Executing SetScene Tasks NOTE: Executing RunQueue Tasks WARNING: 1487 NOTE: Resolving any missing task queue dependencies
1238linux-yocto-4.12.12+gitAUTOINC+eda4d18ce4_16de014967-r0 1488
1239do_kernel_configcheck: [kernel config]: specified values did not make it 1489 Build Configuration:
1240into the kernel's final configuration: ---------- CONFIG_X86_TSC 1490 .
1241----------------- Config: CONFIG_X86_TSC From: 1491 .
1242/home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standard/bsp/common-pc/common-pc-cpu.cfg 1492 .
1243Requested value: CONFIG_X86_TSC=y Actual value: ---------- 1493
1244CONFIG_X86_BIGSMP ----------------- Config: CONFIG_X86_BIGSMP From: 1494 NOTE: Executing SetScene Tasks
1245/home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standard/cfg/smp.cfg 1495 NOTE: Executing RunQueue Tasks
1246/home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standard/defconfig 1496 WARNING: linux-yocto-4.12.12+gitAUTOINC+eda4d18ce4_16de014967-r0 do_kernel_configcheck:
1247Requested value: # CONFIG_X86_BIGSMP is not set Actual value: ---------- 1497 [kernel config]: specified values did not make it into the kernel's final configuration:
1248CONFIG_NR_CPUS ----------------- Config: CONFIG_NR_CPUS From: 1498
1249/home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standard/cfg/smp.cfg 1499 ---------- CONFIG_X86_TSC -----------------
1250/home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standard/bsp/common-pc/common-pc.cfg 1500 Config: CONFIG_X86_TSC
1251/home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standard/defconfig 1501 From: /home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standard/bsp/common-pc/common-pc-cpu.cfg
1252Requested value: CONFIG_NR_CPUS=8 Actual value: CONFIG_NR_CPUS=1 1502 Requested value: CONFIG_X86_TSC=y
1253---------- CONFIG_SCHED_SMT ----------------- Config: CONFIG_SCHED_SMT 1503 Actual value:
1254From: 1504
1255/home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standard/cfg/smp.cfg 1505
1256/home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standard/defconfig 1506 ---------- CONFIG_X86_BIGSMP -----------------
1257Requested value: CONFIG_SCHED_SMT=y Actual value: NOTE: Tasks Summary: 1507 Config: CONFIG_X86_BIGSMP
1258Attempted 288 tasks of which 285 didn't need to be rerun and all 1508 From: /home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standard/cfg/smp.cfg
1259succeeded. Summary: There were 3 WARNING messages shown. 1509 /home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standard/defconfig
1510 Requested value: # CONFIG_X86_BIGSMP is not set
1511 Actual value:
1512
1513
1514 ---------- CONFIG_NR_CPUS -----------------
1515 Config: CONFIG_NR_CPUS
1516 From: /home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standard/cfg/smp.cfg
1517 /home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standard/bsp/common-pc/common-pc.cfg
1518 /home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standard/defconfig
1519 Requested value: CONFIG_NR_CPUS=8
1520 Actual value: CONFIG_NR_CPUS=1
1521
1522
1523 ---------- CONFIG_SCHED_SMT -----------------
1524 Config: CONFIG_SCHED_SMT
1525 From: /home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standard/cfg/smp.cfg
1526 /home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standard/defconfig
1527 Requested value: CONFIG_SCHED_SMT=y
1528 Actual value:
1529
1530
1531
1532 NOTE: Tasks Summary: Attempted 288 tasks of which 285 didn't need to be rerun and all succeeded.
1533
1534 Summary: There were 3 WARNING messages shown.
1260 1535
1261.. note:: 1536.. note::
1262 1537
@@ -1273,7 +1548,7 @@ and
1273tasks until they produce no warnings. 1548tasks until they produce no warnings.
1274 1549
1275For more information on how to use the ``menuconfig`` tool, see the 1550For more information on how to use the ``menuconfig`` tool, see the
1276"`Using ``menuconfig`` <#using-menuconfig>`__" section. 1551:ref:`kernel-dev/kernel-dev-common:using \`\`menuconfig\`\`` section.
1277 1552
1278Fine-Tuning the Kernel Configuration File 1553Fine-Tuning the Kernel Configuration File
1279----------------------------------------- 1554-----------------------------------------
@@ -1319,9 +1594,11 @@ To streamline the configuration, do the following:
1319 successfully. Use this configuration file as your baseline. 1594 successfully. Use this configuration file as your baseline.
1320 1595
13212. *Run Configure and Check Tasks:* Separately run the 15962. *Run Configure and Check Tasks:* Separately run the
1322 ``do_kernel_configme`` and ``do_kernel_configcheck`` tasks: $ bitbake 1597 ``do_kernel_configme`` and ``do_kernel_configcheck`` tasks:
1323 linux-yocto -c kernel_configme -f $ bitbake linux-yocto -c 1598 ::
1324 kernel_configcheck -f 1599
1600 $ bitbake linux-yocto -c kernel_configme -f
1601 $ bitbake linux-yocto -c kernel_configcheck -f
1325 1602
13263. *Process the Results:* Take the resulting list of files from the 16033. *Process the Results:* Take the resulting list of files from the
1327 ``do_kernel_configcheck`` task warnings and do the following: 1604 ``do_kernel_configcheck`` task warnings and do the following:
@@ -1352,8 +1629,12 @@ Expanding Variables
1352Sometimes it is helpful to determine what a variable expands to during a 1629Sometimes it is helpful to determine what a variable expands to during a
1353build. You can do examine the values of variables by examining the 1630build. You can do examine the values of variables by examining the
1354output of the ``bitbake -e`` command. The output is long and is more 1631output of the ``bitbake -e`` command. The output is long and is more
1355easily managed in a text file, which allows for easy searches: $ bitbake 1632easily managed in a text file, which allows for easy searches:
1356-e virtual/kernel > some_text_file Within the text file, you can see 1633::
1634
1635 $ bitbake -e virtual/kernel > some_text_file
1636
1637Within the text file, you can see
1357exactly how each variable is expanded and used by the OpenEmbedded build 1638exactly how each variable is expanded and used by the OpenEmbedded build
1358system. 1639system.
1359 1640
@@ -1366,22 +1647,27 @@ source directory. Follow these steps to clean up the version string:
1366 1647
13671. *Discover the Uncommitted Changes:* Go to the kernel's locally cloned 16481. *Discover the Uncommitted Changes:* Go to the kernel's locally cloned
1368 Git repository (source directory) and use the following Git command 1649 Git repository (source directory) and use the following Git command
1369 to list the files that have been changed, added, or removed: $ git 1650 to list the files that have been changed, added, or removed:
1370 status 1651 ::
1652
1653 $ git status
1371 1654
13722. *Commit the Changes:* You should commit those changes to the kernel 16552. *Commit the Changes:* You should commit those changes to the kernel
1373 source tree regardless of whether or not you will save, export, or 1656 source tree regardless of whether or not you will save, export, or
1374 use the changes: $ git add $ git commit -s -a -m "getting rid of 1657 use the changes:
1375 -dirty" 1658 ::
1659
1660 $ git add
1661 $ git commit -s -a -m "getting rid of -dirty"
1376 1662
13773. *Rebuild the Kernel Image:* Once you commit the changes, rebuild the 16633. *Rebuild the Kernel Image:* Once you commit the changes, rebuild the
1378 kernel. 1664 kernel.
1379 1665
1380 Depending on your particular kernel development workflow, the 1666 Depending on your particular kernel development workflow, the
1381 commands you use to rebuild the kernel might differ. For information 1667 commands you use to rebuild the kernel might differ. For information
1382 on building the kernel image when using ``devtool``, see the "`Using 1668 on building the kernel image when using ``devtool``, see the
1383 ``devtool`` to Patch the 1669 ":ref:`kernel-dev/kernel-dev-common:using \`\`devtool\`\` to patch the kernel`"
1384 Kernel <#using-devtool-to-patch-the-kernel>`__" section. For 1670 section. For
1385 information on building the kernel image when using Bitbake, see the 1671 information on building the kernel image when using Bitbake, see the
1386 "`Using Traditional Kernel Development to Patch the 1672 "`Using Traditional Kernel Development to Patch the
1387 Kernel <#using-traditional-kernel-development-to-patch-the-kernel>`__" 1673 Kernel <#using-traditional-kernel-development-to-patch-the-kernel>`__"
@@ -1405,7 +1691,10 @@ linux-yocto custom recipe (``linux-yocto-custom.bb``) that uses
1405``kernel.org`` sources and the Yocto Project Linux kernel tools for 1691``kernel.org`` sources and the Yocto Project Linux kernel tools for
1406managing kernel Metadata. You can find this recipe in the ``poky`` Git 1692managing kernel Metadata. You can find this recipe in the ``poky`` Git
1407repository of the Yocto Project :yocto_git:`Source Repository <>` 1693repository of the Yocto Project :yocto_git:`Source Repository <>`
1408at: poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb 1694at:
1695::
1696
1697 poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb
1409 1698
1410Here are some basic steps you can use to work with your own sources: 1699Here are some basic steps you can use to work with your own sources:
1411 1700
@@ -1424,7 +1713,12 @@ Here are some basic steps you can use to work with your own sources:
1424 ``defconfig`` file or configuration fragment files in your layer. 1713 ``defconfig`` file or configuration fragment files in your layer.
1425 When you use the ``linux-yocto-custom.bb`` recipe, you must specify a 1714 When you use the ``linux-yocto-custom.bb`` recipe, you must specify a
1426 configuration. If you do not have a ``defconfig`` file, you can run 1715 configuration. If you do not have a ``defconfig`` file, you can run
1427 the following: $ make defconfig After running the command, copy the 1716 the following:
1717 ::
1718
1719 $ make defconfig
1720
1721 After running the command, copy the
1428 resulting ``.config`` file to the ``files`` directory in your layer 1722 resulting ``.config`` file to the ``files`` directory in your layer
1429 as "defconfig" and then add it to the 1723 as "defconfig" and then add it to the
1430 :term:`SRC_URI` variable in the 1724 :term:`SRC_URI` variable in the
@@ -1518,8 +1812,13 @@ is running that image.
1518 1812
1519Prior to attempting to build the out-of-tree modules, you need to be on 1813Prior to attempting to build the out-of-tree modules, you need to be on
1520the target as root and you need to change to the ``/usr/src/kernel`` 1814the target as root and you need to change to the ``/usr/src/kernel``
1521directory. Next, ``make`` the scripts: # cd /usr/src/kernel # make 1815directory. Next, ``make`` the scripts:
1522scripts Because all SDK image recipes include ``dev-pkgs``, the 1816::
1817
1818 # cd /usr/src/kernel
1819 # make scripts
1820
1821Because all SDK image recipes include ``dev-pkgs``, the
1523``kernel-dev`` packages will be installed as part of the SDK image and 1822``kernel-dev`` packages will be installed as part of the SDK image and
1524the ``kernel-devsrc`` packages will be installed as part of applicable 1823the ``kernel-devsrc`` packages will be installed as part of applicable
1525SDK images. The SDK uses the scripts when building out-of-tree modules. 1824SDK images. The SDK uses the scripts when building out-of-tree modules.
@@ -1536,7 +1835,9 @@ create your own out-of-tree Linux kernel module recipe.
1536 1835
1537This template recipe is located in the ``poky`` Git repository of the 1836This template recipe is located in the ``poky`` Git repository of the
1538Yocto Project :yocto_git:`Source Repository <>` at: 1837Yocto Project :yocto_git:`Source Repository <>` at:
1539poky/meta-skeleton/recipes-kernel/hello-mod/hello-mod_0.1.bb 1838::
1839
1840 poky/meta-skeleton/recipes-kernel/hello-mod/hello-mod_0.1.bb
1540 1841
1541To get started, copy this recipe to your layer and give it a meaningful 1842To get started, copy this recipe to your layer and give it a meaningful
1542name (e.g. ``mymodule_1.0.bb``). In the same directory, create a new 1843name (e.g. ``mymodule_1.0.bb``). In the same directory, create a new
@@ -1555,14 +1856,22 @@ Typically, you will need to set the following variables:
1555 1856
1556Depending on the build system used by the module sources, you might need 1857Depending on the build system used by the module sources, you might need
1557to make some adjustments. For example, a typical module ``Makefile`` 1858to make some adjustments. For example, a typical module ``Makefile``
1558looks much like the one provided with the ``hello-mod`` template: obj-m 1859looks much like the one provided with the ``hello-mod`` template:
1559:= hello.o SRC := $(shell pwd) all: $(MAKE) -C $(KERNEL_SRC) M=$(SRC) 1860::
1560modules_install: $(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install ... 1861
1561 1862 obj-m := hello.o
1562The important point to note here is the 1863
1563:term:`KERNEL_SRC` variable. The 1864 SRC := $(shell pwd)
1564:ref:`module <ref-classes-module>` class sets this 1865
1565variable and the 1866 all:
1867 $(MAKE) -C $(KERNEL_SRC) M=$(SRC)
1868
1869 modules_install:
1870 $(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install
1871 ...
1872
1873The important point to note here is the :term:`KERNEL_SRC` variable. The
1874:ref:`module <ref-classes-module>` class sets this variable and the
1566:term:`KERNEL_PATH` variable to 1875:term:`KERNEL_PATH` variable to
1567``${STAGING_KERNEL_DIR}`` with the necessary Linux kernel build 1876``${STAGING_KERNEL_DIR}`` with the necessary Linux kernel build
1568information to build modules. If your module ``Makefile`` uses a 1877information to build modules. If your module ``Makefile`` uses a
@@ -1586,7 +1895,11 @@ them appropriately for your machine configuration file:
1586 1895
1587Modules are often not required for boot and can be excluded from certain 1896Modules are often not required for boot and can be excluded from certain
1588build configurations. The following allows for the most flexibility: 1897build configurations. The following allows for the most flexibility:
1589MACHINE_EXTRA_RRECOMMENDS += "kernel-module-mymodule" The value is 1898::
1899
1900 MACHINE_EXTRA_RRECOMMENDS += "kernel-module-mymodule"
1901
1902The value is
1590derived by appending the module filename without the ``.ko`` extension 1903derived by appending the module filename without the ``.ko`` extension
1591to the string "kernel-module-". 1904to the string "kernel-module-".
1592 1905
@@ -1628,32 +1941,50 @@ Here is an example that looks at what has changed in the ``emenlow``
1628branch of the ``linux-yocto-3.19`` kernel. The lower commit range is the 1941branch of the ``linux-yocto-3.19`` kernel. The lower commit range is the
1629commit associated with the ``standard/base`` branch, while the upper 1942commit associated with the ``standard/base`` branch, while the upper
1630commit range is the commit associated with the ``standard/emenlow`` 1943commit range is the commit associated with the ``standard/emenlow``
1631branch. $ git whatchanged origin/standard/base..origin/standard/emenlow 1944branch.
1945::
1946
1947 $ git whatchanged origin/standard/base..origin/standard/emenlow
1632 1948
1633To see short, one line summaries of changes use the ``git log`` command: 1949To see short, one line summaries of changes use the ``git log`` command:
1634$ git log --oneline origin/standard/base..origin/standard/emenlow 1950::
1951
1952 $ git log --oneline origin/standard/base..origin/standard/emenlow
1953
1954Use this command to see code differences for the changes:
1955::
1635 1956
1636Use this command to see code differences for the changes: $ git diff 1957 $ git diff origin/standard/base..origin/standard/emenlow
1637origin/standard/base..origin/standard/emenlow
1638 1958
1639Use this command to see the commit log messages and the text 1959Use this command to see the commit log messages and the text
1640differences: $ git show origin/standard/base..origin/standard/emenlow 1960differences:
1961::
1962
1963 $ git show origin/standard/base..origin/standard/emenlow
1641 1964
1642Use this command to create individual patches for each change. Here is 1965Use this command to create individual patches for each change. Here is
1643an example that that creates patch files for each commit and places them 1966an example that that creates patch files for each commit and places them
1644in your ``Documents`` directory: $ git format-patch -o $HOME/Documents 1967in your ``Documents`` directory:
1645origin/standard/base..origin/standard/emenlow 1968::
1969
1970 $ git format-patch -o $HOME/Documents origin/standard/base..origin/standard/emenlow
1646 1971
1647Showing a Particular Feature or Branch Change 1972Showing a Particular Feature or Branch Change
1648--------------------------------------------- 1973---------------------------------------------
1649 1974
1650Tags in the Yocto Project kernel tree divide changes for significant 1975Tags in the Yocto Project kernel tree divide changes for significant
1651features or branches. The ``git show`` tag command shows changes based 1976features or branches. The ``git show`` tag command shows changes based
1652on a tag. Here is an example that shows ``systemtap`` changes: $ git 1977on a tag. Here is an example that shows ``systemtap`` changes:
1653show systemtap You can use the ``git branch --contains`` tag command to 1978::
1979
1980 $ git show systemtap
1981
1982You can use the ``git branch --contains`` tag command to
1654show the branches that contain a particular feature. This command shows 1983show the branches that contain a particular feature. This command shows
1655the branches that contain the ``systemtap`` feature: $ git branch 1984the branches that contain the ``systemtap`` feature:
1656--contains systemtap 1985::
1986
1987 $ git branch --contains systemtap
1657 1988
1658Adding Recipe-Space Kernel Features 1989Adding Recipe-Space Kernel Features
1659=================================== 1990===================================
@@ -1706,19 +2037,37 @@ build.
1706 searched during the build as potential feature directories. 2037 searched during the build as potential feature directories.
1707 2038
1708 Continuing with the example, suppose the "test.scc" feature you are 2039 Continuing with the example, suppose the "test.scc" feature you are
1709 adding has a ``test.scc`` file in the following directory: my_recipe 2040 adding has a ``test.scc`` file in the following directory:
1710 \| +-linux-yocto \| +-test.cfg +-test.scc In this example, the 2041 ::
2042
2043 my_recipe
2044 |
2045 +-linux-yocto
2046 |
2047 +-test.cfg
2048 +-test.scc
2049
2050 In this example, the
1711 ``linux-yocto`` directory has both the feature ``test.scc`` file and 2051 ``linux-yocto`` directory has both the feature ``test.scc`` file and
1712 a similarly named configuration fragment file ``test.cfg``. 2052 a similarly named configuration fragment file ``test.cfg``.
1713 2053
17142. *Add the Feature File to ``SRC_URI``:* Add the ``.scc`` file to the 20542. *Add the Feature File to SRC_URI:* Add the ``.scc`` file to the
1715 recipe's ``SRC_URI`` statement: SRC_URI_append = " file://test.scc" 2055 recipe's ``SRC_URI`` statement:
2056 ::
2057
2058 SRC_URI_append = " file://test.scc"
2059
1716 The leading space before the path is important as the path is 2060 The leading space before the path is important as the path is
1717 appended to the existing path. 2061 appended to the existing path.
1718 2062
17193. *Specify the Feature as a Kernel Feature:* Use the 20633. *Specify the Feature as a Kernel Feature:* Use the
1720 ``KERNEL_FEATURES`` statement to specify the feature as a kernel 2064 ``KERNEL_FEATURES`` statement to specify the feature as a kernel
1721 feature: KERNEL_FEATURES_append = " test.scc" The OpenEmbedded build 2065 feature:
2066 ::
2067
2068 KERNEL_FEATURES_append = " test.scc"
2069
2070 The OpenEmbedded build
1722 system processes the kernel feature when it builds the kernel. 2071 system processes the kernel feature when it builds the kernel.
1723 2072
1724 .. note:: 2073 .. note::
diff --git a/documentation/kernel-dev/kernel-dev-concepts-appx.rst b/documentation/kernel-dev/kernel-dev-concepts-appx.rst
index a4611d1ae4..4ddb7ddb60 100644
--- a/documentation/kernel-dev/kernel-dev-concepts-appx.rst
+++ b/documentation/kernel-dev/kernel-dev-concepts-appx.rst
@@ -36,47 +36,46 @@ and custom features. These additions result in a commercially released
36Yocto Project Linux kernel that caters to specific embedded designer 36Yocto Project Linux kernel that caters to specific embedded designer
37needs for targeted hardware. 37needs for targeted hardware.
38 38
39You can find a web interface to the Yocto Linux kernels in the `Source 39You can find a web interface to the Yocto Linux kernels in the
40Repositories <&YOCTO_DOCS_OM_URL;#source-repositories>`__ at 40:ref:`overview-manual/overview-manual-development-environment:yocto project source repositories`
41:yocto_git:`/`. If you look at the interface, you will see to 41at :yocto_git:`/`. If you look at the interface, you will see to
42the left a grouping of Git repositories titled "Yocto Linux Kernel". 42the left a grouping of Git repositories titled "Yocto Linux Kernel".
43Within this group, you will find several Linux Yocto kernels developed 43Within this group, you will find several Linux Yocto kernels developed
44and included with Yocto Project releases: 44and included with Yocto Project releases:
45 45
46- *``linux-yocto-4.1``:* The stable Yocto Project kernel to use with 46- *linux-yocto-4.1:* The stable Yocto Project kernel to use with
47 the Yocto Project Release 2.0. This kernel is based on the Linux 4.1 47 the Yocto Project Release 2.0. This kernel is based on the Linux 4.1
48 released kernel. 48 released kernel.
49 49
50- *``linux-yocto-4.4``:* The stable Yocto Project kernel to use with 50- *linux-yocto-4.4:* The stable Yocto Project kernel to use with
51 the Yocto Project Release 2.1. This kernel is based on the Linux 4.4 51 the Yocto Project Release 2.1. This kernel is based on the Linux 4.4
52 released kernel. 52 released kernel.
53 53
54- *``linux-yocto-4.6``:* A temporary kernel that is not tied to any 54- *linux-yocto-4.6:* A temporary kernel that is not tied to any
55 Yocto Project release. 55 Yocto Project release.
56 56
57- *``linux-yocto-4.8``:* The stable yocto Project kernel to use with 57- *linux-yocto-4.8:* The stable yocto Project kernel to use with
58 the Yocto Project Release 2.2. 58 the Yocto Project Release 2.2.
59 59
60- *``linux-yocto-4.9``:* The stable Yocto Project kernel to use with 60- *linux-yocto-4.9:* The stable Yocto Project kernel to use with
61 the Yocto Project Release 2.3. This kernel is based on the Linux 4.9 61 the Yocto Project Release 2.3. This kernel is based on the Linux 4.9
62 released kernel. 62 released kernel.
63 63
64- *``linux-yocto-4.10``:* The default stable Yocto Project kernel to 64- *linux-yocto-4.10:* The default stable Yocto Project kernel to
65 use with the Yocto Project Release 2.3. This kernel is based on the 65 use with the Yocto Project Release 2.3. This kernel is based on the
66 Linux 4.10 released kernel. 66 Linux 4.10 released kernel.
67 67
68- *``linux-yocto-4.12``:* The default stable Yocto Project kernel to 68- *linux-yocto-4.12:* The default stable Yocto Project kernel to
69 use with the Yocto Project Release 2.4. This kernel is based on the 69 use with the Yocto Project Release 2.4. This kernel is based on the
70 Linux 4.12 released kernel. 70 Linux 4.12 released kernel.
71 71
72- *``yocto-kernel-cache``:* The ``linux-yocto-cache`` contains patches 72- *yocto-kernel-cache:* The ``linux-yocto-cache`` contains patches
73 and configurations for the linux-yocto kernel tree. This repository 73 and configurations for the linux-yocto kernel tree. This repository
74 is useful when working on the linux-yocto kernel. For more 74 is useful when working on the linux-yocto kernel. For more
75 information on this "Advanced Kernel Metadata", see the "`Working 75 information on this "Advanced Kernel Metadata", see the
76 With Advanced Metadata 76 ":doc:`kernel-dev-advanced`" Chapter.
77 (``yocto-kernel-cache``) <#kernel-dev-advanced>`__" Chapter.
78 77
79- *``linux-yocto-dev``:* A development kernel based on the latest 78- *linux-yocto-dev:* A development kernel based on the latest
80 upstream release candidate available. 79 upstream release candidate available.
81 80
82.. note:: 81.. note::
@@ -164,7 +163,7 @@ implemented by the Yocto Project team using the Source Code Manager
164 - You can find documentation on Git at 163 - You can find documentation on Git at
165 http://git-scm.com/documentation. You can also get an 164 http://git-scm.com/documentation. You can also get an
166 introduction to Git as it applies to the Yocto Project in the 165 introduction to Git as it applies to the Yocto Project in the
167 "`Git <&YOCTO_DOCS_OM_URL;#git>`__" section in the Yocto Project 166 ":ref:`overview-manual/overview-manual-development-environment:git`" section in the Yocto Project
168 Overview and Concepts Manual. The latter reference provides an 167 Overview and Concepts Manual. The latter reference provides an
169 overview of Git and presents a minimal set of Git commands that 168 overview of Git and presents a minimal set of Git commands that
170 allows you to be functional using Git. You can use as much, or as 169 allows you to be functional using Git. You can use as much, or as
@@ -295,17 +294,16 @@ available on your host system.
295Kernel source code is available on your host system several different 294Kernel source code is available on your host system several different
296ways: 295ways:
297 296
298- *Files Accessed While using ``devtool``:* ``devtool``, which is 297- *Files Accessed While using devtool:* ``devtool``, which is
299 available with the Yocto Project, is the preferred method by which to 298 available with the Yocto Project, is the preferred method by which to
300 modify the kernel. See the "`Kernel Modification 299 modify the kernel. See the ":ref:`kernel-dev/kernel-dev-intro:kernel modification workflow`" section.
301 Workflow <#kernel-modification-workflow>`__" section.
302 300
303- *Cloned Repository:* If you are working in the kernel all the time, 301- *Cloned Repository:* If you are working in the kernel all the time,
304 you probably would want to set up your own local Git repository of 302 you probably would want to set up your own local Git repository of
305 the Yocto Linux kernel tree. For information on how to clone a Yocto 303 the Yocto Linux kernel tree. For information on how to clone a Yocto
306 Linux kernel Git repository, see the "`Preparing the Build Host to 304 Linux kernel Git repository, see the
307 Work on the 305 ":ref:`kernel-dev/kernel-dev-common:preparing the build host to work on the kernel`"
308 Kernel <#preparing-the-build-host-to-work-on-the-kernel>`__" section. 306 section.
309 307
310- *Temporary Source Files from a Build:* If you just need to make some 308- *Temporary Source Files from a Build:* If you just need to make some
311 patches to the kernel using a traditional BitBake workflow (i.e. not 309 patches to the kernel using a traditional BitBake workflow (i.e. not
@@ -331,13 +329,12 @@ source files used during the build.
331 :align: center 329 :align: center
332 330
333Again, for additional information on the Yocto Project kernel's 331Again, for additional information on the Yocto Project kernel's
334architecture and its branching strategy, see the "`Yocto Linux Kernel 332architecture and its branching strategy, see the
335Architecture and Branching 333":ref:`kernel-dev/kernel-dev-concepts-appx:yocto linux kernel architecture and branching strategies`"
336Strategies <#yocto-linux-kernel-architecture-and-branching-strategies>`__" 334section. You can also reference the
337section. You can also reference the "`Using ``devtool`` to Patch the 335":ref:`kernel-dev/kernel-dev-common:using \`\`devtool\`\` to patch the kernel`"
338Kernel <#using-devtool-to-patch-the-kernel>`__" and "`Using Traditional 336and
339Kernel Development to Patch the 337":ref:`kernel-dev/kernel-dev-common:using traditional kernel development to patch the kernel`"
340Kernel <#using-traditional-kernel-development-to-patch-the-kernel>`__"
341sections for detailed example that modifies the kernel. 338sections for detailed example that modifies the kernel.
342 339
343Determining Hardware and Non-Hardware Features for the Kernel Configuration Audit Phase 340Determining Hardware and Non-Hardware Features for the Kernel Configuration Audit Phase
@@ -346,8 +343,8 @@ Determining Hardware and Non-Hardware Features for the Kernel Configuration Audi
346This section describes part of the kernel configuration audit phase that 343This section describes part of the kernel configuration audit phase that
347most developers can ignore. For general information on kernel 344most developers can ignore. For general information on kernel
348configuration including ``menuconfig``, ``defconfig`` files, and 345configuration including ``menuconfig``, ``defconfig`` files, and
349configuration fragments, see the "`Configuring the 346configuration fragments, see the
350Kernel <#configuring-the-kernel>`__" section. 347":ref:`kernel-dev/kernel-dev-common:configuring the kernel`" section.
351 348
352During this part of the audit phase, the contents of the final 349During this part of the audit phase, the contents of the final
353``.config`` file are compared against the fragments specified by the 350``.config`` file are compared against the fragments specified by the
@@ -366,23 +363,27 @@ To determine whether or not a given option is "hardware" or
366files that classify individual or groups of options as either hardware 363files that classify individual or groups of options as either hardware
367or non-hardware. To better show this, consider a situation where the 364or non-hardware. To better show this, consider a situation where the
368``yocto-kernel-cache`` contains the following files: 365``yocto-kernel-cache`` contains the following files:
369yocto-kernel-cache/features/drm-psb/hardware.cfg 366::
370yocto-kernel-cache/features/kgdb/hardware.cfg 367
371yocto-kernel-cache/ktypes/base/hardware.cfg 368 yocto-kernel-cache/features/drm-psb/hardware.cfg
372yocto-kernel-cache/bsp/mti-malta32/hardware.cfg 369 yocto-kernel-cache/features/kgdb/hardware.cfg
373yocto-kernel-cache/bsp/qemu-ppc32/hardware.cfg 370 yocto-kernel-cache/ktypes/base/hardware.cfg
374yocto-kernel-cache/bsp/qemuarma9/hardware.cfg 371 yocto-kernel-cache/bsp/mti-malta32/hardware.cfg
375yocto-kernel-cache/bsp/mti-malta64/hardware.cfg 372 yocto-kernel-cache/bsp/qemu-ppc32/hardware.cfg
376yocto-kernel-cache/bsp/arm-versatile-926ejs/hardware.cfg 373 yocto-kernel-cache/bsp/qemuarma9/hardware.cfg
377yocto-kernel-cache/bsp/common-pc/hardware.cfg 374 yocto-kernel-cache/bsp/mti-malta64/hardware.cfg
378yocto-kernel-cache/bsp/common-pc-64/hardware.cfg 375 yocto-kernel-cache/bsp/arm-versatile-926ejs/hardware.cfg
379yocto-kernel-cache/features/rfkill/non-hardware.cfg 376 yocto-kernel-cache/bsp/common-pc/hardware.cfg
380yocto-kernel-cache/ktypes/base/non-hardware.cfg 377 yocto-kernel-cache/bsp/common-pc-64/hardware.cfg
381yocto-kernel-cache/features/aufs/non-hardware.kcf 378 yocto-kernel-cache/features/rfkill/non-hardware.cfg
382yocto-kernel-cache/features/ocf/non-hardware.kcf 379 yocto-kernel-cache/ktypes/base/non-hardware.cfg
383yocto-kernel-cache/ktypes/base/non-hardware.kcf 380 yocto-kernel-cache/features/aufs/non-hardware.kcf
384yocto-kernel-cache/ktypes/base/hardware.kcf 381 yocto-kernel-cache/features/ocf/non-hardware.kcf
385yocto-kernel-cache/bsp/qemu-ppc32/hardware.kcf The following list 382 yocto-kernel-cache/ktypes/base/non-hardware.kcf
383 yocto-kernel-cache/ktypes/base/hardware.kcf
384 yocto-kernel-cache/bsp/qemu-ppc32/hardware.kcf
385
386The following list
386provides explanations for the various files: 387provides explanations for the various files:
387 388
388- ``hardware.kcf``: Specifies a list of kernel Kconfig files that 389- ``hardware.kcf``: Specifies a list of kernel Kconfig files that
@@ -402,10 +403,18 @@ provides explanations for the various files:
402 (i.e. ``hardware.kcf`` or ``non-hardware.kcf``). 403 (i.e. ``hardware.kcf`` or ``non-hardware.kcf``).
403 404
404Here is a specific example using the 405Here is a specific example using the
405``kernel-cache/bsp/mti-malta32/hardware.cfg``: CONFIG_SERIAL_8250 406``kernel-cache/bsp/mti-malta32/hardware.cfg``:
406CONFIG_SERIAL_8250_CONSOLE CONFIG_SERIAL_8250_NR_UARTS 407::
407CONFIG_SERIAL_8250_PCI CONFIG_SERIAL_CORE CONFIG_SERIAL_CORE_CONSOLE 408
408CONFIG_VGA_ARB The kernel configuration audit automatically detects 409 CONFIG_SERIAL_8250
410 CONFIG_SERIAL_8250_CONSOLE
411 CONFIG_SERIAL_8250_NR_UARTS
412 CONFIG_SERIAL_8250_PCI
413 CONFIG_SERIAL_CORE
414 CONFIG_SERIAL_CORE_CONSOLE
415 CONFIG_VGA_ARB
416
417The kernel configuration audit automatically detects
409these files (hence the names must be exactly the ones discussed here), 418these files (hence the names must be exactly the ones discussed here),
410and uses them as inputs when generating warnings about the final 419and uses them as inputs when generating warnings about the final
411``.config`` file. 420``.config`` file.
diff --git a/documentation/kernel-dev/kernel-dev-faq.rst b/documentation/kernel-dev/kernel-dev-faq.rst
index fd9f8ce33d..b5e6a84eba 100644
--- a/documentation/kernel-dev/kernel-dev-faq.rst
+++ b/documentation/kernel-dev/kernel-dev-faq.rst
@@ -9,23 +9,46 @@ Kernel Development FAQ
9Common Questions and Solutions 9Common Questions and Solutions
10============================== 10==============================
11 11
12The following lists some solutions for common questions. How do I use my 12The following lists some solutions for common questions.
13own Linux kernel ``.config`` file? Refer to the "`Changing the 13
14Configuration <#changing-the-configuration>`__" section for information. 14How do I use my own Linux kernel ``.config`` file?
15How do I create configuration fragments? Refer to the "`Creating 15--------------------------------------------------
16Configuration Fragments <#creating-config-fragments>`__" section for 16
17information. How do I use my own Linux kernel sources? Refer to the 17Refer to the
18"`Working With Your Own Sources <#working-with-your-own-sources>`__" 18":ref:`kernel-dev/kernel-dev-common:changing the configuration`"
19section for information. How do I install/not-install the kernel image 19section for information.
20on the rootfs? The kernel image (e.g. ``vmlinuz``) is provided by the 20
21How do I create configuration fragments?
22----------------------------------------
23
24A: Refer to the
25":ref:`kernel-dev/kernel-dev-common:creating configuration fragments`"
26section for information.
27
28How do I use my own Linux kernel sources?
29-----------------------------------------
30
31Refer to the
32":ref:`kernel-dev/kernel-dev-common:working with your own sources`"
33section for information.
34
35How do I install/not-install the kernel image on the rootfs?
36------------------------------------------------------------
37
38The kernel image (e.g. ``vmlinuz``) is provided by the
21``kernel-image`` package. Image recipes depend on ``kernel-base``. To 39``kernel-image`` package. Image recipes depend on ``kernel-base``. To
22specify whether or not the kernel image is installed in the generated 40specify whether or not the kernel image is installed in the generated
23root filesystem, override ``RDEPENDS_kernel-base`` to include or not 41root filesystem, override ``RDEPENDS_kernel-base`` to include or not
24include "kernel-image". See the "`Using .bbappend Files in Your 42include "kernel-image". See the
25Layer <&YOCTO_DOCS_DEV_URL;#using-bbappend-files>`__" section in the 43":ref:`dev-manual/dev-manual-common-tasks:using .bbappend files in your layer`"
44section in the
26Yocto Project Development Tasks Manual for information on how to use an 45Yocto Project Development Tasks Manual for information on how to use an
27append file to override metadata. How do I install a specific kernel 46append file to override metadata.
28module? Linux kernel modules are packaged individually. To ensure a 47
48How do I install a specific kernel module?
49------------------------------------------
50
51Linux kernel modules are packaged individually. To ensure a
29specific kernel module is included in an image, include it in the 52specific kernel module is included in an image, include it in the
30appropriate machine 53appropriate machine
31:term:`RRECOMMENDS` variable. 54:term:`RRECOMMENDS` variable.
@@ -36,10 +59,23 @@ These other variables are useful for installing specific modules:
36:term:`MACHINE_EXTRA_RRECOMMENDS` 59:term:`MACHINE_EXTRA_RRECOMMENDS`
37For example, set the following in the ``qemux86.conf`` file to include 60For example, set the following in the ``qemux86.conf`` file to include
38the ``ab123`` kernel modules with images built for the ``qemux86`` 61the ``ab123`` kernel modules with images built for the ``qemux86``
39machine: MACHINE_EXTRA_RRECOMMENDS += "kernel-module-ab123" For more 62machine:
63::
64
65 MACHINE_EXTRA_RRECOMMENDS += "kernel-module-ab123"
66
67For more
40information, see the "`Incorporating Out-of-Tree 68information, see the "`Incorporating Out-of-Tree
41Modules <#incorporating-out-of-tree-modules>`__" section. How do I 69Modules <#incorporating-out-of-tree-modules>`__" section.
42change the Linux kernel command line? The Linux kernel command line is 70
71How do I change the Linux kernel command line?
72----------------------------------------------
73
74The Linux kernel command line is
43typically specified in the machine config using the ``APPEND`` variable. 75typically specified in the machine config using the ``APPEND`` variable.
44For example, you can add some helpful debug information doing the 76For example, you can add some helpful debug information doing the
45following: APPEND += "printk.time=y initcall_debug debug" 77following:
78::
79
80 APPEND += "printk.time=y initcall_debug debug"
81
diff --git a/documentation/kernel-dev/kernel-dev-intro.rst b/documentation/kernel-dev/kernel-dev-intro.rst
index 6708a6afe9..21d43d5e80 100644
--- a/documentation/kernel-dev/kernel-dev-intro.rst
+++ b/documentation/kernel-dev/kernel-dev-intro.rst
@@ -28,8 +28,8 @@ newly-supported platforms. Previous recipes in the release are refreshed
28and supported for at least one additional Yocto Project release. As they 28and supported for at least one additional Yocto Project release. As they
29align, these previous releases are updated to include the latest from 29align, these previous releases are updated to include the latest from
30the Long Term Support Initiative (LTSI) project. You can learn more 30the Long Term Support Initiative (LTSI) project. You can learn more
31about Yocto Linux kernels and LTSI in the "`Yocto Project Kernel 31about Yocto Linux kernels and LTSI in the ":ref:`Yocto Project Kernel
32Development and Maintenance <#kernel-big-picture>`__" section. 32Development and Maintenance <kernel-big-picture>`" section.
33 33
34Also included is a Yocto Linux kernel development recipe 34Also included is a Yocto Linux kernel development recipe
35(``linux-yocto-dev.bb``) should you want to work with the very latest in 35(``linux-yocto-dev.bb``) should you want to work with the very latest in
@@ -81,17 +81,16 @@ facilitate the process of working with the kernel recipes. If you find
81you need some additional background, please be sure to review and 81you need some additional background, please be sure to review and
82understand the following documentation: 82understand the following documentation:
83 83
84- `Yocto Project Quick Build <&YOCTO_DOCS_BRIEF_URL;>`__ document. 84- :doc:`../brief-yoctoprojectqs/brief-yoctoprojectqs` document.
85 85
86- `Yocto Project Overview and Concepts Manual <&YOCTO_DOCS_OM_URL;>`__. 86- :doc:`../overview-manual/overview-manual`.
87 87
88- ```devtool`` 88- :ref:`devtool
89 workflow <&YOCTO_DOCS_SDK_URL;#using-devtool-in-your-sdk-workflow>`__ 89 workflow <sdk-manual/sdk-extensible:using \`\`devtool\`\` in your sdk workflow>`
90 as described in the Yocto Project Application Development and the 90 as described in the Yocto Project Application Development and the
91 Extensible Software Development Kit (eSDK) manual. 91 Extensible Software Development Kit (eSDK) manual.
92 92
93- The "`Understanding and Creating 93- The ":ref:`dev-manual/dev-manual-common-tasks:understanding and creating layers`"
94 Layers <&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers>`__"
95 section in the Yocto Project Development Tasks Manual. 94 section in the Yocto Project Development Tasks Manual.
96 95
97- The "`Kernel Modification 96- The "`Kernel Modification
@@ -114,8 +113,7 @@ general information and references for further information.
114 :align: center 113 :align: center
115 114
1161. *Set up Your Host Development System to Support Development Using the 1151. *Set up Your Host Development System to Support Development Using the
117 Yocto Project*: See the "`Setting Up the Development Host to Use the 116 Yocto Project*: See the ":doc:`../dev-manual/dev-manual-start`" section in
118 Yocto Project <&YOCTO_DOCS_DEV_URL;#dev-manual-start>`__" section in
119 the Yocto Project Development Tasks Manual for options on how to get 117 the Yocto Project Development Tasks Manual for options on how to get
120 a build host ready to use the Yocto Project. 118 a build host ready to use the Yocto Project.
121 119
@@ -127,31 +125,33 @@ general information and references for further information.
127 125
128 Using ``devtool`` and the eSDK requires that you have a clean build 126 Using ``devtool`` and the eSDK requires that you have a clean build
129 of the image and that you are set up with the appropriate eSDK. For 127 of the image and that you are set up with the appropriate eSDK. For
130 more information, see the "`Getting Ready to Develop Using 128 more information, see the
131 ``devtool`` <#getting-ready-to-develop-using-devtool>`__" section. 129 ":ref:`kernel-dev/kernel-dev-common:getting ready to develop using \`\`devtool\`\``"
130 section.
132 131
133 Using traditional kernel development requires that you have the 132 Using traditional kernel development requires that you have the
134 kernel source available in an isolated local Git repository. For more 133 kernel source available in an isolated local Git repository. For more
135 information, see the "`Getting Ready for Traditional Kernel 134 information, see the
136 Development <#getting-ready-for-traditional-kernel-development>`__" 135 ":ref:`kernel-dev/kernel-dev-common:getting ready for traditional kernel development`"
137 section. 136 section.
138 137
1393. *Make Changes to the Kernel Source Code if applicable:* Modifying the 1383. *Make Changes to the Kernel Source Code if applicable:* Modifying the
140 kernel does not always mean directly changing source files. However, 139 kernel does not always mean directly changing source files. However,
141 if you have to do this, you make the changes to the files in the 140 if you have to do this, you make the changes to the files in the
142 eSDK's Build Directory if you are using ``devtool``. For more 141 eSDK's Build Directory if you are using ``devtool``. For more
143 information, see the "`Using ``devtool`` to Patch the 142 information, see the
144 Kernel <#using-devtool-to-patch-the-kernel>`__" section. 143 ":ref:`kernel-dev/kernel-dev-common:using \`\`devtool\`\` to patch the kernel`"
144 section.
145 145
146 If you are using traditional kernel development, you edit the source 146 If you are using traditional kernel development, you edit the source
147 files in the kernel's local Git repository. For more information, see 147 files in the kernel's local Git repository. For more information, see the
148 the "`Using Traditional Kernel Development to Patch the 148 ":ref:`kernel-dev/kernel-dev-common:using traditional kernel development to patch the kernel`"
149 Kernel <#using-traditional-kernel-development-to-patch-the-kernel>`__"
150 section. 149 section.
151 150
1524. *Make Kernel Configuration Changes if Applicable:* If your situation 1514. *Make Kernel Configuration Changes if Applicable:* If your situation
153 calls for changing the kernel's configuration, you can use 152 calls for changing the kernel's configuration, you can use
154 ```menuconfig`` <#using-menuconfig>`__, which allows you to 153 :ref:`menuconfig <kernel-dev/kernel-dev-common:using \`\`menuconfig\`\`>`,
154 which allows you to
155 interactively develop and test the configuration changes you are 155 interactively develop and test the configuration changes you are
156 making to the kernel. Saving changes you make with ``menuconfig`` 156 making to the kernel. Saving changes you make with ``menuconfig``
157 updates the kernel's ``.config`` file. 157 updates the kernel's ``.config`` file.
diff --git a/documentation/kernel-dev/kernel-dev-maint-appx.rst b/documentation/kernel-dev/kernel-dev-maint-appx.rst
index 0b0cca14a7..5514dac876 100644
--- a/documentation/kernel-dev/kernel-dev-maint-appx.rst
+++ b/documentation/kernel-dev/kernel-dev-maint-appx.rst
@@ -28,12 +28,17 @@ in the Yocto Project Linux kernel in any clone of the Yocto Project
28Linux kernel source repository and ``yocto-kernel-cache`` Git trees. For 28Linux kernel source repository and ``yocto-kernel-cache`` Git trees. For
29example, the following commands clone the Yocto Project baseline Linux 29example, the following commands clone the Yocto Project baseline Linux
30kernel that branches off ``linux.org`` version 4.12 and the 30kernel that branches off ``linux.org`` version 4.12 and the
31``yocto-kernel-cache``, which contains stores of kernel Metadata: $ git 31``yocto-kernel-cache``, which contains stores of kernel Metadata:
32clone git://git.yoctoproject.org/linux-yocto-4.12 $ git clone 32::
33git://git.yoctoproject.org/linux-kernel-cache For more information on 33
34 $ git clone git://git.yoctoproject.org/linux-yocto-4.12
35 $ git clone git://git.yoctoproject.org/linux-kernel-cache
36
37For more information on
34how to set up a local Git repository of the Yocto Project Linux kernel 38how to set up a local Git repository of the Yocto Project Linux kernel
35files, see the "`Preparing the Build Host to Work on the 39files, see the
36Kernel <#preparing-the-build-host-to-work-on-the-kernel>`__" section. 40":ref:`kernel-dev/kernel-dev-common:preparing the build host to work on the kernel`"
41section.
37 42
38Once you have cloned the kernel Git repository and the cache of Metadata 43Once you have cloned the kernel Git repository and the cache of Metadata
39on your local machine, you can discover the branches that are available 44on your local machine, you can discover the branches that are available
@@ -41,10 +46,13 @@ in the repository using the following Git command: $ git branch -a
41Checking out a branch allows you to work with a particular Yocto Linux 46Checking out a branch allows you to work with a particular Yocto Linux
42kernel. For example, the following commands check out the 47kernel. For example, the following commands check out the
43"standard/beagleboard" branch of the Yocto Linux kernel repository and 48"standard/beagleboard" branch of the Yocto Linux kernel repository and
44the "yocto-4.12" branch of the ``yocto-kernel-cache`` repository: $ cd 49the "yocto-4.12" branch of the ``yocto-kernel-cache`` repository:
45~/linux-yocto-4.12 $ git checkout -b my-kernel-4.12 50::
46remotes/origin/standard/beagleboard $ cd ~/linux-kernel-cache $ git 51
47checkout -b my-4.12-metadata remotes/origin/yocto-4.12 52 $ cd ~/linux-yocto-4.12
53 $ git checkout -b my-kernel-4.12 remotes/origin/standard/beagleboard
54 $ cd ~/linux-kernel-cache
55 $ git checkout -b my-4.12-metadata remotes/origin/yocto-4.12
48 56
49.. note:: 57.. note::
50 58
@@ -102,7 +110,9 @@ patch, or BSP:
102 For a typical build, the target of the search is a feature 110 For a typical build, the target of the search is a feature
103 description in an ``.scc`` file whose name follows this format (e.g. 111 description in an ``.scc`` file whose name follows this format (e.g.
104 ``beaglebone-standard.scc`` and ``beaglebone-preempt-rt.scc``): 112 ``beaglebone-standard.scc`` and ``beaglebone-preempt-rt.scc``):
105 bsp_root_name-kernel_type.scc 113 ::
114
115 bsp_root_name-kernel_type.scc
106 116
1073. *Expand Feature:* Once located, the feature description is either 1173. *Expand Feature:* Once located, the feature description is either
108 expanded into a simple script of actions, or into an existing 118 expanded into a simple script of actions, or into an existing
@@ -212,7 +222,10 @@ build process generates a build tree that is separate from your kernel's
212local Git source repository tree. This build tree has a name that uses 222local Git source repository tree. This build tree has a name that uses
213the following form, where ``${MACHINE}`` is the metadata name of the 223the following form, where ``${MACHINE}`` is the metadata name of the
214machine (BSP) and "kernel_type" is one of the Yocto Project supported 224machine (BSP) and "kernel_type" is one of the Yocto Project supported
215kernel types (e.g. "standard"): linux-${MACHINE}-kernel_type-build 225kernel types (e.g. "standard"):
226::
227
228 linux-${MACHINE}-kernel_type-build
216 229
217The existing support in the ``kernel.org`` tree achieves this default 230The existing support in the ``kernel.org`` tree achieves this default
218functionality. 231functionality.