All of lore.kernel.org
 help / color / mirror / Atom feed
* Execute recipe only after kernel is built and rootfs file is created in deploy folder
@ 2016-02-05  6:07 Josias Inacio da Silva Filho
  2016-02-05  6:29 ` Khem Raj
  0 siblings, 1 reply; 3+ messages in thread
From: Josias Inacio da Silva Filho @ 2016-02-05  6:07 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 971 bytes --]

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?

Thanks,
Josias

[-- Attachment #2: Type: text/html, Size: 1928 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Execute recipe only after kernel is built and rootfs file is created in deploy folder
  2016-02-05  6:07 Execute recipe only after kernel is built and rootfs file is created in deploy folder Josias Inacio da Silva Filho
@ 2016-02-05  6:29 ` Khem Raj
  2016-02-16  2:59   ` Josias Inacio da Silva Filho
  0 siblings, 1 reply; 3+ messages in thread
From: Khem Raj @ 2016-02-05  6:29 UTC (permalink / raw)
  To: Josias Inacio da Silva Filho; +Cc: yocto


[-- Attachment #1.1: Type: text/plain, Size: 1482 bytes --]


> On Feb 4, 2016, at 10:07 PM, Josias Inacio da Silva Filho <josiasinacio@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() {
}


[-- Attachment #1.2: Type: text/html, Size: 3279 bytes --]

[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 211 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Execute recipe only after kernel is built and rootfs file is created in deploy folder
  2016-02-05  6:29 ` Khem Raj
@ 2016-02-16  2:59   ` Josias Inacio da Silva Filho
  0 siblings, 0 replies; 3+ messages in thread
From: Josias Inacio da Silva Filho @ 2016-02-16  2:59 UTC (permalink / raw)
  To: Khem Raj; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 1886 bytes --]

Thanks Khem. I was able to get it working with something similar to what you explained. Basically a task inside the image recipe (like yours), which calls another task inside a class that I have.

From: Khem Raj 
Sent: Friday, February 05, 2016 1:29 AM
To: Josias Inacio da Silva Filho 
Cc: yocto@yoctoproject.org 
Subject: Re: [yocto] Execute recipe only after kernel is built and rootfs file is created in deploy folder


  On Feb 4, 2016, at 10:07 PM, Josias Inacio da Silva Filho <josiasinacio@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() {
}

[-- Attachment #2: Type: text/html, Size: 4311 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-16  2:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-05  6:07 Execute recipe only after kernel is built and rootfs file is created in deploy folder Josias Inacio da Silva Filho
2016-02-05  6:29 ` Khem Raj
2016-02-16  2:59   ` Josias Inacio da Silva Filho

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.