Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding multiple patches to SRC_URI in a recipe -- Yocto

Tags:

patch

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.

like image 884
evk1206 Avatar asked Oct 16 '25 16:10

evk1206


2 Answers

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.

like image 193
yoctotutor.com Avatar answered Oct 19 '25 13:10

yoctotutor.com


As @Pouet_forever "said", this is not best way to wildcards patches files, instead of this You may use bitbake approach with metadata files such like - .inc files. I mean by that You can extract all of them to one variable then include this file in Your main .bb recipe. Please take look at this example of keeping different patches in one file that may be easily used in many recipes: .inc file with patches - https://github.com/kraj/meta-clang/blob/master/recipes-devtools/clang/common.inc and usage of that in recipe: https://github.com/kraj/meta-clang/blob/master/recipes-devtools/clang/libcxx_git.bb

like image 37
lukaszgard Avatar answered Oct 19 '25 12:10

lukaszgard



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!