Do not install server files on DUT

For files that are only used on Umpire server, let's not install them on
DUTs. This is needed to fit the factory toolkit into devices with
limited disk space.

BUG=chrome-os-partner:32341
TEST=Install toolkit on a test image and check the resulting image.

Change-Id: I5161c0dfaf632fa1252316ff47cbb28b0c748425
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/221413
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
diff --git a/py/toolkit/installer.py b/py/toolkit/installer.py
index 53980f7..43801a1 100755
--- a/py/toolkit/installer.py
+++ b/py/toolkit/installer.py
@@ -84,6 +84,18 @@
 # Override this for unit testing.
 _in_cros_device = utils.in_cros_device
 
+SERVER_FILE_MASK = [
+    # Exclude Umpire server but keep Umpire client
+    '--include', 'py/umpire/__init__.*',
+    '--include', 'py/umpire/common.*',
+    '--include', 'py/umpire/client',
+    '--include', 'py/umpire/client/**',
+    '--exclude', 'py/umpire/**',
+
+    # Lumberjack is only used on Umpire server
+    '--exclude', 'py/lumberjack'
+]
+
 
 class FactoryToolkitInstaller():
   """Factory toolkit installer.
@@ -212,8 +224,9 @@
           Spawn(['chmod', '-R', 'go+rX', src],
                 sudo=True, log=True, check_call=True)
         print '***   %s -> %s' % (src, dest)
-        Spawn(['rsync', '-a', '--force', src + '/', dest],
-              sudo=self._sudo, log=True, check_output=True)
+        Spawn(['rsync', '-a', '--force', ] + SERVER_FILE_MASK +
+              [src + '/', dest], sudo=self._sudo, log=True,
+              check_output=True, cwd=src)
       finally:
         # Need to change the source directory back to the original user, or the
         # script in makeself will fail to remove the temporary source directory.