[英]How to add a custom bitbake task at the end of task list in yocto? I want the custom task to run as the last task while building the image
I want to add a task in bitbake which is supposed to run after a task but not before any task.我想在 bitbake 中添加一个任务,该任务应该在任务之后而不是在任何任务之前运行。 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().我有两个名为 do_task_A() 和 do_task_B() 的任务。 Now, I want do_task_B() to execute after do_task_A().
现在,我希望 do_task_B() 在 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.上面的代码片段确保 task_B 如果执行,则在 task_A 之后执行。 However it does not guarantee the execution of task_B.
但是它不保证 task_B 的执行。
This requirement is that do_task_B() must run as the last task when the image is built.这个要求是 do_task_B() 必须在构建镜像时作为最后一个任务运行。
Things that I have already tried:我已经尝试过的事情:
The above methods (1-3) failed due to circular dependency上述方法(1-3)因循环依赖而失败
The above methods (4-6) failed with Exception: IndexError: list index out of range上述方法(4-6)失败并出现异常:IndexError:列表索引超出范围
Is there any way to forcefully run task_B while building an image?有没有什么办法可以在构建镜像的时候强行运行task_B? I want do_task_B() to get executed by default, and not by using bitbake -c <task_name> <image_name>
我希望 do_task_B() 默认执行,而不是使用 bitbake -c <task_name> <image_name>
build is the final task, so you have to set: build 是最后的任务,所以你必须设置:
addtask do_task_A after do_deploy before do_build
addtask do_task_B after do_task_A before do_build
Maybe you can take a look here: How can I add a task after do_deploy()?也许你可以看看这里: How can I add a task after do_deploy()?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.