summaryrefslogtreecommitdiffstats
path: root/scripts/wic
diff options
context:
space:
mode:
authorTom Zanussi <tom.zanussi@linux.intel.com>2013-10-17 23:45:37 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-10-18 15:58:16 +0100
commite22efb497a425845362f29a987b377067cf6034e (patch)
tree69796ac716362ec4c17420e8f8651df2701109b9 /scripts/wic
parent99d33f27781a7780ae3ec55ece7e6160c33f1ece (diff)
downloadast2050-yocto-poky-e22efb497a425845362f29a987b377067cf6034e.zip
ast2050-yocto-poky-e22efb497a425845362f29a987b377067cf6034e.tar.gz
wic: Check for the existence/correctness of build artifacts
If a user uses the -e option and specifies a machine that hasn't been built or uses the wrong .wks script for the build artifacts pointed to by the current machine, we should point that out for obvious cases. (From OE-Core rev: a5b9ccadc0603c70c65f74fa386995c585a951db) Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/wic')
-rwxr-xr-xscripts/wic20
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/wic b/scripts/wic
index a7221c3..08473d3 100755
--- a/scripts/wic
+++ b/scripts/wic
@@ -143,6 +143,26 @@ def wic_create_subcommand(args, usage_str):
if not os.path.isdir(native_sysroot):
print "--native-sysroot (-n) not found, exiting\n"
sys.exit(1)
+ else:
+ not_found = not_found_dir = ""
+ if not os.path.isdir(rootfs_dir):
+ (not_found, not_found_dir) = ("rootfs-dir", rootfs_dir)
+ elif not os.path.isdir(hdddir) and not os.path.isdir(staging_data_dir):
+ (not_found, not_found_dir) = ("bootimg-dir", bootimg_dir)
+ elif not os.path.isdir(kernel_dir):
+ (not_found, not_found_dir) = ("kernel-dir", kernel_dir)
+ elif not os.path.isdir(native_sysroot):
+ (not_found, not_found_dir) = ("native-sysroot", native_sysroot)
+ if not_found:
+ if not not_found_dir:
+ not_found_dir = "Completely missing artifact - wrong image (.wks) used?"
+ print "Build artifacts not found, exiting."
+ print " (Please check that the build artifacts for the machine"
+ print " selected in local.conf actually exist and that they"
+ print " are the correct artifacts for the image (.wks file)).\n"
+ print "The artifact that couldn't be found was %s:\n %s" % \
+ (not_found, not_found_dir)
+ sys.exit(1)
wic_create(args, wks_file, rootfs_dir, bootimg_dir, kernel_dir,
native_sysroot, hdddir, staging_data_dir, scripts_path,
OpenPOWER on IntegriCloud