diff options
-rwxr-xr-x | tools/art | 7 | ||||
-rwxr-xr-x | tools/buildbot-setup-device.sh | 3 | ||||
-rwxr-xr-x | tools/buildbot-teardown-device.sh | 3 |
3 files changed, 12 insertions, 1 deletions
@@ -1,3 +1,4 @@ +#! /bin/sh # Copyright (C) 2011 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,7 +15,11 @@ # This script is used on host and device. It uses a common subset # shell dialect that should work on the host (e.g. bash), and -# Android (e.g. mksh). +# Android (e.g. mksh). Try to switch to bash if the shebang above +# has launched a pessimal shell on host. +if [ -z "$KSH_VERSION" -a -z "$BASH_VERSION" -a -n "$(which bash)" ]; then + exec bash -c ". $0" -- "$@" +fi ###################################### # Functions diff --git a/tools/buildbot-setup-device.sh b/tools/buildbot-setup-device.sh index 54c928a678..b139c4755c 100755 --- a/tools/buildbot-setup-device.sh +++ b/tools/buildbot-setup-device.sh @@ -173,4 +173,7 @@ if [[ -n "$ART_TEST_CHROOT" ]]; then # Create /linkerconfig directory in chroot. adb shell mkdir -p "$ART_TEST_CHROOT/linkerconfig" + + # Create /bin symlink for shebang compatibility. + adb shell ln -s system/bin "$ART_TEST_CHROOT/bin" fi diff --git a/tools/buildbot-teardown-device.sh b/tools/buildbot-teardown-device.sh index e067a701c3..3a75bbdb58 100755 --- a/tools/buildbot-teardown-device.sh +++ b/tools/buildbot-teardown-device.sh @@ -92,6 +92,9 @@ if [[ -n "$ART_TEST_CHROOT" ]]; then fi } + # Remove /bin symlink from chroot. + adb shell rm -f "$ART_TEST_CHROOT/bin" + # Remove /apex from chroot. adb shell rm -rf "$ART_TEST_CHROOT/apex" |