summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorNicolas Dechesne <nicolas.dechesne@linaro.org>2017-07-25 16:12:14 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-08-29 11:57:28 +0100
commit05f79693663096a5329065fbec8bf7762bf9aa96 (patch)
treea3a5172edf5b1efed5dc7065fc7f3c869bf1cc61 /meta
parentddb3a2f4856cf0b72c20236c5df5e87c01dd1193 (diff)
downloadpoky-05f79693663096a5329065fbec8bf7762bf9aa96.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: d3a89450ae918f467a99ac1c33502fc9a5eb4162) Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit cfc0c897656fe67e81a6a5dcd936dff785529f41) Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-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 cfa61e60de..ce2cab65ae 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -34,7 +34,6 @@ KERNEL_VERSION_PKG_NAME = "${@legitimize_package_name(d.getVar('KERNEL_VERSION')
34KERNEL_VERSION_PKG_NAME[vardepvalue] = "${LINUX_VERSION}" 34KERNEL_VERSION_PKG_NAME[vardepvalue] = "${LINUX_VERSION}"
35 35
36python __anonymous () { 36python __anonymous () {
37 import re
38 37
39 # Merge KERNEL_IMAGETYPE and KERNEL_ALT_IMAGETYPE into KERNEL_IMAGETYPES 38 # Merge KERNEL_IMAGETYPE and KERNEL_ALT_IMAGETYPE into KERNEL_IMAGETYPES
40 type = d.getVar('KERNEL_IMAGETYPE') or "" 39 type = d.getVar('KERNEL_IMAGETYPE') or ""
@@ -46,7 +45,10 @@ python __anonymous () {
46 types = (alttype + ' ' + types).strip() 45 types = (alttype + ' ' + types).strip()
47 d.setVar('KERNEL_IMAGETYPES', types) 46 d.setVar('KERNEL_IMAGETYPES', types)
48 47
49 typeformake = re.sub(r'\.gz', '', types) 48 # some commonly used kernel images aren't generated by the kernel build system, such as vmlinux.gz
49 # typeformake lists only valid kernel make targets, and post processing can be done after the kernel
50 # is built (such as using gzip to compress vmlinux)
51 typeformake = types.replace('vmlinux.gz', 'vmlinux')
50 d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake) 52 d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake)
51 53
52 for type in types.split(): 54 for type in types.split():
@@ -270,14 +272,12 @@ kernel_do_compile() {
270 fi 272 fi
271 for typeformake in ${KERNEL_IMAGETYPE_FOR_MAKE} ; do 273 for typeformake in ${KERNEL_IMAGETYPE_FOR_MAKE} ; do
272 oe_runmake ${typeformake} CC="${KERNEL_CC}" LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS} $use_alternate_initrd 274 oe_runmake ${typeformake} CC="${KERNEL_CC}" LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS} $use_alternate_initrd
273 for type in ${KERNEL_IMAGETYPES} ; do
274 if test "${typeformake}.gz" = "${type}"; then
275 mkdir -p "${KERNEL_OUTPUT_DIR}"
276 gzip -9c < "${typeformake}" > "${KERNEL_OUTPUT_DIR}/${type}"
277 break;
278 fi
279 done
280 done 275 done
276 # vmlinux.gz is not built by kernel
277 if (echo "${KERNEL_IMAGETYPES}" | grep -wq "vmlinux\.gz"); then
278 mkdir -p "${KERNEL_OUTPUT_DIR}"
279 gzip -9c < ${B}/vmlinux > "${KERNEL_OUTPUT_DIR}/vmlinux.gz"
280 fi
281} 281}
282 282
283do_compile_kernelmodules() { 283do_compile_kernelmodules() {