4

I have one git repo where i maintain some binary files. Now i want to create patches of last few commits & integrate them in Yocto build.

I have created patches like

git format-patch -3 --binary

Now i have integrate these patches in Yocto recipe files. And Yocto gives below error while git apply in do_patch()

git binary diffs are not supported.
Patch xyz.patch does not apply (enforce with -f)

Am i missing anything while creating binary patches here?

or

Is there any Yocto Hacks which i can do in my recipe file to handle with binary patches?

3 Answers 3

3

I also ran into this with patches created using the yocto tooling (devtool update-recipe), and I do not want to change the way I create the patches.

By default yocto uses quilt to apply patches, I addressed the issue using git instead.

This can be configured by setting the PATCHTOOL variable in the recipe:

PATCHTOOL = "git"
Sign up to request clarification or add additional context in comments.

Comments

1

Maybe you need to use this cmd with additional flag --full-index

git format-patch -3 --full-index --binary

https://git-scm.com/docs/git-format-patch --binary In addition to --full-index, output a binary diff that can be applied with git-apply.

3 Comments

This works with direct git apply commands. But still these patches does not work with Yocto !!
The possible reason is a different history of bin-files. So, are the Yocto bin-file and patched bin-file history are the same?
Yes patch history are same in both cases. Now i have forked do_patch() in recipe file & applied patches with git apply and those works fine. But with default do_patch() implementation its gives same error.
1

Is there any Yocto Hacks which i can do in my recipe file to handle with binary patches?

When I deal with binary sources, I put the binary parts in a .tar.gz, add that to SRC_URI and then cp the bits I need to where I need them with a do_install_append.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.