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 DEFINE_string board "" "The board for which you are building autotest" |
| 8 |
| 9 function check_board() { |
| 10 local board_names="" |
| 11 local index=1 |
| 12 local found=0 |
| 13 for board in ../overlays/overlay-* |
| 14 do |
| 15 board_names[index]=${board:20} |
| 16 index+=1 |
| 17 if [ "${FLAGS_board}" == "${board:20}" ] |
| 18 then |
| 19 found=1 |
| 20 fi |
| 21 done |
| 22 |
| 23 if [ ${found} -eq 0 ] |
| 24 then |
| 25 echo "You are required to specify a supported board from the command line." |
| 26 echo "Supported boards are:" |
| 27 for board in ${board_names[@]} |
| 28 do |
| 29 echo ${board} |
| 30 done |
| 31 exit 0 |
| 32 fi |
| 33 } |
| 34 |
| 35 |
7 # Populates the chroot's /usr/local/autotest/$FLAGS_board directory based on | 36 # Populates the chroot's /usr/local/autotest/$FLAGS_board directory based on |
8 # the given source directory. | 37 # the given source directory. |
9 # args: | 38 # args: |
10 # $1 - original source directory | 39 # $1 - original source directory |
11 # $2 - target directory | 40 # $2 - target directory |
12 function update_chroot_autotest() { | 41 function update_chroot_autotest() { |
13 local original=$1 | 42 local original=$1 |
14 local target=$2 | 43 local target=$2 |
15 echo "Updating chroot Autotest from ${original} to ${target}..." | 44 echo "Updating chroot Autotest from ${original} to ${target}..." |
16 sudo mkdir -p "${target}" | 45 sudo mkdir -p "${target}" |
17 sudo chmod 777 "${target}" | 46 sudo chmod 777 "${target}" |
18 cp -fpru ${original}/{client,conmux,server,tko,utils,global_config.ini,shadow_
config.ini} ${target} | 47 cp -fpru ${original}/{client,conmux,server,tko,utils,global_config.ini,shadow_
config.ini} ${target} |
19 } | 48 } |
OLD | NEW |