Here is full documentation about tasks. They all start with do_
, so you were advised to extend one of them. Also (as written in docs) packages may have additional tasks, that come from classes - files .bbclass
, that are applied to your package's recipe with inherit
keyword. To get full list of exactly your package tasks use command
bitbake -c listtasks <your package name>
Actually this way you just call task do_listtasks
of your package, do_listtasks
is also... a task)
So.. first you need to understand to what task you need to append your file. Tasks have pretty straightforward names, so to use your file during compilation, you need task do_compile
, and so on.
Now, it is not clear, how you are going to actually add your file to the build, but looks like also somehow by recipe of your package. That means you should place your file in folder files
(there are options about this folder naming) next by your recipe, than add file to variable SRC_URI
like this:
SRC_URI = "
.....
file://your-file-in-folder-files.ext
.....
"
By doing this, you tell bitbake to append this file to WORKDIR during do_unpack
task. More on this here, especially in 3.3.5.
Now to actually your question)) Suppose you need to use your file during do_compile
task, but before the actual compilation actions. Than in your recipe extend do_compile like this:
do_compile_prepend() {
cp ${WORKDIR}/your-file-in-folder-files.ext ${S}/some/subpath/inside/sources
}
Similarly to do something with your file after some actual task actions, create function with _append
suffix. For example, do_configure_append
or do_compile_append
.
Here WORKDIR is some folder under Yocto build
directory, where all your package stuff, needed for build your package, is placed, S is a special folder with downloaded and unpacked source code under WORKDIR
and do_compile_prepend
(and others) is just a bash-script.
Also consider folder D (it is also locates under WORKDIR
). It contains files, that actually shall go into resulting image during image creating. So if somehow your file finds the way to the resulting image, remove it directly from D
like this:
do_install_append() {
rm -f ${D}/path/to/your/file/in/resulting/rootfs/your-file-in-folder-files.ext
}
Well... this is more overview, than a exact answer, but hope this helps!