[meta-swupdate,2/3] fix generation of swu images after recreating tmp-dir from sstate

Message ID 1504954145-19534-2-git-send-email-c.andersen@kostal.com
State Changes Requested
Headers show
Series
  • [meta-swupdate,1/3] fix image generation when signing is enabled
Related show

Commit Message

Andersen, Christian Sept. 9, 2017, 10:49 a.m.
Signed-off-by: Christian Andersen <c.andersen@kostal.com>
---
 classes/swupdate.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Stefano Babic Sept. 14, 2017, 7:48 a.m. | #1
On 09/09/2017 12:49, Christian Andersen wrote:
> Signed-off-by: Christian Andersen <c.andersen@kostal.com>
> ---
>  classes/swupdate.bbclass | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/classes/swupdate.bbclass b/classes/swupdate.bbclass
> index 5a2d963..ef75d7f 100644
> --- a/classes/swupdate.bbclass
> +++ b/classes/swupdate.bbclass
> @@ -199,5 +199,5 @@ python do_swuimage () {
>  COMPRESSIONTYPES = ""
>  PACKAGE_ARCH = "${MACHINE_ARCH}"
>  
> -addtask do_swuimage after do_unpack after do_prepare_recipe_sysroot before do_install
> -addtask do_createlink after do_swuimage before do_install
> +addtask do_swuimage after do_unpack after do_prepare_recipe_sysroot before do_build
> +addtask do_createlink after do_swuimage before do_build
> 

Sure you have already investigated, but the commit message and the
indication of the error remain cryptic to me.

Can you better explain which is the issue ? Is thi caused after applying
your first patch (it does not seem so..) ?

Thanks,
Stefano Babic
Christian Andersen Sept. 14, 2017, 8:21 a.m. | #2
Hi,

On Thursday, 14 September 2017 09:48:53 UTC+2, Stefano Babic wrote:
>
> On 09/09/2017 12:49, Christian Andersen wrote: 
> > Signed-off-by: Christian Andersen <c.and...@kostal.com <javascript:>> 
> > --- 
> >  classes/swupdate.bbclass | 4 ++-- 
> >  1 file changed, 2 insertions(+), 2 deletions(-) 
> > 
> > diff --git a/classes/swupdate.bbclass b/classes/swupdate.bbclass 
> > index 5a2d963..ef75d7f 100644 
> > --- a/classes/swupdate.bbclass 
> > +++ b/classes/swupdate.bbclass 
> > @@ -199,5 +199,5 @@ python do_swuimage () { 
> >  COMPRESSIONTYPES = "" 
> >  PACKAGE_ARCH = "${MACHINE_ARCH}" 
> >   
> > -addtask do_swuimage after do_unpack after do_prepare_recipe_sysroot 
> before do_install 
> > -addtask do_createlink after do_swuimage before do_install 
> > +addtask do_swuimage after do_unpack after do_prepare_recipe_sysroot 
> before do_build 
> > +addtask do_createlink after do_swuimage before do_build 
> > 
>
> Sure you have already investigated, but the commit message and the 
> indication of the error remain cryptic to me. 
>
> Can you better explain which is the issue ? Is thi caused after applying 
> your first patch (it does not seem so..) ? 
>
> Thanks, 
> Stefano Babic 
>
 
when deleting the tmp-dir of Yocto before a build, all unchanged recipes are
recreated from sstate. Unfortunately the swu images are not created in
this case, because the do_swuimage task is not run. After connecting the
do_swuimage task with do_build, the task is run even when recreating more 
or less
everything from sstate.

This is similar to the original image.bbclass where the task 
do_image_complete is
also connected to do_build. In swupdate.bbclass the task do_swuimage
or (more correct) do_createlink corresponds to do_image_complete in 
image.bbclass 

I have to admit that I did no further investigation why do_install is not 
working and
why do_build is okay.

The 3rd part of my patch series utilizes the sstate staging to copy the 
created swu
images to the final deploy directory (without caching the image itself). 
This is also
based on the current process used in pyro. Maybe both patches should be 
squashed.

Regards,
Christian
Stefano Babic Sept. 14, 2017, 8:27 a.m. | #3
Hi Christian,

On 14/09/2017 10:21, Christian Andersen wrote:
> Hi,
> 
> On Thursday, 14 September 2017 09:48:53 UTC+2, Stefano Babic wrote:
> 
>     On 09/09/2017 12:49, Christian Andersen wrote:
>     > Signed-off-by: Christian Andersen <c.and...@kostal.com <javascript:>>
>     > ---
>     >  classes/swupdate.bbclass | 4 ++--
>     >  1 file changed, 2 insertions(+), 2 deletions(-)
>     >
>     > diff --git a/classes/swupdate.bbclass b/classes/swupdate.bbclass
>     > index 5a2d963..ef75d7f 100644
>     > --- a/classes/swupdate.bbclass
>     > +++ b/classes/swupdate.bbclass
>     > @@ -199,5 +199,5 @@ python do_swuimage () {
>     >  COMPRESSIONTYPES = ""
>     >  PACKAGE_ARCH = "${MACHINE_ARCH}"
>     >  
>     > -addtask do_swuimage after do_unpack after
>     do_prepare_recipe_sysroot before do_install
>     > -addtask do_createlink after do_swuimage before do_install
>     > +addtask do_swuimage after do_unpack after
>     do_prepare_recipe_sysroot before do_build
>     > +addtask do_createlink after do_swuimage before do_build
>     >
> 
>     Sure you have already investigated, but the commit message and the
>     indication of the error remain cryptic to me.
> 
>     Can you better explain which is the issue ? Is thi caused after
>     applying
>     your first patch (it does not seem so..) ?
> 
>     Thanks,
>     Stefano Babic 
> 
>  
> when deleting the tmp-dir of Yocto before a build, all unchanged recipes are
> recreated from sstate.

Right.

> Unfortunately the swu images are not created in
> this case, because the do_swuimage task is not run. After connecting the
> do_swuimage task with do_build, the task is run even when recreating
> more or less
> everything from sstate.

Thanks, got it.

> 
> This is similar to the original image.bbclass where the task
> do_image_complete is
> also connected to do_build. In swupdate.bbclass the task do_swuimage
> or (more correct) do_createlink corresponds to do_image_complete in
> image.bbclass 

Right, thanks for explanation.

Waht about to add this explanation in the commit message ? This explains
the issues and how they are solved, and that the solution is already
used in yocto since pyro.

> 
> I have to admit that I did no further investigation why do_install is
> not working and
> why do_build is okay.
> 
> The 3rd part of my patch series utilizes the sstate staging to copy the
> created swu
> images to the final deploy directory (without caching the image itself).
> This is also
> based on the current process used in pyro. Maybe both patches should be
> squashed.

Agree. So please send V2, squashing 2/3 and 3/3, with description in the
commit message - thanks !

Best regards,
Stefano
Andersen, Christian Sept. 15, 2017, 6:52 a.m. | #4
Hi Stefano,

> > I have to admit that I did no further investigation why do_install is
> > not working and why do_build is okay.
> >
> > The 3rd part of my patch series utilizes the sstate staging to copy
> > the created swu images to the final deploy directory (without caching
> > the image itself).
> > This is also
> > based on the current process used in pyro. Maybe both patches should
> > be squashed.
> 
> Agree. So please send V2, squashing 2/3 and 3/3, with description in the commit
> message - thanks !

okay, thanks, I will send an update (today or early next week).

Regards
Christian

Patch

diff --git a/classes/swupdate.bbclass b/classes/swupdate.bbclass
index 5a2d963..ef75d7f 100644
--- a/classes/swupdate.bbclass
+++ b/classes/swupdate.bbclass
@@ -199,5 +199,5 @@  python do_swuimage () {
 COMPRESSIONTYPES = ""
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
-addtask do_swuimage after do_unpack after do_prepare_recipe_sysroot before do_install
-addtask do_createlink after do_swuimage before do_install
+addtask do_swuimage after do_unpack after do_prepare_recipe_sysroot before do_build
+addtask do_createlink after do_swuimage before do_build