[OE-core] [PATCH 01/13] toaster.bbclass: trigger event for other image files

Damian, Alexandru alexandru.damian at intel.com
Wed Dec 10 14:58:01 UTC 2014


Despite the header, this is the single patch in this submission.

Thank you,
Alex

On Wed, Dec 10, 2014 at 2:44 PM, Alex DAMIAN <alexandru.damian at intel.com>
wrote:

> From: Alexandru DAMIAN <alexandru.damian at intel.com>
>
> Toaster will log all the files that it can find in the
> deploy images directory, and list them, considering that
> they may be artifacts of the current build not logged
> anywhere else.
>
> [YOCTO #6836]
>
> Signed-off-by: Alexandru DAMIAN <alexandru.damian at intel.com>
> ---
>  meta/classes/toaster.bbclass | 18 +++++++++++++++---
>  1 file changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/meta/classes/toaster.bbclass b/meta/classes/toaster.bbclass
> index a7dd0aa..55d0d28 100644
> --- a/meta/classes/toaster.bbclass
> +++ b/meta/classes/toaster.bbclass
> @@ -149,14 +149,26 @@ python toaster_image_dumpdata() {
>      image_name = d.getVar('IMAGE_NAME', True);
>
>      image_info_data = {}
> +    artifact_info_data = {}
>
> +    # collect all artifacts
>      for dirpath, dirnames, filenames in os.walk(deploy_dir_image):
>          for fn in filenames:
> -            if fn.startswith(image_name):
> -                image_output = os.path.join(dirpath, fn)
> -                image_info_data[image_output] =
> os.stat(image_output).st_size
> +            try:
> +                if fn.startswith(image_name):
> +                    image_output = os.path.join(dirpath, fn)
> +                    image_info_data[image_output] =
> os.stat(image_output).st_size
> +                else:
> +                    import stat
> +                    artifact_path = os.path.join(dirpath, fn)
> +                    filestat = os.stat(artifact_path)
> +                    if stat.S_ISREG(filestat.st_mode):
> +                        artifact_info_data[artifact_path] =
> filestat.st_size
> +            except OSError as e:
> +                bb.event.fire(bb.event.MetadataEvent("OSErrorException",
> e), d)
>
>
>  bb.event.fire(bb.event.MetadataEvent("ImageFileSize",image_info_data), d)
> +
> bb.event.fire(bb.event.MetadataEvent("ArtifactFileSize",artifact_info_data),
> d)
>  }
>
>
> --
> 1.9.1
>
>


-- 
Alex Damian
Yocto Project
SSG / OTC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20141210/3a8d1329/attachment-0002.html>


More information about the Openembedded-core mailing list