rusefi/firmware/gen_config_board.sh

70 lines
2.9 KiB
Bash
Raw Normal View History

#!/bin/bash
2020-07-05 19:44:45 -07:00
# file gen_config_board.sh
# for example ./gen_config_board.sh hellen/hellen128 hellen128 rusefi_hellen128mercedes.ini
# or ./gen_config_board.sh hellen/hellen128 hellen128
# which is short for ./gen_config_board.sh hellen/hellen128 hellen128 rusefi_hellen128.ini
2020-07-05 19:44:45 -07:00
set -e
2020-07-05 19:39:55 -07:00
echo "This script reads rusefi_config.txt and produces firmware persistent configuration headers"
echo "the storage section of rusefiXXX.ini is updated as well"
if [ -z "$1" ]; then
echo "Board name parameter expected"
exit 1
fi
BOARDNAME=$1
SHORT_BOARDNAME=$2
if [ -n "$3" ]; then
INI="$3"
else
INI="rusefi_${SHORT_BOARDNAME}.ini"
fi
echo "BOARDNAME=${BOARDNAME} SHORT_BOARDNAME=${SHORT_BOARDNAME}"
bash gen_signature.sh ${SHORT_BOARDNAME}
PREPEND_FILE=config/boards/${BOARDNAME}/prepend.txt
BOARD_SPECIFIC_URL=$(cat $PREPEND_FILE | grep MAIN_HELP_URL | cut -d " " -f 3 | sed -e 's/^"//' -e 's/"$//')
2021-07-30 16:33:31 -07:00
echo "BOARD_SPECIFIC_URL=[$BOARD_SPECIFIC_URL] for [$BOARDNAME] as [$SHORT_BOARDNAME]"
if [ "" = "$BOARD_SPECIFIC_URL" ]; then
BOARD_SPECIFIC_URL=https://rusefi.com/s/wiki
fi
echo "BOARD_SPECIFIC_URL=[$BOARD_SPECIFIC_URL]"
source gen_config_common.sh
echo "Using COMMON_GEN_CONFIG [$COMMON_GEN_CONFIG]"
2020-07-05 21:29:30 -07:00
# work in progress: migrating to rusefi_${BUNDLE_NAME}.txt
# in rare cases order of arguments is important - '-tool' should be specified before '-definition'
2021-10-23 17:18:09 -07:00
java -DSystemOut.name=logs/gen_config_board \
$COMMON_GEN_CONFIG_PREFIX \
-tool gen_config.sh \
$COMMON_GEN_CONFIG \
2021-07-30 13:54:55 -07:00
-romraider integration \
-field_lookup_file controllers/lua/generated/value_lookup_generated.cpp \
2021-07-30 13:54:55 -07:00
-java_destination ../java_console/models/src/main/java/com/rusefi/config/generated/Fields.java \
-enumInputFile controllers/algo/rusefi_hw_enums.h \
2021-07-30 14:15:01 -07:00
-romraider_destination ../java_console/rusefi.xml \
-c_defines controllers/generated/rusefi_generated.h \
-c_destination controllers/generated/engine_configuration_generated_structures.h \
-prepend $PREPEND_FILE
2020-07-05 21:29:30 -07:00
Convert jenkins build_extra_bundles scripts to sh (#1554) * Add checkout * remove empty with statement * Actually we do need push depth * convert build_working_folder * convert prepare_bundle * fixed extension * fixed closing bracket * fixed comparison and assignments * no comment * convert compile_and_upload and clean * convert build_simulator * Finish converting build_working_folder * convert build_java_console * Add hashbangs * remove findcyg instruction * changed paths * remove call * add path * fixed script names * add prams * fix cd * convert clean_env_variables * convert common_make.sh * Added linux hex2dfu binary * add file extension to linux hex2dfu * add file extension to linux hex2dfu * remove spurious paren * fixed board name * convert compile-frankenso-na6 * convert compile-frankenso-pal * add hashbang * convert compile-kinetis * convert compile-mre-f4 * convert compile-mre-f4-hardware-QC-special-build * convert compile-mre-f4-slave * convert compile-mre-f7 * convert compile-mre-f7-test * switch to underscores * converting boards to sh * convert prometheus * convert proteus * fixed path * switch to underscores * chmod and add extension * add quotes * Add check for Windows * Add chmod * fix script name * fix error checking * quote vars * remove checking from batch shims * fix typo * change error checking to support nix style error codes * switch to 1 retval * cd back to firmware * Add escapes * change from cd to rel path * add p flags to mkdir Co-authored-by: David Holdeman <David Holdeman>
2020-07-01 11:09:01 -07:00
[ $? -eq 0 ] || { echo "ERROR generating TunerStudio config for ${BOARDNAME}"; exit 1; }
2022-05-10 14:55:47 -07:00
# we generate both versions of the header but only one would be actually included due to conditional compilation see EFI_USE_COMPRESSED_INI_MSD
# todo: make things consistent by
# 0) having generated content not in the same folder with the tool generating content?
# 1) using unique file name for each configuration?
2021-05-07 16:18:43 -07:00
# 2) leverage consistent caching mechanism so that image is generated only in case of fresh .ini. Laziest approach would be to return exit code from java process above
#
hw_layer/mass_storage/create_ini_image.sh ./tunerstudio/generated/${INI} ./hw_layer/mass_storage/ramdisk_image.h 128 ${SHORT_BOARDNAME} ${BOARD_SPECIFIC_URL}
hw_layer/mass_storage/create_ini_image_compressed.sh ./tunerstudio/generated/${INI} ./hw_layer/mass_storage/ramdisk_image_compressed.h 1088 ${SHORT_BOARDNAME} ${BOARD_SPECIFIC_URL}
exit 0