aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManoj Gupta <manojgupta@google.com>2017-05-17 12:57:56 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-05-17 16:59:28 -0700
commit1282e84957a440f18a446888683d0aefb38a5a46 (patch)
treef9efd331d4b42ab68e6aea574a5f0d3c11dca48b
parent5ef88e5ed90b7a76487021b7e0e8a390ba6f05a2 (diff)
downloadtoolchain-utils-1282e84957a440f18a446888683d0aefb38a5a46.tar.gz
Disable beeps post reboots in crosperf.
Run gbb command before flashing to avoid post reboot beeps if possible. It works only on machines with Write Protect Disabled. Crosperf prints the erros messages and continues if this fails. BUG=chromium:697609 TEST=Tested on kevin, daisy and jaq. Change-Id: Ifb0c819281b3215655b7e3b02db605fa073d0e12 Reviewed-on: https://chromium-review.googlesource.com/508153 Commit-Ready: Manoj Gupta <manojgupta@chromium.org> Tested-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Caroline Tice <cmtice@chromium.org>
-rwxr-xr-ximage_chromeos.py21
1 files changed, 19 insertions, 2 deletions
diff --git a/image_chromeos.py b/image_chromeos.py
index 0ea6d390..f65ad4d1 100755
--- a/image_chromeos.py
+++ b/image_chromeos.py
@@ -50,6 +50,20 @@ def CheckForCrosFlash(chromeos_root, remote, log_level):
'cros flash cannot work.'.format(remote))
+def DisableCrosBeeps(chromeos_root, remote, log_level):
+ """Disable annoying chromebooks beeps after reboots."""
+ cmd_executer = command_executer.GetCommandExecuter(log_level=log_level)
+
+ command = '/usr/share/vboot/bin/set_gbb_flags.sh 0x1'
+ logger.GetLogger().LogOutput('Trying to disable beeping.')
+
+ ret, o, _ = cmd_executer.CrosRunCommandWOutput(
+ command, chromeos_root=chromeos_root, machine=remote)
+ if ret != 0:
+ logger.GetLogger().LogOutput(o)
+ logger.GetLogger().LogOutput('Failed to disable beeps.')
+
+
def DoImage(argv):
"""Image ChromeOS."""
@@ -199,9 +213,12 @@ def DoImage(argv):
# Check to see if cros flash will work for the remote machine.
CheckForCrosFlash(options.chromeos_root, options.remote, log_level)
+ # Disable the annoying chromebook beeps after reboot.
+ DisableCrosBeeps(options.chromeos_root, options.remote, log_level)
+
cros_flash_args = [
- 'cros', 'flash', '--board=%s' % board, '--clobber-stateful',
- options.remote
+ 'cros', 'flash',
+ '--board=%s' % board, '--clobber-stateful', options.remote
]
if local_image:
cros_flash_args.append(chroot_image)