public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] linux: Allow extra make arguments
@ 2024-05-22 12:02 Anton Mikanovich
  2024-05-22 12:08 ` Jan Kiszka
  0 siblings, 1 reply; 4+ messages in thread
From: Anton Mikanovich @ 2024-05-22 12:02 UTC (permalink / raw)
  To: isar-users; +Cc: Anton Mikanovich, Ilia Skochilov

Add a new variable into TEMPLATE_VARS and the command line -
KERNEL_EXTRA_BUILDARGS which allows to pass additional arguments for
kernel building.

Signed-off-by: Ilia Skochilov <iskochilov@ilbers.de>
Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
 meta/recipes-kernel/linux/files/debian/isar/build.tmpl | 4 ++--
 meta/recipes-kernel/linux/linux-custom.inc             | 4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-kernel/linux/files/debian/isar/build.tmpl b/meta/recipes-kernel/linux/files/debian/isar/build.tmpl
index 81a6ba8a..bafc5ca4 100644
--- a/meta/recipes-kernel/linux/files/debian/isar/build.tmpl
+++ b/meta/recipes-kernel/linux/files/debian/isar/build.tmpl
@@ -22,9 +22,9 @@ do_build() {
     sed -i "s/@KR@/${KR}/g" ${S}/debian/control ${S}/debian/linux-image-${KERNEL_NAME_PROVIDED}.*
 
     if echo "${DEB_BUILD_PROFILES}" | grep -q "kernel"; then # Build kernel scripts and tools
-        ${MAKE} O=${KERNEL_BUILD_DIR} ${PARALLEL_MAKE} KCFLAGS="${KCFLAGS}" KAFLAGS="${KAFLAGS}"
+        ${MAKE} O=${KERNEL_BUILD_DIR} ${PARALLEL_MAKE} ${KERNEL_EXTRA_BUILDARGS} KCFLAGS="${KCFLAGS}" KAFLAGS="${KAFLAGS}"
     elif echo "${DEB_BUILD_PROFILES}" | grep -q "kbuild"; then # Build kernel scripts and tools
-        ${MAKE} O=${KERNEL_BUILD_DIR} ${PARALLEL_MAKE} KCFLAGS="${KCFLAGS}" KAFLAGS="${KAFLAGS}" scripts
+        ${MAKE} O=${KERNEL_BUILD_DIR} ${PARALLEL_MAKE} ${KERNEL_EXTRA_BUILDARGS} KCFLAGS="${KCFLAGS}" KAFLAGS="${KAFLAGS}" scripts
         if grep -q -E "CONFIG_STACK_VALIDATION=y|CONFIG_HAVE_OBJTOOL=y" ${KERNEL_BUILD_DIR}/.config && [ -d "tools/objtool" ]; then
             ${MAKE} O=${KERNEL_BUILD_DIR} ${PARALLEL_MAKE} KCFLAGS="${KCFLAGS}" KAFLAGS="${KAFLAGS}" tools/objtool || true
         fi
diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc
index 0d222332..48efad03 100644
--- a/meta/recipes-kernel/linux/linux-custom.inc
+++ b/meta/recipes-kernel/linux/linux-custom.inc
@@ -82,6 +82,7 @@ TEMPLATE_VARS += "                \
     KCFLAGS                       \
     KAFLAGS                       \
     DISTRIBUTOR                   \
+    KERNEL_EXTRA_BUILDARGS        \
 "
 
 inherit dpkg
@@ -92,6 +93,9 @@ inherit kbuildtarget
 KCFLAGS ?= "-fdebug-prefix-map=${CURDIR}=."
 KAFLAGS ?= "-fdebug-prefix-map=${CURDIR}=."
 
+# Add extra arguments to the kernel build
+KERNEL_EXTRA_BUILDARGS ??= ""
+
 # Derive name of the kernel packages from the name of this recipe
 KERNEL_NAME_PROVIDED ?= "${@ d.getVar('BPN').partition('linux-')[2]}"
 
-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] linux: Allow extra make arguments
  2024-05-22 12:02 [PATCH] linux: Allow extra make arguments Anton Mikanovich
@ 2024-05-22 12:08 ` Jan Kiszka
  2024-05-22 12:22   ` Anton Mikanovich
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Kiszka @ 2024-05-22 12:08 UTC (permalink / raw)
  To: Anton Mikanovich, isar-users; +Cc: Ilia Skochilov

On 22.05.24 14:02, Anton Mikanovich wrote:
> Add a new variable into TEMPLATE_VARS and the command line -
> KERNEL_EXTRA_BUILDARGS which allows to pass additional arguments for
> kernel building.

Which use cases do you have in mind? Pleaes always describe the reasons
for a patch.

Jan

> 
> Signed-off-by: Ilia Skochilov <iskochilov@ilbers.de>
> Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
> ---
>  meta/recipes-kernel/linux/files/debian/isar/build.tmpl | 4 ++--
>  meta/recipes-kernel/linux/linux-custom.inc             | 4 ++++
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/recipes-kernel/linux/files/debian/isar/build.tmpl b/meta/recipes-kernel/linux/files/debian/isar/build.tmpl
> index 81a6ba8a..bafc5ca4 100644
> --- a/meta/recipes-kernel/linux/files/debian/isar/build.tmpl
> +++ b/meta/recipes-kernel/linux/files/debian/isar/build.tmpl
> @@ -22,9 +22,9 @@ do_build() {
>      sed -i "s/@KR@/${KR}/g" ${S}/debian/control ${S}/debian/linux-image-${KERNEL_NAME_PROVIDED}.*
>  
>      if echo "${DEB_BUILD_PROFILES}" | grep -q "kernel"; then # Build kernel scripts and tools
> -        ${MAKE} O=${KERNEL_BUILD_DIR} ${PARALLEL_MAKE} KCFLAGS="${KCFLAGS}" KAFLAGS="${KAFLAGS}"
> +        ${MAKE} O=${KERNEL_BUILD_DIR} ${PARALLEL_MAKE} ${KERNEL_EXTRA_BUILDARGS} KCFLAGS="${KCFLAGS}" KAFLAGS="${KAFLAGS}"
>      elif echo "${DEB_BUILD_PROFILES}" | grep -q "kbuild"; then # Build kernel scripts and tools
> -        ${MAKE} O=${KERNEL_BUILD_DIR} ${PARALLEL_MAKE} KCFLAGS="${KCFLAGS}" KAFLAGS="${KAFLAGS}" scripts
> +        ${MAKE} O=${KERNEL_BUILD_DIR} ${PARALLEL_MAKE} ${KERNEL_EXTRA_BUILDARGS} KCFLAGS="${KCFLAGS}" KAFLAGS="${KAFLAGS}" scripts
>          if grep -q -E "CONFIG_STACK_VALIDATION=y|CONFIG_HAVE_OBJTOOL=y" ${KERNEL_BUILD_DIR}/.config && [ -d "tools/objtool" ]; then
>              ${MAKE} O=${KERNEL_BUILD_DIR} ${PARALLEL_MAKE} KCFLAGS="${KCFLAGS}" KAFLAGS="${KAFLAGS}" tools/objtool || true
>          fi
> diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc
> index 0d222332..48efad03 100644
> --- a/meta/recipes-kernel/linux/linux-custom.inc
> +++ b/meta/recipes-kernel/linux/linux-custom.inc
> @@ -82,6 +82,7 @@ TEMPLATE_VARS += "                \
>      KCFLAGS                       \
>      KAFLAGS                       \
>      DISTRIBUTOR                   \
> +    KERNEL_EXTRA_BUILDARGS        \
>  "
>  
>  inherit dpkg
> @@ -92,6 +93,9 @@ inherit kbuildtarget
>  KCFLAGS ?= "-fdebug-prefix-map=${CURDIR}=."
>  KAFLAGS ?= "-fdebug-prefix-map=${CURDIR}=."
>  
> +# Add extra arguments to the kernel build
> +KERNEL_EXTRA_BUILDARGS ??= ""
> +
>  # Derive name of the kernel packages from the name of this recipe
>  KERNEL_NAME_PROVIDED ?= "${@ d.getVar('BPN').partition('linux-')[2]}"
>  

-- 
Siemens AG, Technology
Linux Expert Center


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] linux: Allow extra make arguments
  2024-05-22 12:08 ` Jan Kiszka
@ 2024-05-22 12:22   ` Anton Mikanovich
  2024-05-22 14:10     ` Jan Kiszka
  0 siblings, 1 reply; 4+ messages in thread
From: Anton Mikanovich @ 2024-05-22 12:22 UTC (permalink / raw)
  To: Jan Kiszka, isar-users; +Cc: Ilia Skochilov

22/05/2024 15:08, Jan Kiszka wrote:
> On 22.05.24 14:02, Anton Mikanovich wrote:
>> Add a new variable into TEMPLATE_VARS and the command line -
>> KERNEL_EXTRA_BUILDARGS which allows to pass additional arguments for
>> kernel building.
> Which use cases do you have in mind? Please always describe the reasons
> for a patch.
>
> Jan

The real usage of this improvement will be shared soon in 
stm32mp157d-dk1 board
support patchset where LOADADDR=0xC2000040 is applied.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] linux: Allow extra make arguments
  2024-05-22 12:22   ` Anton Mikanovich
@ 2024-05-22 14:10     ` Jan Kiszka
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Kiszka @ 2024-05-22 14:10 UTC (permalink / raw)
  To: Anton Mikanovich, isar-users; +Cc: Ilia Skochilov

On 22.05.24 14:22, Anton Mikanovich wrote:
> 22/05/2024 15:08, Jan Kiszka wrote:
>> On 22.05.24 14:02, Anton Mikanovich wrote:
>>> Add a new variable into TEMPLATE_VARS and the command line -
>>> KERNEL_EXTRA_BUILDARGS which allows to pass additional arguments for
>>> kernel building.
>> Which use cases do you have in mind? Please always describe the reasons
>> for a patch.
>>
>> Jan
> 
> The real usage of this improvement will be shared soon in
> stm32mp157d-dk1 board
> support patchset where LOADADDR=0xC2000040 is applied.
> 

Uh, that's legacy stuff...

OK, please clarify this use case. Nowadays, you describe things in the
.config, and that's it.

Jan

-- 
Siemens AG, Technology
Linux Expert Center


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-05-22 14:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-22 12:02 [PATCH] linux: Allow extra make arguments Anton Mikanovich
2024-05-22 12:08 ` Jan Kiszka
2024-05-22 12:22   ` Anton Mikanovich
2024-05-22 14:10     ` Jan Kiszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox