Reorganizing FAFT client side code.

Created faft packages. Moved old saft modules into faft/utils. This is the
initial reorg step, and file/object names will be cleaned up in subsequent CLs.
Added a common.py which is necessary for setting up the autotest package
namespace.

BUG=None
TEST=Manually ran firmware_FAFTSetup at desk

Change-Id: I631b4457ad47cc15bfb9e3d915d75e648cb3d8f9
Reviewed-on: https://gerrit.chromium.org/gerrit/65614
Reviewed-by: Dennis Jeffrey <dennisjeffrey@chromium.org>
Commit-Queue: Yusuf Mohsinally <mohsinally@chromium.org>
Tested-by: Yusuf Mohsinally <mohsinally@chromium.org>
diff --git a/client/cros/saft/__init__.py b/client/cros/faft/__init__.py
similarity index 100%
rename from client/cros/saft/__init__.py
rename to client/cros/faft/__init__.py
diff --git a/client/cros/faft/common.py b/client/cros/faft/common.py
new file mode 100644
index 0000000..4ca5cb6
--- /dev/null
+++ b/client/cros/faft/common.py
@@ -0,0 +1,8 @@
+import os, sys
+dirname = os.path.dirname(sys.modules[__name__].__file__)
+client_dir = os.path.abspath(os.path.join(dirname, os.pardir, os.pardir))
+sys.path.insert(0, client_dir)
+import setup_modules
+sys.path.pop(0)
+setup_modules.setup(base_path=client_dir,
+                    root_module_name="autotest_lib.client")
diff --git a/client/cros/faft_client.py b/client/cros/faft/faft_client.py
similarity index 97%
rename from client/cros/faft_client.py
rename to client/cros/faft/faft_client.py
index 4324dce..e43bbb4 100755
--- a/client/cros/faft_client.py
+++ b/client/cros/faft/faft_client.py
@@ -14,9 +14,15 @@
 from optparse import OptionParser
 from SimpleXMLRPCServer import SimpleXMLRPCServer
 
-from saft import cgpt_state, chromeos_interface, flashrom_handler
-from saft import kernel_handler, saft_flashrom_util, tpm_handler
-from firmware_updater import FirmwareUpdater
+import common
+from autotest_lib.client.cros.faft.utils import (cgpt_state,
+                                                 chromeos_interface,
+                                                 firmware_updater,
+                                                 flashrom_handler,
+                                                 kernel_handler,
+                                                 saft_flashrom_util,
+                                                 tpm_handler,
+                                                )
 
 
 def allow_multiple_section_input(image_operator):
@@ -135,7 +141,7 @@
         self._cgpt_state = cgpt_state.CgptState(
                 'SHORT', self._chromeos_interface, self._system_get_root_dev())
 
-        self._updater = FirmwareUpdater(self._chromeos_interface)
+        self._updater = firmware_updater.FirmwareUpdater(self._chromeos_interface)
 
         # Initialize temporary directory path
         self._temp_path = '/var/tmp/faft/autest'
diff --git a/client/cros/saft/__init__.py b/client/cros/faft/utils/__init__.py
similarity index 100%
copy from client/cros/saft/__init__.py
copy to client/cros/faft/utils/__init__.py
diff --git a/client/cros/saft/cgpt_handler.py b/client/cros/faft/utils/cgpt_handler.py
similarity index 100%
rename from client/cros/saft/cgpt_handler.py
rename to client/cros/faft/utils/cgpt_handler.py
diff --git a/client/cros/saft/cgpt_state.py b/client/cros/faft/utils/cgpt_state.py
similarity index 100%
rename from client/cros/saft/cgpt_state.py
rename to client/cros/faft/utils/cgpt_state.py
diff --git a/client/cros/saft/chromeos_interface.py b/client/cros/faft/utils/chromeos_interface.py
similarity index 100%
rename from client/cros/saft/chromeos_interface.py
rename to client/cros/faft/utils/chromeos_interface.py
diff --git a/client/cros/firmware_updater.py b/client/cros/faft/utils/firmware_updater.py
similarity index 100%
rename from client/cros/firmware_updater.py
rename to client/cros/faft/utils/firmware_updater.py
diff --git a/client/cros/saft/flashrom_handler.py b/client/cros/faft/utils/flashrom_handler.py
similarity index 100%
rename from client/cros/saft/flashrom_handler.py
rename to client/cros/faft/utils/flashrom_handler.py
diff --git a/client/cros/saft/kernel_handler.py b/client/cros/faft/utils/kernel_handler.py
similarity index 100%
rename from client/cros/saft/kernel_handler.py
rename to client/cros/faft/utils/kernel_handler.py
diff --git a/client/cros/saft/saft_flashrom_util.py b/client/cros/faft/utils/saft_flashrom_util.py
similarity index 100%
rename from client/cros/saft/saft_flashrom_util.py
rename to client/cros/faft/utils/saft_flashrom_util.py
diff --git a/client/cros/saft/tpm_handler.py b/client/cros/faft/utils/tpm_handler.py
similarity index 100%
rename from client/cros/saft/tpm_handler.py
rename to client/cros/faft/utils/tpm_handler.py