[OE-core] [PATCH] kernel-yocto: checksum indirect cfg and scc files

Bruce Ashfield bruce.ashfield at gmail.com
Thu Jul 4 12:48:23 UTC 2019


On Thu, Jul 4, 2019 at 7:02 AM Zhaolong Zhang <zhangzl2013 at 126.com> wrote:
>
> Currently, Yocto can not realize the modification of the cfg/scc files indirectly
> introduced by scc files in custom layers.
>
> Instead of introducing complicated scc parser code, this patch walks though
> FILESEXTRAPATHS and takes all the cfg/scc files into account when calculating
> checksums.

There used to be a bugzilla around for this .. but I can't find it now.

While the approach isn't wrong, I think it is too heavy, since it is
looking at *all* the .scc and .cfg files that can be located in the
search paths, not just the ones that are actually used.

I do have some old code from the existing bugzilla that I can try and
locate. The right approach is to have the kern-tools emit the list of
files, since that's where we know the includes, etc, and what is
actually going to be used. What you have will also conflict a bit with
some changes that I'm making to tweak the config handling.

Since I can't find the old bugzilla, can you open a new one, put the
patch there and I can find the code to dump the list of files from the
tools.

Bruce

>
> Signed-off-by: Zhaolong Zhang <zhangzl2013 at 126.com>
> ---
>  meta/classes/kernel-yocto.bbclass | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
>
> diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
> index ed9bcfa57c..a9aac8a9d9 100644
> --- a/meta/classes/kernel-yocto.bbclass
> +++ b/meta/classes/kernel-yocto.bbclass
> @@ -69,6 +69,24 @@ def get_machine_branch(d, default):
>
>      return default
>
> +def get_files_in_filesextrapaths(d):
> +    extrapaths = []
> +    extrafiles = []
> +    extrapathsvalue = (d.getVar("FILESEXTRAPATHS") or "")
> +    # Remove default flag which was used for checking
> +    extrapathsvalue = extrapathsvalue.replace("__default:", "")
> +    extrapaths = extrapathsvalue.split(":")
> +    for path in extrapaths:
> +        for root, dirs, files in os.walk(path):
> +            for name in files:
> +                base, ext = os.path.splitext(name)
> +                if ext and ext in [".scc", ".cfg"]:
> +                    filepath = os.path.join(root, name)
> +                    extrafiles.append(filepath + ":" + str(os.path.exists(filepath)))
> +    return " ".join(extrafiles)
> +
> +
> +
>  do_kernel_metadata() {
>         set +e
>         cd ${S}
> @@ -296,6 +314,7 @@ do_kernel_checkout[dirs] = "${S}"
>  addtask kernel_checkout before do_kernel_metadata after do_unpack
>  addtask kernel_metadata after do_validate_branches do_unpack before do_patch
>  do_kernel_metadata[depends] = "kern-tools-native:do_populate_sysroot"
> +do_kernel_metadata[file-checksums] = " ${@get_files_in_filesextrapaths(d)}"
>  do_validate_branches[depends] = "kern-tools-native:do_populate_sysroot"
>
>  do_kernel_configme[depends] += "virtual/${TARGET_PREFIX}binutils:do_populate_sysroot"
> --
> 2.19.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core



-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II


More information about the Openembedded-core mailing list