aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaroline Tice <cmtice@google.com>2017-06-06 10:19:59 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-06-06 12:38:43 -0700
commitc53ca3f32cde74a150a4ddaf5c30e3ce2d2ab32a (patch)
tree16cfb8802d651ee9106eb96ed889c92bdf7addcf
parent8ab698a91e101c218e58a67d810d1ae0691d7b29 (diff)
downloadtoolchain-utils-c53ca3f32cde74a150a4ddaf5c30e3ce2d2ab32a.tar.gz
Add scripts for usb-only flashing for cros package bisecting.
BUG=None TEST=None Change-Id: I0927bdb69d80c55cfccf0ea9c0ae3ad4ef554f2f Reviewed-on: https://chromium-review.googlesource.com/525840 Commit-Ready: Caroline Tice <cmtice@chromium.org> Tested-by: Caroline Tice <cmtice@chromium.org> Reviewed-by: Rahul Chaudhry <rahulchaudhry@chromium.org>
-rwxr-xr-xbinary_search_tool/common/interactive_test_noping.sh27
l---------binary_search_tool/cros_pkg/interactive_test_noping.sh1
-rwxr-xr-xbinary_search_tool/cros_pkg/test_setup_usb.sh56
3 files changed, 84 insertions, 0 deletions
diff --git a/binary_search_tool/common/interactive_test_noping.sh b/binary_search_tool/common/interactive_test_noping.sh
new file mode 100755
index 00000000..bb01b950
--- /dev/null
+++ b/binary_search_tool/common/interactive_test_noping.sh
@@ -0,0 +1,27 @@
+#!/bin/bash -u
+#
+# Copyright 2016 Google Inc. All Rights Reserved.
+#
+# This script asks the user if the image is good or not, allowing the user to
+# conduct whatever tests the user wishes, and waiting for a response.
+#
+# This script is intended to be used by binary_search_state.py, as
+# part of the binary search triage on ChromeOS package and object files. It
+# waits for the test setup script to build and install the image, then asks the
+# user if the image is good or not. It should return '0' if the test succeeds
+# (the image is 'good'); '1' if the test fails (the image is 'bad'); and '125'
+# if it could not determine (does not apply in this case).
+#
+
+source common/common.sh
+
+while true; do
+ read -p "Is this a good ChromeOS image?" yn
+ case $yn in
+ [Yy]* ) exit 0;;
+ [Nn]* ) exit 1;;
+ * ) echo "Please answer yes or no.";;
+ esac
+done
+
+exit 125
diff --git a/binary_search_tool/cros_pkg/interactive_test_noping.sh b/binary_search_tool/cros_pkg/interactive_test_noping.sh
new file mode 120000
index 00000000..c76f9404
--- /dev/null
+++ b/binary_search_tool/cros_pkg/interactive_test_noping.sh
@@ -0,0 +1 @@
+../common/interactive_test_noping.sh \ No newline at end of file
diff --git a/binary_search_tool/cros_pkg/test_setup_usb.sh b/binary_search_tool/cros_pkg/test_setup_usb.sh
new file mode 100755
index 00000000..fec66f8e
--- /dev/null
+++ b/binary_search_tool/cros_pkg/test_setup_usb.sh
@@ -0,0 +1,56 @@
+#!/bin/bash
+#
+# Copyright 2016 Google Inc. All Rights Reserved.
+#
+# This is a generic ChromeOS package/image test setup script. It is meant to
+# be used for the package bisection tool, in particular when there is a booting
+# issue with the image, so the image MUST be 'flashed' via USB.
+#
+# This script is intended to be used by binary_search_state.py, as
+# part of the binary search triage on ChromeOS objects and packages. It should
+# return '0' if the setup succeeds; and '1' if the setup fails (the image
+# could not built or be flashed).
+#
+
+export PYTHONUNBUFFERED=1
+
+source common/common.sh
+
+echo "BUILDING IMAGE"
+pushd ~/trunk/src/scripts
+./build_image test --board=${BISECT_BOARD} --noenable_rootfs_verification --noeclean
+build_status=$?
+popd
+
+if [[ ${build_status} -eq 0 ]] ; then
+ echo
+ echo "INSTALLING IMAGE VIA USB (requires some manual intervention)"
+ echo
+ echo "Insert a usb stick into the current machine"
+ echo "Note: The cros flash will take time and doesn't give much output."
+ echo " Be patient. If your usb access light is flashing it's working."
+ sleep 1
+ read -p "Press enter to continue" notused
+
+ cros flash --board=${BISECT_BOARD} --clobber-stateful usb:// ~/trunk/src/build/images/${BISECT_BOARD}/latest/chromiumos_test_image.bin
+
+ echo
+ echo "Flash to usb complete!"
+ echo "Plug the usb into your chromebook and install the image."
+ echo "Refer to the ChromiumOS Developer's Handbook for more details."
+ echo "http://www.chromium.org/chromium-os/developer-guide#TOC-Boot-from-your-USB-disk"
+ while true; do
+ sleep 1
+ read -p "Was the installation of the image successful? " choice
+ case $choice in
+ [Yy]*) exit 0;;
+ [Nn]*) exit 1;;
+ *) echo "Please answer y or n.";;
+ esac
+ done
+else
+ echo "build_image returned a non-zero status: ${build_status}"
+ exit 1
+fi
+
+exit 0