[yocto] Execute recipe only after kernel is built and rootfs file is created in deploy folder

Khem Raj raj.khem at gmail.com
Thu Feb 4 22:29:33 PST 2016


> On Feb 4, 2016, at 10:07 PM, Josias Inacio da Silva Filho <josiasinacio at hotmail.com> wrote:
> 
> Hi guys,
> 
> I’m trying to run a recipe that has dependencies in the generation of the roofts and kernel image files. Without those two files already in the deploy folder, I cannot start running my recipe.
> 
> Some suggested that I should add the task in a class and make that dependent of do_rootfs. Then, inherit that class in a recipe. But I haven’t been successful with that. Here’s what I have:
> 
> myclass.bbclass:
> 
> do_work() {
>         #main work done here
> }
> addtask work after do_rootfs
> 
> ##### end of class
> 
> myrecipe.bb:
> 
> inherit myclass
> 
> do_deploy() {
>     do_work
> }
> addtask do_deploy
> 
> ##### end of recipe
> 
> 
> This must be very wrong, as the do_deploy task of my recipe is being executed before do_rootfs happens, so it fails because do_work needs files that haven’t been created in the deploy folder yet.
> 
> How can I fix this? Do I really need a class and recipe, or can I get away with just having one or the other?

actually its better for you to latch onto image recipe via additional task defined in bbappend


something like below


addtask mytask after do_rootfs before do_build
do_mytask[depends] += "${PN}:do_rootfs"
do_mytask[depends] += "virtual/kernel:do_deploy"
# We want to build updater everytime we build image
do_mytask[nostamp] = “1"

do_mytask() {
}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20160204/eb8195c1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20160204/eb8195c1/attachment.pgp>


More information about the yocto mailing list