[OE-core] [PATCH] kernel.bbclass: fix KERNEL_IMAGETYPE(S) for Image.gz

Andre McCurdy armccurdy at gmail.com
Thu Jun 1 19:11:00 UTC 2017


On Thu, Jun 1, 2017 at 2:21 AM, Nicolas Dechesne
<nicolas.dechesne at linaro.org> wrote:
> 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.
>
> Signed-off-by: Nicolas Dechesne <nicolas.dechesne at linaro.org>
> ---
>  meta/classes/kernel.bbclass | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index 7a134d5c29..459b6d66a3 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -44,7 +44,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 = re.sub(r'vmlinux\.gz', 'vmlinux', types)

You could use types.replace('vmlinux.gz', 'vmlinux') here (and then
drop the "import re"). Also, if vmlinux.gz is the only special case
being supported, then the kernel_do_compile() can be simplified too
(see the patch I sent yesterday).

>      d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake)
>
>      for type in types.split():
> --
> 2.11.0
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core



More information about the Openembedded-core mailing list