aboutsummaryrefslogtreecommitdiff
path: root/binary_search_tool
diff options
context:
space:
mode:
authorCaroline Tice <cmtice@google.com>2016-05-25 14:56:02 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-05-26 15:30:21 -0700
commitc4d58d04b0f92b52c645f0b8a0fc1d5e5b983e5f (patch)
tree73446bec0e99b5595fbb5e76b71b2f522acb46e8 /binary_search_tool
parentc5c905559df6890ff5c59b88b7a6856346874faf (diff)
downloadtoolchain-utils-c4d58d04b0f92b52c645f0b8a0fc1d5e5b983e5f.tar.gz
[crosperf] Update bisecing triage tool to not update build_image.
The package bisecting tool used to actually edit the build_image script, to prevent it from calling 'eclean', which messed up the bisecting tool. Now there's a flag '-noeclean' that can be passed to build_image instead. This CL updates the tool to use the flag, which is much safer, rather than modifying the build_image script. It also cleans up a few other minor issues with the tool BUG=chromium:614829 TEST=Ran the tool with these changes. Change-Id: If92148306c041b49d3fa45253ea5451bc840d862 Reviewed-on: https://chrome-internal-review.googlesource.com/260726 Commit-Ready: Caroline Tice <cmtice@google.com> Tested-by: Caroline Tice <cmtice@google.com> Reviewed-by: Yunlian Jiang <yunlian@google.com>
Diffstat (limited to 'binary_search_tool')
-rw-r--r--binary_search_tool/cros_pkg/README.cros_pkg_triage16
-rwxr-xr-xbinary_search_tool/cros_pkg/cros_pkg_boot_test.sh4
-rwxr-xr-xbinary_search_tool/cros_pkg/cros_pkg_create_cleanup_script.py26
-rwxr-xr-xbinary_search_tool/cros_pkg/cros_pkg_interactive_test.sh2
-rwxr-xr-xbinary_search_tool/cros_pkg/cros_pkg_setup.sh31
5 files changed, 26 insertions, 53 deletions
diff --git a/binary_search_tool/cros_pkg/README.cros_pkg_triage b/binary_search_tool/cros_pkg/README.cros_pkg_triage
index 1530060b..bc050b27 100644
--- a/binary_search_tool/cros_pkg/README.cros_pkg_triage
+++ b/binary_search_tool/cros_pkg/README.cros_pkg_triage
@@ -88,15 +88,11 @@ FILES AND SCRIPTS:
package binary search triage, and it generates two
necessary scripts (see below).
- cros_pkg_swith_to_bad.sh - This script is used to copy packages from the
- 'bad' build tree into the work area.
+ cros_pkg_switch_to_bad.sh - This script is used to copy packages from the
+ 'bad' build tree into the work area.
- cros_pkg_swith_to_good.sh - This script is used to copy packages from the
- 'good' build tree into the work area.
-
- cros_pkg_undo_eclean.py - Script for modifying build_image script so that it
- does not perform any calls to 'eclean', which can
- mess up the binary search triage process.
+ cros_pkg_switch_to_good.sh - This script is used to copy packages from the
+ 'good' build tree into the work area.
GENERATED SCRIPTS:
@@ -150,8 +146,6 @@ testing your chromeos images. cros_pkg_setup.sh will do the following:
and work).
- Create a soft link for /build/${board} pointing to the work build
tree.
- - Update build_image, so it will not do 'eclean', which gets in the
- way of copying packages around for building the image.
- Create the cros_pkg_common.sh file that the other scripts passed to the
binary triage tool will need.
- Create a cleanup script, cros_pkg_${board}_cleanup.sh, for you to
@@ -169,7 +163,7 @@ prompts you and waits for a response).
Once you have run cros_pkg_setup.sh (and decided which test script you
-want to use) run the binary triage tool using this scripts to
+want to use) run the binary triage tool using these scripts to
isolate/identify the bad package:
~/trunk/src/third_party/toolchain_utils/binary_search_tool/binary_search_state.py \
diff --git a/binary_search_tool/cros_pkg/cros_pkg_boot_test.sh b/binary_search_tool/cros_pkg/cros_pkg_boot_test.sh
index 382f0362..55672c57 100755
--- a/binary_search_tool/cros_pkg/cros_pkg_boot_test.sh
+++ b/binary_search_tool/cros_pkg/cros_pkg_boot_test.sh
@@ -18,14 +18,14 @@
source cros_pkg_common.sh
pushd ~/trunk/src/scripts
-./build_image test --board=${BOARD} --noenable_rootfs_verification
+./build_image test --noeclean --board=${BOARD} --noenable_rootfs_verification
build_status=$?
popd
if [[ ${build_status} -eq 0 ]] ; then
echo "Pushing built image onto device."
echo "cros flash --board=${BOARD} --clobber-stateful ${REMOTE} ~/trunk/src/build/images/${BOARD}/latest/chromiumos_test_image.bin"
- cros flash --board=${BOARD} --clobber-stateful ${REMOTE} ../build/images/${BOARD}/latest/chromiumos_test_image.bin
+ cros flash --board=${BOARD} --clobber-stateful ${REMOTE} ~/trunk/src/build/images/${BOARD}/latest/chromiumos_test_image.bin
cros_flash_status=$?
if [[ ${cros_flash_status} -ne 0 ]] ; then
echo "cros flash failed!!"
diff --git a/binary_search_tool/cros_pkg/cros_pkg_create_cleanup_script.py b/binary_search_tool/cros_pkg/cros_pkg_create_cleanup_script.py
index fc479c92..a4770a8c 100755
--- a/binary_search_tool/cros_pkg/cros_pkg_create_cleanup_script.py
+++ b/binary_search_tool/cros_pkg/cros_pkg_create_cleanup_script.py
@@ -25,21 +25,20 @@ def Usage(parser, msg):
def Main(argv):
"""Generate a script to undo changes done by cros_pkg_setup.sh
- The script cros_pkg_setup.sh make two main changes that need to be
- undone: 1). It creates a soft link making /build/${board} point to
- /build/${board}.work, and 2). It saves a copy of the build_image
- script, then updates build_image to not execute 'eclean'. For the first
- change, it had to see if /build/${board} already existed, and if so, whether
- it was a real tree or a soft link. If it was soft link, it saved the old
- value of the link, then deleted it and created the new link. If it was a
- real tree, it renamed the tree to /build/${board}.save, and then created the
- new soft link. If the /build/${board} did not previously exist, then it
- just
- created the new soft link.
+ The script cros_pkg_setup.sh makes a change that needs to be
+ undone, namely it creates a soft link making /build/${board} point
+ to /build/${board}.work. To do this, it had to see if
+ /build/${board} already existed, and if so, whether it was a real
+ tree or a soft link. If it was soft link, it saved the old value
+ of the link, then deleted it and created the new link. If it was
+ a real tree, it renamed the tree to /build/${board}.save, and then
+ created the new soft link. If the /build/${board} did not
+ previously exist, then it just created the new soft link.
This function takes arguments that tell it exactly what cros_pkg_setup.sh
actually did, then generates a script to undo those exact changes.
- """
+
+ """
parser = argparse.ArgumentParser()
parser.add_argument('--board',
@@ -101,9 +100,6 @@ def Main(argv):
out_file.write('sudo ln -s %s /build/%s\n' % (original_link,
options.board))
out_file.write('\n')
- # Restore the original saved version of build_image script.
- out_file.write('mv ~/trunk/src/scripts/build_image.save '
- '~/trunk/src/scripts/build_image\n\n')
# Remove cros_pkg_common.sh file
out_file.write('rm cros_pkg_common.sh\n')
diff --git a/binary_search_tool/cros_pkg/cros_pkg_interactive_test.sh b/binary_search_tool/cros_pkg/cros_pkg_interactive_test.sh
index e79b044a..ef7c6872 100755
--- a/binary_search_tool/cros_pkg/cros_pkg_interactive_test.sh
+++ b/binary_search_tool/cros_pkg/cros_pkg_interactive_test.sh
@@ -20,7 +20,7 @@
source cros_pkg_common.sh
pushd ~/trunk/src/scripts
-./build_image test --board=${BOARD} --noenable_rootfs_verification
+./build_image test --noeclean --board=${BOARD} --noenable_rootfs_verification
build_status=$?
popd
diff --git a/binary_search_tool/cros_pkg/cros_pkg_setup.sh b/binary_search_tool/cros_pkg/cros_pkg_setup.sh
index b84172f0..99cb802d 100755
--- a/binary_search_tool/cros_pkg/cros_pkg_setup.sh
+++ b/binary_search_tool/cros_pkg/cros_pkg_setup.sh
@@ -12,15 +12,13 @@
# etc.). The second argument must be the name or IP address of the chromebook
# on which the ChromeOS images will be pushed and tested.
#
-# This script sets up a soft link definining /build/${board} to point to the
-# working build tree, for the binary search triags process. It also modifies
-# the build_image script, to prevent that script from undoing the package
-# copying that the binary triage process must do. In addition, this script
-# generates two other scripts, cros_pkg_common.sh, which generates enviroment
-# variables used by the other scripts in the package binary search triage
-# process; and cros_pkg_${board}_cleanup.sh, which undoes the various changes
-# that this script performs, returning the user's environment to its original
-# state.
+# This script sets up a soft link definining /build/${board} to point
+# to the working build tree, for the binary search triags process. In
+# addition, this script generates two other scripts, cros_pkg_common.sh,
+# which generates enviroment variables used by the other scripts in the
+# package binary search triage process; and cros_pkg_${board}_cleanup.sh,
+# which undoes the various changes that this script performs, returning the
+# user's environment to its original state.
#
# Set up basic variables.
@@ -99,21 +97,6 @@ EOF
chmod 755 ${COMMON_FILE}
#
-# Fix ~/trunk/src/scripts/build_image script to NOT delete/update the packages
-# after we have put them in place. First save a copy of the original file,
-# then call cros_pkg_undo_eclean.py to edit the script (it creates
-# 'build_image.edited').
-#
-
-cp ~/trunk/src/scripts/build_image .
-python cros_pkg_undo_eclean.py build_image
-if [[ $? -eq 0 ]] ; then
- chmod 755 build_image.edited
- mv build_image ~/trunk/src/scripts/build_image.save
- mv build_image.edited ~/trunk/src/scripts/build_image
-fi
-
-#
# Create clean-up script, calling cros_pkg_create_cleanup_script.py with
# the appropriate flags.
#