summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2014-12-10 14:44:59 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-12-19 18:08:00 +0000
commit31e86e6b02bcd1f5abd376a4f9b5598464cbe994 (patch)
treec87217ed93910b4c1b865194d3464970cb361bac /meta/classes
parent1f41cb64b45472ba01fe6e57f58a71ac23801258 (diff)
downloadpoky-31e86e6b02bcd1f5abd376a4f9b5598464cbe994.tar.gz
toaster.bbclass: trigger event for other image files
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] (From OE-Core rev: 87a25b1dec86da809c9a13c10449bd33a471cb95) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/toaster.bbclass18
1 files changed, 15 insertions, 3 deletions
diff --git a/meta/classes/toaster.bbclass b/meta/classes/toaster.bbclass
index a7dd0aa854..55d0d28157 100644
--- a/meta/classes/toaster.bbclass
+++ b/meta/classes/toaster.bbclass
@@ -149,14 +149,26 @@ python toaster_image_dumpdata() {
149 image_name = d.getVar('IMAGE_NAME', True); 149 image_name = d.getVar('IMAGE_NAME', True);
150 150
151 image_info_data = {} 151 image_info_data = {}
152 artifact_info_data = {}
152 153
154 # collect all artifacts
153 for dirpath, dirnames, filenames in os.walk(deploy_dir_image): 155 for dirpath, dirnames, filenames in os.walk(deploy_dir_image):
154 for fn in filenames: 156 for fn in filenames:
155 if fn.startswith(image_name): 157 try:
156 image_output = os.path.join(dirpath, fn) 158 if fn.startswith(image_name):
157 image_info_data[image_output] = os.stat(image_output).st_size 159 image_output = os.path.join(dirpath, fn)
160 image_info_data[image_output] = os.stat(image_output).st_size
161 else:
162 import stat
163 artifact_path = os.path.join(dirpath, fn)
164 filestat = os.stat(artifact_path)
165 if stat.S_ISREG(filestat.st_mode):
166 artifact_info_data[artifact_path] = filestat.st_size
167 except OSError as e:
168 bb.event.fire(bb.event.MetadataEvent("OSErrorException", e), d)
158 169
159 bb.event.fire(bb.event.MetadataEvent("ImageFileSize",image_info_data), d) 170 bb.event.fire(bb.event.MetadataEvent("ImageFileSize",image_info_data), d)
171 bb.event.fire(bb.event.MetadataEvent("ArtifactFileSize",artifact_info_data), d)
160} 172}
161 173
162 174