All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] kernel.bbclass: Find the kernel consistently.
@ 2011-08-25 12:59 Mike Crowe
  2011-08-25 12:59 ` [PATCH 2/2] kernel.bbclass: support kernel image type of vmlinux.gz Mike Crowe
  2011-08-25 19:32 ` [PATCH 1/2] kernel.bbclass: Find the kernel consistently Saul Wold
  0 siblings, 2 replies; 6+ messages in thread
From: Mike Crowe @ 2011-08-25 12:59 UTC (permalink / raw)
  To: openembedded-core

Use KERNEL_OUTPUT variable to find the generated kernel image rather than
duplicating the existing path. This also means it can be overridden simply.

Signed-off-by: Mike Crowe <mac@mcrowe.com>
---
 meta/classes/kernel.bbclass |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index a2b10f2..04e673a 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -476,7 +476,7 @@ KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
 KERNEL_IMAGE_SYMLINK_NAME ?= "${KERNEL_IMAGETYPE}-${MACHINE}"
 
 kernel_do_deploy() {
-	install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin
+	install -m 0644 ${KERNEL_OUTPUT} ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin
 	if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
 		tar -cvzf ${DEPLOYDIR}/modules-${KERNEL_VERSION}-${PR}-${MACHINE}.tgz -C ${D} lib
 	fi
-- 
1.7.2.5




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

* [PATCH 2/2] kernel.bbclass: support kernel image type of vmlinux.gz
  2011-08-25 12:59 [PATCH 1/2] kernel.bbclass: Find the kernel consistently Mike Crowe
@ 2011-08-25 12:59 ` Mike Crowe
  2011-08-25 19:32 ` [PATCH 1/2] kernel.bbclass: Find the kernel consistently Saul Wold
  1 sibling, 0 replies; 6+ messages in thread
From: Mike Crowe @ 2011-08-25 12:59 UTC (permalink / raw)
  To: openembedded-core

Add support for a gzipped vmlinux kernel by specifying:

  KERNEL_IMAGETYPE = "vmlinux.gz"

Signed-off-by: Mike Crowe <mac@mcrowe.com>
---
 meta/classes/kernel.bbclass |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 04e673a..15e3518 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -75,10 +75,15 @@ EXTRA_OEMAKE = ""
 
 KERNEL_ALT_IMAGETYPE ??= ""
 
+KERNEL_IMAGETYPE_FOR_MAKE = "${@(lambda s: s[:-3] if s[-3:] == ".gz" else s)(bb.data.getVar('KERNEL_IMAGETYPE', d, 1))}"
+
 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} ${KERNEL_ALT_IMAGETYPE} CC="${KERNEL_CC}" LD="${KERNEL_LD}"
+	oe_runmake ${KERNEL_IMAGETYPE_FOR_MAKE} ${KERNEL_ALT_IMAGETYPE} CC="${KERNEL_CC}" LD="${KERNEL_LD}"
+	if test "${KERNEL_IMAGETYPE_FOR_MAKE}.gz" = "${KERNEL_IMAGETYPE}"; then
+		gzip -9c < "${KERNEL_IMAGETYPE_FOR_MAKE}" > "${KERNEL_OUTPUT}"
+	fi
 }
 
 do_compile_kernelmodules() {
-- 
1.7.2.5




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

* Re: [PATCH 1/2] kernel.bbclass: Find the kernel consistently.
  2011-08-25 12:59 [PATCH 1/2] kernel.bbclass: Find the kernel consistently Mike Crowe
  2011-08-25 12:59 ` [PATCH 2/2] kernel.bbclass: support kernel image type of vmlinux.gz Mike Crowe
@ 2011-08-25 19:32 ` Saul Wold
  2011-08-26  9:17   ` Mike Crowe
  1 sibling, 1 reply; 6+ messages in thread
From: Saul Wold @ 2011-08-25 19:32 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On 08/25/2011 05:59 AM, Mike Crowe wrote:
> Use KERNEL_OUTPUT variable to find the generated kernel image rather than
> duplicating the existing path. This also means it can be overridden simply.
>
There are other places in kernel.bbclass that use the path vs 
KERNEL_OUTPUT, is there a reason you did not change those also?

Sau!

> Signed-off-by: Mike Crowe<mac@mcrowe.com>
> ---
>   meta/classes/kernel.bbclass |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index a2b10f2..04e673a 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -476,7 +476,7 @@ KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
>   KERNEL_IMAGE_SYMLINK_NAME ?= "${KERNEL_IMAGETYPE}-${MACHINE}"
>
>   kernel_do_deploy() {
> -	install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin
> +	install -m 0644 ${KERNEL_OUTPUT} ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin
>   	if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
>   		tar -cvzf ${DEPLOYDIR}/modules-${KERNEL_VERSION}-${PR}-${MACHINE}.tgz -C ${D} lib
>   	fi



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

* Re: [PATCH 1/2] kernel.bbclass: Find the kernel consistently.
  2011-08-25 19:32 ` [PATCH 1/2] kernel.bbclass: Find the kernel consistently Saul Wold
@ 2011-08-26  9:17   ` Mike Crowe
  2011-08-26  9:21     ` [PATCH v2] " Mike Crowe
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Crowe @ 2011-08-26  9:17 UTC (permalink / raw)
  To: Saul Wold, Patches and discussions about the oe-core layer

On Thu, Aug 25, 2011 at 12:32:25PM -0700, Saul Wold wrote:
> On 08/25/2011 05:59 AM, Mike Crowe wrote:
> >Use KERNEL_OUTPUT variable to find the generated kernel image rather than
> >duplicating the existing path. This also means it can be overridden simply.
> >
> There are other places in kernel.bbclass that use the path vs
> KERNEL_OUTPUT, is there a reason you did not change those also?

The patch came out of an earlier attempt to do what I was doing in
PATCH 2/2 and I hadn't needed to change the other places. :(

Looking at the other places now I think that the two in do_sizecheck
are candidates for changing to KERNEL_OUTPUT. I'm less sure about the
uImage ones in kernel_do_deploy due to there being other references to
arch/${ARCH}/boot/... nearby. I wouldn't want to make the code less
clear.

Updated patch follows.

Thanks for your comments.

Mike.



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

* [PATCH v2] kernel.bbclass: Find the kernel consistently.
  2011-08-26  9:17   ` Mike Crowe
@ 2011-08-26  9:21     ` Mike Crowe
  2011-08-29 13:02       ` Richard Purdie
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Crowe @ 2011-08-26  9:21 UTC (permalink / raw)
  To: openembedded-core

Use KERNEL_OUTPUT variable to find the generated kernel image rather than
duplicating the existing path. This also means it can be overridden simply.

Signed-off-by: Mike Crowe <mac@mcrowe.com>
---
 meta/classes/kernel.bbclass |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index a2b10f2..6ebc7de 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -460,9 +460,9 @@ python populate_packages_prepend () {
 # with a fixed length or there is a limit in transferring the kernel to memory
 do_sizecheck() {
 	if [ ! -z "${KERNEL_IMAGE_MAXSIZE}" ]; then
-        	size=`ls -l arch/${ARCH}/boot/${KERNEL_IMAGETYPE} | awk '{ print $5}'`
+		size=`ls -l ${KERNEL_OUTPUT} | awk '{ print $5}'`
         	if [ $size -ge ${KERNEL_IMAGE_MAXSIZE} ]; then
-                	rm arch/${ARCH}/boot/${KERNEL_IMAGETYPE}
+			rm ${KERNEL_OUTPUT}
                 	die  "This kernel (size=$size > ${KERNEL_IMAGE_MAXSIZE}) is too big for your device. Please reduce the size of the kernel by making more of it modular."
         	fi
     	fi
@@ -476,7 +476,7 @@ KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
 KERNEL_IMAGE_SYMLINK_NAME ?= "${KERNEL_IMAGETYPE}-${MACHINE}"
 
 kernel_do_deploy() {
-	install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin
+	install -m 0644 ${KERNEL_OUTPUT} ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin
 	if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
 		tar -cvzf ${DEPLOYDIR}/modules-${KERNEL_VERSION}-${PR}-${MACHINE}.tgz -C ${D} lib
 	fi
-- 
1.7.2.5




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

* Re: [PATCH v2] kernel.bbclass: Find the kernel consistently.
  2011-08-26  9:21     ` [PATCH v2] " Mike Crowe
@ 2011-08-29 13:02       ` Richard Purdie
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Purdie @ 2011-08-29 13:02 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Fri, 2011-08-26 at 10:21 +0100, Mike Crowe wrote:
> Use KERNEL_OUTPUT variable to find the generated kernel image rather than
> duplicating the existing path. This also means it can be overridden simply.
> 
> Signed-off-by: Mike Crowe <mac@mcrowe.com>
> ---
>  meta/classes/kernel.bbclass |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)

Merged to master, thanks.

Richard




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

end of thread, other threads:[~2011-08-29 13:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-25 12:59 [PATCH 1/2] kernel.bbclass: Find the kernel consistently Mike Crowe
2011-08-25 12:59 ` [PATCH 2/2] kernel.bbclass: support kernel image type of vmlinux.gz Mike Crowe
2011-08-25 19:32 ` [PATCH 1/2] kernel.bbclass: Find the kernel consistently Saul Wold
2011-08-26  9:17   ` Mike Crowe
2011-08-26  9:21     ` [PATCH v2] " Mike Crowe
2011-08-29 13:02       ` Richard Purdie

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.