aboutsummaryrefslogtreecommitdiff
path: root/cc3200/appsign.sh
blob: d72498a2870c5e249bad1c78145ac808b6eabfc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash

if [ "$#" -ne 2 ]; then
    echo "Usage: appsign.sh *board type* *build type*"
    exit 1
fi

BOARD=$1
BTYPE=$2

# Build location
# Based on build type and board type
BUILD=build/${BOARD}/${BTYPE}

# Generate the MD5 hash
echo -n `md5sum --binary $BUILD/application.bin | awk '{ print $1 }'` > __md5hash.bin

# Concatenate it with the application binary
cat $BUILD/application.bin __md5hash.bin > $BUILD/MCUIMG.BIN
RET=$?

# Remove the tmp files
rm -f __md5hash.bin

# Remove hte unsigned binary
rm -f $BUILD/application.bin

exit $RET