summaryrefslogtreecommitdiffstats
path: root/scripts/wic
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2017-06-13 14:21:58 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-14 10:18:20 +0100
commitdf5152c834ef58036b41ad51b19eda6abecd9543 (patch)
treef28d099b68171e26b6323956b236778d59adb773 /scripts/wic
parent3b271f6a40d7ef93fff9700dd8ac98bddd92d581 (diff)
downloadopenembedded-core-contrib-df5152c834ef58036b41ad51b19eda6abecd9543.tar.gz
wic: add wic_init_parser_cp
Add parser for 'wic cp' subcommand and a custom argument type. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/wic')
-rwxr-xr-xscripts/wic16
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/wic b/scripts/wic
index 4161f803670..945dda82e31 100755
--- a/scripts/wic
+++ b/scripts/wic
@@ -341,6 +341,8 @@ def imgtype(arg):
image, part = image.split(':')
if '/' in part:
part, path = part.split('/', 1)
+ if not path:
+ path = '/'
if not os.path.isfile(image):
err = "%s is not a regular file or symlink" % image
@@ -354,6 +356,20 @@ def wic_init_parser_ls(subparser):
subparser.add_argument("-n", "--native-sysroot",
help="path to the native sysroot containing the tools")
+def imgpathtype(arg):
+ img = imgtype(arg)
+ if img.part is None:
+ raise argparse.ArgumentTypeError("partition number is not specified")
+ return img
+
+def wic_init_parser_cp(subparser):
+ subparser.add_argument("src",
+ help="source spec")
+ subparser.add_argument("dest", type=imgpathtype,
+ help="image spec: <image>:<vfat partition>[<path>]")
+ subparser.add_argument("-n", "--native-sysroot",
+ help="path to the native sysroot containing the tools")
+
def wic_init_parser_help(subparser):
helpparsers = subparser.add_subparsers(dest='help_topic', help=hlp.wic_usage)
for helptopic in helptopics: