Hide xBuddy build/images management behind a flag.

xBuddy should only manage the images in the local build/images directory
if devserver is run with that explicitly set by a flag.
i.e. if the -x flag isn't set for devserver, it will neither generate
timestamp files for not delete old builds.

Also, bugfix and extra documentation for local management of images in
build/images.

BUG=chromium:260474
TEST=manual

Start devserver without -x flag, and check that if there were previously
more than 5 builds in build/images, none are deleted by xBuddy, and
newly generated ones are not logged by xBuddy timestamps.

Start devserver with the flag. Images should be logged and deleted as
neccessary.

Change-Id: Id1a678eea703be61dc7d5771d26ddd9245dabb39
Reviewed-on: https://gerrit.chromium.org/gerrit/62236
Commit-Queue: Joy Chen <joychen@chromium.org>
Reviewed-by: Joy Chen <joychen@chromium.org>
Tested-by: Joy Chen <joychen@chromium.org>
diff --git a/devserver.py b/devserver.py
index 0ccdaaa..a80046b 100755
--- a/devserver.py
+++ b/devserver.py
@@ -978,6 +978,11 @@
                     help='If set, look for the chromiumos_test_image.bin file '
                     'when generating update payloads rather than the '
                     'chromiumos_image.bin which is the default.')
+  parser.add_option('-x', '--xbuddy_manage_builds',
+                    action='store_true',
+                    default=False,
+                    help='If set, allow xbuddy to manage images in'
+                    'build/images.')
   _AddProductionOptions(parser)
   _AddUpdateOptions(parser)
   _AddTestingOptions(parser)
@@ -1065,7 +1070,9 @@
   if options.exit:
     return
 
-  _xbuddy = xbuddy.XBuddy(root_dir=root_dir, static_dir=options.static_dir)
+  _xbuddy = xbuddy.XBuddy(options.xbuddy_manage_builds,
+                          root_dir=root_dir,
+                          static_dir=options.static_dir)
   dev_server = DevServerRoot(_xbuddy)
 
   cherrypy.quickstart(dev_server, config=_GetConfig(options))