summaryrefslogtreecommitdiffstats
path: root/documentation
diff options
context:
space:
mode:
authorScott Rifenbark <srifenbark@gmail.com>2016-03-31 14:42:10 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-06 23:11:57 +0100
commit23dbf81eddb3c539875b29885ff52e2f116887ef (patch)
tree4427ca666526f9f2be38dfe1009daa6403543f1b /documentation
parentf30bfe990a95479ca3f31c44838e9a1cc98ddd1d (diff)
downloadpoky-23dbf81eddb3c539875b29885ff52e2f116887ef.tar.gz
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 <srifenbark@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation')
-rw-r--r--documentation/kernel-dev/kernel-dev-common.xml122
1 files changed, 122 insertions, 0 deletions
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 @@
1032 </para> 1032 </para>
1033 </section> 1033 </section>
1034 </section> 1034 </section>
1035
1036 <section id='adding-recipe-space-kernel-features'>
1037 <title>Adding Recipe-Space Kernel Features</title>
1038
1039 <para>
1040 You can add kernel features in the
1041 <link linkend='recipe-space-metadata'>recipe-space</link> by
1042 using the
1043 <ulink url='&YOCTO_DOCS_REF_URL;#var-KERNEL_FEATURES'><filename>KERNEL_FEATURES</filename></ulink>
1044 variable along with specifying the <filename>.scc</filename> file
1045 path on the
1046 <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
1047 statement.
1048 When you add features using this method, the OpenEmbedded build
1049 system checks to be sure the features are present.
1050 If the features are not present, the build stops.
1051 Kernel features are the last elements processed for configuring
1052 and patching the kernel.
1053 Therefore, adding features in this manner is a way
1054 to enforce that specific features are present, and enabled,
1055 without needing to do a full audit of any other layer's additions
1056 to the <filename>SRC_URI</filename> statement.
1057 </para>
1058
1059 <para>
1060 You add a kernel feature by providing the feature as part of the
1061 <filename>KERNEL_FEATURES</filename> variable and by providing the
1062 path to the feature's <filename>.scc</filename> file, which is
1063 relative to the root of the kernel Metadata.
1064 The OpenEmbedded build system searches all forms of kernel
1065 Metadata on the <filename>SRC_URI</filename> statement regardless
1066 of whether the Metadata is in the "kernel-cache", system kernel
1067 Metadata, or a recipe-space Metadata.
1068 See the
1069 "<link linkend='kernel-metadata-location'>Kernel Metadata Location</link>"
1070 section for additional information.
1071 </para>
1072
1073 <para>
1074 When you specify the feature's <filename>.scc</filename> file
1075 on the <filename>SRC_URI</filename> statement, the OpenEmbedded
1076 build system adds the directory of that
1077 <filename>.scc</filename> file, and all its subdirectories,
1078 to the kernel feature search path.
1079 Because subdirectories are searched, you can reference a single
1080 <filename>.scc</filename> file in the
1081 <filename>SRC_URI</filename> statement to reference multiple kernel
1082 features.
1083 </para>
1084
1085 <para>
1086 Consider the following example that adds the "test.scc" feature
1087 to the build.
1088 <orderedlist>
1089 <listitem><para>
1090 Create a <filename>.scc</filename> file and locate it
1091 just as you would any other patch file,
1092 <filename>.cfg</filename> file, or fetcher item
1093 you specify in the <filename>SRC_URI</filename>
1094 statement.
1095 <note><title>Notes</title>
1096 <itemizedlist>
1097 <listitem><para>
1098 The directory you use for the
1099 <filename>.scc</filename> must be added to the
1100 fetcher search directory just as you would,
1101 for example, if you were adding a
1102 <filename>.patch</filename> file.
1103 </para></listitem>
1104 <listitem><para>
1105 You can create additional
1106 <filename>.scc</filename> files beneath the
1107 directory that contains the file you are
1108 adding.
1109 All subdirectories are searched during the
1110 build as potential feature directories.
1111 </para></listitem>
1112 </itemizedlist>
1113 </note>
1114 Continuing with the example, suppose the "test.scc"
1115 feature you are adding has a
1116 <filename>test.scc</filename> file in the following
1117 directory:
1118 <literallayout class='monospaced'>
1119 <replaceable>my_recipe</replaceable>
1120 |
1121 +-linux-yocto
1122 |
1123 +-test.cfg
1124 +-test.scc
1125 </literallayout>
1126 In this example, the <filename>linux-yocto</filename>
1127 directory has both the feature
1128 <filename>test.scc</filename> file and a similarly
1129 named configuration fragment file
1130 <filename>test.cfg</filename>.
1131 </para></listitem>
1132 <listitem><para>
1133 Add the <filename>.scc</filename> file to the
1134 recipe's <filename>SRC_URI</filename> statement:
1135 <literallayout class='monospaced'>
1136 SRC_URI_append = " file://test.scc"
1137 </literallayout>
1138 The leading space before the path is important as the
1139 path is appended to the existing path.
1140 </para></listitem>
1141 <listitem><para>
1142 Specify the feature as a kernel feature:
1143 <literallayout class='monospaced'>
1144 KERNEL_FEATURES_append = " test.scc"
1145 </literallayout>
1146 The OpenEmbedded build system processes the kernel feature
1147 when it builds the kernel.
1148 <note>
1149 If other features are contained below "test.scc",
1150 then their directories are relative to the directory
1151 containing the <filename>test.scc</filename> file.
1152 </note>
1153 </para></listitem>
1154 </orderedlist>
1155 </para>
1156 </section>
1035</chapter> 1157</chapter>
1036<!-- 1158<!--
1037vim: expandtab tw=80 ts=4 1159vim: expandtab tw=80 ts=4