Patchwork kernel.bbclass: Preserve generated headers

login
register
mail settings
Submitter Khem Raj
Date July 31, 2012, 3:10 p.m.
Message ID <1343747440-31885-1-git-send-email-raj.khem@gmail.com>
Download mbox | patch
Permalink /patch/33433/
State Accepted
Commit 813256bf7bb6e26d542d5f769e2802564116ebe5
Headers show

Comments

Khem Raj - July 31, 2012, 3:10 p.m.
asm/unistd.h includes asm/unistd_64.h on x86_64
and asm/unistd_32.h on i386 but these files are
generated files in 3.4 and when we do 'make clean' they get
deleted and it shows up as an error when building
external modules. May be its a 3.4 kernel bug may be not
but make clean should have left the tree in
a shape to build modules but it does not.

Probably we should run make modules_prepare after having
run make clean.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/classes/kernel.bbclass |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Bruce Ashfield - July 31, 2012, 3:16 p.m.
On Tue, Jul 31, 2012 at 11:10 AM, Khem Raj <raj.khem@gmail.com> wrote:
> asm/unistd.h includes asm/unistd_64.h on x86_64
> and asm/unistd_32.h on i386 but these files are
> generated files in 3.4 and when we do 'make clean' they get
> deleted and it shows up as an error when building
> external modules. May be its a 3.4 kernel bug may be not
> but make clean should have left the tree in
> a shape to build modules but it does not.
>
> Probably we should run make modules_prepare after having
> run make clean.
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  meta/classes/kernel.bbclass |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index b19ed4c..4ac3d48 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -197,6 +197,8 @@ kernel_do_install() {
>         if [ -f include/generated/bounds.h ]; then
>                 cp include/generated/bounds.h $kerneldir/include/generated/bounds.h
>         fi
> +       mkdir -p $kerneldir/arch/${ARCH}/include/generated/
> +       cp -fR arch/${ARCH}/include/generated/* $kerneldir/arch/${ARCH}/include/generated/

If we take the blanket protection, we should be able to drop the
bounds.h specific
case a the same time .. right ?

I'm ok with this, but I can run a test with 'make modules_prepare'
being run if you
already haven't.

Cheers,

Bruce

>
>         # Remove the following binaries which cause strip or arch QA errors
>         # during do_package for cross-compiled platforms
> --
> 1.7.5.4
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Darren Hart - July 31, 2012, 4:18 p.m.
On 07/31/2012 08:10 AM, Khem Raj wrote:
> asm/unistd.h includes asm/unistd_64.h on x86_64
> and asm/unistd_32.h on i386 but these files are
> generated files in 3.4 and when we do 'make clean' they get
> deleted and it shows up as an error when building
> external modules. May be its a 3.4 kernel bug may be not
> but make clean should have left the tree in
> a shape to build modules but it does not.
> 
> Probably we should run make modules_prepare after having
> run make clean.

There just doesn't seem to be a good way to do what we need to do here.
modules_prepare will build scripts, which we don't want, but clean kills
all the generated files.

This sounds like a good Linux kernel bug for us to to take a look at
fixing upstream:

make modules_prepare_cross

or something simlar, so we can get what we need with proper make targets
and avoid this constant cherry picking of files.

> 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  meta/classes/kernel.bbclass |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index b19ed4c..4ac3d48 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -197,6 +197,8 @@ kernel_do_install() {
>  	if [ -f include/generated/bounds.h ]; then
>  		cp include/generated/bounds.h $kerneldir/include/generated/bounds.h
>  	fi
> +	mkdir -p $kerneldir/arch/${ARCH}/include/generated/
> +	cp -fR arch/${ARCH}/include/generated/* $kerneldir/arch/${ARCH}/include/generated/

Do you need all the generated files in arch/$ARCH/include/generated? Are
there any binaries in there?

>  
>  	# Remove the following binaries which cause strip or arch QA errors
>  	# during do_package for cross-compiled platforms
>
Darren Hart - July 31, 2012, 4:19 p.m.
On 07/31/2012 08:16 AM, Bruce Ashfield wrote:
> On Tue, Jul 31, 2012 at 11:10 AM, Khem Raj <raj.khem@gmail.com> wrote:
>> asm/unistd.h includes asm/unistd_64.h on x86_64
>> and asm/unistd_32.h on i386 but these files are
>> generated files in 3.4 and when we do 'make clean' they get
>> deleted and it shows up as an error when building
>> external modules. May be its a 3.4 kernel bug may be not
>> but make clean should have left the tree in
>> a shape to build modules but it does not.
>>
>> Probably we should run make modules_prepare after having
>> run make clean.
>>
>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> ---
>>  meta/classes/kernel.bbclass |    2 ++
>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
>> index b19ed4c..4ac3d48 100644
>> --- a/meta/classes/kernel.bbclass
>> +++ b/meta/classes/kernel.bbclass
>> @@ -197,6 +197,8 @@ kernel_do_install() {
>>         if [ -f include/generated/bounds.h ]; then
>>                 cp include/generated/bounds.h $kerneldir/include/generated/bounds.h
>>         fi
>> +       mkdir -p $kerneldir/arch/${ARCH}/include/generated/
>> +       cp -fR arch/${ARCH}/include/generated/* $kerneldir/arch/${ARCH}/include/generated/
> 
> If we take the blanket protection, we should be able to drop the
> bounds.h specific
> case a the same time .. right ?

No, different dirs (one is ARCH)

> 
> I'm ok with this, but I can run a test with 'make modules_prepare'
> being run if you
> already haven't.

We really can't, this builds scripts, which we don't want as this
results in native binaries being installed on the target :(

We need some cross-build-system-friendly make targets for this.

> 
> Cheers,
> 
> Bruce
> 
>>
>>         # Remove the following binaries which cause strip or arch QA errors
>>         # during do_package for cross-compiled platforms
>> --
>> 1.7.5.4
>>
>>
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
> 
> 
>
Bruce Ashfield - July 31, 2012, 4:31 p.m.
On Tue, Jul 31, 2012 at 12:19 PM, Darren Hart <dvhart@linux.intel.com> wrote:
>
>
> On 07/31/2012 08:16 AM, Bruce Ashfield wrote:
>> On Tue, Jul 31, 2012 at 11:10 AM, Khem Raj <raj.khem@gmail.com> wrote:
>>> asm/unistd.h includes asm/unistd_64.h on x86_64
>>> and asm/unistd_32.h on i386 but these files are
>>> generated files in 3.4 and when we do 'make clean' they get
>>> deleted and it shows up as an error when building
>>> external modules. May be its a 3.4 kernel bug may be not
>>> but make clean should have left the tree in
>>> a shape to build modules but it does not.
>>>
>>> Probably we should run make modules_prepare after having
>>> run make clean.
>>>
>>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>>> ---
>>>  meta/classes/kernel.bbclass |    2 ++
>>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
>>> index b19ed4c..4ac3d48 100644
>>> --- a/meta/classes/kernel.bbclass
>>> +++ b/meta/classes/kernel.bbclass
>>> @@ -197,6 +197,8 @@ kernel_do_install() {
>>>         if [ -f include/generated/bounds.h ]; then
>>>                 cp include/generated/bounds.h $kerneldir/include/generated/bounds.h
>>>         fi
>>> +       mkdir -p $kerneldir/arch/${ARCH}/include/generated/
>>> +       cp -fR arch/${ARCH}/include/generated/* $kerneldir/arch/${ARCH}/include/generated/
>>
>> If we take the blanket protection, we should be able to drop the
>> bounds.h specific
>> case a the same time .. right ?
>
> No, different dirs (one is ARCH)

Aha. I missed that, but can we back up a directory and take everything from
generated/* ? .. assuming your question about binaries being in those
directory is "no".

Cheers,

Bruce

>
>>
>> I'm ok with this, but I can run a test with 'make modules_prepare'
>> being run if you
>> already haven't.
>
> We really can't, this builds scripts, which we don't want as this
> results in native binaries being installed on the target :(
>
> We need some cross-build-system-friendly make targets for this.
>
>>
>> Cheers,
>>
>> Bruce
>>
>>>
>>>         # Remove the following binaries which cause strip or arch QA errors
>>>         # during do_package for cross-compiled platforms
>>> --
>>> 1.7.5.4
>>>
>>>
>>> _______________________________________________
>>> Openembedded-core mailing list
>>> Openembedded-core@lists.openembedded.org
>>> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>>
>>
>>
>
> --
> Darren Hart
> Intel Open Source Technology Center
> Yocto Project - Technical Lead - Linux Kernel
Darren Hart - July 31, 2012, 4:44 p.m.
On 07/31/2012 09:31 AM, Bruce Ashfield wrote:
> On Tue, Jul 31, 2012 at 12:19 PM, Darren Hart <dvhart@linux.intel.com> wrote:
>>
>>
>> On 07/31/2012 08:16 AM, Bruce Ashfield wrote:
>>> On Tue, Jul 31, 2012 at 11:10 AM, Khem Raj <raj.khem@gmail.com> wrote:
>>>> asm/unistd.h includes asm/unistd_64.h on x86_64
>>>> and asm/unistd_32.h on i386 but these files are
>>>> generated files in 3.4 and when we do 'make clean' they get
>>>> deleted and it shows up as an error when building
>>>> external modules. May be its a 3.4 kernel bug may be not
>>>> but make clean should have left the tree in
>>>> a shape to build modules but it does not.
>>>>
>>>> Probably we should run make modules_prepare after having
>>>> run make clean.
>>>>
>>>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>>>> ---
>>>>  meta/classes/kernel.bbclass |    2 ++
>>>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>>>
>>>> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
>>>> index b19ed4c..4ac3d48 100644
>>>> --- a/meta/classes/kernel.bbclass
>>>> +++ b/meta/classes/kernel.bbclass
>>>> @@ -197,6 +197,8 @@ kernel_do_install() {
>>>>         if [ -f include/generated/bounds.h ]; then
>>>>                 cp include/generated/bounds.h $kerneldir/include/generated/bounds.h
>>>>         fi
>>>> +       mkdir -p $kerneldir/arch/${ARCH}/include/generated/
>>>> +       cp -fR arch/${ARCH}/include/generated/* $kerneldir/arch/${ARCH}/include/generated/
>>>
>>> If we take the blanket protection, we should be able to drop the
>>> bounds.h specific
>>> case a the same time .. right ?
>>
>> No, different dirs (one is ARCH)
> 
> Aha. I missed that, but can we back up a directory and take everything from
> generated/* ? .. assuming your question about binaries being in those
> directory is "no".

It isn't a "no" for the include/generated dir, just not sure about ARCH.
Khem Raj - Aug. 8, 2012, 2:36 p.m.
ping

On Tue, Jul 31, 2012 at 8:10 AM, Khem Raj <raj.khem@gmail.com> wrote:
> asm/unistd.h includes asm/unistd_64.h on x86_64
> and asm/unistd_32.h on i386 but these files are
> generated files in 3.4 and when we do 'make clean' they get
> deleted and it shows up as an error when building
> external modules. May be its a 3.4 kernel bug may be not
> but make clean should have left the tree in
> a shape to build modules but it does not.
>
> Probably we should run make modules_prepare after having
> run make clean.
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  meta/classes/kernel.bbclass |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index b19ed4c..4ac3d48 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -197,6 +197,8 @@ kernel_do_install() {
>         if [ -f include/generated/bounds.h ]; then
>                 cp include/generated/bounds.h $kerneldir/include/generated/bounds.h
>         fi
> +       mkdir -p $kerneldir/arch/${ARCH}/include/generated/
> +       cp -fR arch/${ARCH}/include/generated/* $kerneldir/arch/${ARCH}/include/generated/
>
>         # Remove the following binaries which cause strip or arch QA errors
>         # during do_package for cross-compiled platforms
> --
> 1.7.5.4
>
Saul Wold - Aug. 16, 2012, 6:22 p.m.
On 07/31/2012 08:10 AM, Khem Raj wrote:
> asm/unistd.h includes asm/unistd_64.h on x86_64
> and asm/unistd_32.h on i386 but these files are
> generated files in 3.4 and when we do 'make clean' they get
> deleted and it shows up as an error when building
> external modules. May be its a 3.4 kernel bug may be not
> but make clean should have left the tree in
> a shape to build modules but it does not.
>
> Probably we should run make modules_prepare after having
> run make clean.
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>   meta/classes/kernel.bbclass |    2 ++
>   1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index b19ed4c..4ac3d48 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -197,6 +197,8 @@ kernel_do_install() {
>   	if [ -f include/generated/bounds.h ]; then
>   		cp include/generated/bounds.h $kerneldir/include/generated/bounds.h
>   	fi
> +	mkdir -p $kerneldir/arch/${ARCH}/include/generated/
> +	cp -fR arch/${ARCH}/include/generated/* $kerneldir/arch/${ARCH}/include/generated/
>
>   	# Remove the following binaries which cause strip or arch QA errors
>   	# during do_package for cross-compiled platforms
>
Merged into OE-Core

Thanks
	Sau!
Saul Wold - Aug. 16, 2012, 6:50 p.m.
On 08/16/2012 11:22 AM, Saul Wold wrote:
> On 07/31/2012 08:10 AM, Khem Raj wrote:
>> asm/unistd.h includes asm/unistd_64.h on x86_64
>> and asm/unistd_32.h on i386 but these files are
>> generated files in 3.4 and when we do 'make clean' they get
>> deleted and it shows up as an error when building
>> external modules. May be its a 3.4 kernel bug may be not
>> but make clean should have left the tree in
>> a shape to build modules but it does not.
>>
>> Probably we should run make modules_prepare after having
>> run make clean.
>>
>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> ---
>>   meta/classes/kernel.bbclass |    2 ++
>>   1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
>> index b19ed4c..4ac3d48 100644
>> --- a/meta/classes/kernel.bbclass
>> +++ b/meta/classes/kernel.bbclass
>> @@ -197,6 +197,8 @@ kernel_do_install() {
>>       if [ -f include/generated/bounds.h ]; then
>>           cp include/generated/bounds.h
>> $kerneldir/include/generated/bounds.h
>>       fi
>> +    mkdir -p $kerneldir/arch/${ARCH}/include/generated/
>> +    cp -fR arch/${ARCH}/include/generated/*
>> $kerneldir/arch/${ARCH}/include/generated/
>>
>>       # Remove the following binaries which cause strip or arch QA errors
>>       # during do_package for cross-compiled platforms
>>
> Merged into OE-Core
>
Oops not yet!  I was scanning the wrong list!

Sorry
	Sau!

> Thanks
>      Sau!
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
Saul Wold - Aug. 20, 2012, 4:57 p.m.
On 07/31/2012 08:10 AM, Khem Raj wrote:
> asm/unistd.h includes asm/unistd_64.h on x86_64
> and asm/unistd_32.h on i386 but these files are
> generated files in 3.4 and when we do 'make clean' they get
> deleted and it shows up as an error when building
> external modules. May be its a 3.4 kernel bug may be not
> but make clean should have left the tree in
> a shape to build modules but it does not.
>
> Probably we should run make modules_prepare after having
> run make clean.
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>   meta/classes/kernel.bbclass |    2 ++
>   1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index b19ed4c..4ac3d48 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -197,6 +197,8 @@ kernel_do_install() {
>   	if [ -f include/generated/bounds.h ]; then
>   		cp include/generated/bounds.h $kerneldir/include/generated/bounds.h
>   	fi
> +	mkdir -p $kerneldir/arch/${ARCH}/include/generated/
> +	cp -fR arch/${ARCH}/include/generated/* $kerneldir/arch/${ARCH}/include/generated/
>
>   	# Remove the following binaries which cause strip or arch QA errors
>   	# during do_package for cross-compiled platforms
>

Merged into OE-Core

Thanks
	Sau!

Patch

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index b19ed4c..4ac3d48 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -197,6 +197,8 @@  kernel_do_install() {
 	if [ -f include/generated/bounds.h ]; then
 		cp include/generated/bounds.h $kerneldir/include/generated/bounds.h
 	fi
+	mkdir -p $kerneldir/arch/${ARCH}/include/generated/
+	cp -fR arch/${ARCH}/include/generated/* $kerneldir/arch/${ARCH}/include/generated/
 
 	# Remove the following binaries which cause strip or arch QA errors
 	# during do_package for cross-compiled platforms