diff options
author | Adrian Dudau <adrian.dudau@enea.com> | 2014-06-26 13:23:09 +0200 |
---|---|---|
committer | Adrian Dudau <adrian.dudau@enea.com> | 2014-06-26 13:24:09 +0200 |
commit | c7da892cb23d50d4d85746c9a0b6b14bf570989d (patch) | |
tree | e7136073f386d6156f51766c498c52c30c8df85f /plugins/org.yocto.remote.utils/resources/yocto_ust.sh | |
download | eclipse-poky-kepler-daisy.tar.gz |
initial commit for Enea Linux 4.0daisy
Migrated from the internal git server on the daisy-enea branch
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'plugins/org.yocto.remote.utils/resources/yocto_ust.sh')
-rwxr-xr-x | plugins/org.yocto.remote.utils/resources/yocto_ust.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/plugins/org.yocto.remote.utils/resources/yocto_ust.sh b/plugins/org.yocto.remote.utils/resources/yocto_ust.sh new file mode 100755 index 0000000..a1637db --- /dev/null +++ b/plugins/org.yocto.remote.utils/resources/yocto_ust.sh | |||
@@ -0,0 +1,35 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | #set PATH to include sbin dirs | ||
4 | export PATH="$PATH:/usr/local/sbin:/usr/sbin:/sbin" | ||
5 | |||
6 | DATESTRING="$(date +%Y%m%d%H%M%S%N)" | ||
7 | TEMPFILE="/tmp/yocto-ust-tmp-$DATESTRING" | ||
8 | |||
9 | rm -f ${TEMPFILE} | ||
10 | usttrace $@ &> ${TEMPFILE} | ||
11 | ret=$? | ||
12 | |||
13 | if [ $ret -ne 0 ]; then | ||
14 | cat $TEMPFILE | ||
15 | rm -f $TEMPFILE | ||
16 | exit $ret | ||
17 | fi | ||
18 | |||
19 | #search for output dir | ||
20 | USTDIR=`cat ${TEMPFILE} | awk '/^Trace was output in:/ { print $5}'` | ||
21 | rm -f ${TEMPFILE} | ||
22 | |||
23 | if [ -z "$USTDIR" ]; then | ||
24 | exit 1 | ||
25 | fi | ||
26 | |||
27 | BASENAME=`basename $USTDIR` | ||
28 | DATAFILE=/tmp/${BASENAME}.tar | ||
29 | cd $USTDIR | ||
30 | cd .. | ||
31 | |||
32 | tar -cf ${DATAFILE} ${BASENAME} &> /dev/null || exit $? | ||
33 | |||
34 | echo -e "ustfile:$DATAFILE\n" | ||
35 | |||