[oe,meta-oe] kernel.bbclass: kernel_do_install fails with 2.6 kernel recipes

Submitted by Marco Cavallini on Jan. 7, 2013, 1:39 p.m.

Details

Message ID 1357565963-21367-1-git-send-email-m.cavallini@koansoftware.com
State New
Headers show

Commit Message

Marco Cavallini Jan. 7, 2013, 1:39 p.m.
* old 2.6.x kernels don't have $kerneldir/tools directory
 * so we got this error:
 * sed: can't read ...SNIP...linux/2.6.30-r0/image/usr/src/kernel/tools/perf/Makefile: No such file or directory
 * ERROR: Function failed: do_install

Signed-off-by: Marco Cavallini <m.cavallini@koansoftware.com>
---
 meta/classes/kernel.bbclass | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index aee8a77..06b23e0 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -204,8 +204,10 @@  kernel_do_install() {
 		rm -f $kerneldir/$entry
 	done
 
-	# Fix SLANG_INC for slang.h
-	sed -i 's#-I/usr/include/slang#-I=/usr/include/slang#g' $kerneldir/tools/perf/Makefile
+	if [ -f $kerneldir/tools/perf/Makefile ]; then
+		# Fix SLANG_INC for slang.h
+		sed -i 's#-I/usr/include/slang#-I=/usr/include/slang#g' $kerneldir/tools/perf/Makefile
+	fi
 }
 
 sysroot_stage_all_append() {

Comments

Darren Hart Jan. 7, 2013, 4:11 p.m.
Hi Marco,

On 01/07/2013 05:39 AM, Marco Cavallini wrote:
>  * old 2.6.x kernels don't have $kerneldir/tools directory
>  * so we got this error:
>  * sed: can't read ...SNIP...linux/2.6.30-r0/image/usr/src/kernel/tools/perf/Makefile: No such file or directory
>  * ERROR: Function failed: do_install
> 
> Signed-off-by: Marco Cavallini <m.cavallini@koansoftware.com>
> ---
>  meta/classes/kernel.bbclass | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index aee8a77..06b23e0 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -204,8 +204,10 @@ kernel_do_install() {
>  		rm -f $kerneldir/$entry
>  	done
>  
> -	# Fix SLANG_INC for slang.h
> -	sed -i 's#-I/usr/include/slang#-I=/usr/include/slang#g' $kerneldir/tools/perf/Makefile

Please include a comment here describing why this was needed. Something
like:

	# Linux 2.6.x kernels don't have a tools directory

(Replace .x with the appropriate version of course)

Otherwise, looks good to me. Thanks!

> +	if [ -f $kerneldir/tools/perf/Makefile ]; then
> +		# Fix SLANG_INC for slang.h
> +		sed -i 's#-I/usr/include/slang#-I=/usr/include/slang#g' $kerneldir/tools/perf/Makefile
> +	fi
>  }
>  
>  sysroot_stage_all_append() {
>
Marco Cavallini Jan. 7, 2013, 5:10 p.m.
Il 07/01/2013 17:11, Darren Hart ha scritto:
> Hi Marco,
>
> On 01/07/2013 05:39 AM, Marco Cavallini wrote:
>>   * old 2.6.x kernels don't have $kerneldir/tools directory
>>   * so we got this error:
>>   * sed: can't read ...SNIP...linux/2.6.30-r0/image/usr/src/kernel/tools/perf/Makefile: No such file or directory
>>   * ERROR: Function failed: do_install
>>
>> Signed-off-by: Marco Cavallini <m.cavallini@koansoftware.com>
>> ---
>>   meta/classes/kernel.bbclass | 6 ++++--
>>   1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
>> index aee8a77..06b23e0 100644
>> --- a/meta/classes/kernel.bbclass
>> +++ b/meta/classes/kernel.bbclass
>> @@ -204,8 +204,10 @@ kernel_do_install() {
>>   		rm -f $kerneldir/$entry
>>   	done
>>
>> -	# Fix SLANG_INC for slang.h
>> -	sed -i 's#-I/usr/include/slang#-I=/usr/include/slang#g' $kerneldir/tools/perf/Makefile
>
> Please include a comment here describing why this was needed. Something
> like:
>
> 	# Linux 2.6.x kernels don't have a tools directory
>
> (Replace .x with the appropriate version of course)
>
> Otherwise, looks good to me. Thanks!
>
>> +	if [ -f $kerneldir/tools/perf/Makefile ]; then
>> +		# Fix SLANG_INC for slang.h
>> +		sed -i 's#-I/usr/include/slang#-I=/usr/include/slang#g' $kerneldir/tools/perf/Makefile
>> +	fi
>>   }
>>
>>   sysroot_stage_all_append() {
>>
>


Hi Darren,
the comment describing why this was needed was in the patch header, is 
in these four lines:

  * old 2.6.x kernels don't have $kerneldir/tools directory
  * so we got this error:
  * sed: can't read 
...SNIP...linux/2.6.30-r0/image/usr/src/kernel/tools/perf/Makefile: No 
such file or directory
  * ERROR: Function failed: do_install

I haven't specified the 2.6 version because I thought that all 2.6 
version don't have a 'tools' directory.
BTW I patched it because with 2.6.28 and 2.6.30 it failed.


Cordiali Saluti / Kindest Regards / Mit freundlichen Grüßen
Darren Hart Jan. 7, 2013, 5:19 p.m.
On 01/07/2013 09:10 AM, Marco wrote:
> Il 07/01/2013 17:11, Darren Hart ha scritto:
>> Hi Marco,
>>
>> On 01/07/2013 05:39 AM, Marco Cavallini wrote:
>>>   * old 2.6.x kernels don't have $kerneldir/tools directory
>>>   * so we got this error:
>>>   * sed: can't read ...SNIP...linux/2.6.30-r0/image/usr/src/kernel/tools/perf/Makefile: No such file or directory
>>>   * ERROR: Function failed: do_install
>>>
>>> Signed-off-by: Marco Cavallini <m.cavallini@koansoftware.com>
>>> ---
>>>   meta/classes/kernel.bbclass | 6 ++++--
>>>   1 file changed, 4 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
>>> index aee8a77..06b23e0 100644
>>> --- a/meta/classes/kernel.bbclass
>>> +++ b/meta/classes/kernel.bbclass
>>> @@ -204,8 +204,10 @@ kernel_do_install() {
>>>   		rm -f $kerneldir/$entry
>>>   	done
>>>
>>> -	# Fix SLANG_INC for slang.h
>>> -	sed -i 's#-I/usr/include/slang#-I=/usr/include/slang#g' $kerneldir/tools/perf/Makefile
>>
>> Please include a comment here describing why this was needed. Something
>> like:
>>
>> 	# Linux 2.6.x kernels don't have a tools directory
>>
>> (Replace .x with the appropriate version of course)
>>
>> Otherwise, looks good to me. Thanks!
>>
>>> +	if [ -f $kerneldir/tools/perf/Makefile ]; then
>>> +		# Fix SLANG_INC for slang.h
>>> +		sed -i 's#-I/usr/include/slang#-I=/usr/include/slang#g' $kerneldir/tools/perf/Makefile
>>> +	fi
>>>   }
>>>
>>>   sysroot_stage_all_append() {
>>>
>>
> 
> 
> Hi Darren,
> the comment describing why this was needed was in the patch header, is 
> in these four lines:
> 
>   * old 2.6.x kernels don't have $kerneldir/tools directory
>   * so we got this error:
>   * sed: can't read 
> ...SNIP...linux/2.6.30-r0/image/usr/src/kernel/tools/perf/Makefile: No 
> such file or directory
>   * ERROR: Function failed: do_install
> 

Yes :-) The point being that it should be in the code itself so someone
reading the code can understand why the test is there without having to
use git blame and git log to discover it.

--
Darren

> I haven't specified the 2.6 version because I thought that all 2.6 
> version don't have a 'tools' directory.
> BTW I patched it because with 2.6.28 and 2.6.30 it failed.
> 
> 
> Cordiali Saluti / Kindest Regards / Mit freundlichen Grüßen
>