Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
micropython/ports/cc3200/appsign.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
29 lines (22 sloc)
589 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: appsign.sh *build dir*" | |
exit 1 | |
fi | |
# Build location | |
BUILD=$1 | |
# Generate the MD5 hash | |
# md5 on Darwin, md5sum on Unix | |
if [ `uname -s` = "Darwin" ]; then | |
echo -n `md5 -q $BUILD/application.bin` > __md5hash.bin | |
else | |
echo -n `md5sum --binary $BUILD/application.bin | awk '{ print $1 }'` > __md5hash.bin | |
fi | |
# 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 the unsigned binary | |
rm -f $BUILD/application.bin | |
exit $RET |