deploy_chrome: Avoid unnecessary D-Bus reboots.
When D-Bus service files in /opt/google/chrome/dbus are updated, we need
to trigger a reboot so that dbus-daemon can be set up properly with the
new configuration.
However, when a user uses the --target-dir option, the D-Bus changes
won't be applied, and there is no need to perform the reboot. In that
case, a warning message is logged so users are aware in case they
expected D-Bus changes to be applied.
BUG=chromium:724175
TEST=deploy_chrome with a new dbus file
Change-Id: I1be9824881648d2092688b906700ba319b3b713e
Reviewed-on: https://chromium-review.googlesource.com/509932
Commit-Ready: Justin TerAvest <teravest@chromium.org>
Tested-by: Justin TerAvest <teravest@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/scripts/deploy_chrome.py b/scripts/deploy_chrome.py
index 9833254..c4f4c3f 100644
--- a/scripts/deploy_chrome.py
+++ b/scripts/deploy_chrome.py
@@ -270,9 +270,14 @@
new_dbus_checksums = self._GetDBusChecksums()
if old_dbus_checksums != new_dbus_checksums:
- logging.info('Detected change to D-Bus service files, rebooting.')
- self._Reboot()
- return
+ if self.options.target_dir == _CHROME_DIR:
+ logging.info('Detected change to D-Bus service files, rebooting.')
+ self._Reboot()
+ return
+ else:
+ logging.warn('Detected change in D-Bus service files, but target dir '
+ 'is not %s. D-Bus changes will not be picked up by '
+ 'dbus-daemon at boot time.', _CHROME_DIR)
if self.options.startui:
logging.info('Starting UI...')
@@ -324,7 +329,8 @@
This is used to determine if a reboot is required after deploying Chrome.
"""
- result = self.device.RunCommand('md5sum /opt/google/chrome/dbus/*',
+ path = os.path.join(_CHROME_DIR, 'dbus/*')
+ result = self.device.RunCommand('md5sum ' + path,
error_code_ok=True)
return result.output