diff options
author | Scott Rifenbark <srifenbark@gmail.com> | 2016-03-31 14:26:53 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-04-06 23:11:57 +0100 |
commit | f30bfe990a95479ca3f31c44838e9a1cc98ddd1d (patch) | |
tree | 2d8698e9aecacbc2b126b3cfe8c86be6b346f630 /documentation | |
parent | 53729bca3427959d7f140dda6ff9725b7d3b0e6b (diff) | |
download | poky-f30bfe990a95479ca3f31c44838e9a1cc98ddd1d.tar.gz |
kernel-dev: Updated the "Kernel Metadata Location" section.
Fixes [YOCTO #8272]
I re-wrote the section to basically consider kernel metadata
coming from either inside the recipe (recipe-space) or from
outside the recipe, which would be like a "kernel-cache".
The re-write eliminated the term "in-tree" regarding where
kernel metadata could reside.
(From yocto-docs rev: d358c00fbb779328bd472494023ecb802da15d59)
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-advanced.xml | 87 |
1 files changed, 50 insertions, 37 deletions
diff --git a/documentation/kernel-dev/kernel-dev-advanced.xml b/documentation/kernel-dev/kernel-dev-advanced.xml index 4fdb853f92..9e15f178a6 100644 --- a/documentation/kernel-dev/kernel-dev-advanced.xml +++ b/documentation/kernel-dev/kernel-dev-advanced.xml | |||
@@ -29,8 +29,8 @@ | |||
29 | source Git repositories. | 29 | source Git repositories. |
30 | This Metadata defines Board Support Packages (BSPs) that | 30 | This Metadata defines Board Support Packages (BSPs) that |
31 | correspond to definitions in linux-yocto recipes for the same BSPs. | 31 | correspond to definitions in linux-yocto recipes for the same BSPs. |
32 | A BSP consists of an aggregation of kernel policy and hardware-specific | 32 | A BSP consists of an aggregation of kernel policy and enabled |
33 | feature enablements. | 33 | hardware-specific features. |
34 | The BSP can be influenced from within the linux-yocto recipe. | 34 | The BSP can be influenced from within the linux-yocto recipe. |
35 | <note> | 35 | <note> |
36 | Linux kernel source that contains kernel Metadata is said to be | 36 | Linux kernel source that contains kernel Metadata is said to be |
@@ -171,8 +171,8 @@ | |||
171 | <title>Kernel Metadata Location</title> | 171 | <title>Kernel Metadata Location</title> |
172 | 172 | ||
173 | <para> | 173 | <para> |
174 | Kernel Metadata can be defined in either the kernel recipe | 174 | Kernel Metadata always exists outside of the kernel tree either |
175 | (recipe-space) or in the kernel tree (in-tree). | 175 | defined in a kernel recipe (recipe-space) or outside of the recipe. |
176 | Where you choose to define the Metadata depends on what you want | 176 | Where you choose to define the Metadata depends on what you want |
177 | to do and how you intend to work. | 177 | to do and how you intend to work. |
178 | Regardless of where you define the kernel Metadata, the syntax used | 178 | Regardless of where you define the kernel Metadata, the syntax used |
@@ -195,10 +195,10 @@ | |||
195 | <para> | 195 | <para> |
196 | Conversely, if you are actively developing a kernel and are already | 196 | Conversely, if you are actively developing a kernel and are already |
197 | maintaining a Linux kernel Git repository of your own, you might find | 197 | maintaining a Linux kernel Git repository of your own, you might find |
198 | it more convenient to work with the kernel Metadata in the same | 198 | it more convenient to work with kernel Metadata kept outside the |
199 | repository as the Linux kernel sources. | 199 | recipe-space. |
200 | This method can make iterative development of the Linux kernel | 200 | Working with Metadata in this area can make iterative development of |
201 | more efficient outside of the BitBake environment. | 201 | the Linux kernel more efficient outside of the BitBake environment. |
202 | </para> | 202 | </para> |
203 | 203 | ||
204 | <section id='recipe-space-metadata'> | 204 | <section id='recipe-space-metadata'> |
@@ -249,38 +249,52 @@ | |||
249 | </para> | 249 | </para> |
250 | </section> | 250 | </section> |
251 | 251 | ||
252 | <section id='in-tree-metadata'> | 252 | <section id='metadata-outside-the-recipe-space'> |
253 | <title>In-Tree Metadata</title> | 253 | <title>Metadata Outside the Recipe-Space</title> |
254 | 254 | ||
255 | <para> | 255 | <para> |
256 | When stored in-tree, the kernel Metadata files reside in the | 256 | When stored outside of the recipe-space, the kernel Metadata |
257 | <filename>meta</filename> directory of the Linux kernel sources. | 257 | files reside in a separate repository. |
258 | The <filename>meta</filename> directory can be present in the | 258 | The OpenEmbedded build system adds the Metadata to the build as |
259 | same repository branch as the sources, | 259 | a "ktype=meta" repository through the |
260 | such as "master", or <filename>meta</filename> can be its own | 260 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink> |
261 | orphan branch. | 261 | variable. |
262 | <note> | 262 | As an example, consider the following <filename>SRC_URI</filename> |
263 | An orphan branch in Git is a branch with unique history and | 263 | statement from the <filename>linux-yocto_4.4.bb</filename> |
264 | content to the other branches in the repository. | 264 | kernel recipe: |
265 | Orphan branches are useful to track Metadata changes | 265 | <literallayout class='monospaced'> |
266 | independently from the sources of the Linux kernel, while | 266 | SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.4.git;name=machine;branch=${KBRANCH}; \ |
267 | still keeping them together in the same repository. | 267 | git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.4;destsuffix=${KMETA}" |
268 | </note> | 268 | </literallayout> |
269 | For the purposes of this document, we will discuss all | 269 | <filename>${KMETA}</filename>, in this context, is simply used to |
270 | in-tree Metadata as residing below the | 270 | name the directory into which the Git fetcher places the Metadata. |
271 | <filename>meta/cfg/kernel-cache</filename> directory. | 271 | This behavior is no different than any multi-repository |
272 | <filename>SRC_URI</filename> statement used in a recipe. | ||
272 | </para> | 273 | </para> |
273 | 274 | ||
274 | <para> | 275 | <para> |
276 | You can keep kernel Metadata in a "kernel-cache", which is a | ||
277 | directory containing configuration fragments. | ||
278 | As with any Metadata kept outside the recipe-space, you simply | ||
279 | need to use the <filename>SRC_URI</filename> statement with the | ||
280 | "type=kmeta" attribute. | ||
281 | Doing so makes the kernel Metadata available during the | ||
282 | configuration phase. | ||
283 | </para> | ||
284 | |||
285 | <!-- | ||
286 | |||
287 | |||
288 | <para> | ||
275 | Following is an example that shows how a trivial tree of Metadata | 289 | Following is an example that shows how a trivial tree of Metadata |
276 | is stored in a custom Linux kernel Git repository: | 290 | is stored in a custom Linux kernel Git repository: |
277 | <literallayout class='monospaced'> | 291 | <literallayout class='monospaced'> |
278 | meta/ | 292 | meta/ |
279 | `-- cfg | 293 | `‐‐ cfg |
280 | `-- kernel-cache | 294 | `‐‐ kernel-cache |
281 | |-- bsp-standard.scc | 295 | |‐‐ bsp-standard.scc |
282 | |-- bsp.cfg | 296 | |‐‐ bsp.cfg |
283 | `-- standard.cfg | 297 | `‐‐ standard.cfg |
284 | </literallayout> | 298 | </literallayout> |
285 | </para> | 299 | </para> |
286 | 300 | ||
@@ -301,16 +315,15 @@ | |||
301 | orphan <filename>meta</filename> branch, use these commands | 315 | orphan <filename>meta</filename> branch, use these commands |
302 | from within your Linux kernel Git repository: | 316 | from within your Linux kernel Git repository: |
303 | <literallayout class='monospaced'> | 317 | <literallayout class='monospaced'> |
304 | $ git checkout --orphan meta | 318 | $ git checkout ‐‐orphan meta |
305 | $ git rm -rf . | 319 | $ git rm -rf . |
306 | $ git commit --allow-empty -m "Create orphan meta branch" | 320 | $ git commit ‐‐allow-empty -m "Create orphan meta branch" |
307 | </literallayout> | 321 | </literallayout> |
308 | </para> | 322 | </para> |
323 | --> | ||
309 | 324 | ||
310 | <para> | 325 | <para> |
311 | If you modify the Metadata in the linux-yocto | 326 | If you modify the Metadata, you must not forget to update the |
312 | <filename>meta</filename> branch, you must not forget to update | ||
313 | the | ||
314 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRCREV'><filename>SRCREV</filename></ulink> | 327 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRCREV'><filename>SRCREV</filename></ulink> |
315 | statements in the kernel's recipe. | 328 | statements in the kernel's recipe. |
316 | In particular, you need to update the | 329 | In particular, you need to update the |
@@ -437,7 +450,7 @@ | |||
437 | if you are creating Metadata in | 450 | if you are creating Metadata in |
438 | <link linkend='recipe-space-metadata'>recipe-space</link>, | 451 | <link linkend='recipe-space-metadata'>recipe-space</link>, |
439 | or <filename>meta/cfg/kernel-cache/</filename> if you are creating | 452 | or <filename>meta/cfg/kernel-cache/</filename> if you are creating |
440 | Metadata <link linkend='in-tree-metadata'>in-tree</link>. | 453 | <link linkend='metadata-outside-the-recipe-space'>Metadata outside of the recipe-space</link>. |
441 | </para> | 454 | </para> |
442 | 455 | ||
443 | <section id='configuration'> | 456 | <section id='configuration'> |