![](/img/trans.png)
[英]Yocto error: Building libreoffice package fails in do_package task
[英]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
我想在 bitbake 中添加一個任務,該任務應該在任務之后而不是在任何任務之前運行。 換句話說,我希望自定義任務在構建圖像時作為最后一個任務運行。
例子:
我有兩個名為 do_task_A() 和 do_task_B() 的任務。 現在,我希望 do_task_B() 在 do_task_A() 之后執行。
do_task_A() {
..........
..........
..........
}
addtask task_A
do_task_B() {
..........
..........
..........
}
addtask task_B after do_task_A
上面的代碼片段確保 task_B 如果執行,則在 task_A 之后執行。 但是它不保證 task_B 的執行。
這個要求是 do_task_B() 必須在構建鏡像時作為最后一個任務運行。
我已經嘗試過的事情:
上述方法(1-3)因循環依賴而失敗
上述方法(4-6)失敗並出現異常:IndexError:列表索引超出范圍
有沒有什么辦法可以在構建鏡像的時候強行運行task_B? 我希望 do_task_B() 默認執行,而不是使用 bitbake -c <task_name> <image_name>
build 是最后的任務,所以你必須設置:
addtask do_task_A after do_deploy before do_build
addtask do_task_B after do_task_A before do_build
也許你可以看看這里: How can I add a task after do_deploy()?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.