I want to add a task in bitbake which is supposed to run after a task but not before any task. In other words, I want the custom task to run as the last task while building the image.
Example:
I have two tasks named do_task_A() and do_task_B(). Now, I want do_task_B() to execute after do_task_A().
do_task_A() {
..........
..........
..........
}
addtask task_A
do_task_B() {
..........
..........
..........
}
addtask task_B after do_task_A
The above snippet ensures that task_B if executed, gets executed after task_A. However it does not guarantee the execution of task_B.
This requirement is that do_task_B() must run as the last task when the image is built.
Things that I have already tried:
- addtask task_B after do_task_A before do_build
- addtask task_B after do_task_A before do_image
- addtask task_B after do_task_A before do_image_complete
The above methods (1-3) failed due to circular dependency
- Adding task_B as a postfuncs for an existing task (ensuring all the dependencies are satisfied)
- Added task_B as a function inside another function
- Used bb.build.exec_func('task_B',d) inside a task/function that is successfully being executed.
The above methods (4-6) failed with Exception: IndexError: list index out of range
Is there any way to forcefully run task_B while building an image? I want do_task_B() to get executed by default, and not by using bitbake -c <task_name> <image_name>