aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbinary_search_tool/android/cleanup.sh4
-rwxr-xr-xbinary_search_tool/android/generate_cmd.sh14
2 files changed, 15 insertions, 3 deletions
diff --git a/binary_search_tool/android/cleanup.sh b/binary_search_tool/android/cleanup.sh
index c89c337d..759b3ed4 100755
--- a/binary_search_tool/android/cleanup.sh
+++ b/binary_search_tool/android/cleanup.sh
@@ -9,3 +9,7 @@
#
rm android/common.sh
+# Remove build command script if pass_bisect enabled
+rm -f android/cmd_script.sh
+# Remove tmp IR file used for ir_diff in pass beisction
+rm -f /tmp/bisection_bad_item.o
diff --git a/binary_search_tool/android/generate_cmd.sh b/binary_search_tool/android/generate_cmd.sh
index 7db3e7e0..78a39b12 100755
--- a/binary_search_tool/android/generate_cmd.sh
+++ b/binary_search_tool/android/generate_cmd.sh
@@ -1,4 +1,4 @@
-#!/bin/bash -u
+#!/bin/bash -eu
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
@@ -28,14 +28,22 @@ output+='source android/common.sh\n'
result=$(egrep -m 1 -- "${item}" ${populate_log})
+# Re-generate bad item to tmp directory location
+tmp_ir='/tmp/bisection_bad_item.o'
+result=$(sed "s|$item|-o $tmp_ir |g" <<< ${result})
+
# Remove `:` after cd command
-result=$(sed 's/cd\:/cd/g' <<< ${result})
+result=$(sed 's|cd:|cd|g' <<< ${result})
# Add environment variable which helps pass level bisection
-result=$(sed 's/ \-o / $LIMIT_FLAGS \-o /g' <<< ${result})
+result=$(sed 's| -o | $LIMIT_FLAGS -o |g' <<< ${result})
output+=${result}
+# Symbolic link generated bad item to original object
+output+="\nln -f $tmp_ir $abs_path"
+output+="\ntouch $abs_path"
+
echo -e "${output}" > android/cmd_script.sh
chmod u+x android/cmd_script.sh