Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] kernel.bbclass: Delay rm_work to run after do_bundle_initramfs
@ 2013-10-31  1:24 Xufeng Zhang
  2013-10-31  8:26 ` Martin Jansa
  0 siblings, 1 reply; 5+ messages in thread
From: Xufeng Zhang @ 2013-10-31  1:24 UTC (permalink / raw)
  To: openembedded-core

From: "Signed-off-by: Xufeng Zhang" <xufeng.zhang@windriver.com>

Since kernel will build twice when we are trying to bundle kernel
and initramfs together after commit 609d5a9ab("kernel.bbclass,
image.bbclass: Implement kernel INITRAMFS dependency and bundling"),
thus, the second building for kernel would fail if rm_work is done
previously.

To fix this problem, we need to delay the rm_work task for kernel
to run after do_bundle_initramfs task.

[YOCTO #5416]

Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
---
 meta/classes/kernel.bbclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index dedfab7..6154df0 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -29,6 +29,9 @@ python __anonymous () {
     image_task = d.getVar('INITRAMFS_TASK', True)
     if image_task:
         d.appendVarFlag('do_configure', 'depends', ' ${INITRAMFS_TASK}')
+
+    if image or image_task:
+        d.appendVarFlag('do_rm_work', 'depends', " %s:do_bundle_initramfs" % d.getVar('PN', True))
 }
 
 inherit kernel-arch deploy
-- 
1.8.3.3



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

* Re: [PATCH] kernel.bbclass: Delay rm_work to run after do_bundle_initramfs
  2013-10-31  1:24 [PATCH] kernel.bbclass: Delay rm_work to run after do_bundle_initramfs Xufeng Zhang
@ 2013-10-31  8:26 ` Martin Jansa
  2013-11-01  1:10   ` Xufeng Zhang
  2013-11-07 15:08   ` Enrico Scholz
  0 siblings, 2 replies; 5+ messages in thread
From: Martin Jansa @ 2013-10-31  8:26 UTC (permalink / raw)
  To: Xufeng Zhang; +Cc: openembedded-core

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

On Thu, Oct 31, 2013 at 09:24:40AM +0800, Xufeng Zhang wrote:
> From: "Signed-off-by: Xufeng Zhang" <xufeng.zhang@windriver.com>
> 
> Since kernel will build twice when we are trying to bundle kernel
> and initramfs together after commit 609d5a9ab("kernel.bbclass,
> image.bbclass: Implement kernel INITRAMFS dependency and bundling"),
> thus, the second building for kernel would fail if rm_work is done
> previously.
> 
> To fix this problem, we need to delay the rm_work task for kernel
> to run after do_bundle_initramfs task.
> 
> [YOCTO #5416]
> 
> Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
> ---
>  meta/classes/kernel.bbclass | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index dedfab7..6154df0 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -29,6 +29,9 @@ python __anonymous () {
>      image_task = d.getVar('INITRAMFS_TASK', True)
>      if image_task:
>          d.appendVarFlag('do_configure', 'depends', ' ${INITRAMFS_TASK}')
> +
> +    if image or image_task:
> +        d.appendVarFlag('do_rm_work', 'depends', " %s:do_bundle_initramfs" % d.getVar('PN', True))
>  }

Why not add "before" param to addtask?

addtask bundle_initramfs after do_compile before do_build

could do the trick

>  inherit kernel-arch deploy
> -- 
> 1.8.3.3
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

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

* Re: [PATCH] kernel.bbclass: Delay rm_work to run after do_bundle_initramfs
  2013-10-31  8:26 ` Martin Jansa
@ 2013-11-01  1:10   ` Xufeng Zhang
  2013-11-07 15:08   ` Enrico Scholz
  1 sibling, 0 replies; 5+ messages in thread
From: Xufeng Zhang @ 2013-11-01  1:10 UTC (permalink / raw)
  To: Martin Jansa; +Cc: openembedded-core

On 10/31/2013 04:26 PM, Martin Jansa wrote:
> On Thu, Oct 31, 2013 at 09:24:40AM +0800, Xufeng Zhang wrote:
>    
>> From: "Signed-off-by: Xufeng Zhang"<xufeng.zhang@windriver.com>
>>
>> Since kernel will build twice when we are trying to bundle kernel
>> and initramfs together after commit 609d5a9ab("kernel.bbclass,
>> image.bbclass: Implement kernel INITRAMFS dependency and bundling"),
>> thus, the second building for kernel would fail if rm_work is done
>> previously.
>>
>> To fix this problem, we need to delay the rm_work task for kernel
>> to run after do_bundle_initramfs task.
>>
>> [YOCTO #5416]
>>
>> Signed-off-by: Xufeng Zhang<xufeng.zhang@windriver.com>
>> ---
>>   meta/classes/kernel.bbclass | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
>> index dedfab7..6154df0 100644
>> --- a/meta/classes/kernel.bbclass
>> +++ b/meta/classes/kernel.bbclass
>> @@ -29,6 +29,9 @@ python __anonymous () {
>>       image_task = d.getVar('INITRAMFS_TASK', True)
>>       if image_task:
>>           d.appendVarFlag('do_configure', 'depends', ' ${INITRAMFS_TASK}')
>> +
>> +    if image or image_task:
>> +        d.appendVarFlag('do_rm_work', 'depends', " %s:do_bundle_initramfs" % d.getVar('PN', True))
>>   }
>>      
> Why not add "before" param to addtask?
>
> addtask bundle_initramfs after do_compile before do_build
>
> could do the trick
>    

Yes, this works better than my fix, thanks a lot!
I'll send a V2 patch.


Thanks,
Xufeng

>    
>>   inherit kernel-arch deploy
>> -- 
>> 1.8.3.3
>>
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>>      
>    



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

* Re: [PATCH] kernel.bbclass: Delay rm_work to run after do_bundle_initramfs
  2013-10-31  8:26 ` Martin Jansa
  2013-11-01  1:10   ` Xufeng Zhang
@ 2013-11-07 15:08   ` Enrico Scholz
  2013-11-07 22:26     ` Richard Purdie
  1 sibling, 1 reply; 5+ messages in thread
From: Enrico Scholz @ 2013-11-07 15:08 UTC (permalink / raw)
  To: openembedded-core; +Cc: Martin Jansa

Martin Jansa <martin.jansa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
writes:

> Why not add "before" param to addtask?
>
> addtask bundle_initramfs after do_compile before do_build
>
> could do the trick

no; due to

  do_bundle_initramfs[nostamp] = "1"

a (non-initramfs) kernel will be rebuilt everytime although nothing has
been changed.  The initramfs related tasks should be executed only when
an initramfs is really used.


Enrico


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

* Re: [PATCH] kernel.bbclass: Delay rm_work to run after do_bundle_initramfs
  2013-11-07 15:08   ` Enrico Scholz
@ 2013-11-07 22:26     ` Richard Purdie
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Purdie @ 2013-11-07 22:26 UTC (permalink / raw)
  To: Enrico Scholz; +Cc: Martin Jansa, openembedded-core

On Thu, 2013-11-07 at 16:08 +0100, Enrico Scholz wrote:
> Martin Jansa <martin.jansa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> writes:
> 
> > Why not add "before" param to addtask?
> >
> > addtask bundle_initramfs after do_compile before do_build
> >
> > could do the trick
> 
> no; due to
> 
>   do_bundle_initramfs[nostamp] = "1"
> 
> a (non-initramfs) kernel will be rebuilt everytime although nothing has
> been changed.  The initramfs related tasks should be executed only when
> an initramfs is really used.

There is no good reason to have this as a nostamp task any more. With
the checksums on the stamp files, we have reliable image generation now.

Cheers,

Richard



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

end of thread, other threads:[~2013-11-07 22:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-31  1:24 [PATCH] kernel.bbclass: Delay rm_work to run after do_bundle_initramfs Xufeng Zhang
2013-10-31  8:26 ` Martin Jansa
2013-11-01  1:10   ` Xufeng Zhang
2013-11-07 15:08   ` Enrico Scholz
2013-11-07 22:26     ` Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox