From: Elliot Smith <elliot.smith@intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH] toaster.bbclass: Separate artifact dump from image file dump
Date: Wed, 13 Jan 2016 08:55:36 +0000 [thread overview]
Message-ID: <1452675336-28886-1-git-send-email-elliot.smith@intel.com> (raw)
SDK artifacts were being dumped alongside the image file dump.
However, the dump was not being triggered correctly, as it
should be attached as a postfunc to do_populate_sdk, rather than
do_rootfs, as do_rootfs doesn't always fire when populating
the SDK directory.
By adding a postfunc to do_populate_sdk, the postfunc is fired
in the correct situations.
Also fixes the directory which is scanned for SDK artifacts, as
this is different from the image file directory.
[YOCTO #7603]
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
---
meta/classes/toaster.bbclass | 38 +++++++++++++++++++++++++++-----------
1 file changed, 27 insertions(+), 11 deletions(-)
diff --git a/meta/classes/toaster.bbclass b/meta/classes/toaster.bbclass
index bbda2f8..fba9067 100644
--- a/meta/classes/toaster.bbclass
+++ b/meta/classes/toaster.bbclass
@@ -147,31 +147,43 @@ python toaster_image_dumpdata() {
deploy_dir_image = d.getVar('DEPLOY_DIR_IMAGE', True);
image_name = d.getVar('IMAGE_NAME', True);
-
image_info_data = {}
- artifact_info_data = {}
- # collect all artifacts
+ # collect all images
for dirpath, dirnames, filenames in os.walk(deploy_dir_image):
for fn in filenames:
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 not os.path.islink(artifact_path):
- 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)
}
+python toaster_artifact_dumpdata() {
+ """
+ Dump data about artifacts in the SDK_DEPLOY directory
+ """
+
+ artifact_dir = d.getVar("SDK_DEPLOY", True)
+ artifact_info_data = {}
+
+ # collect all artifacts
+ for dirpath, dirnames, filenames in os.walk(artifact_dir):
+ 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
+ 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)
+}
# collect list of buildstats files based on fired events; when the build completes, collect all stats and fire an event with collected data
@@ -341,9 +353,13 @@ toaster_collect_task_stats[eventmask] = "bb.event.BuildCompleted bb.build.TaskSu
addhandler toaster_buildhistory_dump
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_rootfs[postfuncs] += "toaster_licensemanifest_dump "
-do_rootfs[vardepsexclude] += "toaster_image_dumpdata toaster_licensemanifest_dump"
+do_rootfs[vardepsexclude] += "toaster_image_dumpdata toaster_licensemanifest_dump "
+
+do_populate_sdk[postfuncs] += "toaster_artifact_dumpdata "
+do_populate_sdk[vardepsexclude] += "toaster_artifact_dumpdata "
--
1.9.3
---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
reply other threads:[~2016-01-13 8:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1452675336-28886-1-git-send-email-elliot.smith@intel.com \
--to=elliot.smith@intel.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox