diff options
author | Andre McCurdy <armccurdy@gmail.com> | 2018-05-15 12:13:51 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-05-22 13:13:33 +0100 |
commit | 95a1d7aefa93de688fa69d37a5cd38a1ebcf0e29 (patch) | |
tree | ff4218c26801d73c8cddcecdc891f4b387440e14 /meta/classes/kernel.bbclass | |
parent | 0124d2d94e64f0073b78260fad0391f14942ba78 (diff) | |
download | poky-95a1d7aefa93de688fa69d37a5cd38a1ebcf0e29.tar.gz |
kernel.bbclass: avoid duplicates in KERNEL_IMAGETYPE_FOR_MAKE
Currently if KERNEL_IMAGETYPES contains both vmlinux and vmlinux.gz,
KERNEL_IMAGETYPE_FOR_MAKE will end up containing two copies of
vmlinux, which will result in two calls to "make vmlinux" from
kernel_do_compile().
Avoid duplicating vmlinux in KERNEL_IMAGETYPE_FOR_MAKE plus some
minor non-functional updates to formatting and comments.
(From OE-Core rev: 80455a0b6cce6d12a5b32194d0cad2e4c7f71599)
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/kernel.bbclass')
-rw-r--r-- | meta/classes/kernel.bbclass | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index 6595a04fb1..68d218584a 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass | |||
@@ -62,32 +62,36 @@ python __anonymous () { | |||
62 | type = d.getVar('KERNEL_IMAGETYPE') or "" | 62 | type = d.getVar('KERNEL_IMAGETYPE') or "" |
63 | alttype = d.getVar('KERNEL_ALT_IMAGETYPE') or "" | 63 | alttype = d.getVar('KERNEL_ALT_IMAGETYPE') or "" |
64 | types = d.getVar('KERNEL_IMAGETYPES') or "" | 64 | types = d.getVar('KERNEL_IMAGETYPES') or "" |
65 | kname = d.getVar('KERNEL_PACKAGE_NAME') or "kernel" | ||
66 | if type not in types.split(): | 65 | if type not in types.split(): |
67 | types = (type + ' ' + types).strip() | 66 | types = (type + ' ' + types).strip() |
68 | if alttype not in types.split(): | 67 | if alttype not in types.split(): |
69 | types = (alttype + ' ' + types).strip() | 68 | types = (alttype + ' ' + types).strip() |
70 | d.setVar('KERNEL_IMAGETYPES', types) | 69 | d.setVar('KERNEL_IMAGETYPES', types) |
71 | 70 | ||
71 | # KERNEL_IMAGETYPES may contain a mixture of image types supported directly | ||
72 | # by the kernel build system and types which are created by post-processing | ||
73 | # the output of the kernel build system (e.g. compressing vmlinux -> | ||
74 | # vmlinux.gz in kernel_do_compile()). | ||
75 | # KERNEL_IMAGETYPE_FOR_MAKE should contain only image types supported | ||
76 | # directly by the kernel build system. | ||
72 | if not d.getVar('KERNEL_IMAGETYPE_FOR_MAKE'): | 77 | if not d.getVar('KERNEL_IMAGETYPE_FOR_MAKE'): |
73 | # some commonly used kernel images aren't generated by the kernel build system, such as vmlinux.gz | 78 | typeformake = set() |
74 | # typeformake lists only valid kernel make targets, and post processing can be done after the kernel | 79 | for type in types.split(): |
75 | # is built (such as using gzip to compress vmlinux) | 80 | if type == 'vmlinux.gz': |
76 | typeformake = types.replace('vmlinux.gz', 'vmlinux') | 81 | type = 'vmlinux' |
77 | d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake) | 82 | typeformake.add(type) |
83 | |||
84 | d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', ' '.join(sorted(typeformake))) | ||
85 | |||
86 | kname = d.getVar('KERNEL_PACKAGE_NAME') or "kernel" | ||
87 | imagedest = d.getVar('KERNEL_IMAGEDEST') | ||
78 | 88 | ||
79 | for type in types.split(): | 89 | for type in types.split(): |
80 | typelower = type.lower() | 90 | typelower = type.lower() |
81 | imagedest = d.getVar('KERNEL_IMAGEDEST') | ||
82 | |||
83 | d.appendVar('PACKAGES', ' %s-image-%s' % (kname, typelower)) | 91 | d.appendVar('PACKAGES', ' %s-image-%s' % (kname, typelower)) |
84 | |||
85 | d.setVar('FILES_' + kname + '-image-' + typelower, '/' + imagedest + '/' + type + '-${KERNEL_VERSION_NAME}' + ' /' + imagedest + '/' + type) | 92 | d.setVar('FILES_' + kname + '-image-' + typelower, '/' + imagedest + '/' + type + '-${KERNEL_VERSION_NAME}' + ' /' + imagedest + '/' + type) |
86 | |||
87 | d.appendVar('RDEPENDS_%s-image' % kname, ' %s-image-%s' % (kname, typelower)) | 93 | d.appendVar('RDEPENDS_%s-image' % kname, ' %s-image-%s' % (kname, typelower)) |
88 | |||
89 | d.setVar('PKG_%s-image-%s' % (kname,typelower), '%s-image-%s-${KERNEL_VERSION_PKG_NAME}' % (kname, typelower)) | 94 | d.setVar('PKG_%s-image-%s' % (kname,typelower), '%s-image-%s-${KERNEL_VERSION_PKG_NAME}' % (kname, typelower)) |
90 | |||
91 | d.setVar('ALLOW_EMPTY_%s-image-%s' % (kname, typelower), '1') | 95 | d.setVar('ALLOW_EMPTY_%s-image-%s' % (kname, typelower), '1') |
92 | 96 | ||
93 | image = d.getVar('INITRAMFS_IMAGE') | 97 | image = d.getVar('INITRAMFS_IMAGE') |