[v3,2/3] linux-custom: use to_boolean when checking ISAR_CROSS_COMPILE

Message ID 20240513041747.774666-3-adriaan.schmidt@siemens.com
State Superseded, archived
Headers show
Series Kbuild follow-up | expand

Commit Message

Schmidt, Adriaan May 13, 2024, 4:17 a.m. UTC
we've changed style/convention in Isar sometime during the review of the
kbuild series, and this was missed.

Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
---
 meta/recipes-kernel/linux/linux-custom.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Koch, Stefan May 13, 2024, 7:45 a.m. UTC | #1
This is already included in:
[PATCH] linux-module: Support emulated module build with cross-compiled
kernel

On Mon, 2024-05-13 at 06:17 +0200, Adriaan Schmidt wrote:
> we've changed style/convention in Isar sometime during the review of
> the
> kbuild series, and this was missed.
> 
> Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
> ---
>  meta/recipes-kernel/linux/linux-custom.inc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-kernel/linux/linux-custom.inc
> b/meta/recipes-kernel/linux/linux-custom.inc
> index 35c61187..53516ef3 100644
> --- a/meta/recipes-kernel/linux/linux-custom.inc
> +++ b/meta/recipes-kernel/linux/linux-custom.inc
> @@ -97,7 +97,7 @@ KERNEL_NAME_PROVIDED ?= "${@
> d.getVar('BPN').partition('linux-')[2]}"
>  
>  # Determine cross-profile override
>  python() {
> -    if d.getVar("DISTRO_ARCH") != d.getVar("HOST_ARCH") and
> d.getVar("ISAR_CROSS_COMPILE", True) == "1" and "class-native" not in
> d.getVar("OVERRIDES", True).split(":"):
> +    if d.getVar("DISTRO_ARCH") != d.getVar("HOST_ARCH") and
> bb.utils.to_boolean(d.getVar("ISAR_CROSS_COMPILE")) and "class-
> native" not in d.getVar("OVERRIDES", True).split(":"):
>          d.appendVar("OVERRIDES", ":cross-profile")
>  }
>
Koch, Stefan May 13, 2024, 9:06 a.m. UTC | #2
Good improvement, when this similar cross-profile OVERRIDE is not
needed anymore for module.inc

On Mon, 2024-05-13 at 06:17 +0200, Adriaan Schmidt wrote:
> we've changed style/convention in Isar sometime during the review of
> the
> kbuild series, and this was missed.
> 
> Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
> ---
>  meta/recipes-kernel/linux/linux-custom.inc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-kernel/linux/linux-custom.inc
> b/meta/recipes-kernel/linux/linux-custom.inc
> index 35c61187..53516ef3 100644
> --- a/meta/recipes-kernel/linux/linux-custom.inc
> +++ b/meta/recipes-kernel/linux/linux-custom.inc
> @@ -97,7 +97,7 @@ KERNEL_NAME_PROVIDED ?= "${@
> d.getVar('BPN').partition('linux-')[2]}"
>  
>  # Determine cross-profile override
>  python() {
> -    if d.getVar("DISTRO_ARCH") != d.getVar("HOST_ARCH") and
> d.getVar("ISAR_CROSS_COMPILE", True) == "1" and "class-native" not in
> d.getVar("OVERRIDES", True).split(":"):
> +    if d.getVar("DISTRO_ARCH") != d.getVar("HOST_ARCH") and
> bb.utils.to_boolean(d.getVar("ISAR_CROSS_COMPILE")) and "class-
> native" not in d.getVar("OVERRIDES", True).split(":"):
>          d.appendVar("OVERRIDES", ":cross-profile")
>  }
>

Patch

diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc
index 35c61187..53516ef3 100644
--- a/meta/recipes-kernel/linux/linux-custom.inc
+++ b/meta/recipes-kernel/linux/linux-custom.inc
@@ -97,7 +97,7 @@  KERNEL_NAME_PROVIDED ?= "${@ d.getVar('BPN').partition('linux-')[2]}"
 
 # Determine cross-profile override
 python() {
-    if d.getVar("DISTRO_ARCH") != d.getVar("HOST_ARCH") and d.getVar("ISAR_CROSS_COMPILE", True) == "1" and "class-native" not in d.getVar("OVERRIDES", True).split(":"):
+    if d.getVar("DISTRO_ARCH") != d.getVar("HOST_ARCH") and bb.utils.to_boolean(d.getVar("ISAR_CROSS_COMPILE")) and "class-native" not in d.getVar("OVERRIDES", True).split(":"):
         d.appendVar("OVERRIDES", ":cross-profile")
 }