Updating oe-core patches in recipes according to remote git new commits

Hi,

we are using bitbake/oe-core for building of our OS for colibri module. We have a lot of patch files spread in recipes directories (patches to kernel, u-boot etc.). The problem is, our patches are compatible only with certain commit in git repository. If we try to apply our patches to the latest version, some of them fails (with error “while searching for…”).
According to this, it looks that we need to adjust our patches according to changes to the source code on git repo.
To be more specific, I’m trying to fix this problem currently on u-boot, branch 2016.11-toradex. Patches were created on older code (commit f0e414972b5b225e33ebe75574562266116746f9 from 14 June 2017).

Is there any recommended way how to keep patches, used by oe-core recipes, compatible with new commits in source code?

Many thanks for any recommendations

EDIT: It looks like tool “devtool” from Yocto can do this job. I’m going to investigate it, but still any comments are welcomed :slight_smile: TipsAndTricks/Patching the source for a recipe - Yocto Project

HI @janulo

It depends on the number of patches and files you are changing by these patches. Additionally it depends how many changes do you add to these files. Are you just changing some parameters of the existing kernel or uboot or are you changing the interfaces completely?

In general, you have to decide if you want to create patches for the code, this make sense for small changes. Or you want to create a your own branch of the git repository from which you will do the build. In this case you can always track the differences between your custom branch and the original one.

Beside this there is no way to keep patches compatible with new commits…

For your specific problem, you need to find the differences in the files modified by your patch by doing for example:
git diff f0e414972b5b225e33ebe75574562266116746f9 ./arch/arm/cpu/armv7/mx6/Kconfig

Then you need to check manually, if your patches are still compatible with the new code.

We don’t have any experience with devtool.

Best regards, Jaski

Hi @jaski.tx

thank you for your response.

We are changing only some parameters, so patch files seems to be ok.
I made the same as you recommended - check manually differences and edit patch file. But it may be complicated to follow new commits on your git repository (I suppose that working always with latest versions each time we need to add new change to UBoot/kernel is a right way, as new commits may bring bugfixes etc. - please correct me if this approach is not right). But it may exist another way of updating/editing recipes and patches using devtool.

So far I just tested devtool by adding another changes into Uboot (besides already existing changes) and devtool helped a lot. It copies source files into temporary folder (reflecting all existing patches), allowing you to make needed changes. After changes are done, you just need to commit it to local git and run devtool update-recipe command.

There are also commands related to updgrade of recipes, but I didn’t test it yet. From devtool help: Upgrades an existing recipe to a new upstream version. Puts the upgraded recipe file into the workspace along with any associated files, and extracts the source tree to a specified location (in case patches need rebasing or adding to as a result of the upgrade).

Maybe it’s a good candidate to investigate and to extend your useful article library at https://developer.toradex.com/

So what do you think @jaski.tx ,

  • is it right to get always the latest version of source code (within the same branch)? Or it’s good practice just to stay on one commit all the time?
  • does Bitbake refresh source of UBoot/Kernel if it’s already cached from previous build? How can this be told explicitly to Bitbake? Patches will probably be incompatible if not adjusted…

Best regards
Jan

hi @janulo

Thanks for the Information about “Devtool”. It sounds very interesting and helpful. We will try this out and extend it to the open-embedded build Article.

So what do you think @jaski.tx , - is it right to get always the latest version of source code (within the same branch)? Or it’s good practice just to stay on one commit all the time?
Well, this will depend on the changes in the BSP. You should stick to a stable release and update if there are some issues solved for your application or you need new features which don’t have with your current Bsp. The amount of work to modify your patches will depend on the time gap and the changes in Bsp between updates.

  • does Bitbake refresh source of UBoot/Kernel if it’s already cached from previous build? How can this be told explicitly to Bitbake? Patches will probably be incompatible if not adjusted…

If your sources are on a stable git branch, then Bitbake will do the build on your local sources unless you do repo sync, only then the sources will be updated. If your sources are on a development git branch, as .next branch for toradex, then sources will be updated to the latest commit. If you want explicitly to update to the newest commits then you need to do repo sync.

Best regards, Jaski

I’m glad that you like Devtool as well.
Thanks for useful comments @jaski.tx . Have a nice day!

Regards Jan

You are welcome. Have a nice day too.