Patchwork [1/9] kernel.bbclass: compile kernel and modules in a single task

login
register
mail settings
Submitter lumag
Date Dec. 13, 2011, 4:19 p.m.
Message ID <1323793193-31090-1-git-send-email-dbaryshkov@gmail.com>
Download mbox | patch
Permalink /patch/16821/
State New
Headers show

Comments

lumag - Dec. 13, 2011, 4:19 p.m.
There is no point in compiling kernel modules in a separate task, run
right after do_compile. On the other hand merging those tasks will e.g.
make icecc used also for modules compilation, etc.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 meta/classes/kernel.bbclass |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
Phil Blundell - Dec. 13, 2011, 4:22 p.m.
On Tue, 2011-12-13 at 20:19 +0400, Dmitry Eremin-Solenikov wrote:
> -		oe_runmake ${PARALLEL_MAKE} modules  CC="${KERNEL_CC}" LD="${KERNEL_LD}"
> +		oe_runmake modules  CC="${KERNEL_CC}" LD="${KERNEL_LD}"

Why did you remove PARALLEL_MAKE?

p.
lumag - Dec. 13, 2011, 4:46 p.m.
On 12/13/2011 08:22 PM, Phil Blundell wrote:
> On Tue, 2011-12-13 at 20:19 +0400, Dmitry Eremin-Solenikov wrote:
>> -		oe_runmake ${PARALLEL_MAKE} modules  CC="${KERNEL_CC}" LD="${KERNEL_LD}"
>> +		oe_runmake modules  CC="${KERNEL_CC}" LD="${KERNEL_LD}"
>
> Why did you remove PARALLEL_MAKE?

Because PARALLEL_MAKE is already defined for do_compile() task
Darren Hart - Dec. 14, 2011, 12:15 a.m.
On 12/13/2011 08:19 AM, Dmitry Eremin-Solenikov wrote:
> There is no point in compiling kernel modules in a separate task, run
> right after do_compile. On the other hand merging those tasks will e.g.
> make icecc used also for modules compilation, etc.

This split was done intentionally to allow tasks to be inserted between
compile and compile_kernelmodules. See:

commit 509364eb634cf148b6ac1fb5f51924f4eb6a8991
Author: Koen Kooi <koen@dominion.thruhere.net>
Date:   Tue Mar 15 11:25:01 2011 +0100

    kernel bbclass: split do_compile into do_compile and do_compile_modules

    This allows recipes to insert a custom task in between building
*Image and modules

    >From OE .dev revision 615876fe218dc3feb4a3df9e6546a7b1a6376800

    (From OE-Core rev: a2cc999d663407d17f41e1b0344361944993fa86)

    Signed-off-by: Koen Kooi <koen@openembedded.org>
    Acked-by: Graeme Gregory <dp@xora.org.uk>
    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

If you want to be able to use icecc, can you pull the necessary logic
into compile_kernelmodules rather than reverting Koen's patch?

Thanks,

Darren

> 
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
>  meta/classes/kernel.bbclass |    6 +-----
>  1 files changed, 1 insertions(+), 5 deletions(-)
> 
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index 3f2f75a..a75c199 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -89,17 +89,13 @@ kernel_do_compile() {
>  	if test "${KERNEL_IMAGETYPE_FOR_MAKE}.gz" = "${KERNEL_IMAGETYPE}"; then
>  		gzip -9c < "${KERNEL_IMAGETYPE_FOR_MAKE}" > "${KERNEL_OUTPUT}"
>  	fi
> -}
>  
> -do_compile_kernelmodules() {
> -	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
>  	if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
> -		oe_runmake ${PARALLEL_MAKE} modules  CC="${KERNEL_CC}" LD="${KERNEL_LD}"
> +		oe_runmake modules  CC="${KERNEL_CC}" LD="${KERNEL_LD}"
>  	else
>  		bbnote "no modules to compile"
>  	fi
>  }
> -addtask compile_kernelmodules after do_compile before do_install
>  
>  kernel_do_install() {
>  	#
lumag - Dec. 14, 2011, 12:17 a.m.
On Wed, Dec 14, 2011 at 4:15 AM, Darren Hart <dvhart@linux.intel.com> wrote:
>
>
> On 12/13/2011 08:19 AM, Dmitry Eremin-Solenikov wrote:
>> There is no point in compiling kernel modules in a separate task, run
>> right after do_compile. On the other hand merging those tasks will e.g.
>> make icecc used also for modules compilation, etc.
>
> This split was done intentionally to allow tasks to be inserted between
> compile and compile_kernelmodules. See:

Could you (or Koen) name any tasks that have to be inserted between kernel
and modules compilation please?

>
> commit 509364eb634cf148b6ac1fb5f51924f4eb6a8991
> Author: Koen Kooi <koen@dominion.thruhere.net>
> Date:   Tue Mar 15 11:25:01 2011 +0100
>
>    kernel bbclass: split do_compile into do_compile and do_compile_modules
>
>    This allows recipes to insert a custom task in between building
> *Image and modules
>
>    >From OE .dev revision 615876fe218dc3feb4a3df9e6546a7b1a6376800
>
>    (From OE-Core rev: a2cc999d663407d17f41e1b0344361944993fa86)
>
>    Signed-off-by: Koen Kooi <koen@openembedded.org>
>    Acked-by: Graeme Gregory <dp@xora.org.uk>
>    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
>
> If you want to be able to use icecc, can you pull the necessary logic
> into compile_kernelmodules rather than reverting Koen's patch?
>
> Thanks,
>
> Darren
>
>>
>> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
>> ---
>>  meta/classes/kernel.bbclass |    6 +-----
>>  1 files changed, 1 insertions(+), 5 deletions(-)
>>
>> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
>> index 3f2f75a..a75c199 100644
>> --- a/meta/classes/kernel.bbclass
>> +++ b/meta/classes/kernel.bbclass
>> @@ -89,17 +89,13 @@ kernel_do_compile() {
>>       if test "${KERNEL_IMAGETYPE_FOR_MAKE}.gz" = "${KERNEL_IMAGETYPE}"; then
>>               gzip -9c < "${KERNEL_IMAGETYPE_FOR_MAKE}" > "${KERNEL_OUTPUT}"
>>       fi
>> -}
>>
>> -do_compile_kernelmodules() {
>> -     unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
>>       if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
>> -             oe_runmake ${PARALLEL_MAKE} modules  CC="${KERNEL_CC}" LD="${KERNEL_LD}"
>> +             oe_runmake modules  CC="${KERNEL_CC}" LD="${KERNEL_LD}"
>>       else
>>               bbnote "no modules to compile"
>>       fi
>>  }
>> -addtask compile_kernelmodules after do_compile before do_install
>>
>>  kernel_do_install() {
>>       #
>
> --
> Darren Hart
> Intel Open Source Technology Center
> Yocto Project - Linux Kernel
Darren Hart - Dec. 14, 2011, 12:19 a.m.
On 12/13/2011 04:17 PM, Dmitry Eremin-Solenikov wrote:
> On Wed, Dec 14, 2011 at 4:15 AM, Darren Hart <dvhart@linux.intel.com> wrote:
>>
>>
>> On 12/13/2011 08:19 AM, Dmitry Eremin-Solenikov wrote:
>>> There is no point in compiling kernel modules in a separate task, run
>>> right after do_compile. On the other hand merging those tasks will e.g.
>>> make icecc used also for modules compilation, etc.
>>
>> This split was done intentionally to allow tasks to be inserted between
>> compile and compile_kernelmodules. See:
> 
> Could you (or Koen) name any tasks that have to be inserted between kernel
> and modules compilation please?

I'll leave that to Koen as I'm confident he had a reason for doing the
split. I don't make use of the split myself.

--
Darren

> 
>>
>> commit 509364eb634cf148b6ac1fb5f51924f4eb6a8991
>> Author: Koen Kooi <koen@dominion.thruhere.net>
>> Date:   Tue Mar 15 11:25:01 2011 +0100
>>
>>    kernel bbclass: split do_compile into do_compile and do_compile_modules
>>
>>    This allows recipes to insert a custom task in between building
>> *Image and modules
>>
>>    >From OE .dev revision 615876fe218dc3feb4a3df9e6546a7b1a6376800
>>
>>    (From OE-Core rev: a2cc999d663407d17f41e1b0344361944993fa86)
>>
>>    Signed-off-by: Koen Kooi <koen@openembedded.org>
>>    Acked-by: Graeme Gregory <dp@xora.org.uk>
>>    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
>>
>> If you want to be able to use icecc, can you pull the necessary logic
>> into compile_kernelmodules rather than reverting Koen's patch?
>>
>> Thanks,
>>
>> Darren
>>
>>>
>>> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
>>> ---
>>>  meta/classes/kernel.bbclass |    6 +-----
>>>  1 files changed, 1 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
>>> index 3f2f75a..a75c199 100644
>>> --- a/meta/classes/kernel.bbclass
>>> +++ b/meta/classes/kernel.bbclass
>>> @@ -89,17 +89,13 @@ kernel_do_compile() {
>>>       if test "${KERNEL_IMAGETYPE_FOR_MAKE}.gz" = "${KERNEL_IMAGETYPE}"; then
>>>               gzip -9c < "${KERNEL_IMAGETYPE_FOR_MAKE}" > "${KERNEL_OUTPUT}"
>>>       fi
>>> -}
>>>
>>> -do_compile_kernelmodules() {
>>> -     unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
>>>       if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
>>> -             oe_runmake ${PARALLEL_MAKE} modules  CC="${KERNEL_CC}" LD="${KERNEL_LD}"
>>> +             oe_runmake modules  CC="${KERNEL_CC}" LD="${KERNEL_LD}"
>>>       else
>>>               bbnote "no modules to compile"
>>>       fi
>>>  }
>>> -addtask compile_kernelmodules after do_compile before do_install
>>>
>>>  kernel_do_install() {
>>>       #
>>
>> --
>> Darren Hart
>> Intel Open Source Technology Center
>> Yocto Project - Linux Kernel
> 
> 
>
Koen Kooi - Dec. 15, 2011, 9:27 a.m.
Op 14 dec. 2011, om 01:17 heeft Dmitry Eremin-Solenikov het volgende geschreven:

> On Wed, Dec 14, 2011 at 4:15 AM, Darren Hart <dvhart@linux.intel.com> wrote:
>> 
>> 
>> On 12/13/2011 08:19 AM, Dmitry Eremin-Solenikov wrote:
>>> There is no point in compiling kernel modules in a separate task, run
>>> right after do_compile. On the other hand merging those tasks will e.g.
>>> make icecc used also for modules compilation, etc.
>> 
>> This split was done intentionally to allow tasks to be inserted between
>> compile and compile_kernelmodules. See:
> 
> Could you (or Koen) name any tasks that have to be inserted between kernel
> and modules compilation please?

Building external modules that are referenced by internal ones for example. But besides that, this also allows me to build just *Image quickly and not having to wait for the modules to build.
Bruce Ashfield - Dec. 15, 2011, 1:57 p.m.
On Thu, Dec 15, 2011 at 4:27 AM, Koen Kooi <koen@dominion.thruhere.net> wrote:
>
> Op 14 dec. 2011, om 01:17 heeft Dmitry Eremin-Solenikov het volgende geschreven:
>
>> On Wed, Dec 14, 2011 at 4:15 AM, Darren Hart <dvhart@linux.intel.com> wrote:
>>>
>>>
>>> On 12/13/2011 08:19 AM, Dmitry Eremin-Solenikov wrote:
>>>> There is no point in compiling kernel modules in a separate task, run
>>>> right after do_compile. On the other hand merging those tasks will e.g.
>>>> make icecc used also for modules compilation, etc.
>>>
>>> This split was done intentionally to allow tasks to be inserted between
>>> compile and compile_kernelmodules. See:
>>
>> Could you (or Koen) name any tasks that have to be inserted between kernel
>> and modules compilation please?
>
> Building external modules that are referenced by internal ones for example. But besides that, this also allows me to build just *Image quickly and not having to wait for the modules to build.

I've had the same thing here, just building the main image and not
wanting to wait for
kernel modules to compile. More of an incremental ad-hoc, scp and reboot sort of
workflow, but only building what you need in that situation is just
what a person wants.

Cheers,

Bruce

> -----BEGIN PGP SIGNATURE-----
>
> iEYEARECAAYFAk7pvXkACgkQMkyGM64RGpE2pwCdFjZuuNW4ler8ES4OsKddTaB2
> JnIAn0ME2FOwLyXeCS2DDBsTwKBFUKDt
> =l9hr
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
Richard Purdie - Dec. 15, 2011, 2:56 p.m.
On Tue, 2011-12-13 at 20:19 +0400, Dmitry Eremin-Solenikov wrote:
> There is no point in compiling kernel modules in a separate task, run
> right after do_compile. On the other hand merging those tasks will e.g.
> make icecc used also for modules compilation, etc.
> 
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
>  meta/classes/kernel.bbclass |    6 +-----
>  1 files changed, 1 insertions(+), 5 deletions(-)

Just to summarise the feedback, I think there valid reasons to have
these tasks separately so icecc is going to need to learn to deal with
this...

Cheers,

Richard

Patch

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 3f2f75a..a75c199 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -89,17 +89,13 @@  kernel_do_compile() {
 	if test "${KERNEL_IMAGETYPE_FOR_MAKE}.gz" = "${KERNEL_IMAGETYPE}"; then
 		gzip -9c < "${KERNEL_IMAGETYPE_FOR_MAKE}" > "${KERNEL_OUTPUT}"
 	fi
-}
 
-do_compile_kernelmodules() {
-	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
 	if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
-		oe_runmake ${PARALLEL_MAKE} modules  CC="${KERNEL_CC}" LD="${KERNEL_LD}"
+		oe_runmake modules  CC="${KERNEL_CC}" LD="${KERNEL_LD}"
 	else
 		bbnote "no modules to compile"
 	fi
 }
-addtask compile_kernelmodules after do_compile before do_install
 
 kernel_do_install() {
 	#