patchyocto

Adding multiple patches to SRC_URI in a recipe -- Yocto


I would like to know is there an easy way of adding patches to the SRC_URI in Yocto. I am creating a BSP for a customized board using Yocto. I have some hundred plus patches for the Linux kernel and barebox.

To include the patches for the Linux kernel, I have created an .scc file. In the .scc file I have included all the patches required.The SRC_URI option in the kernel recipe looks like:

SRC_URI += "https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.0.9.tar.xz \
        file://kernelpatch.scc \
        file://kernel-4.0.9.cfg \
        "

For the barebox, I tried to do the same, but it seems it doesn't support .scc files. So now I have included all the hundred plus patches using

file://patchname.patch

file://patches/0001-drivers.patch \
file://patches/0002-hw_random-C.patch \
.
.
.
.
file://patches/0304-usb-fastbootupport.patch \

Is there any option to include all the patches in a single line like in the kernel.


Solution

  • Go to your meta-layer/recipes-kernel/linux Create a dir like patches. Copy all your patches to this patches directory.

    create linux-ti_%.bbappend file and add below lines

    FILESEXTRAPATHS_prepend := "${THISDIR}:"
    SRC_URI = "file://patches/* "
    

    this will take all your patches at single instance and apply to the kernel.