Reputation: 457
I am trying to add new c file in place of file that already comes after downloading the package from git.Tried bbappend but the original file is still there.also modified src_uri += file://fileone.c but that is also not overwriting file. Any suggestions would be of great help
Regards Mayank
Upvotes: 2
Views: 3997
Reputation: 471
This is where devtool modify
can be very helpful if you're using the jethro (2.0) release or later. Assuming you have already sourced the environment setup script:
devtool modify <recipename>
cd
into that directory.git commit -a
to commit your changesdevtool update-recipe <recipename> -a /path/to/your/custom/layer
(assuming you want to create a bbappend in a custom layer, otherwise just omit the -a
and path to apply the changes to the original recipe instead).devtool reset <recipename>
to put everything back to building completely from the metadata.Upvotes: 3
Reputation: 14607
So the original C file is part of the release tarball (or git, or wherever the release comes from) and you want to replace that file with your own before configure and compile happen?
Replacing the whole file is just a special case of any smaller changes you might want to do the source files, so just do what you would do in those cases: create a patch the replaces the file and add the patch with SRC_URI += file://replace-file-with-my-file.patch
.
I use this work flow (in the project source directory, e.g. poky/build/tmp/work/corei7-64-poky-linux/my-project):
# initialize git (only if this is not a git repo already)
git init
git add *
git commit -m "original code"
# <--- here you should replace the file
git commit -a -m "Replace file with a better file"
git format-patch -1
Now you should have a patch file that you can copy into the proper recipe directory.
Upvotes: 2