All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] [PATCH] Add KERNEL_EXTRA_ARGS parameter
@ 2012-04-29 10:03 Wolfgang Denk
  2012-04-29 15:41 ` Khem Raj
  2012-05-03 13:48 ` Wolfgang Denk
  0 siblings, 2 replies; 8+ messages in thread
From: Wolfgang Denk @ 2012-04-29 10:03 UTC (permalink / raw)
  To: openembedded-core

With recent kernel versions, some ARM configurations need may fail to
build with errors like this:

	multiple load addresses: 0x80008000 0x80008000
	This is incompatible with uImages
	Specify LOADADDR on the commandline to build an uImage

Add KERNEL_EXTRA_ARGS parameter so affected boards can add for example

	KERNEL_EXTRA_ARGS = "LOADADDR=0x80008000"

to their configuration.  We make this general enough so other needed
command line options can be passed as well when compiling the kernel.

Signed-off-by: Wolfgang Denk <wd@denx.de>
---
 meta/classes/kernel.bbclass |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 139bad9..7a554f0 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -71,6 +71,9 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
 UBOOT_ENTRYPOINT ?= "20008000"
 UBOOT_LOADADDRESS ?= "${UBOOT_ENTRYPOINT}"
 
+# Some Linux kenrel configurations need additional parameters on the command line
+KERNEL_EXTRA_ARGS ?= ""
+
 # For the kernel, we don't want the '-e MAKEFLAGS=' in EXTRA_OEMAKE.
 # We don't want to override kernel Makefile variables from the environment
 EXTRA_OEMAKE = ""
@@ -82,7 +85,7 @@ KERNEL_IMAGETYPE_FOR_MAKE = "${@(lambda s: s[:-3] if s[-3:] == ".gz" else s)(d.g
 kernel_do_compile() {
 	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
 	oe_runmake include/linux/version.h CC="${KERNEL_CC}" LD="${KERNEL_LD}"
-	oe_runmake ${KERNEL_IMAGETYPE_FOR_MAKE} ${KERNEL_ALT_IMAGETYPE} CC="${KERNEL_CC}" LD="${KERNEL_LD}"
+	oe_runmake ${KERNEL_IMAGETYPE_FOR_MAKE} ${KERNEL_ALT_IMAGETYPE} CC="${KERNEL_CC}" LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS}
 	if test "${KERNEL_IMAGETYPE_FOR_MAKE}.gz" = "${KERNEL_IMAGETYPE}"; then
 		gzip -9c < "${KERNEL_IMAGETYPE_FOR_MAKE}" > "${KERNEL_OUTPUT}"
 	fi
-- 
1.7.7.6




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

* Re: [RFC] [PATCH] Add KERNEL_EXTRA_ARGS parameter
  2012-04-29 10:03 [RFC] [PATCH] Add KERNEL_EXTRA_ARGS parameter Wolfgang Denk
@ 2012-04-29 15:41 ` Khem Raj
  2012-04-30 21:03   ` Wolfgang Denk
  2012-05-03 13:48 ` Wolfgang Denk
  1 sibling, 1 reply; 8+ messages in thread
From: Khem Raj @ 2012-04-29 15:41 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Sun, Apr 29, 2012 at 3:03 AM, Wolfgang Denk <wd@denx.de> wrote:
> With recent kernel versions, some ARM configurations need may fail to
> build with errors like this:
>
>        multiple load addresses: 0x80008000 0x80008000
>        This is incompatible with uImages
>        Specify LOADADDR on the commandline to build an uImage
>
> Add KERNEL_EXTRA_ARGS parameter so affected boards can add for example
>
>        KERNEL_EXTRA_ARGS = "LOADADDR=0x80008000"
>
> to their configuration.  We make this general enough so other needed
> command line options can be passed as well when compiling the kernel.

will EXTRA_OEMAKE = "..." work ?



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

* Re: [RFC] [PATCH] Add KERNEL_EXTRA_ARGS parameter
  2012-04-29 15:41 ` Khem Raj
@ 2012-04-30 21:03   ` Wolfgang Denk
  0 siblings, 0 replies; 8+ messages in thread
From: Wolfgang Denk @ 2012-04-30 21:03 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer, Khem Raj

Dear Khem Raj,

In message <CAMKF1so3xwMOB30-yogUL9jCuHoTEsMgTDRxTLWKT_dYn-LkuQ@mail.gmail.com> you wrote:
>
> > Add KERNEL_EXTRA_ARGS parameter so affected boards can add for example
> >
> >        KERNEL_EXTRA_ARGS = "LOADADDR=0x80008000"
> >
> > to their configuration.  We make this general enough so other needed
> > command line options can be passed as well when compiling the kernel.
> 
> will EXTRA_OEMAKE = "..." work ?

No, it will not, as "meta/classes/kernel.bbclass" explicitly ignores
all EXTRA_OEMAKE settings:

...
# For the kernel, we don't want the '-e MAKEFLAGS=' in EXTRA_OEMAKE.
# We don't want to override kernel Makefile variables from the environment
EXTRA_OEMAKE = ""
...


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
I express preference for a chronological  sequence  of  events  which
precludes a violence.   - Terry Pratchett, _The Dark Side of the Sun_



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

* [PATCH] Add KERNEL_EXTRA_ARGS parameter
  2012-04-29 10:03 [RFC] [PATCH] Add KERNEL_EXTRA_ARGS parameter Wolfgang Denk
  2012-04-29 15:41 ` Khem Raj
@ 2012-05-03 13:48 ` Wolfgang Denk
  2012-05-03 14:02   ` Koen Kooi
  2012-05-03 14:23   ` Eric Bénard
  1 sibling, 2 replies; 8+ messages in thread
From: Wolfgang Denk @ 2012-05-03 13:48 UTC (permalink / raw)
  To: openembedded-core

With recent kernel versions, some ARM configurations need may fail to
build with errors like this:

	multiple load addresses: 0x80008000 0x80008000
	This is incompatible with uImages
	Specify LOADADDR on the commandline to build an uImage

We cannot pass this information in EXTRA_OEMAKE, as
"meta/classes/kernel.bbclass" explicitly ignores all EXTRA_OEMAKE
settings.  So add KERNEL_EXTRA_ARGS parameter so affected boards
can add for example

	KERNEL_EXTRA_ARGS = "LOADADDR=0x80008000"

to their configuration.  We make this general enough so other needed
command line options can be passed as well when compiling the kernel.

Signed-off-by: Wolfgang Denk <wd@denx.de>
---
See also
http://thread.gmane.org/gmane.comp.handhelds.openembedded.core/19444

 meta/classes/kernel.bbclass |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 139bad9..7a554f0 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -71,6 +71,9 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
 UBOOT_ENTRYPOINT ?= "20008000"
 UBOOT_LOADADDRESS ?= "${UBOOT_ENTRYPOINT}"
 
+# Some Linux kenrel configurations need additional parameters on the command line
+KERNEL_EXTRA_ARGS ?= ""
+
 # For the kernel, we don't want the '-e MAKEFLAGS=' in EXTRA_OEMAKE.
 # We don't want to override kernel Makefile variables from the environment
 EXTRA_OEMAKE = ""
@@ -82,7 +85,7 @@ KERNEL_IMAGETYPE_FOR_MAKE = "${@(lambda s: s[:-3] if s[-3:] == ".gz" else s)(d.g
 kernel_do_compile() {
 	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
 	oe_runmake include/linux/version.h CC="${KERNEL_CC}" LD="${KERNEL_LD}"
-	oe_runmake ${KERNEL_IMAGETYPE_FOR_MAKE} ${KERNEL_ALT_IMAGETYPE} CC="${KERNEL_CC}" LD="${KERNEL_LD}"
+	oe_runmake ${KERNEL_IMAGETYPE_FOR_MAKE} ${KERNEL_ALT_IMAGETYPE} CC="${KERNEL_CC}" LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS}
 	if test "${KERNEL_IMAGETYPE_FOR_MAKE}.gz" = "${KERNEL_IMAGETYPE}"; then
 		gzip -9c < "${KERNEL_IMAGETYPE_FOR_MAKE}" > "${KERNEL_OUTPUT}"
 	fi
-- 
1.7.7.6




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

* Re: [PATCH] Add KERNEL_EXTRA_ARGS parameter
  2012-05-03 13:48 ` Wolfgang Denk
@ 2012-05-03 14:02   ` Koen Kooi
  2012-05-03 14:28     ` Richard Purdie
  2012-05-03 14:23   ` Eric Bénard
  1 sibling, 1 reply; 8+ messages in thread
From: Koen Kooi @ 2012-05-03 14:02 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer


Op 3 mei 2012, om 15:48 heeft Wolfgang Denk het volgende geschreven:

> With recent kernel versions, some ARM configurations need may fail to
> build with errors like this:
> 
> 	multiple load addresses: 0x80008000 0x80008000
> 	This is incompatible with uImages
> 	Specify LOADADDR on the commandline to build an uImage
> 
> We cannot pass this information in EXTRA_OEMAKE, as
> "meta/classes/kernel.bbclass" explicitly ignores all EXTRA_OEMAKE
> settings.  So add KERNEL_EXTRA_ARGS parameter so affected boards
> can add for example
> 
> 	KERNEL_EXTRA_ARGS = "LOADADDR=0x80008000"

Isn't KERNEL_EXTRA_OEMAKE clearer in this case? I see kernel args being what ends up in /proc/cmdline.


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

* Re: [PATCH] Add KERNEL_EXTRA_ARGS parameter
  2012-05-03 13:48 ` Wolfgang Denk
  2012-05-03 14:02   ` Koen Kooi
@ 2012-05-03 14:23   ` Eric Bénard
  1 sibling, 0 replies; 8+ messages in thread
From: Eric Bénard @ 2012-05-03 14:23 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

Le Thu,  3 May 2012 15:48:48 +0200,
Wolfgang Denk <wd@denx.de> a écrit :

> With recent kernel versions, some ARM configurations need may fail to
> build with errors like this:
> 
> 	multiple load addresses: 0x80008000 0x80008000
> 	This is incompatible with uImages
> 	Specify LOADADDR on the commandline to build an uImage
> 
> We cannot pass this information in EXTRA_OEMAKE, as
> "meta/classes/kernel.bbclass" explicitly ignores all EXTRA_OEMAKE
> settings.  So add KERNEL_EXTRA_ARGS parameter so affected boards
> can add for example
> 
> 	KERNEL_EXTRA_ARGS = "LOADADDR=0x80008000"
> 
> to their configuration.  We make this general enough so other needed
> command line options can be passed as well when compiling the kernel.
> 
> Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Eric Bénard <eric@eukrea.com>

useful when multiple machines with different LOADADDR are built in the
same kernel.

Eric



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

* Re: [PATCH] Add KERNEL_EXTRA_ARGS parameter
  2012-05-03 14:02   ` Koen Kooi
@ 2012-05-03 14:28     ` Richard Purdie
  2012-05-08 15:20       ` Darren Hart
  0 siblings, 1 reply; 8+ messages in thread
From: Richard Purdie @ 2012-05-03 14:28 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Thu, 2012-05-03 at 16:02 +0200, Koen Kooi wrote:
> Op 3 mei 2012, om 15:48 heeft Wolfgang Denk het volgende geschreven:
> 
> > With recent kernel versions, some ARM configurations need may fail to
> > build with errors like this:
> > 
> > 	multiple load addresses: 0x80008000 0x80008000
> > 	This is incompatible with uImages
> > 	Specify LOADADDR on the commandline to build an uImage
> > 
> > We cannot pass this information in EXTRA_OEMAKE, as
> > "meta/classes/kernel.bbclass" explicitly ignores all EXTRA_OEMAKE
> > settings.  So add KERNEL_EXTRA_ARGS parameter so affected boards
> > can add for example
> > 
> > 	KERNEL_EXTRA_ARGS = "LOADADDR=0x80008000"
> 
> Isn't KERNEL_EXTRA_OEMAKE clearer in this case? I see kernel args
> being what ends up in /proc/cmdline.

In many ways I wish we could use EXTRA_OEMAKE and try and keep the API
simpler. Looking at the code, I think it actually can work even with the
existing code in some circumstances.

Whilst kernel.bbclass does zero out the contents, it does this simply to
get rid of the default value (the -e MAKEARGS= bit).

The following recipe will therefore work:

"""
<some recipe code>

inherit kernel

EXTRA_OEMAKE += 'LOADADDR=0x80008000'
"""

but the problem is likely this can't be set from machine.conf.

I was wondering about changing the system so that in bitbake.conf we
set:

OEMAKEDEFAULT = "-e MAKEFLAGS="
EXTRA_OEMAKE = "${OEMAKEDEFAULT}"

and then kernel.bbclass can zero out OEMAKEDEFAULT. The trouble is you
want to set:

EXTRA_OEMAKE_append_xxxx = " LOADADDR=0x80008000"

and I'm not coming up with a good value of xxxx other than
pn-linux-xxxx :/. We could consider an extra override for the kernel
case I guess.

I would prefer not to add mode global variables unless we can possibly
help it...

Cheers,

Richard







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

* Re: [PATCH] Add KERNEL_EXTRA_ARGS parameter
  2012-05-03 14:28     ` Richard Purdie
@ 2012-05-08 15:20       ` Darren Hart
  0 siblings, 0 replies; 8+ messages in thread
From: Darren Hart @ 2012-05-08 15:20 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer



On 05/03/2012 07:28 AM, Richard Purdie wrote:
> On Thu, 2012-05-03 at 16:02 +0200, Koen Kooi wrote:
>> Op 3 mei 2012, om 15:48 heeft Wolfgang Denk het volgende geschreven:
>>
>>> With recent kernel versions, some ARM configurations need may fail to
>>> build with errors like this:
>>>
>>> 	multiple load addresses: 0x80008000 0x80008000
>>> 	This is incompatible with uImages
>>> 	Specify LOADADDR on the commandline to build an uImage
>>>
>>> We cannot pass this information in EXTRA_OEMAKE, as
>>> "meta/classes/kernel.bbclass" explicitly ignores all EXTRA_OEMAKE
>>> settings.  So add KERNEL_EXTRA_ARGS parameter so affected boards
>>> can add for example
>>>
>>> 	KERNEL_EXTRA_ARGS = "LOADADDR=0x80008000"
>>
>> Isn't KERNEL_EXTRA_OEMAKE clearer in this case? I see kernel args
>> being what ends up in /proc/cmdline.
> 
> In many ways I wish we could use EXTRA_OEMAKE and try and keep the API
> simpler. Looking at the code, I think it actually can work even with the
> existing code in some circumstances.
> 
> Whilst kernel.bbclass does zero out the contents, it does this simply to
> get rid of the default value (the -e MAKEARGS= bit).
> 
> The following recipe will therefore work:
> 
> """
> <some recipe code>
> 
> inherit kernel
> 
> EXTRA_OEMAKE += 'LOADADDR=0x80008000'
> """
> 
> but the problem is likely this can't be set from machine.conf.
> 
> I was wondering about changing the system so that in bitbake.conf we
> set:
> 
> OEMAKEDEFAULT = "-e MAKEFLAGS="
> EXTRA_OEMAKE = "${OEMAKEDEFAULT}"
> 
> and then kernel.bbclass can zero out OEMAKEDEFAULT. The trouble is you
> want to set:
> 
> EXTRA_OEMAKE_append_xxxx = " LOADADDR=0x80008000"
> 
> and I'm not coming up with a good value of xxxx other than
> pn-linux-xxxx :/. We could consider an extra override for the kernel
> case I guess.
> 
> I would prefer not to add mode global variables unless we can possibly
> help it...

I like the idea of reusing EXTRA_OEMAKE. Unfortunately, by the time we
have to add _append_pn-linux-yocto it seems like the benefit is lost and
I prefer Koen's KERNEL_EXTRA_OEMAKE suggestion.

--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel



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

end of thread, other threads:[~2012-05-08 15:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-29 10:03 [RFC] [PATCH] Add KERNEL_EXTRA_ARGS parameter Wolfgang Denk
2012-04-29 15:41 ` Khem Raj
2012-04-30 21:03   ` Wolfgang Denk
2012-05-03 13:48 ` Wolfgang Denk
2012-05-03 14:02   ` Koen Kooi
2012-05-03 14:28     ` Richard Purdie
2012-05-08 15:20       ` Darren Hart
2012-05-03 14:23   ` Eric Bénard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.