From 269bcad9a77b50131bd1d735c1d9bae394cc3ef1 Mon Sep 17 00:00:00 2001 From: Gui Chen Date: Thu, 5 Dec 2013 02:57:34 -0500 Subject: [PATCH] check if mic-native installed when running native mode Change-Id: I48500314b2f7de0187beb92b7ec8877d9874dc36 Signed-off-by: Gui Chen --- plugins/imager/fs_plugin.py | 10 ++++++++++ plugins/imager/livecd_plugin.py | 10 ++++++++++ plugins/imager/liveusb_plugin.py | 10 ++++++++++ plugins/imager/loop_plugin.py | 10 ++++++++++ plugins/imager/raw_plugin.py | 10 ++++++++++ 5 files changed, 50 insertions(+) diff --git a/plugins/imager/fs_plugin.py b/plugins/imager/fs_plugin.py index 8e758db..3333157 100644 --- a/plugins/imager/fs_plugin.py +++ b/plugins/imager/fs_plugin.py @@ -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: diff --git a/plugins/imager/livecd_plugin.py b/plugins/imager/livecd_plugin.py index d24ef59..0ccba72 100644 --- a/plugins/imager/livecd_plugin.py +++ b/plugins/imager/livecd_plugin.py @@ -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') diff --git a/plugins/imager/liveusb_plugin.py b/plugins/imager/liveusb_plugin.py index 7aa8927..297a9b0 100644 --- a/plugins/imager/liveusb_plugin.py +++ b/plugins/imager/liveusb_plugin.py @@ -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') diff --git a/plugins/imager/loop_plugin.py b/plugins/imager/loop_plugin.py index fd1f057..30dc3d9 100644 --- a/plugins/imager/loop_plugin.py +++ b/plugins/imager/loop_plugin.py @@ -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: diff --git a/plugins/imager/raw_plugin.py b/plugins/imager/raw_plugin.py index 1b9631d..25409a9 100644 --- a/plugins/imager/raw_plugin.py +++ b/plugins/imager/raw_plugin.py @@ -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: -- 2.7.4