deploy_chrome: Offer user to run dev_install automatically

Developer tools are removed on test images after powerwash, making
deploying Chrome difficult if you need to powerwash frequently. This
reduces steps to just once extra confirmation.

BUG=None
TEST=tested with my local DUT

Change-Id: I94daf2c168700a02bef8413cd028600ba80f8657
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/4567735
Commit-Queue: Sergiy Belozorov <sergiyb@chromium.org>
Auto-Submit: Sergiy Belozorov <sergiyb@chromium.org>
Tested-by: Sergiy Belozorov <sergiyb@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/scripts/deploy_chrome.py b/scripts/deploy_chrome.py
index 6eb1410..09b9f39 100644
--- a/scripts/deploy_chrome.py
+++ b/scripts/deploy_chrome.py
@@ -412,10 +412,16 @@
         # CopyToDevice will fall back to scp if rsync is corrupted on stateful.
         # This does not work for deploy.
         if not self.device.HasRsync():
-            raise DeployFailure(
-                "rsync is not found on the device.\n"
-                "Run dev_install on the device to get rsync installed."
-            )
+            # This assumes that rsync is part of the bootstrap package. In the
+            # future, this might change and we'll have to install it separately.
+            if not cros_build_lib.BooleanPrompt(
+                "Run dev_install on the device to install rsync?", True
+            ):
+                raise DeployFailure("rsync is not found on the device.")
+            self.device.BootstrapDevTools()
+            if not self.device.HasRsync():
+                raise DeployFailure("Failed to install rsync")
+
         self.device.CopyToDevice(
             "%s/" % os.path.abspath(self.staging_dir),
             self.options.target_dir,