diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-05-10 07:04:52 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-05-10 07:04:52 +0000 |
commit | 9c52e44041c3cb9896f730597b61520e9c2f67a9 (patch) | |
tree | b0522edde1d3c5356c95eb1ee2eae3e87befa1f3 /binary_search_tool/common/test_setup.sh | |
parent | b38deade70675ef32068da454167f15391f0b0cc (diff) | |
parent | 882a18888febb9cb0b9d6c6069498cbc4aa30f88 (diff) | |
download | toolchain-utils-android13-mainline-permission-release.tar.gz |
Snap for 8564071 from 882a18888febb9cb0b9d6c6069498cbc4aa30f88 to mainline-permission-releaseaml_per_331913010aml_per_331812030aml_per_331710050aml_per_331611010aml_per_331512020aml_per_331411000aml_per_331313010aml_per_331115020aml_per_331019040aml_per_330912010aml_per_330811030android13-mainline-permission-release
Change-Id: I495d4991a606d780fa2bef79797e0c88b34efca2
Diffstat (limited to 'binary_search_tool/common/test_setup.sh')
-rwxr-xr-x | binary_search_tool/common/test_setup.sh | 71 |
1 files changed, 57 insertions, 14 deletions
diff --git a/binary_search_tool/common/test_setup.sh b/binary_search_tool/common/test_setup.sh index 4fa1abe2..3ea73272 100755 --- a/binary_search_tool/common/test_setup.sh +++ b/binary_search_tool/common/test_setup.sh @@ -1,6 +1,8 @@ #!/bin/bash # -# Copyright 2016 Google Inc. All Rights Reserved. +# Copyright 2021 The Chromium OS Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. # # This is a generic ChromeOS package/image test setup script. It is meant to # be used for either the object file or package bisection tools. This script @@ -94,12 +96,29 @@ 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 + if [[ ${BISECT_PACKAGE} == *chromeos-chrome ]]; then + if [[ ${BISECT_USE_FLAGS} == *chrome_internal* && \ + ${BISECT_USE_FLAGS} != *-chrome_internal* ]]; then + # for the pre-upload check of the length of lines + chrome_build_dir="/var/cache/chromeos-chrome/chrome-src-internal/src/" + chrome_build_dir+="out_${BISECT_BOARD}" + else + # for the pre-upload check of the length of lines + chrome_build_dir="/var/cache/chromeos-chrome/chrome-src/src/" + chrome_build_dir+="out_${BISECT_BOARD}" + fi + set -x + sudo rm -rf ${chrome_build_dir} + set +x + fi + set -x CLEAN_DELAY=0 emerge-${BISECT_BOARD} -C ${BISECT_PACKAGE} - emerge-${BISECT_BOARD} ${BISECT_PACKAGE} + USE="${BISECT_USE_FLAGS}" emerge-${BISECT_BOARD} ${BISECT_PACKAGE} + set +x emerge_status=$? if [[ ${emerge_status} -ne 0 ]] ; then @@ -108,20 +127,43 @@ if [[ "${BISECT_MODE}" == "OBJECT_MODE" ]]; then fi 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}" + echo "DEPLOYING TO ${BISECT_REMOTE}" + + 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 + if [[ ${BISECT_REBOOT_OPTION} == false ]]; then + cmd+=" --noreboot" + 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}" - cros deploy ${BISECT_REMOTE} ${BISECT_PACKAGE} --log-level=info - + if [[ ${BISECT_PACKAGE} == *chromeos-chrome ]]; then + # deploy_chrome needs to run inside chrome source tree + pushd ~/chrome_root + set -x + deploy_chrome --force --build-dir=${chrome_build_dir}/Release \ + --device=${BISECT_REMOTE} + set +x + popd + else + set -x + cros deploy ${BISECT_REMOTE} ${BISECT_PACKAGE} --log-level=info + set +x + fi deploy_status=$? + if [[ ${BISECT_REBOOT_OPTION} == false ]]; then + exit 0 + fi + if [[ ${deploy_status} -eq 0 ]] ; then echo "Deploy successful. Rebooting device..." reboot @@ -139,7 +181,8 @@ fi echo "BUILDING IMAGE" pushd ~/trunk/src/scripts -./build_image test --board=${BISECT_BOARD} --noenable_rootfs_verification --noeclean +USE="${BISECT_USE_FLAGS}" ./build_image test --board=${BISECT_BOARD} \ + --noenable_rootfs_verification --noeclean build_status=$? popd |