diff options
Diffstat (limited to 'documentation')
-rw-r--r-- | documentation/ref-manual/ref-tasks.xml | 76 |
1 files changed, 72 insertions, 4 deletions
diff --git a/documentation/ref-manual/ref-tasks.xml b/documentation/ref-manual/ref-tasks.xml index b4db97c53b..93ad692775 100644 --- a/documentation/ref-manual/ref-tasks.xml +++ b/documentation/ref-manual/ref-tasks.xml | |||
@@ -429,12 +429,80 @@ | |||
429 | 429 | ||
430 | <para> | 430 | <para> |
431 | Locates patch files and applies them to the source code. | 431 | Locates patch files and applies them to the source code. |
432 | See the | 432 | </para> |
433 | |||
434 | <para> | ||
435 | After fetching and unpacking source files, the build system locates | ||
436 | and applies patches to the source code. | ||
437 | Patch files, by default, are <filename>*.patch</filename> and | ||
438 | <filename>*.diff</filename> files created and kept in a | ||
439 | subdirectory of the directory holding the recipe file. | ||
440 | For example, consider the | ||
441 | <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/meta/recipes-connectivity/bluez5'><filename>bluez5</filename></ulink> | ||
442 | recipe from the OE-Core layer (i.e. | ||
443 | <filename>poky/meta</filename>): | ||
444 | <literallayout class='monospaced'> | ||
445 | poky/meta/recipes-connectivity/bluez5 | ||
446 | </literallayout> | ||
447 | This recipe has two patch files located here: | ||
448 | <literallayout class='monospaced'> | ||
449 | poky/meta/recipes-connectivity/bluez5/bluez5 | ||
450 | </literallayout> | ||
451 | </para> | ||
452 | |||
453 | <para> | ||
454 | The recipe for <filename>bluez5</filename> uses the | ||
455 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink> | ||
456 | variable to point to the source and patch files needed to build | ||
457 | the recipe. | ||
458 | <note> | ||
459 | In the case for the <filename>bluez5_5.48.bb</filename> | ||
460 | recipe, the <filename>SRC_URI</filename> statements are from an | ||
461 | include file <filename>bluez5.inc</filename>. | ||
462 | </note> | ||
463 | </para> | ||
464 | |||
465 | <para> | ||
466 | As mentioned earlier, the build system treats files whose file | ||
467 | types are <filename>.patch</filename> and | ||
468 | <filename>.diff</filename> as patch files. | ||
469 | However, you can use the "apply=yes" parameter with the | ||
470 | <filename>SRC_URI</filename> statement to indicate any file as a | ||
471 | patch file: | ||
472 | <literallayout class='monospaced'> | ||
473 | SRC_URI = " \ | ||
474 | git://<replaceable>path_to_repo</replaceable>/<replaceable>some_recipe</replaceable> \ | ||
475 | file://<replaceable>file</replaceable>;apply=yes \ | ||
476 | " | ||
477 | </literallayout> | ||
478 | </para> | ||
479 | |||
480 | <para> | ||
481 | Conversely, if you have a directory full of patch files and you | ||
482 | want to exclude some so that the <filename>do_patch</filename> | ||
483 | task does not apply them during the patch phase, you can use | ||
484 | the "apply=no" parameter with the <filename>SRC_URI</filename> | ||
485 | statement: | ||
486 | <literallayout class='monospaced'> | ||
487 | SRC_URI = " \ | ||
488 | git://<replaceable>path_to_repo</replaceable>/<replaceable>some_recipe</replaceable> \ | ||
489 | file://<replaceable>path_to_lots_of_patch_files</replaceable> \ | ||
490 | file://<replaceable>path_to_lots_of_patch_files</replaceable>/<replaceable>patch_file5</replaceable>;apply=no \ | ||
491 | " | ||
492 | </literallayout> | ||
493 | In the previous example, assuming all the files in the directory | ||
494 | holding the patch files end with either <filename>.patch</filename> | ||
495 | or <filename>.diff</filename>, every file would be applied as a | ||
496 | patch by default except for the | ||
497 | <replaceable>patch_file5</replaceable> patch. | ||
498 | </para> | ||
499 | |||
500 | <para> | ||
501 | You can find out more about the patching process in the | ||
433 | "<ulink url='&YOCTO_DOCS_OM_URL;#patching-dev-environment'>Patching</ulink>" | 502 | "<ulink url='&YOCTO_DOCS_OM_URL;#patching-dev-environment'>Patching</ulink>" |
434 | section in the Yocto Project Overview and Concepts Manual and the | 503 | section in the Yocto Project Overview and Concepts Manual and the |
435 | "<ulink url='&YOCTO_DOCS_DEV_URL;#new-recipe-patching-code'>Patching Code"</ulink>" | 504 | "<ulink url='&YOCTO_DOCS_DEV_URL;#new-recipe-patching-code'>Patching Code</ulink>" |
436 | section in the Yocto Project Development Tasks Manual for more | 505 | section in the Yocto Project Development Tasks Manual. |
437 | information. | ||
438 | </para> | 506 | </para> |
439 | </section> | 507 | </section> |
440 | 508 | ||