Locates patch files and applies them to the source code.
After fetching and unpacking source files, the build system
uses the recipe's
SRC_URI
statements to locate and apply patch files to the source code.
FILESPATH
variable to determine the default set of directories when
searching for patches.
Patch files, by default, are *.patch
and
*.diff
files created and kept in a
subdirectory of the directory holding the recipe file.
For example, consider the
bluez5
recipe from the OE-Core layer (i.e.
poky/meta
):
poky/meta/recipes-connectivity/bluez5
This recipe has two patch files located here:
poky/meta/recipes-connectivity/bluez5/bluez5
In the bluez5
recipe, the
SRC_URI
statements point to the source and
patch files needed to build the package.
bluez5_5.48.bb
recipe, the SRC_URI
statements are from an
include file bluez5.inc
.
As mentioned earlier, the build system treats files whose file
types are .patch
and
.diff
as patch files.
However, you can use the "apply=yes" parameter with the
SRC_URI
statement to indicate any file as a
patch file:
SRC_URI = " \ git://path_to_repo
/some_package
\ file://file
;apply=yes \ "
Conversely, if you have a directory full of patch files and you
want to exclude some so that the do_patch
task does not apply them during the patch phase, you can use
the "apply=no" parameter with the SRC_URI
statement:
SRC_URI = " \ git://path_to_repo
/some_package
\ file://path_to_lots_of_patch_files
\ file://path_to_lots_of_patch_files
/patch_file5
;apply=no \ "
In the previous example, assuming all the files in the directory
holding the patch files end with either .patch
or .diff
, every file would be applied as a
patch by default except for the
patch_file5
patch.
You can find out more about the patching process in the "Patching" section in the Yocto Project Overview and Concepts Manual and the "Patching Code" section in the Yocto Project Development Tasks Manual.