summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/wic16
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/wic b/scripts/wic
index 4161f80367..945dda82e3 100755
--- a/scripts/wic
+++ b/scripts/wic
@@ -341,6 +341,8 @@ def imgtype(arg):
341 image, part = image.split(':') 341 image, part = image.split(':')
342 if '/' in part: 342 if '/' in part:
343 part, path = part.split('/', 1) 343 part, path = part.split('/', 1)
344 if not path:
345 path = '/'
344 346
345 if not os.path.isfile(image): 347 if not os.path.isfile(image):
346 err = "%s is not a regular file or symlink" % image 348 err = "%s is not a regular file or symlink" % image
@@ -354,6 +356,20 @@ def wic_init_parser_ls(subparser):
354 subparser.add_argument("-n", "--native-sysroot", 356 subparser.add_argument("-n", "--native-sysroot",
355 help="path to the native sysroot containing the tools") 357 help="path to the native sysroot containing the tools")
356 358
359def imgpathtype(arg):
360 img = imgtype(arg)
361 if img.part is None:
362 raise argparse.ArgumentTypeError("partition number is not specified")
363 return img
364
365def wic_init_parser_cp(subparser):
366 subparser.add_argument("src",
367 help="source spec")
368 subparser.add_argument("dest", type=imgpathtype,
369 help="image spec: <image>:<vfat partition>[<path>]")
370 subparser.add_argument("-n", "--native-sysroot",
371 help="path to the native sysroot containing the tools")
372
357def wic_init_parser_help(subparser): 373def wic_init_parser_help(subparser):
358 helpparsers = subparser.add_subparsers(dest='help_topic', help=hlp.wic_usage) 374 helpparsers = subparser.add_subparsers(dest='help_topic', help=hlp.wic_usage)
359 for helptopic in helptopics: 375 for helptopic in helptopics: