summaryrefslogtreecommitdiffstats
path: root/documentation/kernel-dev/kernel-dev-advanced.rst
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/kernel-dev/kernel-dev-advanced.rst')
-rw-r--r--documentation/kernel-dev/kernel-dev-advanced.rst463
1 files changed, 341 insertions, 122 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.