How to apply patch for uboot, kernel in YOCTO?

Let us take the example for kernel source to add the patch

  • First create the patch of kernel source.
  • Create a folder “files” in kernel bb path.
    ../sources/meta-iwave/recipes-kernel/linux/
  • Copy the created patch to this “files” folder.
  • Now, edit the linux bb file to include the patch file while compilation
    vi ../sources/meta-iwave/recipes-kernel/linux/linux-iwg_.bb
  • Add the below line to the bb file
    FILESEXTRAPATHS:prepend := “${THISDIR}/files:”
  • Also, edit the “KERNEL_SRC” line as below:
    KERNEL_SRC = “git://git-codecommit.ap-south-1.amazonaws.com/v1/repos/linux-imx-iwave;protocol=https;branch=${SRCBRANCH} \
    file://<kernel_path_name>.patch”