@@ -17,6 +17,7 @@ SUDO="echo $PASSWORD | sudo -S"
17NUM_JOBS='$(( `grep -c ^processor /proc/cpuinfo` + 1 ))'
17NUM_JOBS='$(( `grep -c ^processor /proc/cpuinfo` + 1 ))'
18FLIPPED=false
18FLIPPED=false
19CHROOT_PREFIX="/data/ubuntu"
19CHROOT_PREFIX="/data/ubuntu"
22 echo "usage: run_on_device [OPTIONS]\n"
23 echo "usage: run_on_device [OPTIONS]\n"
@@ -32,7 +33,16 @@ usage() {
37+ if [ $SSH_STARTED -eq 0 ]; then
38+ exec_with_adb service ssh start
35exec_with_ssh() {
43exec_with_ssh() {
36 ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -t $USER@$TARGET_IP -p $TARGET_SSH_PORT sudo -u $USER -i bash -ic \"$@\"
46 ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -t $USER@$TARGET_IP -p $TARGET_SSH_PORT sudo -u $USER -i bash -ic \"$@\"
@@ -66,7 +76,6 @@ setup_adb_forwarding() {
67install_dependencies() {
77install_dependencies() {
68 exec_with_adb rm /etc/init/ssh.override
78 exec_with_adb rm /etc/init/ssh.override
69− exec_with_adb service ssh start
70 exec_with_adb apt-get update
79 exec_with_adb apt-get update
71 exec_with_ssh $SUDO apt-get -y install build-essential rsync bzr ccache gdb ninja-build devscripts equivs
80 exec_with_ssh $SUDO apt-get -y install build-essential rsync bzr ccache gdb ninja-build devscripts equivs
@@ -74,6 +83,7 @@ install_dependencies() {
74sync_code() {
83sync_code() {
75 [ -e .bzr ] && bzr export --uncommitted --format=dir /tmp/$CODE_DIR
84 [ -e .bzr ] && bzr export --uncommitted --format=dir /tmp/$CODE_DIR
76 [ -e .git ] && git checkout-index -a -f --prefix=/tmp/$CODE_DIR/
85 [ -e .git ] && git checkout-index -a -f --prefix=/tmp/$CODE_DIR/
77 rsync -crlOzv --delete --exclude builddir -e "ssh -p $TARGET_SSH_PORT -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" /tmp/$CODE_DIR/ $USER@$TARGET_IP:$CODE_DIR/
87 rsync -crlOzv --delete --exclude builddir -e "ssh -p $TARGET_SSH_PORT -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" /tmp/$CODE_DIR/ $USER@$TARGET_IP:$CODE_DIR/
78 rm -rf /tmp/$CODE_DIR
88 rm -rf /tmp/$CODE_DIR