If you have a single patch or a small series of patches
that you want to apply to the Linux kernel source, you
can do so just as you would with any other recipe.
You first copy the patches to the path added to
FILESEXTRAPATHS
in your .bbappend
file as described in
the previous section, and then reference them in
SRC_URI
statements.
For example, you can apply a three-patch series by adding the
following lines to your linux-yocto
.bbappend
file in your layer:
SRC_URI += "file://0001-first-change.patch" SRC_URI += "file://0002-second-change.patch" SRC_URI += "file://0003-third-change.patch"
The next time you run BitBake to build the Linux kernel, BitBake detects the change in the recipe and fetches and applies the patches before building the kernel.
For a detailed example showing how to patch the kernel, see the "Patching the Kernel" section in the Yocto Project Development Manual.