Patchwork kernel.bbclass, base.bbclass: Fix support for old kernel configuration

login
register
mail settings
Submitter Otavio Salvador
Date Feb. 12, 2014, 3:54 p.m.
Message ID <1392220457-23287-1-git-send-email-otavio@ossystems.com.br>
Download mbox | patch
Permalink /patch/66643/
State New
Headers show

Comments

Otavio Salvador - Feb. 12, 2014, 3:54 p.m.
This solves a regression introduced by OE-Core:9b75f6a (kernel:
use oldnoconfig before yes '' | make oldconfig).

The original oe_runmake explicitly calls 'die' command in case of
failure so the fallback code never runs. The fallback code needs
to handle the oe_runmake return code to call the backward
compatible callback so we introduced a new command called
oe_runmake_call which is used by oe_runmake.

This does not change the functional behaviour of oe_runmake so it
avoids any change except for the code which does need to handle
the oe_runmake exit code.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 meta/classes/base.bbclass   | 8 ++++++--
 meta/classes/kernel.bbclass | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)
Gary Thomas - Feb. 12, 2014, 4:01 p.m.
On 2014-02-12 08:54, Otavio Salvador wrote:
> This solves a regression introduced by OE-Core:9b75f6a (kernel:
> use oldnoconfig before yes '' | make oldconfig).
> 
> The original oe_runmake explicitly calls 'die' command in case of
> failure so the fallback code never runs. The fallback code needs
> to handle the oe_runmake return code to call the backward
> compatible callback so we introduced a new command called
> oe_runmake_call which is used by oe_runmake.
> 
> This does not change the functional behaviour of oe_runmake so it
> avoids any change except for the code which does need to handle
> the oe_runmake exit code.
> 
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>

You might make it clear in this description that this change is necessary
to handle older kernels where 'make oldnoconfig' is not supported.

> ---
>  meta/classes/base.bbclass   | 8 ++++++--
>  meta/classes/kernel.bbclass | 2 +-
>  2 files changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
> index 81fc305..7837c89 100644
> --- a/meta/classes/base.bbclass
> +++ b/meta/classes/base.bbclass
> @@ -53,9 +53,13 @@ die() {
>  	bbfatal "$*"
>  }
>  
> -oe_runmake() {
> +oe_runmake_call() {
>  	bbnote ${MAKE} ${EXTRA_OEMAKE} "$@"
> -	${MAKE} ${EXTRA_OEMAKE} "$@" || die "oe_runmake failed"
> +	${MAKE} ${EXTRA_OEMAKE} "$@"
> +}
> +
> +oe_runmake() {
> +	oe_runmake_call "$@" || die "oe_runmake failed"
>  }
>  
>  
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index 3003fb1..6953109 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -313,7 +313,7 @@ python sysroot_stage_all () {
>      oe.path.copyhardlinktree(d.expand("${D}${KERNEL_SRC_PATH}"), d.expand("${SYSROOT_DESTDIR}${KERNEL_SRC_PATH}"))
>  }
>  
> -KERNEL_CONFIG_COMMAND ?= "oe_runmake oldnoconfig || yes '' | oe_runmake oldconfig"
> +KERNEL_CONFIG_COMMAND ?= "oe_runmake_call oldnoconfig || yes '' | oe_runmake oldconfig"
>  
>  kernel_do_configure() {
>  	# fixes extra + in /lib/modules/2.6.37+
>
Alexandre Belloni - Feb. 12, 2014, 4:29 p.m.
On 12/02/2014 at 13:54:17 -0200, Otavio Salvador wrote :
> This solves a regression introduced by OE-Core:9b75f6a (kernel:
> use oldnoconfig before yes '' | make oldconfig).
> 
> The original oe_runmake explicitly calls 'die' command in case of
> failure so the fallback code never runs. The fallback code needs
> to handle the oe_runmake return code to call the backward
> compatible callback so we introduced a new command called
> oe_runmake_call which is used by oe_runmake.
> 
> This does not change the functional behaviour of oe_runmake so it
> avoids any change except for the code which does need to handle
> the oe_runmake exit code.
> 
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>

I'm fine with that patch and I'm sorry for the breakage. I tested
"make oldnoconfig || yes '' | make oldconfig" outside of oe as I don't
have any instance of yocto using a kernel older than 3.10 and assumed
oe_runmake was simply calling make with the correct environment...

Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>

> ---
>  meta/classes/base.bbclass   | 8 ++++++--
>  meta/classes/kernel.bbclass | 2 +-
>  2 files changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
> index 81fc305..7837c89 100644
> --- a/meta/classes/base.bbclass
> +++ b/meta/classes/base.bbclass
> @@ -53,9 +53,13 @@ die() {
>  	bbfatal "$*"
>  }
>  
> -oe_runmake() {
> +oe_runmake_call() {
>  	bbnote ${MAKE} ${EXTRA_OEMAKE} "$@"
> -	${MAKE} ${EXTRA_OEMAKE} "$@" || die "oe_runmake failed"
> +	${MAKE} ${EXTRA_OEMAKE} "$@"
> +}
> +
> +oe_runmake() {
> +	oe_runmake_call "$@" || die "oe_runmake failed"
>  }
>  
>  
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index 3003fb1..6953109 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -313,7 +313,7 @@ python sysroot_stage_all () {
>      oe.path.copyhardlinktree(d.expand("${D}${KERNEL_SRC_PATH}"), d.expand("${SYSROOT_DESTDIR}${KERNEL_SRC_PATH}"))
>  }
>  
> -KERNEL_CONFIG_COMMAND ?= "oe_runmake oldnoconfig || yes '' | oe_runmake oldconfig"
> +KERNEL_CONFIG_COMMAND ?= "oe_runmake_call oldnoconfig || yes '' | oe_runmake oldconfig"
>  
>  kernel_do_configure() {
>  	# fixes extra + in /lib/modules/2.6.37+
> -- 
> 1.8.5.3
>

Patch

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 81fc305..7837c89 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -53,9 +53,13 @@  die() {
 	bbfatal "$*"
 }
 
-oe_runmake() {
+oe_runmake_call() {
 	bbnote ${MAKE} ${EXTRA_OEMAKE} "$@"
-	${MAKE} ${EXTRA_OEMAKE} "$@" || die "oe_runmake failed"
+	${MAKE} ${EXTRA_OEMAKE} "$@"
+}
+
+oe_runmake() {
+	oe_runmake_call "$@" || die "oe_runmake failed"
 }
 
 
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 3003fb1..6953109 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -313,7 +313,7 @@  python sysroot_stage_all () {
     oe.path.copyhardlinktree(d.expand("${D}${KERNEL_SRC_PATH}"), d.expand("${SYSROOT_DESTDIR}${KERNEL_SRC_PATH}"))
 }
 
-KERNEL_CONFIG_COMMAND ?= "oe_runmake oldnoconfig || yes '' | oe_runmake oldconfig"
+KERNEL_CONFIG_COMMAND ?= "oe_runmake_call oldnoconfig || yes '' | oe_runmake oldconfig"
 
 kernel_do_configure() {
 	# fixes extra + in /lib/modules/2.6.37+