2015-02-06 09:35:48 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
2015-02-28 06:20:04 -05:00
|
|
|
if [ "$#" -ne 2 ]; then
|
|
|
|
echo "Usage: appsign.sh *board type* *build type*"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
BOARD=$1
|
|
|
|
BTYPE=$2
|
|
|
|
|
2015-02-06 09:35:48 -05:00
|
|
|
# Build location
|
2015-02-28 06:20:04 -05:00
|
|
|
# Based on build type and board type
|
|
|
|
BUILD=build/${BOARD}/${BTYPE}
|
2015-02-06 09:35:48 -05:00
|
|
|
|
|
|
|
# Generate the MD5 hash
|
2015-02-25 16:26:16 -05:00
|
|
|
echo -n `md5sum --binary $BUILD/application.bin | awk '{ print $1 }'` > __md5hash.bin
|
2015-02-06 09:35:48 -05:00
|
|
|
|
|
|
|
# Concatenate it with the application binary
|
|
|
|
cat $BUILD/application.bin __md5hash.bin > $BUILD/MCUIMG.BIN
|
2015-02-21 04:52:19 -05:00
|
|
|
RET=$?
|
2015-02-06 09:35:48 -05:00
|
|
|
|
|
|
|
# Remove the tmp files
|
|
|
|
rm -f __md5hash.bin
|
|
|
|
|
|
|
|
# Remove hte unsigned binary
|
|
|
|
rm -f $BUILD/application.bin
|
2015-02-21 04:52:19 -05:00
|
|
|
|
2015-02-28 06:20:04 -05:00
|
|
|
exit $RET
|