kernel bbclass: recreate uImage unless KEEPUIMAGE is set

Submitted by Khem Raj on July 20, 2012, 5:56 a.m.

Details

Message ID 1342763803-32218-1-git-send-email-raj.khem@gmail.com
State New
Headers show

Commit Message

Khem Raj July 20, 2012, 5:56 a.m.
From: Koen Kooi <koen@dominion.thruhere.net>

The intent of the uImage code in this class includes the following

1) be able to specify custom load addresses without needing to patch the kernel
2) add better information to the uImage description field

The current state is a NOP anyway, the kernel will always build a uImage when you tell it to 'make uImage'.

weakly Set KEEPUIMAGE in default-distrovars.inc which preserve the
current OE-Core behavior. Machines which are being ported from oe.dev and need to
regenerate uImage can set this to be empty

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/classes/kernel.bbclass                     |    2 +-
 meta/conf/distro/include/default-distrovars.inc |    1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index ce4d7de..efe4a9f 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -507,7 +507,7 @@  KERNEL_IMAGE_SYMLINK_NAME ?= "${KERNEL_IMAGETYPE}-${MACHINE}"
 
 do_uboot_mkimage() {
 	if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then 
-		if test ! -e arch/${ARCH}/boot/uImage ; then
+		if test "x${KEEPUIMAGE}" = "x" ; then
 			ENTRYPOINT=${UBOOT_ENTRYPOINT}
 			if test -n "${UBOOT_ENTRYSYMBOL}"; then
 				ENTRYPOINT=`${HOST_PREFIX}nm ${S}/vmlinux | \
diff --git a/meta/conf/distro/include/default-distrovars.inc b/meta/conf/distro/include/default-distrovars.inc
index f770919..7448415 100644
--- a/meta/conf/distro/include/default-distrovars.inc
+++ b/meta/conf/distro/include/default-distrovars.inc
@@ -2,6 +2,7 @@  QA_LOGFILE = "${TMPDIR}/qa.log"
 
 OEINCLUDELOGS ?= "yes"
 KERNEL_CONSOLE ?= "ttyS0"
+KEEPUIMAGE ?? = "1"
 
 PCMCIA_MANAGER ?= "pcmciautils"
 

Comments

Koen Kooi July 20, 2012, 7:01 a.m.
Op 20 jul. 2012, om 07:56 heeft Khem Raj het volgende geschreven:

> From: Koen Kooi <koen@dominion.thruhere.net>
> 
> The intent of the uImage code in this class includes the following
> 
> 1) be able to specify custom load addresses without needing to patch the kernel
> 2) add better information to the uImage description field
> 
> The current state is a NOP anyway, the kernel will always build a uImage when you tell it to 'make uImage'.
> 
> weakly Set KEEPUIMAGE in default-distrovars.inc which preserve the
> current OE-Core behavior. Machines which are being ported from oe.dev and need to
> regenerate uImage can set this to be empty
> 
> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
> meta/classes/kernel.bbclass                     |    2 +-
> meta/conf/distro/include/default-distrovars.inc |    1 +
> 2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index ce4d7de..efe4a9f 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -507,7 +507,7 @@ KERNEL_IMAGE_SYMLINK_NAME ?= "${KERNEL_IMAGETYPE}-${MACHINE}"
> 
> do_uboot_mkimage() {
> 	if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then 
> -		if test ! -e arch/${ARCH}/boot/uImage ; then
> +		if test "x${KEEPUIMAGE}" = "x" ; then
> 			ENTRYPOINT=${UBOOT_ENTRYPOINT}
> 			if test -n "${UBOOT_ENTRYSYMBOL}"; then
> 				ENTRYPOINT=`${HOST_PREFIX}nm ${S}/vmlinux | \
> diff --git a/meta/conf/distro/include/default-distrovars.inc b/meta/conf/distro/include/default-distrovars.inc
> index f770919..7448415 100644
> --- a/meta/conf/distro/include/default-distrovars.inc
> +++ b/meta/conf/distro/include/default-distrovars.inc
> @@ -2,6 +2,7 @@ QA_LOGFILE = "${TMPDIR}/qa.log"
> 
> OEINCLUDELOGS ?= "yes"
> KERNEL_CONSOLE ?= "ttyS0"
> +KEEPUIMAGE ?? = "1"

If you're going this way then explicitly test for '1' in the kernel.bbclass code, since KEEPUIMAGE = 0 won't do what people expect.
Bruce Ashfield July 20, 2012, 12:32 p.m.
On Fri, Jul 20, 2012 at 1:56 AM, Khem Raj <raj.khem@gmail.com> wrote:
> From: Koen Kooi <koen@dominion.thruhere.net>
>
> The intent of the uImage code in this class includes the following
>
> 1) be able to specify custom load addresses without needing to patch the kernel
> 2) add better information to the uImage description field
>
> The current state is a NOP anyway, the kernel will always build a uImage when you tell it to 'make uImage'.
>
> weakly Set KEEPUIMAGE in default-distrovars.inc which preserve the
> current OE-Core behavior. Machines which are being ported from oe.dev and need to
> regenerate uImage can set this to be empty

Fine with me, either with the existing test or the "1" as suggested Koen.

Acked-by: Bruce Ashfield <bruce.ashfield@windriver.com>

>
> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  meta/classes/kernel.bbclass                     |    2 +-
>  meta/conf/distro/include/default-distrovars.inc |    1 +
>  2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index ce4d7de..efe4a9f 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -507,7 +507,7 @@ KERNEL_IMAGE_SYMLINK_NAME ?= "${KERNEL_IMAGETYPE}-${MACHINE}"
>
>  do_uboot_mkimage() {
>         if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then
> -               if test ! -e arch/${ARCH}/boot/uImage ; then
> +               if test "x${KEEPUIMAGE}" = "x" ; then
>                         ENTRYPOINT=${UBOOT_ENTRYPOINT}
>                         if test -n "${UBOOT_ENTRYSYMBOL}"; then
>                                 ENTRYPOINT=`${HOST_PREFIX}nm ${S}/vmlinux | \
> diff --git a/meta/conf/distro/include/default-distrovars.inc b/meta/conf/distro/include/default-distrovars.inc
> index f770919..7448415 100644
> --- a/meta/conf/distro/include/default-distrovars.inc
> +++ b/meta/conf/distro/include/default-distrovars.inc
> @@ -2,6 +2,7 @@ QA_LOGFILE = "${TMPDIR}/qa.log"
>
>  OEINCLUDELOGS ?= "yes"
>  KERNEL_CONSOLE ?= "ttyS0"
> +KEEPUIMAGE ?? = "1"
>
>  PCMCIA_MANAGER ?= "pcmciautils"
>
> --
> 1.7.9.5
>