From 23dbf81eddb3c539875b29885ff52e2f116887ef Mon Sep 17 00:00:00 2001 From: Scott Rifenbark Date: Thu, 31 Mar 2016 14:42:10 -0700 Subject: kernel-dev: Added new "Adding Recipe-Space Kernel Features" section. Fixes [YOCTO #4047] I added a new section describing how to add kernel features from within a kernel recipe through the KERNEL_FEATURES variable and the SRC_URI statement. (From yocto-docs rev: d30925c65e3f49b2ba481f1e7f9cac98fe86f6af) Signed-off-by: Scott Rifenbark Signed-off-by: Richard Purdie --- documentation/kernel-dev/kernel-dev-common.xml | 122 +++++++++++++++++++++++++ 1 file changed, 122 insertions(+) (limited to 'documentation/kernel-dev') diff --git a/documentation/kernel-dev/kernel-dev-common.xml b/documentation/kernel-dev/kernel-dev-common.xml index d3119a88b2..89c2a6840b 100644 --- a/documentation/kernel-dev/kernel-dev-common.xml +++ b/documentation/kernel-dev/kernel-dev-common.xml @@ -1032,6 +1032,128 @@ + +
+ Adding Recipe-Space Kernel Features + + + You can add kernel features in the + recipe-space by + using the + KERNEL_FEATURES + variable along with specifying the .scc file + path on 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 that 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. + 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, and 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 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. + Notes + + + The directory you use for the + .scc must be added to the + fetcher search directory just as you would, + for example, if you were adding 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 .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: + + KERNEL_FEATURES_append = " test.scc" + + The OpenEmbedded build system processes the kernel feature + when it builds the kernel. + + If other features are contained below "test.scc", + then their directories are relative to the directory + containing the test.scc file. + + + + +