From b3aad5f4507122f75dbd153c8cad888f48e55f26 Mon Sep 17 00:00:00 2001 From: Roga Hagen Date: Sat, 9 Feb 2019 16:00:02 +0100 Subject: [PATCH 1/5] Select variant from list --- build.sh | 54 +++++++++++++++++++++++++++++---------------- lang/config.sh | 0 lang/fw-clean.sh | 0 lang/lang-add.sh | 0 lang/lang-check.sh | 0 lang/lang-clean.sh | 0 lang/lang-export.sh | 0 lang/lang-import.sh | 0 8 files changed, 35 insertions(+), 19 deletions(-) mode change 100644 => 100755 lang/config.sh mode change 100644 => 100755 lang/fw-clean.sh mode change 100644 => 100755 lang/lang-add.sh mode change 100644 => 100755 lang/lang-check.sh mode change 100644 => 100755 lang/lang-clean.sh mode change 100644 => 100755 lang/lang-export.sh mode change 100644 => 100755 lang/lang-import.sh diff --git a/build.sh b/build.sh index 1702ff03e6..2a20ac51cb 100755 --- a/build.sh +++ b/build.sh @@ -34,15 +34,29 @@ BUILD_ENV="1.0.1" SCRIPT_PATH="$( cd "$(dirname "$0")" ; pwd -P )" -# First argument defines which varaint of the Prusa Firmware will be compiled, like -# -if [ -z "$1" ] - then - echo "You have too choose a variant or ALL to compile all existing varaints." - exit 0 - else - VARIANT=$1 -fi + +# Select which varaint of the Prusa Firmware will be compiled, like +unset options i +PS3="Select a variant: " +while IFS= read -r -d $'\0' f; do + options[i++]="$f" +done < <(find Firmware/variants/ -maxdepth 1 -type f -name "*.h" -print0 ) +select opt in "${options[@]}" "Quiet"; do + case $opt in + *.h) + VARIANT=$(basename "$opt" ".h") + break + ;; + "Quiet") + echo "You chose to stop" + exit + ;; + *) + echo "This is not a valid variant" + ;; + esac +done + # NOT IMPLEMENTED YET. Second argument defines if it is an english only version. Format EN_ONLY EN_ONLY=$2 # Find firmware version in Configuration.h file and use it to generate the hex filename @@ -64,14 +78,16 @@ else fi # List few useful data -echo $SCRIPT_PATH -echo $VARIANT -echo "Firmware: " $FW -echo "Build #" $BUILD -echo "Dev Check:" $DEV_CHECK -echo "DEV Status:" $DEV_STATUS -echo $MOTHERBOARD -echo $OS " : " $OSTYPE +echo +echo "Script path:" $SCRIPT_PATH +echo "Variant :" $VARIANT +echo "Firmware :" $FW +echo "Build # :" $BUILD +echo "Dev Check :" $DEV_CHECK +echo "DEV Status :" $DEV_STATUS +echo "Motherboard:" $MOTHERBOARD +echo "OS :" $OS +echo "OS type :" $OSTYPE echo $2 #### Start prepare building @@ -107,10 +123,10 @@ if [ $OS == "Linux" ]; then wget https://github.com/mkbel/PF-build-env/releases/download/$BUILD_ENV/PF-build-env-Linux64-$BUILD_ENV.zip || exit 3 fi - if [ ! -d "../../PF-build-env-$BUILD_ENV" ]; then + if [ ! -d "../PF-build-env-$BUILD_ENV" ]; then echo "Unzipping Linux build enviroment..." sleep 5 - unzip PF-build-env-Linux64-$BUILD_ENV.zip -d ../../PF-build-env-$BUILD_ENV || exit 4 + unzip PF-build-env-Linux64-$BUILD_ENV.zip -d ../PF-build-env-$BUILD_ENV || exit 4 fi fi diff --git a/lang/config.sh b/lang/config.sh old mode 100644 new mode 100755 diff --git a/lang/fw-clean.sh b/lang/fw-clean.sh old mode 100644 new mode 100755 diff --git a/lang/lang-add.sh b/lang/lang-add.sh old mode 100644 new mode 100755 diff --git a/lang/lang-check.sh b/lang/lang-check.sh old mode 100644 new mode 100755 diff --git a/lang/lang-clean.sh b/lang/lang-clean.sh old mode 100644 new mode 100755 diff --git a/lang/lang-export.sh b/lang/lang-export.sh old mode 100644 new mode 100755 diff --git a/lang/lang-import.sh b/lang/lang-import.sh old mode 100644 new mode 100755 From 47e030d07adf24c95850f53c738c4919bed0d66d Mon Sep 17 00:00:00 2001 From: Roga Hagen Date: Sat, 9 Feb 2019 16:15:33 +0100 Subject: [PATCH 2/5] Clean up --- build.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 2a20ac51cb..cdb6a85f27 100755 --- a/build.sh +++ b/build.sh @@ -36,7 +36,6 @@ BUILD_ENV="1.0.1" SCRIPT_PATH="$( cd "$(dirname "$0")" ; pwd -P )" # Select which varaint of the Prusa Firmware will be compiled, like -unset options i PS3="Select a variant: " while IFS= read -r -d $'\0' f; do options[i++]="$f" @@ -87,7 +86,7 @@ echo "Dev Check :" $DEV_CHECK echo "DEV Status :" $DEV_STATUS echo "Motherboard:" $MOTHERBOARD echo "OS :" $OS -echo "OS type :" $OSTYPE +echo "OS type :" $OSTYPE echo $2 #### Start prepare building From e7e47ba969f98a63cdc150b45149a91e711f3f86 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Sun, 10 Feb 2019 12:12:18 +0100 Subject: [PATCH 3/5] Variants argument can be used again, if not you get a selection of existing variants --- build.sh | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/build.sh b/build.sh index cdb6a85f27..97ed1c0e87 100755 --- a/build.sh +++ b/build.sh @@ -35,26 +35,31 @@ BUILD_ENV="1.0.1" SCRIPT_PATH="$( cd "$(dirname "$0")" ; pwd -P )" -# Select which varaint of the Prusa Firmware will be compiled, like -PS3="Select a variant: " -while IFS= read -r -d $'\0' f; do - options[i++]="$f" -done < <(find Firmware/variants/ -maxdepth 1 -type f -name "*.h" -print0 ) -select opt in "${options[@]}" "Quiet"; do - case $opt in - *.h) - VARIANT=$(basename "$opt" ".h") - break - ;; - "Quiet") - echo "You chose to stop" - exit - ;; - *) - echo "This is not a valid variant" - ;; - esac -done +# First argument defines which varaint of the Prusa Firmware will be compiled +if [ -z "$1" ] ; then + # Select which varaint of the Prusa Firmware will be compiled, like + PS3="Select a variant: " + while IFS= read -r -d $'\0' f; do + options[i++]="$f" + done < <(find Firmware/variants/ -maxdepth 1 -type f -name "*.h" -print0 ) + select opt in "${options[@]}" "Quit"; do + case $opt in + *.h) + VARIANT=$(basename "$opt" ".h") + break + ;; + "Quit") + echo "You chose to stop" + exit + ;; + *) + echo "This is not a valid variant" + ;; + esac + done +else + VARIANT=$1 +fi # NOT IMPLEMENTED YET. Second argument defines if it is an english only version. Format EN_ONLY EN_ONLY=$2 From de305a29d2c32aede66a80ec4ef31f1c513cfaa5 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Sun, 10 Feb 2019 12:25:44 +0100 Subject: [PATCH 4/5] updated notes in build.sh --- build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build.sh b/build.sh index 97ed1c0e87..ed6e31e3ee 100755 --- a/build.sh +++ b/build.sh @@ -31,6 +31,7 @@ # 12 Jan 2019, 3d-gussner, Fixed "compiler.c.elf.flags=-w -Os -Wl,-u,vfprintf -lprintf_flt -lm -Wl,--gc-sections" in 'platform.txt' # 16 Jan 2019, 3d-gussner, Build_2, Added development check to modify 'Configuration.h' to prevent unwanted LCD messages that Firmware is uknown # 17 Jan 2019, 3d-gussner, Build_3, Check for OS Windows or Linux and use the right build enviroment +# 10 Feb 2019, ropaha, Pull Request, Select variant from list while using build.sh BUILD_ENV="1.0.1" SCRIPT_PATH="$( cd "$(dirname "$0")" ; pwd -P )" From 301b8fc8ba4e794049bc9fdd6f51bba5e42b3094 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Sun, 10 Feb 2019 13:32:38 +0100 Subject: [PATCH 5/5] preparing for 1st tests with english only --- build.sh | 56 ++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 16 deletions(-) diff --git a/build.sh b/build.sh index ed6e31e3ee..5200ed5155 100755 --- a/build.sh +++ b/build.sh @@ -32,6 +32,8 @@ # 16 Jan 2019, 3d-gussner, Build_2, Added development check to modify 'Configuration.h' to prevent unwanted LCD messages that Firmware is uknown # 17 Jan 2019, 3d-gussner, Build_3, Check for OS Windows or Linux and use the right build enviroment # 10 Feb 2019, ropaha, Pull Request, Select variant from list while using build.sh +# 10 Feb 2019, ropaha, change FW_DEV_VERSION automatically depending on FW_VERSION RC/BETA/ALPHA +# 10 Feb 2019, 3d-gussner, 1st tests with english only BUILD_ENV="1.0.1" SCRIPT_PATH="$( cd "$(dirname "$0")" ; pwd -P )" @@ -62,8 +64,13 @@ else VARIANT=$1 fi -# NOT IMPLEMENTED YET. Second argument defines if it is an english only version. Format EN_ONLY -EN_ONLY=$2 +# NOT IMPLEMENTED YET. Second argument defines if it is an english only version. Known values EN_ONLY / / ALL +if [ -z "$2" ] ; then + echo "Which lang-build do you want?" +else + LANGUAGES=$2 +fi + # Find firmware version in Configuration.h file and use it to generate the hex filename FW=$(grep --max-count=1 "\bFW_VERSION\b" Firmware/Configuration.h | sed -e's/ */ /g'|cut -d '"' -f2|sed 's/\.//g') # Find build version in Configuration.h file and use it to generate the hex filename @@ -72,15 +79,6 @@ BUILD=$(grep --max-count=1 "\bFW_COMMIT_NR\b" Firmware/Configuration.h | sed -e' MOTHERBOARD=$(grep --max-count=1 "\bMOTHERBOARD\b" Firmware/variants/$VARIANT.h | sed -e's/ */ /g' |cut -d ' ' -f3) # Check development status DEV_CHECK=$(grep --max-count=1 "\bFW_VERSION\b" Firmware/Configuration.h | sed -e's/ */ /g'|cut -d '"' -f2|sed 's/\.//g'|cut -d '-' -f2) -if [ "$DEV_CHECK" == "$FW" ] ; then - DEV_STATUS="GOLD" -else - if [[ "$DEV_CHECK" == "RC1" || "$DEV_CHECK" == "RC2" ]] ; then - DEV_STATUS="RC" - else - DEV_STATUS="UNKNOWN" - fi -fi # List few useful data echo @@ -93,7 +91,7 @@ echo "DEV Status :" $DEV_STATUS echo "Motherboard:" $MOTHERBOARD echo "OS :" $OS echo "OS type :" $OSTYPE -echo $2 +echo "Languages :" $LANGUAGES #### Start prepare building @@ -155,9 +153,33 @@ BUILD_PATH="$( pwd -P )" if [ ! -f "$SCRIPT_PATH/Firmware/Configuration_prusa.h" ]; then cp -f $SCRIPT_PATH/Firmware/variants/$VARIANT.h $SCRIPT_PATH/Firmware/Configuration_prusa.h || exit 8 fi - #if [ ! -z "$EN_ONLY" ]; then +#Prepare Configuration.h to use the correct FW_DEV_VERSION to prevent LCD messages when connecting with OctoPrint +if [ "$DEV_CHECK" == "$FW" ] ; then + DEV_STATUS="GOLD" +else + if [[ "$DEV_CHECK" == "RC1" || "$DEV_CHECK" == "RC2" ]] ; then + DEV_STATUS="RC" + sed -i -- 's/#define FW_DEV_VERSION FW_VERSION_UNKNOWN/#define FW_DEV_VERSION FW_VERSION_RC/g' $SCRIPT_PATH/Firmware/Configuration.h + + else + DEV_STATUS="UNKNOWN" + fi +fi + +#Prepare english only or multilanguage version to be build +if [ ! -z "$LANGUAGES" ] ; then + echo + echo "Multi-language firmware will be build" + echo +else + echo + echo "English language firmware will be build" + echo +fi + + +#Set FW_DEV_VERSION to development status - #Set FW_DEV_VERSION to development status #Check if compiler flags are set to Prusa specific needs for the rambo board. if [ $OS == "Windows_NT" ]; then @@ -185,8 +207,9 @@ export ARDUINO=$BUILD_ENV_PATH echo $BUILD_ENV_PATH export BUILDER=$ARDUINO/arduino-builder -sleep 5 -#read -p "Press any Enter..." +echo +read -t 10 -p "Press any Enter..." +echo if [ $OS == "Windows_NT" ]; then echo "Start to build Prusa Firmware under Windows..." @@ -242,6 +265,7 @@ echo "" echo "Restore platform.txt" echo "" cp -f $BUILD_ENV_PATH/portable/packages/$RAMBO_PLATFORM_FILE.bck $BUILD_ENV_PATH/portable/packages/$RAMBO_PLATFORM_FILE +sed -i -- 's/#define FW_DEV_VERSION FW_VERSION_*/#define FW_DEV_VERSION FW_VERSION_UNKNOWN/g' $SCRIPT_PATH/Firmware/Configuration.h # Switch to hex path and list build files cd $SCRIPT_PATH