Ini signature generation (#1539)
* ini signature generator * sh->bash * decimal fix * octal fix * fix shell arrays * use the new -signature option instead of -prepend * /bin/sh Co-authored-by: Andrei <andreikagit@users.noreply.github.com>
This commit is contained in:
parent
898f03bb4c
commit
da2917deca
|
@ -11,6 +11,8 @@ rm gen_config_board.log
|
|||
|
||||
mkdir build
|
||||
|
||||
sh gen_signature.sh all
|
||||
|
||||
java -DSystemOut.name=gen_config \
|
||||
-Drusefi.generator.lazyfile.enabled=true \
|
||||
-jar ../java_tools/ConfigDefinition.jar \
|
||||
|
@ -29,6 +31,7 @@ java -DSystemOut.name=gen_config \
|
|||
-c_fsio_names controllers/generated/fsio_names.def \
|
||||
-c_fsio_strings controllers/generated/fsio_strings.def \
|
||||
-java_destination ../java_console/models/src/com/rusefi/config/generated/Fields.java \
|
||||
-signature tunerstudio/signature_all.txt \
|
||||
-romraider_destination ../java_console/rusefi.xml
|
||||
|
||||
[ $? -eq 0 ] || (echo "ERROR generating"; exit $?)
|
||||
|
@ -41,9 +44,11 @@ else
|
|||
cp -v tunerstudio/rusefi_microrusefi.ini $TS_PATH/dev_mre/projectCfg/mainController.ini
|
||||
fi
|
||||
|
||||
for BOARD in "microrusefi" "frankenso" "prometheus" "proteus"; do
|
||||
sh gen_config_board.sh $BOARD
|
||||
[ $? -eq 0 ] || (echo "ERROR generating $BOARD"; exit $?)
|
||||
for BOARD in "microrusefi mre" "frankenso fra" "prometheus pth" "proteus pro"; do
|
||||
BOARD_NAME="${BOARD% *}"
|
||||
BOARD_SHORT_NAME="${BOARD#* }"
|
||||
sh gen_config_board.sh $BOARD_NAME $BOARD_SHORT_NAME
|
||||
[ $? -eq 0 ] || (echo "ERROR generating $BOARD_NAME $BOARD_SHORT_NAME"; exit $?)
|
||||
done
|
||||
|
||||
cd config/boards/kinetis/config
|
||||
|
|
|
@ -11,8 +11,11 @@ if [ -z "$1" ]; then
|
|||
fi
|
||||
|
||||
BOARDNAME=$1
|
||||
SHORT_BOARDNAME=$2
|
||||
|
||||
echo "BOARDNAME=${BOARDNAME}"
|
||||
echo "BOARDNAME=${BOARDNAME} SHORT_BOARDNAME=${SHORT_BOARDNAME}"
|
||||
|
||||
sh gen_signature.sh ${SHORT_BOARDNAME}
|
||||
|
||||
java -DSystemOut.name=gen_config_board \
|
||||
-Drusefi.generator.lazyfile.enabled=true \
|
||||
|
@ -34,6 +37,7 @@ java -DSystemOut.name=gen_config_board \
|
|||
-cache tunerstudio/cache/${BOARDNAME} \
|
||||
-firing_order controllers/algo/firing_order.h \
|
||||
-ts_output_name rusefi_${BOARDNAME}.ini \
|
||||
-signature tunerstudio/signature_${SHORT_BOARDNAME}.txt \
|
||||
-prepend tunerstudio/${BOARDNAME}_prefix.txt \
|
||||
-prepend config/boards/${BOARDNAME}/prepend.txt
|
||||
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
#!/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")
|
||||
nanosec=${nanosec#0} # numbers starting from 0 can be treated as octal numbers
|
||||
hash=$(($nanosec % 2147483648))
|
||||
echo "#define SIGNATURE_HASH $hash" >> tunerstudio/signature_${SHORT_BOARDNAME}.txt
|
||||
|
||||
exit 0
|
|
@ -22,8 +22,7 @@
|
|||
! each field is declared as
|
||||
! type name;comment
|
||||
|
||||
|
||||
#define TS_SIGNATURE "rusEFI v1.2020.4"
|
||||
#define TS_SIGNATURE "rusEFI @@SIGNATURE_DATE@@.@@SIGNATURE_BOARD@@.@@SIGNATURE_HASH@@"
|
||||
|
||||
!
|
||||
! this is here so that rusEfi console can access it, too
|
||||
|
|
Loading…
Reference in New Issue