aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/kernel.bbclass18
1 files changed, 9 insertions, 9 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 7a134d5c29..7670c7107a 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -32,7 +32,6 @@ KERNEL_VERSION_PKG_NAME = "${@legitimize_package_name(d.getVar('KERNEL_VERSION')
KERNEL_VERSION_PKG_NAME[vardepvalue] = "${LINUX_VERSION}"
python __anonymous () {
- import re
# Merge KERNEL_IMAGETYPE and KERNEL_ALT_IMAGETYPE into KERNEL_IMAGETYPES
type = d.getVar('KERNEL_IMAGETYPE') or ""
@@ -44,7 +43,10 @@ python __anonymous () {
types = (alttype + ' ' + types).strip()
d.setVar('KERNEL_IMAGETYPES', types)
- typeformake = re.sub(r'\.gz', '', types)
+ # some commonly used kernel images aren't generated by the kernel build system, such as vmlinux.gz
+ # typeformake lists only valid kernel make targets, and post processing can be done after the kernel
+ # is built (such as using gzip to compress vmlinux)
+ typeformake = types.replace('vmlinux.gz', 'vmlinux')
d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake)
for type in types.split():
@@ -268,14 +270,12 @@ kernel_do_compile() {
fi
for typeformake in ${KERNEL_IMAGETYPE_FOR_MAKE} ; do
oe_runmake ${typeformake} CC="${KERNEL_CC}" LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS} $use_alternate_initrd
- for type in ${KERNEL_IMAGETYPES} ; do
- if test "${typeformake}.gz" = "${type}"; then
- mkdir -p "${KERNEL_OUTPUT_DIR}"
- gzip -9c < "${typeformake}" > "${KERNEL_OUTPUT_DIR}/${type}"
- break;
- fi
- done
done
+ # vmlinux.gz is not built by kernel
+ if (echo "${KERNEL_IMAGETYPES}" | grep -wq "vmlinux\.gz"); then
+ mkdir -p "${KERNEL_OUTPUT_DIR}"
+ gzip -9c < ${B}/vmlinux > "${KERNEL_OUTPUT_DIR}/vmlinux.gz"
+ fi
}
do_compile_kernelmodules() {