diff options
author | Dohyung Kim <dohyung2.kim@samsung.com> | 2017-06-09 20:00:01 +0900 |
---|---|---|
committer | yuhuan.yang <yuhuan.yang@samsung.com> | 2018-01-30 11:44:07 +0800 |
commit | 3394e94e03ce666cfc770f7256583045c0f2774e (patch) | |
tree | e68a7110136caf82efe7b227408cff721f8ef380 | |
parent | 1ab622c921a7e25516dc90806b250273793a6b1c (diff) | |
download | mic-3394e94e03ce666cfc770f7256583045c0f2774e.tar.gz mic-3394e94e03ce666cfc770f7256583045c0f2774e.tar.bz2 mic-3394e94e03ce666cfc770f7256583045c0f2774e.zip |
add --use-mic-in-bootstrap option
use mic in bootstrap without copy host mic to bootstrap.
by default, copy host mic to bootstrap and use it
Change-Id: I3f4f03cc666df05ad4a7c393b771a2487350b9fe
Signed-off-by: Dohyung Kim <dohyung2.kim@samsung.com>
-rw-r--r-- | etc/mic.conf.in | 1 | ||||
-rwxr-xr-x | mic/cmd_create.py | 3 | ||||
-rwxr-xr-x | mic/conf.py | 8 | ||||
-rw-r--r-- | mic/rt_util.py | 6 | ||||
-rwxr-xr-x | tools/mic | 5 |
5 files changed, 22 insertions, 1 deletions
diff --git a/etc/mic.conf.in b/etc/mic.conf.in index 3d41eff..81907ff 100644 --- a/etc/mic.conf.in +++ b/etc/mic.conf.in @@ -10,6 +10,7 @@ tmpdir= /var/tmp/mic cachedir= /var/tmp/mic/cache outdir= ./mic-output runtime=bootstrap +#use_mic_in_bootstrap = yes pkgmgr = auto diff --git a/mic/cmd_create.py b/mic/cmd_create.py index 7ef7e46..203d08d 100755 --- a/mic/cmd_create.py +++ b/mic/cmd_create.py @@ -151,6 +151,9 @@ def main(parser, args, argv): if args.runtime:
configmgr.set_runtime(args.runtime)
+ if args.use_mic_in_bootstrap:
+ configmgr.create['use_mic_in_bootstrap'] = args.use_mic_in_bootstrap
+
if args.pack_to is not None:
configmgr.create['pack_to'] = args.pack_to
diff --git a/mic/conf.py b/mic/conf.py index 40d4a64..33e534f 100755 --- a/mic/conf.py +++ b/mic/conf.py @@ -78,6 +78,7 @@ class ConfigMgr(object): "strict_mode": False, "run_script": None, "tpk_install": None, + "use_mic_in_bootstrap": False, }, 'chroot': { "saveto": None, @@ -195,6 +196,13 @@ class ConfigMgr(object): packages = packages.split() self.bootstrap['packages'] = packages + if type(self.create['use_mic_in_bootstrap']) != 'bool': + use_mic_in_bootstrap = str(self.create['use_mic_in_bootstrap']) + if use_mic_in_bootstrap.lower() in ('on', 'yes', 'true', '1'): + self.create['use_mic_in_bootstrap'] = True + else: + self.create['use_mic_in_bootstrap'] = False + def _parse_kickstart(self, ksconf=None): if not ksconf: return diff --git a/mic/rt_util.py b/mic/rt_util.py index 316375d..61b0bb2 100644 --- a/mic/rt_util.py +++ b/mic/rt_util.py @@ -104,7 +104,11 @@ def bootstrap_mic(argv=None): rootdir = os.path.join(rootdir, "bootstrap") bsenv.dirsetup(rootdir) - sync_mic(rootdir, plugin=cropts['plugin_dir']) + if cropts['use_mic_in_bootstrap']: + msger.info("No copy host mic") + else: + msger.info("Copy host mic to bootstrap") + sync_mic(rootdir, plugin=cropts['plugin_dir']) #FIXME: sync the ks file to bootstrap if "/" == os.path.dirname(os.path.abspath(configmgr._ksconf)): @@ -124,6 +124,11 @@ 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('--use-mic-in-bootstrap', action='store_true', + dest='use_mic_in_bootstrap', default=False, + help='This option works in bootstrap runtime mode,' + ' Use mic in bootstrap to create image.' + ' By default, copy host mic to bootstrap and use it.') parent_parser.add_argument('-d', '--debug', action='store_true', help='debug output') |