aboutsummaryrefslogtreecommitdiff
path: root/binary_search_tool/sysroot_wrapper/setup.sh
diff options
context:
space:
mode:
authorCassidy Burden <cburden@google.com>2016-06-30 15:24:20 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-07-01 11:58:13 -0700
commitc4671bdd601ff945b2cccbfe1aee9f931dc908c7 (patch)
tree4cdec6fd367b6f8a9162f4c56f18d3232a494b63 /binary_search_tool/sysroot_wrapper/setup.sh
parent63f13489b1a02bbbc75b46fec6ae7a817442df94 (diff)
downloadtoolchain-utils-c4671bdd601ff945b2cccbfe1aee9f931dc908c7.tar.gz
binary search tool: (Refactor) Extract common scripts into common folder
Refactor warning! Move install.sh, boot_test.sh, and interactive_test.sh into common folder so they can be shared by both package and object bisectors. To allow this sharing, sysroot_wrapper now has a setup script similar to cros_pkg. All scripts now source common/common.sh. TEST=Run unit tests, run system tests, run couple iterations of install script for both bisectors. Change-Id: I9e164b4e6b842ff321c2400201e6ac0984f99088 Reviewed-on: https://chrome-internal-review.googlesource.com/268027 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
Diffstat (limited to 'binary_search_tool/sysroot_wrapper/setup.sh')
-rwxr-xr-xbinary_search_tool/sysroot_wrapper/setup.sh71
1 files changed, 71 insertions, 0 deletions
diff --git a/binary_search_tool/sysroot_wrapper/setup.sh b/binary_search_tool/sysroot_wrapper/setup.sh
new file mode 100755
index 00000000..d000b3b5
--- /dev/null
+++ b/binary_search_tool/sysroot_wrapper/setup.sh
@@ -0,0 +1,71 @@
+#!/bin/bash -u
+#
+# Copyright 2016 Google Inc. All Rights Reserved.
+#
+# This script is part of the ChromeOS object binary search triage process.
+# It should be the first script called by the user, after the user has set up
+# the two necessary build tree directories (see sysroot_wrapper/README).
+#
+# This script requires three arguments. The first argument must be the name of
+# the board for which this work is being done (e.g. 'daisy', 'lumpy','parrot',
+# etc.). The second argument must be the name or IP address of the chromebook
+# on which the ChromeOS images will be pushed and tested. The third argument
+# must be the name of the package being bisected (e.g. 'chromeos-chrome',
+# 'cryptohome', etc.).
+#
+# This script generates common/common.sh, which generates enviroment variables
+# used by the other scripts in the object file binary search triage process.
+#
+
+# Set up basic variables.
+bisect_dir=${BISECT_DIR:-/tmp/sysroot_bisect}
+
+BOARD=$1
+REMOTE=$2
+PACKAGE=$3
+
+GOOD_BUILD=${bisect_dir}/good
+BAD_BUILD=${bisect_dir}/bad
+GOOD_LIST=${GOOD_BUILD}/_LIST
+BAD_LIST=${BAD_BUILD}/_LIST
+
+#
+# Verify that the necessary directories exist.
+#
+
+if [[ ! -d ${GOOD_BUILD} ]] ; then
+ echo "Error: ${GOOD_BUILD} does not exist."
+ exit 1
+fi
+
+if [[ ! -d ${BAD_BUILD} ]] ; then
+ echo "Error: ${BAD_BUILD} does not exist."
+ exit 1
+fi
+
+if [[ ! -e ${GOOD_LIST} ]] ; then
+ echo "Error: ${GOOD_LIST} does not exist."
+ exit 1
+fi
+
+if [[ ! -e ${BAD_LIST} ]] ; then
+ echo "Error: ${BAD_LIST} does not exist."
+ exit 1
+fi
+
+COMMON_FILE="common/common.sh"
+
+cat <<-EOF > ${COMMON_FILE}
+
+BISECT_BOARD=${BOARD}
+BISECT_REMOTE=${REMOTE}
+BISECT_PACKAGE=${PACKAGE}
+BISECT_MODE="OBJECT_MODE"
+
+bisect_dir=${bisect_dir}
+
+EOF
+
+chmod 755 ${COMMON_FILE}
+
+exit 0