You can add kernel features in the
recipe-space by
using the
KERNEL_FEATURES
variable and by specifying the feature's .scc
file path in the
SRC_URI
statement.
When you add features using this method, the OpenEmbedded build
system checks to be sure the features are present.
If the features are not present, the build stops.
Kernel features are the last elements processed for configuring
and patching the kernel.
Therefore, adding features in this manner is a way
to enforce specific features are present and enabled
without needing to do a full audit of any other layer's additions
to the SRC_URI
statement.
You add a kernel feature by providing the feature as part of the
KERNEL_FEATURES
variable and by providing the
path to the feature's .scc
file, which is
relative to the root of the kernel Metadata.
The OpenEmbedded build system searches all forms of kernel
Metadata on the SRC_URI
statement regardless
of whether the Metadata is in the "kernel-cache", system kernel
Metadata, or a recipe-space Metadata (i.e. part of the kernel
recipe).
See the
"Kernel Metadata Location"
section for additional information.
When you specify the feature's .scc
file
on the SRC_URI
statement, the OpenEmbedded
build system adds the directory of that
.scc
file along with all its subdirectories
to the kernel feature search path.
Because subdirectories are searched, you can reference a single
.scc
file in the
SRC_URI
statement to reference multiple kernel
features.
Consider the following example that adds the "test.scc" feature to the build.
Create the Feature File:
Create a .scc
file and locate it
just as you would any other patch file,
.cfg
file, or fetcher item
you specify in the SRC_URI
statement.
You must add the directory of the
.scc
file to the fetcher's
search path in the same manner as you would
add a .patch
file.
You can create additional
.scc
files beneath the
directory that contains the file you are
adding.
All subdirectories are searched during the
build as potential feature directories.
Continuing with the example, suppose the "test.scc"
feature you are adding has a
test.scc
file in the following
directory:
my_recipe
|
+-linux-yocto
|
+-test.cfg
+-test.scc
In this example, the linux-yocto
directory has both the feature
test.scc
file and a similarly
named configuration fragment file
test.cfg
.
Add the Feature File to SRC_URI
:
Add the .scc
file to the
recipe's SRC_URI
statement:
SRC_URI_append = " file://test.scc"
The leading space before the path is important as the path is appended to the existing path.
Specify the Feature as a Kernel Feature:
Use the KERNEL_FEATURES
statement
to specify the feature as a kernel feature:
KERNEL_FEATURES_append = " test.scc"
The OpenEmbedded build system processes the kernel feature when it builds the kernel.
test.scc
file.