]>
Commit | Line | Data |
---|---|---|
a4c86bbb ŁM |
1 | #! /bin/bash |
2 | set -e # any command return if not equal to zero | |
3 | clear | |
4 | ||
5 | COLOUR_RED="\33[31m" | |
6 | COLOUR_GREEN="\33[32m" | |
7 | COLOUR_DEFAULT="\33[0m" | |
8 | ||
9 | LOG_DIR="./log" | |
10 | BKP_DIR="./bkp" | |
11 | ||
12 | TEST_FILES_SIZES="127 128 129 8M 4095 4096 4097 63 64 65 960" | |
13 | ||
14 | printf "Init script for generating data necessary for DFU test script" | |
15 | ||
16 | if [ ! -d $LOG_DIR ]; then | |
17 | `mkdir $LOG_DIR` | |
18 | fi | |
19 | ||
20 | if [ ! -d $BKP_DIR ]; then | |
21 | `mkdir $BKP_DIR` | |
22 | fi | |
23 | ||
24 | for size in $TEST_FILES_SIZES | |
25 | do | |
26 | FILE="./dat_$size.img" | |
27 | if [ ! -f $FILE ]; then | |
28 | dd if=/dev/urandom of="./dat_$size.img" bs=$size count=1 > /dev/null 2>&1 || exit $? | |
29 | fi | |
30 | done | |
31 | ||
32 | printf "$COLOUR_GREEN OK $COLOUR_DEFAULT \n" | |
33 | ||
34 | exit 0 |