3 # Copyright (C) 2014 Samsung Electronics
4 # Lukasz Majewski <l.majewski@samsung.com>
6 # Script fixes, enhancements and testing:
7 # Stephen Warren <swarren@nvidia.com>
9 # Script for test files generation
11 # SPDX-License-Identifier: GPL-2.0+
13 set -e # any command return if not equal to zero
17 COLOUR_GREEN="\33[32m"
18 COLOUR_DEFAULT="\33[0m"
23 TEST_FILES_SIZES="63 64 65 127 128 129 4095 4096 4097 959 960 961 1048575 1048576 8M"
28 printf "Init script for generating data necessary for DFU test script"
30 if [ ! -d $LOG_DIR ]; then
34 for size in $TEST_FILES_SIZES
36 FILE="./dat_$size.img"
37 if [ ! -f $FILE ]; then
38 dd if=/dev/urandom of="./dat_$size.img" bs=$size count=1 > /dev/null 2>&1 || exit $?
41 dd if=/dev/urandom of="./dfudummy.bin" bs=1024 count=1 > /dev/null 2>&1 || exit $?
43 printf "$COLOUR_GREEN OK $COLOUR_DEFAULT \n"