toolkit/installer.py: packing should take presenter,device options

installer.py should not install goofy_run_device and goofy_run_presenter
tag.

BUG=none
TEST=`./install_factory_toolkit.py -- --no-host-based` make sure tag
file is not present.

Change-Id: Id1a9be62af3095e39d978e65a031e05cd7a1521a
Reviewed-on: https://chromium-review.googlesource.com/230151
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Queue: Wei-Ning Huang <wnhuang@chromium.org>
Tested-by: Wei-Ning Huang <wnhuang@chromium.org>
diff --git a/py/toolkit/installer.py b/py/toolkit/installer.py
index 43801a1..5faa719 100755
--- a/py/toolkit/installer.py
+++ b/py/toolkit/installer.py
@@ -269,17 +269,21 @@
     print f.read()
 
 
-def PackFactoryToolkit(src_root, output_path):
+def PackFactoryToolkit(src_root, output_path, enable_device, enable_presenter):
   """Packs the files containing this script into a factory toolkit."""
   with open(os.path.join(src_root, 'VERSION'), 'r') as f:
     version = f.read().strip()
   with tempfile.NamedTemporaryFile() as help_header:
     help_header.write(version + "\n" + HELP_HEADER + HELP_HEADER_MAKESELF)
     help_header.flush()
-    Spawn([os.path.join(src_root, 'makeself.sh'), '--bzip2', '--nox11',
+    cmd = [os.path.join(src_root, 'makeself.sh'), '--bzip2', '--nox11',
            '--help-header', help_header.name,
-           src_root, output_path, version, INSTALLER_PATH, '--in-exe'],
-          check_call=True, log=True)
+           src_root, output_path, version, INSTALLER_PATH, '--in-exe']
+    if not enable_device:
+      cmd.append('--no-enable-device')
+    if not enable_presenter:
+      cmd.append('--no-enable-presenter')
+    Spawn(cmd, check_call=True, log=True)
   print ('\n'
       '  Factory toolkit generated at %s.\n'
       '\n'
@@ -395,7 +399,8 @@
   # --pack-into may be called directly so this must be done before changing
   # working directory to OLDPWD.
   if args.pack_into and args.repack is None:
-    PackFactoryToolkit(src_root, args.pack_into)
+    PackFactoryToolkit(src_root, args.pack_into, args.enable_device,
+                       args.enable_presenter)
     return
 
   if not in_archive: