5 # ============================================================================
7 # Copyright (C) THALES. All rights reserved
8 # Author: Laurent Mazet
10 # 2014-10-06 V1.0 : Creation
12 # ============================================================================
15 FIRMWARE
=/opt
/trc6500
/config
/code_metier
/libHwCtrl
/Bitstream
16 LIST
="application.out production.bin ts12_fp_pano.bin ts22_fp_pano.bin firmware.out"
18 TRC6500_SCRIPT_DIR
=$
(dirname $0)
23 echo "usage: $PROGNAME [-d] [-f dir] [-h] [-i host] [-l list]"
25 echo " -f: firmware directory ($FIRMWARE)"
26 echo " -h: help message"
27 echo " -i: board hostname (or ip)"
28 echo " -l: list of firmware ($LIST)"
34 function title
() { echo -e "\033[0;1m$*\033[0;0m"; }
35 function pass
() { echo -e "\033[1;32m$*\033[0;0m"; }
36 function warn
() { echo -e "\033[1;33m$*\033[0;0m"; }
37 function fail
() { echo -e "\033[1;31m$*\033[0;0m"; }
41 while [ $# -gt 0 ]; do
44 -f) shift; FIRMWARE
=$1;;
55 [ "$HOST" ] ||
ping -c 1 $HOST >&/dev
/null || \
56 { fail
"Can't connect '$HOST'"; exit 1; }
61 [ -f $FIRMWARE/$f ] ||
{ fail
"Can't find '$FIRMWARE/$f'"; exit 1; }
67 [ "$DRY" = yes ] && protect
="!echo"
71 title
"flash fe306 '$HOST'"
79 $(for f in $LIST; do echo "$protect send $FIRMWARE/$f"; done)
83 # vim:set tabstop=4 shiftwidth=4 softtabstop=4: