]> code.ossystems Code Review - openembedded-core.git/commitdiff
toaster.bbclass: attach image file scan postfunc to do_image_complete
authorElliot Smith <elliot.smith@intel.com>
Tue, 2 Feb 2016 10:25:02 +0000 (10:25 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 4 Feb 2016 23:35:04 +0000 (23:35 +0000)
The postfunc for finding image files after completion of a build
fails, as the image files we're interested in don't exist at the
point when the scan is currently done (following do_rootfs).

Attach the postfunc for scanning for image files to the new
do_image_complete task, which definitely runs after the image files
have been created.

[YOCTO #8956]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/toaster.bbclass

index fba9067f0a7f50b2dd531250c3719cc306bbbdc8..e307014a6ab7f43064ad3ad2f941da2f98cc857f 100644 (file)
@@ -159,7 +159,7 @@ python toaster_image_dumpdata() {
             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("ImageFileSize", image_info_data), d)
 }
 
 python toaster_artifact_dumpdata() {
@@ -175,14 +175,12 @@ python toaster_artifact_dumpdata() {
         for fn in filenames:
             try:
                 artifact_path = os.path.join(dirpath, fn)
-                filestat = os.stat(artifact_path)
                 if not os.path.islink(artifact_path):
-                    artifact_info_data[artifact_path] = filestat.st_size
+                    artifact_info_data[artifact_path] = os.stat(artifact_path).st_size
             except OSError as e:
-                import sys
                 bb.event.fire(bb.event.MetadataEvent("OSErrorException", e), d)
 
-    bb.event.fire(bb.event.MetadataEvent("ArtifactFileSize",artifact_info_data), d)
+    bb.event.fire(bb.event.MetadataEvent("ArtifactFileSize", artifact_info_data), d)
 }
 
 # collect list of buildstats files based on fired events; when the build completes, collect all stats and fire an event with collected data
@@ -357,9 +355,11 @@ toaster_buildhistory_dump[eventmask] = "bb.event.BuildCompleted"
 do_package[postfuncs] += "toaster_package_dumpdata "
 do_package[vardepsexclude] += "toaster_package_dumpdata "
 
-do_rootfs[postfuncs] += "toaster_image_dumpdata "
+do_image_complete[postfuncs] += "toaster_image_dumpdata "
+do_image_complete[vardepsexclude] += "toaster_image_dumpdata "
+
 do_rootfs[postfuncs] += "toaster_licensemanifest_dump "
-do_rootfs[vardepsexclude] += "toaster_image_dumpdata toaster_licensemanifest_dump "
+do_rootfs[vardepsexclude] += "toaster_licensemanifest_dump "
 
 do_populate_sdk[postfuncs] += "toaster_artifact_dumpdata "
 do_populate_sdk[vardepsexclude] += "toaster_artifact_dumpdata "