2020-06-28 10:39:09 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
SHORT_BOARDNAME=$1
|
|
|
|
|
|
|
|
echo "Generating signature for ${SHORT_BOARDNAME}"
|
|
|
|
|
|
|
|
# generate a unique signature
|
|
|
|
date=$(date +"%Y.%m.%d")
|
|
|
|
echo "#define SIGNATURE_DATE $date" > tunerstudio/signature_${SHORT_BOARDNAME}.txt
|
|
|
|
echo "#define SIGNATURE_BOARD ${SHORT_BOARDNAME}" >> tunerstudio/signature_${SHORT_BOARDNAME}.txt
|
|
|
|
|
|
|
|
nanosec=$(date +"%N")
|
2020-07-02 05:16:18 -07:00
|
|
|
# prevent octal numbers once and for all
|
|
|
|
nanosec="1$nanosec"
|
2020-06-28 10:39:09 -07:00
|
|
|
hash=$(($nanosec % 2147483648))
|
|
|
|
echo "#define SIGNATURE_HASH $hash" >> tunerstudio/signature_${SHORT_BOARDNAME}.txt
|
|
|
|
|
|
|
|
exit 0
|