check if mic-native installed when running native mode
authorGui Chen <gui.chen@intel.com>
Thu, 5 Dec 2013 07:57:34 +0000 (02:57 -0500)
committerGui Chen <gui.chen@intel.com>
Wed, 11 Dec 2013 07:59:55 +0000 (02:59 -0500)
Change-Id: I48500314b2f7de0187beb92b7ec8877d9874dc36
Signed-off-by: Gui Chen <gui.chen@intel.com>
plugins/imager/fs_plugin.py
plugins/imager/livecd_plugin.py
plugins/imager/liveusb_plugin.py
plugins/imager/loop_plugin.py
plugins/imager/raw_plugin.py

index 8e758db..3333157 100644 (file)
@@ -52,6 +52,16 @@ class FsPlugin(ImagerPlugin):
         if creatoropts['runtime'] == 'bootstrap':
             configmgr._ksconf = ksconf
             rt_util.bootstrap_mic()
+        elif not rt_util.inbootstrap():
+            try:
+                fs_related.find_binary_path('mic-native')
+            except errors.CreatorError:
+                if not msger.ask("Subpackage \"mic-native\" has not been "
+                                 "installed in your host system, still "
+                                 "continue with \"native\" running mode?",
+                                 False):
+                    raise errors.Abort("Abort because subpackage 'mic-native' "
+                                       "has not been installed")
 
         recording_pkgs = []
         if len(creatoropts['record_pkgs']) > 0:
index d24ef59..0ccba72 100644 (file)
@@ -48,6 +48,16 @@ class LiveCDPlugin(ImagerPlugin):
         if creatoropts['runtime'] == 'bootstrap':
             configmgr._ksconf = ksconf
             rt_util.bootstrap_mic()
+        elif not rt_util.inbootstrap():
+            try:
+                fs_related.find_binary_path('mic-native')
+            except errors.CreatorError:
+                if not msger.ask("Subpackage \"mic-native\" has not been "
+                                 "installed in your host system, still "
+                                 "continue with \"native\" running mode?",
+                                 False):
+                    raise errors.Abort("Abort because subpackage 'mic-native' "
+                                       "has not been installed")
 
         if creatoropts['arch'] and creatoropts['arch'].startswith('arm'):
             msger.warning('livecd cannot support arm images, Quit')
index 7aa8927..297a9b0 100644 (file)
@@ -50,6 +50,16 @@ class LiveUSBPlugin(ImagerPlugin):
         if creatoropts['runtime'] == "bootstrap":
             configmgr._ksconf = ksconf
             rt_util.bootstrap_mic()
+        elif not rt_util.inbootstrap():
+            try:
+                fs_related.find_binary_path('mic-native')
+            except errors.CreatorError:
+                if not msger.ask("Subpackage \"mic-native\" has not been "
+                                 "installed in your host system, still "
+                                 "continue with \"native\" running mode?",
+                                 False):
+                    raise errors.Abort("Abort because subpackage 'mic-native' "
+                                       "has not been installed")
 
         if creatoropts['arch'] and creatoropts['arch'].startswith('arm'):
             msger.warning('liveusb cannot support arm images, Quit')
index fd1f057..30dc3d9 100644 (file)
@@ -57,6 +57,16 @@ class LoopPlugin(ImagerPlugin):
         if creatoropts['runtime'] == "bootstrap":
             configmgr._ksconf = ksconf
             rt_util.bootstrap_mic()
+        elif not rt_util.inbootstrap():
+            try:
+                fs_related.find_binary_path('mic-native')
+            except errors.CreatorError:
+                if not msger.ask("Subpackage \"mic-native\" has not been "
+                                 "installed in your host system, still "
+                                 "continue with \"native\" running mode?",
+                                 False):
+                    raise errors.Abort("Abort because subpackage 'mic-native' "
+                                       "has not been installed")
 
         recording_pkgs = []
         if len(creatoropts['record_pkgs']) > 0:
index 1b9631d..25409a9 100644 (file)
@@ -63,6 +63,16 @@ class RawPlugin(ImagerPlugin):
         if creatoropts['runtime'] == "bootstrap":
             configmgr._ksconf = ksconf
             rt_util.bootstrap_mic()
+        elif not rt_util.inbootstrap():
+            try:
+                fs_related.find_binary_path('mic-native')
+            except errors.CreatorError:
+                if not msger.ask("Subpackage \"mic-native\" has not been "
+                                 "installed in your host system, still "
+                                 "continue with \"native\" running mode?",
+                                 False):
+                    raise errors.Abort("Abort because subpackage 'mic-native' "
+                                       "has not been installed")
 
         recording_pkgs = []
         if len(creatoropts['record_pkgs']) > 0: