Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I add a task after do_deploy()?

Tags:

yocto

bitbake

I have written a recipe where I want to execute a task after do_deploy():

[...]

inherit deploy

[...]

do_deploy () {
    echo "do_deploy() has been called."
}
addtask deploy after do_compile

do_after_deploy () {
    echo "do_after_deploy() has been called."
}
addtask after_deploy after do_deploy

When I build the recipe the do_deploy() task is executed. However, the after_deploy() task is not.

When I manually execute the task with bitbake my_recipe -c after_deploy the instructions in the task are executed.

What is the reason for this? Is do_deploy() the very last task and BitBake doesn't let me add tasks after it?

like image 349
h0ch5tr4355 Avatar asked Dec 24 '22 18:12

h0ch5tr4355


1 Answers

do_deploy() gets executed by default because base.bbclass happens to make do_build (the default task) depend on do_deploy.

You should be able to make your new task run by default with

addtask after_deploy after do_deploy before do_build
like image 102
Jussi Kukkonen Avatar answered Jan 18 '23 08:01

Jussi Kukkonen