diff options
author | Jian Cai <jiancai@google.com> | 2021-03-23 14:03:46 -0700 |
---|---|---|
committer | Jian Cai <jiancai@google.com> | 2021-04-07 00:02:16 +0000 |
commit | a2c555df34e77c5e0e95bebc05db415861e5cfe2 (patch) | |
tree | b2e8611ba47aa4f3d907a6db343e98c2d28302c7 /binary_search_tool/common/test_setup.sh | |
parent | 7383470703a53edfd81fe83317065fd85730637b (diff) | |
download | toolchain-utils-a2c555df34e77c5e0e95bebc05db415861e5cfe2.tar.gz |
bisection: support hostname:port form device in kernel bisection
This could be useful when SSH port forwarding is used to access a test
device.
BUG=chromium:1191682
TEST=verified locally.
Change-Id: I5c0c84c7493ee90677c6e32e95c52172cba6b284
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2782073
Tested-by: Jian Cai <jiancai@google.com>
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Diffstat (limited to 'binary_search_tool/common/test_setup.sh')
-rwxr-xr-x | binary_search_tool/common/test_setup.sh | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/binary_search_tool/common/test_setup.sh b/binary_search_tool/common/test_setup.sh index 4fa1abe2..6e64e5c4 100755 --- a/binary_search_tool/common/test_setup.sh +++ b/binary_search_tool/common/test_setup.sh @@ -94,10 +94,10 @@ echo if [[ "${BISECT_MODE}" == "OBJECT_MODE" ]]; then echo "EMERGING ${BISECT_PACKAGE}" - echo "sudo rm -rf /build/${BISECT_BOARD}/var/cache/portage/*" + set -x sudo rm -rf /build/${BISECT_BOARD}/var/cache/portage/* - echo "sudo rm -rf /build/${BISECT_BOARD}/tmp/portage/${BISECT_PACKAGE}*" sudo rm -rf /build/${BISECT_BOARD}/tmp/portage/${BISECT_PACKAGE}* + set +x CLEAN_DELAY=0 emerge-${BISECT_BOARD} -C ${BISECT_PACKAGE} emerge-${BISECT_BOARD} ${BISECT_PACKAGE} emerge_status=$? @@ -110,11 +110,17 @@ if [[ "${BISECT_MODE}" == "OBJECT_MODE" ]]; then echo echo "DEPLOYING" - if [[ ${BISECT_PACKAGE} == sys-kernel/chromeos-kernel-* ]]; then - echo "/mnt/host/source/src/scripts/update_kernel.sh " \ - "--remote=${BISECT_REMOTE} --board=${BISECT_BOARD}" + if [[ ${BISECT_PACKAGE} == *chromeos-kernel-* ]]; then + cmd="/mnt/host/source/src/scripts/update_kernel.sh --board=${BISECT_BOARD} --remote=${BISECT_REMOTE}" + if [[ ${BISECT_REMOTE} == *:* ]]; then + IP=$(echo $1 | cut -d ":" -f1) + PORT=$(echo $1 | cut -d ":" -f2) + cmd="/mnt/host/source/src/scripts/update_kernel.sh --board=${BISECT_BOARD} --remote=${IP} --ssh_port=${PORT}" + fi + set -x # exec the command to make sure it always exit after - exec /mnt/host/source/src/scripts/update_kernel.sh --remote=${BISECT_REMOTE} --board=${BISECT_BOARD} + exec $cmd + set +x fi echo "cros deploy ${BISECT_REMOTE} ${BISECT_PACKAGE}" |