diff options
Diffstat (limited to 'documentation/kernel-dev/kernel-dev-common.xml')
-rw-r--r-- | documentation/kernel-dev/kernel-dev-common.xml | 81 |
1 files changed, 80 insertions, 1 deletions
diff --git a/documentation/kernel-dev/kernel-dev-common.xml b/documentation/kernel-dev/kernel-dev-common.xml index 063867dd70..0de39d5686 100644 --- a/documentation/kernel-dev/kernel-dev-common.xml +++ b/documentation/kernel-dev/kernel-dev-common.xml | |||
@@ -478,7 +478,85 @@ adjust your configuration files and repeat the "kernel_configme" and | |||
478 | <title>Modifying Source Code</title> | 478 | <title>Modifying Source Code</title> |
479 | 479 | ||
480 | <para> | 480 | <para> |
481 | You can experiment with source code changes and create a simple patch without | 481 | You can experiment with source code changes and create a |
482 | simple patch without leaving the BitBake environment. | ||
483 | To get started, be sure to complete a build at | ||
484 | least through the kernel configuration task: | ||
485 | <literallayout class='monospaced'> | ||
486 | $ bitbake linux-yocto -c kernel_configme -f | ||
487 | </literallayout> | ||
488 | Taking this step ensures you have the sources prepared | ||
489 | and the configuration completed. | ||
490 | You can find the sources in the | ||
491 | <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink><filename>}/linux</filename> directory. | ||
492 | </para> | ||
493 | |||
494 | <para> | ||
495 | You can edit the sources as you would any other Linux source | ||
496 | tree. | ||
497 | However, keep in mind that you will lose changes if you | ||
498 | trigger the <filename>fetch</filename> task for the recipe. | ||
499 | You can avoid triggering this task by not issuing BitBake's | ||
500 | <filename>cleanall</filename>, <filename>cleansstate</filename>, | ||
501 | or forced <filename>fetch</filename> commands. | ||
502 | Also, do not modify the recipe itself while working | ||
503 | with temporary changes or BitBake might run the | ||
504 | <filename>fetch</filename> command depending on the | ||
505 | changes to the recipe. | ||
506 | </para> | ||
507 | |||
508 | <para> | ||
509 | To test your temporary changes, instruct BitBake to run the | ||
510 | <filename>compile</filename> again. | ||
511 | The <filename>-f</filename> option forces the command to run | ||
512 | even though BitBake might think it has already done so: | ||
513 | <literallayout class='monospaced'> | ||
514 | $ bitbake linux-yocto -c compile -f | ||
515 | </literallayout> | ||
516 | If the compile fails, you can update the sources and repeat | ||
517 | the <filename>compile</filename>. | ||
518 | Once compilation is successful, you can inspect and test | ||
519 | the resulting build (i.e. kernel, modules, and so forth) from | ||
520 | the build directory: | ||
521 | <literallayout class='monospaced'> | ||
522 | ${WORKDIR}/linux-${MACHINE}-${KTYPE}-build | ||
523 | </literallayout> | ||
524 | Alternatively, you can run the <filename>deploy</filename> | ||
525 | command to place the kernel image in the | ||
526 | <filename>tmp/deploy/images</filename> directory: | ||
527 | <literallayout class='monospaced'> | ||
528 | $ bitbake linux-yocto -c deploy | ||
529 | </literallayout> | ||
530 | And, of course, you can perform the remaining installation and | ||
531 | packaging steps by issuing: | ||
532 | <literallayout class='monospaced'> | ||
533 | $ bitbake linux-yocto | ||
534 | </literallayout> | ||
535 | </para> | ||
536 | |||
537 | <para> | ||
538 | For rapid iterative development, the edit-compile-repeat loop | ||
539 | described in this section is preferable to rebuilding the | ||
540 | entire recipe because the installation and packaging tasks | ||
541 | are very time consuming. | ||
542 | </para> | ||
543 | |||
544 | <para> | ||
545 | Once you are satisfied with your source code modifications, | ||
546 | you can make them permanent by generating patches and | ||
547 | applying them to the | ||
548 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink> | ||
549 | statement as described in section | ||
550 | "<link linkend='applying-patches'>Applying Patches</link>" section. | ||
551 | If you are not familiar with generating patches, refer to the | ||
552 | "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-the-patch'>Creating the Patch</ulink>" | ||
553 | section in the Yocto Project Development Manual. | ||
554 | </para> | ||
555 | |||
556 | <para> | ||
557 | Original Text: | ||
558 | <literallayout class='monospaced'> | ||
559 | You can experiment with source code changes and create a simple patch without | ||
482 | leaving the bitbake environment. To get started, be sure to complete a build at | 560 | leaving the bitbake environment. To get started, be sure to complete a build at |
483 | least through the kernel configuration task: | 561 | least through the kernel configuration task: |
484 | 562 | ||
@@ -521,6 +599,7 @@ Once you are happy with your modifications, you can make these permanent by | |||
521 | generating patches and applying them to the SRC_URI as described in section | 599 | generating patches and applying them to the SRC_URI as described in section |
522 | 2.2.1 Applying Patches. If you are not familiar with generating patches, refer | 600 | 2.2.1 Applying Patches. If you are not familiar with generating patches, refer |
523 | to the Yocto Project Development Manual, section 5.7.3 Creating the Patch. | 601 | to the Yocto Project Development Manual, section 5.7.3 Creating the Patch. |
602 | </literallayout> | ||
524 | </para> | 603 | </para> |
525 | </section> | 604 | </section> |
526 | </section> | 605 | </section> |