Patchwork [CONSOLIDATED,PULL,09/21] kernel.bbclass: support kernel image type of vmlinux.gz

login
register
mail settings
Submitter Saul Wold
Date Aug. 26, 2011, 7:39 p.m.
Message ID <cb17b6c2a72f260c61b0ec46887c2a04ac5b3f80.1314387279.git.sgw@linux.intel.com>
Download mbox | patch
Permalink /patch/10657/
State New, archived
Headers show

Comments

Saul Wold - Aug. 26, 2011, 7:39 p.m.
From: Mike Crowe <mac@mcrowe.com>

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(-)

Patch

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 52aea97..229679c 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() {