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