summaryrefslogtreecommitdiffstats
path: root/meta/classes/kernel.bbclass
diff options
context:
space:
mode:
authorNicolas Dechesne <nicolas.dechesne@linaro.org>2017-06-02 09:05:31 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-05 09:19:51 +0100
commit9c800996e546bb67e8df77926b3378723e504808 (patch)
tree5e460935fbeb7a594485a1882ac825ff93eb0dcd /meta/classes/kernel.bbclass
parenta89fe5ec17916206cceb72886d9d135196acb84a (diff)
downloadpoky-9c800996e546bb67e8df77926b3378723e504808.tar.gz
kernel.bbclass: fix KERNEL_IMAGETYPE(S) for Image.gz
KERNEL_IMAGETYPES lists all the kernel images that we want to build. in cb17b6c2a7 (kernel.bbclass: support kernel image type of vmlinux.gz), some logic was added to support vmlinux.gz which is not a target built by kernel makefiles (only vmlinux). It is clear that the goal of this logic is only to support vmlinux.gz and not others compressed format (such as Image.gz) which are valid target for kernel makefiles. For Image.gz we should rely on the kernel makefiles and not do the compression in kernel class. This patch updates the logic used to filter out non supported kernel target from KERNEL_IMAGETYPES, and make vmlinux.gz a 'special case', instead of *.gz. If more special cases are needed in the future, we could add them in a similar way. This patch should be a no-op for anyone using vmlinux or vmlinux.gz, and on top of that it is fixing the build for Image.gz which was not working until now. (From OE-Core rev: cfc0c897656fe67e81a6a5dcd936dff785529f41) Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/kernel.bbclass')
-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')
32KERNEL_VERSION_PKG_NAME[vardepvalue] = "${LINUX_VERSION}" 32KERNEL_VERSION_PKG_NAME[vardepvalue] = "${LINUX_VERSION}"
33 33
34python __anonymous () { 34python __anonymous () {
35 import re
36 35
37 # Merge KERNEL_IMAGETYPE and KERNEL_ALT_IMAGETYPE into KERNEL_IMAGETYPES 36 # Merge KERNEL_IMAGETYPE and KERNEL_ALT_IMAGETYPE into KERNEL_IMAGETYPES
38 type = d.getVar('KERNEL_IMAGETYPE') or "" 37 type = d.getVar('KERNEL_IMAGETYPE') or ""
@@ -44,7 +43,10 @@ python __anonymous () {
44 types = (alttype + ' ' + types).strip() 43 types = (alttype + ' ' + types).strip()
45 d.setVar('KERNEL_IMAGETYPES', types) 44 d.setVar('KERNEL_IMAGETYPES', types)
46 45
47 typeformake = re.sub(r'\.gz', '', types) 46 # some commonly used kernel images aren't generated by the kernel build system, such as vmlinux.gz
47 # typeformake lists only valid kernel make targets, and post processing can be done after the kernel
48 # is built (such as using gzip to compress vmlinux)
49 typeformake = types.replace('vmlinux.gz', 'vmlinux')
48 d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake) 50 d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake)
49 51
50 for type in types.split(): 52 for type in types.split():
@@ -268,14 +270,12 @@ kernel_do_compile() {
268 fi 270 fi
269 for typeformake in ${KERNEL_IMAGETYPE_FOR_MAKE} ; do 271 for typeformake in ${KERNEL_IMAGETYPE_FOR_MAKE} ; do
270 oe_runmake ${typeformake} CC="${KERNEL_CC}" LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS} $use_alternate_initrd 272 oe_runmake ${typeformake} CC="${KERNEL_CC}" LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS} $use_alternate_initrd
271 for type in ${KERNEL_IMAGETYPES} ; do
272 if test "${typeformake}.gz" = "${type}"; then
273 mkdir -p "${KERNEL_OUTPUT_DIR}"
274 gzip -9c < "${typeformake}" > "${KERNEL_OUTPUT_DIR}/${type}"
275 break;
276 fi
277 done
278 done 273 done
274 # vmlinux.gz is not built by kernel
275 if (echo "${KERNEL_IMAGETYPES}" | grep -wq "vmlinux\.gz"); then
276 mkdir -p "${KERNEL_OUTPUT_DIR}"
277 gzip -9c < ${B}/vmlinux > "${KERNEL_OUTPUT_DIR}/vmlinux.gz"
278 fi
279} 279}
280 280
281do_compile_kernelmodules() { 281do_compile_kernelmodules() {