From a2c555df34e77c5e0e95bebc05db415861e5cfe2 Mon Sep 17 00:00:00 2001 From: Jian Cai Date: Tue, 23 Mar 2021 14:03:46 -0700 Subject: 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 Reviewed-by: Manoj Gupta --- binary_search_tool/common/test_setup.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'binary_search_tool/common/test_setup.sh') 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}" -- cgit v1.2.3