diff options
-rw-r--r-- | documentation/kernel-dev/kernel-dev-common.xml | 94 |
1 files changed, 67 insertions, 27 deletions
diff --git a/documentation/kernel-dev/kernel-dev-common.xml b/documentation/kernel-dev/kernel-dev-common.xml index dcce83fc0e..24feb94b79 100644 --- a/documentation/kernel-dev/kernel-dev-common.xml +++ b/documentation/kernel-dev/kernel-dev-common.xml | |||
@@ -468,7 +468,8 @@ | |||
468 | <ulink url='&YOCTO_DOCS_REF_URL;#bitbake-term'>BitBake</ulink> | 468 | <ulink url='&YOCTO_DOCS_REF_URL;#bitbake-term'>BitBake</ulink> |
469 | append files (<filename>.bbappend</filename>) and provides a | 469 | append files (<filename>.bbappend</filename>) and provides a |
470 | convenient mechanism to create your own recipe files | 470 | convenient mechanism to create your own recipe files |
471 | (<filename>.bb</filename>). | 471 | (<filename>.bb</filename>) as well as store and use kernel |
472 | patch files. | ||
472 | For background information on working with layers, see the | 473 | For background information on working with layers, see the |
473 | "<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and Creating Layers</ulink>" | 474 | "<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and Creating Layers</ulink>" |
474 | section in the Yocto Project Development Manual. | 475 | section in the Yocto Project Development Manual. |
@@ -485,8 +486,9 @@ | |||
485 | </para> | 486 | </para> |
486 | 487 | ||
487 | <para> | 488 | <para> |
488 | Following is a detailed example showing how to create a layer | 489 | To better understand the layer you create for kernel development, |
489 | without the aid of tools for building the kernel: | 490 | the following section describes how to create a layer |
491 | without the aid of tools: | ||
490 | <orderedlist> | 492 | <orderedlist> |
491 | <listitem><para> | 493 | <listitem><para> |
492 | <emphasis>Create additional structure</emphasis>: | 494 | <emphasis>Create additional structure</emphasis>: |
@@ -498,9 +500,10 @@ | |||
498 | $ mkdir recipes-kernel/linux | 500 | $ mkdir recipes-kernel/linux |
499 | $ mkdir recipes-kernel/linux/linux-yocto | 501 | $ mkdir recipes-kernel/linux/linux-yocto |
500 | </literallayout> | 502 | </literallayout> |
501 | The <filename>conf</filename> directory holds your configuration files, while the | 503 | The <filename>conf</filename> directory holds your |
502 | <filename>recipes-kernel</filename> directory holds your append file and | 504 | configuration files, while the |
503 | your patch file. | 505 | <filename>recipes-kernel</filename> directory holds your |
506 | append file and eventual patch files. | ||
504 | </para></listitem> | 507 | </para></listitem> |
505 | <listitem><para> | 508 | <listitem><para> |
506 | <emphasis>Create the layer configuration file</emphasis>: | 509 | <emphasis>Create the layer configuration file</emphasis>: |
@@ -519,29 +522,35 @@ | |||
519 | BBFILE_PATTERN_mylayer = "^${LAYERDIR}/" | 522 | BBFILE_PATTERN_mylayer = "^${LAYERDIR}/" |
520 | BBFILE_PRIORITY_mylayer = "5" | 523 | BBFILE_PRIORITY_mylayer = "5" |
521 | </literallayout> | 524 | </literallayout> |
522 | Notice <filename>mylayer</filename> as part of the last three | 525 | Notice <filename>mylayer</filename> as part of the last |
523 | statements.</para></listitem> | 526 | three statements. |
527 | </para></listitem> | ||
524 | <listitem><para> | 528 | <listitem><para> |
525 | <emphasis>Create the kernel recipe append file</emphasis>: | 529 | <emphasis>Create the kernel recipe append file</emphasis>: |
526 | Move to the <filename>meta-mylayer/recipes-kernel/linux</filename> directory and create | 530 | Move to the |
527 | the <filename>linux-yocto_3.4.bbappend</filename> file as follows: | 531 | <filename>meta-mylayer/recipes-kernel/linux</filename> |
532 | directory and create the kernel's append file. | ||
533 | This example uses the | ||
534 | <filename>linux-yocto_4.12</filename> kernel. | ||
535 | Thus, the name of the append file is | ||
536 | <filename>linux-yocto_4.12.bbappend</filename>: | ||
528 | <literallayout class='monospaced'> | 537 | <literallayout class='monospaced'> |
529 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | 538 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" |
530 | 539 | ||
531 | SRC_URI += "file://0001-calibrate-Add-printk-example.patch" | 540 | SRC_URI += "file://<replaceable>patch-file-one</replaceable>" |
541 | SRC_URI += "file://<replaceable>patch-file-two</replaceable>" | ||
542 | SRC_URI += "file://<replaceable>patch-file-three</replaceable>" | ||
532 | </literallayout> | 543 | </literallayout> |
533 | The <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink> | 544 | The |
534 | and <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink> | 545 | <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink> |
535 | statements enable the OpenEmbedded build system to find the patch file. | 546 | and |
547 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink> | ||
548 | statements enable the OpenEmbedded build system to find | ||
549 | patch files. | ||
536 | For more information on using append files, see the | 550 | For more information on using append files, see the |
537 | "<ulink url='&YOCTO_DOCS_DEV_URL;#using-bbappend-files'>Using .bbappend Files in Your Layer</ulink>" | 551 | "<ulink url='&YOCTO_DOCS_DEV_URL;#using-bbappend-files'>Using .bbappend Files in Your Layer</ulink>" |
538 | section in the Yocto Project Development Manual. | 552 | section in the Yocto Project Development Manual. |
539 | </para></listitem> | 553 | </para></listitem> |
540 | <listitem><para> | ||
541 | <emphasis>Put the patch file in your layer</emphasis>: | ||
542 | Move the <filename>0001-calibrate-Add-printk-example.patch</filename> file to | ||
543 | the <filename>meta-mylayer/recipes-kernel/linux/linux-yocto</filename> | ||
544 | directory.</para></listitem> | ||
545 | </orderedlist> | 554 | </orderedlist> |
546 | </para> | 555 | </para> |
547 | </section> | 556 | </section> |
@@ -1371,16 +1380,47 @@ | |||
1371 | </literallayout> | 1380 | </literallayout> |
1372 | </para></listitem> | 1381 | </para></listitem> |
1373 | <listitem><para> | 1382 | <listitem><para> |
1374 | <emphasis>Prepare Your Layer for Subsequent Builds:</emphasis> | 1383 | <emphasis>Make Changes to Use Patch Files During Subsequent Builds:</emphasis> |
1375 | In order for subsequent builds to pick up patches, the | 1384 | In order for subsequent builds to pick up patches, you |
1376 | patches need to be stored in a layer. | 1385 | need to make some changes in your layer. |
1377 | This example created the layer | 1386 | This example created the layer |
1378 | <filename>meta-mylayer</filename> earlier but left it | 1387 | <filename>meta-mylayer</filename> earlier with basically |
1379 | pretty much empty. | 1388 | just a <filename>bblayers.conf</filename> file. |
1380 | To get it ready for subsequent builds that automatically | 1389 | To get it ready for subsequent builds that automatically |
1381 | apply patches, follow the steps in the | 1390 | apply patches, you need to create an kernel recipe append |
1382 | "<link linkend='creating-and-preparing-a-layer'>Creating and Preparing a Layer</link>" | 1391 | file.</para> |
1383 | section. | 1392 | |
1393 | <para>Move to the <filename>meta-mylayer</filename> | ||
1394 | directory and create some extra structure in your layer: | ||
1395 | <literallayout class='monospaced'> | ||
1396 | $ cd ~/poky/meta-mylayer | ||
1397 | $ mkdir recipes-kernel | ||
1398 | $ mkdir recipes-kernel/linux | ||
1399 | $ mkdir recipes-kernel/linux/linux-yocto | ||
1400 | </literallayout></para> | ||
1401 | |||
1402 | <para>In the | ||
1403 | <filename>recipes-kernel/linux/linux-yocto</filename> | ||
1404 | directory, create an append file named | ||
1405 | <filename>linux-yocto_4.12.bbappend</filename> with the | ||
1406 | following contents: | ||
1407 | <literallayout class='monospaced'> | ||
1408 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | ||
1409 | |||
1410 | SRC_URI += "file://0001-calibrate.c-Added-some-printk-statements.patch" | ||
1411 | </literallayout> | ||
1412 | The | ||
1413 | <ulink url='&YOCTO_DOCS_REF_URL;var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink> | ||
1414 | and | ||
1415 | <ulink url='&YOCTO_DOCS_REF_URL;var-SRC_URI'><filename>SRC_URI</filename></ulink> | ||
1416 | statements enable the OpenEmbedded build system to find | ||
1417 | the patch file. | ||
1418 | For more information on using append files, see the | ||
1419 | "<ulink url='&YOCTO_DOCS_DEV_URL;#using-bbappend-files'>Using .bbappend Files in Your Layer"</ulink>" | ||
1420 | section in the Yocto Project Development Manual.</para> | ||
1421 | |||
1422 | <para>Move the patch file you created in the earlier step | ||
1423 | to the TBD | ||
1384 | </para></listitem> | 1424 | </para></listitem> |
1385 | </orderedlist> | 1425 | </orderedlist> |
1386 | </para> | 1426 | </para> |