diff options
author | jianzhong.fang <jz.fang@samsung.com> | 2016-09-18 11:04:42 +0800 |
---|---|---|
committer | SoonKyu Park <sk7.park@samsung.com> | 2016-09-23 16:50:42 +0900 |
commit | 9980b13278c8c684b5091bb19390aab23976eee4 (patch) | |
tree | 7ad1a2e8d2ae69c8b1b8876367b2f86d58d9a5ee | |
parent | ac1526642ae23e02ce6bed44386902fb666e6dad (diff) | |
download | mic-9980b13278c8c684b5091bb19390aab23976eee4.tar.gz mic-9980b13278c8c684b5091bb19390aab23976eee4.tar.bz2 mic-9980b13278c8c684b5091bb19390aab23976eee4.zip |
Add subcommand option parameters(-v, -d, -i) for fixing tizen2.4 mobile issue
Change-Id: I18f0667bc7537aaf1e8eee5ec3320f1b52058071
Signed-off-by: jianzhong.fang <jz.fang@samsung.com>
-rwxr-xr-x | mic/cmd_create.py | 21 | ||||
-rwxr-xr-x | tools/mic | 15 |
2 files changed, 31 insertions, 5 deletions
diff --git a/mic/cmd_create.py b/mic/cmd_create.py index ce574a1..54fdbde 100755 --- a/mic/cmd_create.py +++ b/mic/cmd_create.py @@ -54,11 +54,28 @@ def main(parser, args, argv): % args.logfile)
configmgr.create['logfile'] = logfile_abs_path
configmgr.set_logfile()
-
+
if args.subcommand == "auto":
do_auto(parser, args.ksfile, argv)
return
-
+
+ if args.interactive:
+ msger.enable_interactive()
+ else:
+ msger.disable_interactive()
+
+ if args.verbose:
+ msger.set_loglevel('VERBOSE')
+
+ if args.debug:
+ try:
+ import rpm
+ rpm.setVerbosity(rpm.RPMLOG_NOTICE)
+ except ImportError:
+ pass
+
+ msger.set_loglevel('DEBUG')
+
#check the imager type
createrClass = None
for subcmd, klass in pluginmgr.get_plugins('imager').iteritems():
@@ -123,16 +123,25 @@ def create_parser(parser): dest='strict_mode', default=False, help='Abort creation of image, if there are some errors' ' during rpm installation. ') + + parent_parser.add_argument('-d', '--debug', action='store_true', + help='debug output') + parent_parser.add_argument('-v', '--verbose', action='store_true', + help='verbose output') + parent_parser.add_argument('-i', '--interactive', action='store_true', + dest='interactive', default=True, + help='interactive output') + parser.set_defaults(alias="cr") subparsers = parser.add_subparsers(title='Subcommands', dest='subcommand') auto_parser = subparsers.add_parser('auto', parents=[parent_parser], help='auto detect image type from magic header') - - fs_parser = subparsers.add_parser('fs', parents=[parent_parser], + + fs_parser = subparsers.add_parser('fs', parents=[parent_parser], help='create fs image') fs_parser.add_argument("--include-src", dest = "include_src",action = "store_true", default = False, help = "Generate a image with source rpms included") - + loop_parser = subparsers.add_parser('loop', parents=[parent_parser], help='create loop image') loop_parser.add_argument("--compress-disk-image", dest="compress_image", |