summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorNicolas Dechesne <nicolas.dechesne@linaro.org>2017-09-13 21:38:20 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-10-10 17:27:39 +0100
commita73154618283d7b8fd2107f6939834956b77b254 (patch)
tree95c9c5cdb5831d6489732f9bad96ef59756a2cd9 /meta/classes
parent064ddc1652ab8b73dc454ba24c3ed363508954d0 (diff)
downloadpoky-a73154618283d7b8fd2107f6939834956b77b254.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: 241cc3083f873743ac3551237acc62e55abbbf05) 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/classes')
-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 eefe574a60..f8318b83a1 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -28,7 +28,6 @@ KERNEL_VERSION_PKG_NAME = "${@legitimize_package_name(d.getVar('KERNEL_VERSION',
28KERNEL_VERSION_PKG_NAME[vardepvalue] = "${LINUX_VERSION}" 28KERNEL_VERSION_PKG_NAME[vardepvalue] = "${LINUX_VERSION}"
29 29
30python __anonymous () { 30python __anonymous () {
31 import re
32 31
33 # Merge KERNEL_IMAGETYPE and KERNEL_ALT_IMAGETYPE into KERNEL_IMAGETYPES 32 # Merge KERNEL_IMAGETYPE and KERNEL_ALT_IMAGETYPE into KERNEL_IMAGETYPES
34 type = d.getVar('KERNEL_IMAGETYPE', True) or "" 33 type = d.getVar('KERNEL_IMAGETYPE', True) or ""
@@ -40,7 +39,10 @@ python __anonymous () {
40 types = (alttype + ' ' + types).strip() 39 types = (alttype + ' ' + types).strip()
41 d.setVar('KERNEL_IMAGETYPES', types) 40 d.setVar('KERNEL_IMAGETYPES', types)
42 41
43 typeformake = re.sub(r'\.gz', '', types) 42 # some commonly used kernel images aren't generated by the kernel build system, such as vmlinux.gz
43 # typeformake lists only valid kernel make targets, and post processing can be done after the kernel
44 # is built (such as using gzip to compress vmlinux)
45 typeformake = types.replace('vmlinux.gz', 'vmlinux')
44 d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake) 46 d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake)
45 47
46 for type in types.split(): 48 for type in types.split():
@@ -262,14 +264,12 @@ kernel_do_compile() {
262 fi 264 fi
263 for typeformake in ${KERNEL_IMAGETYPE_FOR_MAKE} ; do 265 for typeformake in ${KERNEL_IMAGETYPE_FOR_MAKE} ; do
264 oe_runmake ${typeformake} CC="${KERNEL_CC}" LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS} $use_alternate_initrd 266 oe_runmake ${typeformake} CC="${KERNEL_CC}" LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS} $use_alternate_initrd
265 for type in ${KERNEL_IMAGETYPES} ; do
266 if test "${typeformake}.gz" = "${type}"; then
267 mkdir -p "${KERNEL_OUTPUT_DIR}"
268 gzip -9c < "${typeformake}" > "${KERNEL_OUTPUT_DIR}/${type}"
269 break;
270 fi
271 done
272 done 267 done
268 # vmlinux.gz is not built by kernel
269 if (echo "${KERNEL_IMAGETYPES}" | grep -wq "vmlinux\.gz"); then
270 mkdir -p "${KERNEL_OUTPUT_DIR}"
271 gzip -9c < ${B}/vmlinux > "${KERNEL_OUTPUT_DIR}/vmlinux.gz"
272 fi
273} 273}
274 274
275do_compile_kernelmodules() { 275do_compile_kernelmodules() {