| OLD | NEW |
| 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 # | 4 # |
| 5 # Provides common commands for dealing running/building autotest | 5 # Provides common commands for dealing running/building autotest |
| 6 | 6 |
| 7 . "$(dirname "$0")/common.sh" | 7 . "$(dirname "$0")/common.sh" |
| 8 | 8 |
| 9 get_default_board | 9 get_default_board |
| 10 | 10 |
| 11 DEFINE_string board "$DEFAULT_BOARD" \ | 11 DEFINE_string board "$DEFAULT_BOARD" \ |
| 12 "The board for which you are building autotest" | 12 "The board for which you are building autotest" |
| 13 | 13 |
| 14 function check_board() { | 14 function check_board() { |
| 15 local board_names="" | 15 local board_names="" |
| 16 local index=1 | 16 local index=1 |
| 17 local found=0 | 17 local found=0 |
| 18 for board in ../overlays/overlay-* | 18 for overlay_path in "${SRC_ROOT}"/overlays/overlay-* |
| 19 do | 19 do |
| 20 board_names[index]=${board:20} | 20 local overlay="$(basename \"${overlay_path}\")" |
| 21 local board="${overlay#overlay-}" |
| 22 board_names[index]="${board}" |
| 21 index+=1 | 23 index+=1 |
| 22 if [ "${FLAGS_board}" == "${board:20}" ] | 24 if [ "${FLAGS_board}" == "${board}" ] |
| 23 then | 25 then |
| 24 found=1 | 26 found=1 |
| 25 fi | 27 fi |
| 26 done | 28 done |
| 27 | 29 |
| 28 if [ ${found} -eq 0 ] | 30 if [ ${found} -eq 0 ] |
| 29 then | 31 then |
| 30 echo "You are required to specify a supported board from the command line." | 32 echo "You are required to specify a supported board from the command line." |
| 31 echo "Supported boards are:" | 33 echo "Supported boards are:" |
| 32 for board in ${board_names[@]} | 34 for board in ${board_names[@]} |
| (...skipping 11 matching lines...) Expand all Loading... |
| 44 # $1 - original source directory | 46 # $1 - original source directory |
| 45 # $2 - target directory | 47 # $2 - target directory |
| 46 function update_chroot_autotest() { | 48 function update_chroot_autotest() { |
| 47 local original=$1 | 49 local original=$1 |
| 48 local target=$2 | 50 local target=$2 |
| 49 echo "Updating chroot Autotest from ${original} to ${target}..." | 51 echo "Updating chroot Autotest from ${original} to ${target}..." |
| 50 sudo mkdir -p "${target}" | 52 sudo mkdir -p "${target}" |
| 51 sudo chmod 777 "${target}" | 53 sudo chmod 777 "${target}" |
| 52 cp -fpru ${original}/{client,conmux,server,tko,utils,global_config.ini,shadow_
config.ini} ${target} | 54 cp -fpru ${original}/{client,conmux,server,tko,utils,global_config.ini,shadow_
config.ini} ${target} |
| 53 } | 55 } |
| OLD | NEW |