A kernel type defines a high-level kernel policy by
aggregating non-hardware configuration fragments with
patches you want to use when building a Linux kernel of a
specific type (e.g. a real-time kernel).
Syntactically, kernel types are no different than features
as described in the "Features"
section.
The
LINUX_KERNEL_TYPE
variable in the kernel recipe selects the kernel type.
For example, in the linux-yocto_4.12.bb
kernel recipe found in
poky/meta/recipes-kernel/linux
, a
require
directive includes the
poky/meta/recipes-kernel/linux/linux-yocto.inc
file, which has the following statement that defines the default
kernel type:
LINUX_KERNEL_TYPE ??= "standard"
Another example would be the real-time kernel (i.e.
linux-yocto-rt_4.12.bb
).
This kernel recipe directly sets the kernel type as follows:
LINUX_KERNEL_TYPE = "preempt-rt"
meta/recipes-kernel/linux
directory of the
Source Directory
(e.g. poky/meta/recipes-kernel/linux/linux-yocto_4.12.bb
).
See the "Using Kernel Metadata in a Recipe"
section for more information.
Three kernel types ("standard", "tiny", and "preempt-rt") are supported for Linux Yocto kernels:
"standard": Includes the generic Linux kernel policy of the Yocto Project linux-yocto kernel recipes. This policy includes, among other things, which file systems, networking options, core kernel features, and debugging and tracing options are supported.
"preempt-rt":
Applies the PREEMPT_RT
patches and the configuration options required to
build a real-time Linux kernel.
This kernel type inherits from the "standard" kernel type.
"tiny": Defines a bare minimum configuration meant to serve as a base for very small Linux kernels. The "tiny" kernel type is independent from the "standard" configuration. Although the "tiny" kernel type does not currently include any source changes, it might in the future.
For any given kernel type, the Metadata is defined by the
.scc
(e.g. standard.scc
).
Here is a partial listing for the standard.scc
file, which is found in the ktypes/standard
directory of the yocto-kernel-cache
Git
repository:
# Include this kernel type fragment to get the standard features and # configuration values. # Note: if only the features are desired, but not the configuration # then this should be included as: # include ktypes/standard/standard.scc nocfg # if no chained configuration is desired, include it as: # include ktypes/standard/standard.scc nocfg inherit include ktypes/base/base.scc branch standard kconf non-hardware standard.cfg include features/kgdb/kgdb.scc . . . include cfg/net/ip6_nf.scc include cfg/net/bridge.scc include cfg/systemd.scc include features/rfkill/rfkill.scc
As with any .scc
file, a
kernel type definition can aggregate other
.scc
files with
include
commands.
These definitions can also directly pull in
configuration fragments and patches with the
kconf
and patch
commands, respectively.
.scc
file.
The Board Support Package (BSP) file can implicitly define
the kernel type using a define
KTYPE myktype
line.
See the "BSP Descriptions"
section for more information.