Fixed spelling errors in PF-build.sh

This commit is contained in:
Andrew Luebke 2019-04-05 14:53:33 -07:00
parent fd96bde69f
commit 99d6c74999

View File

@ -1,12 +1,12 @@
#!/bin/bash #!/bin/bash
# This bash script is used to compile automatically the Prusa firmware with a dedecated build enviroment and settings # This bash script is used to compile automatically the Prusa firmware with a dedicated build environment and settings
# #
# Supported OS: Windows 10, Linux64 bit # Supported OS: Windows 10, Linux64 bit
# #
# Linux: # Linux:
# #
# Windows: # Windows:
# To excecute this sciprt you gonna need few things on your Windows machine # To execute this script you gonna need few things on your Windows machine
# #
# Linux Subsystem Ubuntu # Linux Subsystem Ubuntu
# 1. Follow these instructions # 1. Follow these instructions
@ -28,15 +28,15 @@
# 4. Run git Bash under Administrator privilege and navigate to the directory /c/Program Files/Git/mingw64/bin, # 4. Run git Bash under Administrator privilege and navigate to the directory /c/Program Files/Git/mingw64/bin,
# you can run the command ln -s /c/Program Files/7-Zip/7z.exe zip.exe # you can run the command ln -s /c/Program Files/7-Zip/7z.exe zip.exe
# #
# Usefull things to edit and compare your custom Firmware # Useful things to edit and compare your custom Firmware
# 1. Download and install current and correct (64bit or 32bit) Notepad++ version https://notepad-plus-plus.org/download # 1. Download and install current and correct (64bit or 32bit) Notepad++ version https://notepad-plus-plus.org/download
# 2. Another great tool to compare your custom mod and stock firmware is WinMerge http://winmerge.org/downloads/?lang=en # 2. Another great tool to compare your custom mod and stock firmware is WinMerge http://winmerge.org/downloads/?lang=en
# #
# Example for MK3: open git bash and chage to your Firmware directory # Example for MK3: open git bash and change to your Firmware directory
# <username>@<machinename> MINGW64 /<drive>/path # <username>@<machinename> MINGW64 /<drive>/path
# bash build.sh 1_75mm_MK3-EINSy10a-E3Dv6full # bash build.sh 1_75mm_MK3-EINSy10a-E3Dv6full
# #
# Example for MK25: open git bash and chage to your directory # Example for MK25: open git bash and change to your directory
# gussner@WIN01 MINGW64 /d/Data/Prusa-Firmware/MK3 # gussner@WIN01 MINGW64 /d/Data/Prusa-Firmware/MK3
# bash build.sh 1_75mm_MK25-RAMBo13a-E3Dv6full # bash build.sh 1_75mm_MK25-RAMBo13a-E3Dv6full
# #
@ -47,7 +47,7 @@
# Version: 1.0.1-Build_8 # Version: 1.0.1-Build_8
# Change log: # Change log:
# 12 Jan 2019, 3d-gussner, Fixed "compiler.c.elf.flags=-w -Os -Wl,-u,vfprintf -lprintf_flt -lm -Wl,--gc-sections" in 'platform.txt' # 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 # 16 Jan 2019, 3d-gussner, Build_2, Added development check to modify 'Configuration.h' to prevent unwanted LCD messages that Firmware is unknown
# 17 Jan 2019, 3d-gussner, Build_3, Check for OS Windows or Linux and use the right build enviroment # 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, 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, ropaha, change FW_DEV_VERSION automatically depending on FW_VERSION RC/BETA/ALPHA
@ -96,7 +96,7 @@ else
exit exit
fi fi
sleep 2 sleep 2
###Prepare bash enviroment and check if wget and zip are availible ###Prepare bash enviroment and check if wget and zip are available
if ! type wget > /dev/null; then if ! type wget > /dev/null; then
echo "$(tput setaf 1)Missing 'wget' which is important to run this script" echo "$(tput setaf 1)Missing 'wget' which is important to run this script"
echo "Please follow these instructions https://gist.github.com/evanwill/0207876c3243bbb6863e65ec5dc3f058 to install wget$(tput sgr0)" echo "Please follow these instructions https://gist.github.com/evanwill/0207876c3243bbb6863e65ec5dc3f058 to install wget$(tput sgr0)"
@ -139,7 +139,7 @@ fi
cd ../build-env || exit 3 cd ../build-env || exit 3
# Check if PF-build-env-<version> exists and downloads + creates it if not # Check if PF-build-env-<version> exists and downloads + creates it if not
# The build enviroment is based on the Arduino IDE 1.8.5 portal vesion with some changes # The build enviroment is based on the Arduino IDE 1.8.5 portal version with some changes
if [ ! -d "../PF-build-env-$BUILD_ENV" ]; then if [ ! -d "../PF-build-env-$BUILD_ENV" ]; then
echo "$(tput setaf 6)PF-build-env-$BUILD_ENV is missing ... creating it now for you$(tput sgr 0)" echo "$(tput setaf 6)PF-build-env-$BUILD_ENV is missing ... creating it now for you$(tput sgr 0)"
mkdir ../PF-build-env-$BUILD_ENV mkdir ../PF-build-env-$BUILD_ENV
@ -148,14 +148,14 @@ fi
if [ $OSTYPE == "msys" ]; then if [ $OSTYPE == "msys" ]; then
if [ ! -f "PF-build-env-Win-$BUILD_ENV.zip" ]; then if [ ! -f "PF-build-env-Win-$BUILD_ENV.zip" ]; then
echo "$(tput setaf 6)Downloding Windows build enviroment...$(tput setaf 2)" echo "$(tput setaf 6)Downlaoding Windows build environment...$(tput setaf 2)"
sleep 2 sleep 2
wget https://github.com/3d-gussner/PF-build-env/releases/download/Win-$BUILD_ENV/PF-build-env-Win-$BUILD_ENV.zip || exit 4 wget https://github.com/3d-gussner/PF-build-env/releases/download/Win-$BUILD_ENV/PF-build-env-Win-$BUILD_ENV.zip || exit 4
#cp -f ../../PF-build-env/PF-build-env-Win-$BUILD_ENV.zip PF-build-env-Win-$BUILD_ENV.zip || exit4 #cp -f ../../PF-build-env/PF-build-env-Win-$BUILD_ENV.zip PF-build-env-Win-$BUILD_ENV.zip || exit4
echo "$(tput sgr 0)" echo "$(tput sgr 0)"
fi fi
if [ ! -d "../PF-build-env-$BUILD_ENV/$OSTYPE" ]; then if [ ! -d "../PF-build-env-$BUILD_ENV/$OSTYPE" ]; then
echo "$(tput setaf 6)Unzipping Windows build enviroment...$(tput setaf 2)" echo "$(tput setaf 6)Unzipping Windows build environment...$(tput setaf 2)"
sleep 2 sleep 2
unzip PF-build-env-Win-$BUILD_ENV.zip -d ../PF-build-env-$BUILD_ENV/$OSTYPE || exit 4 unzip PF-build-env-Win-$BUILD_ENV.zip -d ../PF-build-env-$BUILD_ENV/$OSTYPE || exit 4
echo "$(tput sgr0)" echo "$(tput sgr0)"
@ -165,7 +165,7 @@ fi
if [ $OSTYPE == "linux-gnu" ]; then if [ $OSTYPE == "linux-gnu" ]; then
if [ ! -f "PF-build-env-Linux64-$BUILD_ENV.zip" ]; then if [ ! -f "PF-build-env-Linux64-$BUILD_ENV.zip" ]; then
echo "$(tput setaf 6)Downloading Linux 64 build enviroment...$(tput setaf 2)" echo "$(tput setaf 6)Downloading Linux 64 build environment...$(tput setaf 2)"
sleep 2 sleep 2
wget https://github.com/mkbel/PF-build-env/releases/download/$BUILD_ENV/PF-build-env-Linux64-$BUILD_ENV.zip || exit 3 wget https://github.com/mkbel/PF-build-env/releases/download/$BUILD_ENV/PF-build-env-Linux64-$BUILD_ENV.zip || exit 3
echo "$(tput sgr0)" echo "$(tput sgr0)"
@ -180,9 +180,9 @@ if [ $OSTYPE == "linux-gnu" ]; then
fi fi
cd $SCRIPT_PATH cd $SCRIPT_PATH
# First argument defines which varaint of the Prusa Firmware will be compiled # First argument defines which variant of the Prusa Firmware will be compiled
if [ -z "$1" ] ; then if [ -z "$1" ] ; then
# Select which varaint of the Prusa Firmware will be compiled, like # Select which variant of the Prusa Firmware will be compiled, like
PS3="Select a variant: " PS3="Select a variant: "
while IFS= read -r -d $'\0' f; do while IFS= read -r -d $'\0' f; do
options[i++]="$f" options[i++]="$f"
@ -248,7 +248,7 @@ else
if [[ "$2" == "ALL" || "$2" == "EN_ONLY" ]] ; then if [[ "$2" == "ALL" || "$2" == "EN_ONLY" ]] ; then
LANGUAGES=$2 LANGUAGES=$2
else else
echo "$(tput setaf 1)Language agrument is wrong!$(tput sgr0)" echo "$(tput setaf 1)Language argument is wrong!$(tput sgr0)"
echo "Only $(tput setaf 2)'ALL'$(tput sgr0) or $(tput setaf 2)'EN_ONLY'$(tput sgr0) are allowed as 2nd argument!" echo "Only $(tput setaf 2)'ALL'$(tput sgr0) or $(tput setaf 2)'EN_ONLY'$(tput sgr0) are allowed as 2nd argument!"
exit exit
fi fi
@ -270,7 +270,7 @@ BUILD_ENV_PATH="$( pwd -P )"
cd ../.. cd ../..
#Checkif BUILD_PATH exisits and if not creates it #Checkif BUILD_PATH exists and if not creates it
if [ ! -d "Prusa-Firmware-build" ]; then if [ ! -d "Prusa-Firmware-build" ]; then
mkdir Prusa-Firmware-build || exit 6 mkdir Prusa-Firmware-build || exit 6
fi fi
@ -286,7 +286,7 @@ do
FW=$(grep --max-count=1 "\bFW_VERSION\b" $SCRIPT_PATH/Firmware/Configuration.h | sed -e's/ */ /g'|cut -d '"' -f2|sed 's/\.//g') FW=$(grep --max-count=1 "\bFW_VERSION\b" $SCRIPT_PATH/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 # Find build version in Configuration.h file and use it to generate the hex filename
BUILD=$(grep --max-count=1 "\bFW_COMMIT_NR\b" $SCRIPT_PATH/Firmware/Configuration.h | sed -e's/ */ /g'|cut -d ' ' -f3) BUILD=$(grep --max-count=1 "\bFW_COMMIT_NR\b" $SCRIPT_PATH/Firmware/Configuration.h | sed -e's/ */ /g'|cut -d ' ' -f3)
# Check if the motherboard is an EINSY and if so the only one hex file will generated # Check if the motherboard is an EINSY and if so only one hex file will generated
MOTHERBOARD=$(grep --max-count=1 "\bMOTHERBOARD\b" $SCRIPT_PATH/Firmware/variants/$VARIANT.h | sed -e's/ */ /g' |cut -d ' ' -f3) MOTHERBOARD=$(grep --max-count=1 "\bMOTHERBOARD\b" $SCRIPT_PATH/Firmware/variants/$VARIANT.h | sed -e's/ */ /g' |cut -d ' ' -f3)
# Check development status # Check development status
DEV_CHECK=$(grep --max-count=1 "\bFW_VERSION\b" $SCRIPT_PATH/Firmware/Configuration.h | sed -e's/ */ /g'|cut -d '"' -f2|sed 's/\.//g'|cut -d '-' -f2) DEV_CHECK=$(grep --max-count=1 "\bFW_VERSION\b" $SCRIPT_PATH/Firmware/Configuration.h | sed -e's/ */ /g'|cut -d '"' -f2|sed 's/\.//g'|cut -d '-' -f2)
@ -333,22 +333,22 @@ do
fi fi
OUTPUT_FOLDER="Hex-files/FW$FW-Build$BUILD/$MOTHERBOARD" OUTPUT_FOLDER="Hex-files/FW$FW-Build$BUILD/$MOTHERBOARD"
#Check if exacly the same hexfile already exsits #Check if exactly the same hexfile already exists
if [[ -f "$SCRIPT_PATH/../$OUTPUT_FOLDER/FW$FW-Build$BUILD-$VARIANT.hex" && "$LANGUAGES" == "ALL" ]]; then if [[ -f "$SCRIPT_PATH/../$OUTPUT_FOLDER/FW$FW-Build$BUILD-$VARIANT.hex" && "$LANGUAGES" == "ALL" ]]; then
echo "" echo ""
ls -1 $SCRIPT_PATH/../$OUTPUT_FOLDER/FW$FW-Build$BUILD-$VARIANT.hex | xargs -n1 basename ls -1 $SCRIPT_PATH/../$OUTPUT_FOLDER/FW$FW-Build$BUILD-$VARIANT.hex | xargs -n1 basename
echo "$(tput setaf 6)This hex file to be comiled already exsits! To cancle this process press CRTL+C and rename existing hex file.$(tput sgr 0)" echo "$(tput setaf 6)This hex file to be compiled already exists! To cancel this process press CRTL+C and rename existing hex file.$(tput sgr 0)"
read -t 10 -p "Press Enter to continue..." read -t 10 -p "Press Enter to continue..."
elif [[ -f "$SCRIPT_PATH/../$OUTPUT_FOLDER/FW$FW-Build$BUILD-$VARIANT-EN_ONLY.hex" && "$LANGUAGES" == "EN_ONLY" ]]; then elif [[ -f "$SCRIPT_PATH/../$OUTPUT_FOLDER/FW$FW-Build$BUILD-$VARIANT-EN_ONLY.hex" && "$LANGUAGES" == "EN_ONLY" ]]; then
echo "" echo ""
ls -1 $SCRIPT_PATH/../$OUTPUT_FOLDER/FW$FW-Build$BUILD-$VARIANT-EN_ONLY.hex | xargs -n1 basename ls -1 $SCRIPT_PATH/../$OUTPUT_FOLDER/FW$FW-Build$BUILD-$VARIANT-EN_ONLY.hex | xargs -n1 basename
echo "$(tput setaf 6)This hex file to be comiled already exsits! To cancle this process press CRTL+C and rename existing hex file.$(tput sgr 0)" echo "$(tput setaf 6)This hex file to be compiled already exists! To cancel this process press CRTL+C and rename existing hex file.$(tput sgr 0)"
read -t 10 -p "Press Enter to continue..." read -t 10 -p "Press Enter to continue..."
fi fi
if [[ -f "$SCRIPT_PATH/../$OUTPUT_FOLDER/FW$FW-Build$BUILD-$VARIANT.zip" && "$LANGUAGES" == "ALL" ]]; then if [[ -f "$SCRIPT_PATH/../$OUTPUT_FOLDER/FW$FW-Build$BUILD-$VARIANT.zip" && "$LANGUAGES" == "ALL" ]]; then
echo "" echo ""
ls -1 $SCRIPT_PATH/../$OUTPUT_FOLDER/FW$FW-Build$BUILD-$VARIANT.zip | xargs -n1 basename ls -1 $SCRIPT_PATH/../$OUTPUT_FOLDER/FW$FW-Build$BUILD-$VARIANT.zip | xargs -n1 basename
echo "$(tput setaf 6)This zip file to be comiled already exsits! To cancle this process press CRTL+C and rename existing hex file.$(tput sgr 0)" echo "$(tput setaf 6)This zip file to be compiled already exists! To cancel this process press CRTL+C and rename existing hex file.$(tput sgr 0)"
read -t 10 -p "Press Enter to continue..." read -t 10 -p "Press Enter to continue..."
fi fi
@ -382,11 +382,11 @@ do
#Prepare english only or multilanguage version to be build #Prepare english only or multilanguage version to be build
if [ $LANGUAGES == "ALL" ]; then if [ $LANGUAGES == "ALL" ]; then
echo " " echo " "
echo "Multi-language firmware will be build" echo "Multi-language firmware will be built"
echo " " echo " "
else else
echo " " echo " "
echo "English only language firmware will be build" echo "English only language firmware will be built"
echo " " echo " "
fi fi
@ -439,14 +439,14 @@ do
if [ $LANGUAGES == "ALL" ]; then if [ $LANGUAGES == "ALL" ]; then
echo "$(tput setaf 2)" echo "$(tput setaf 2)"
echo "Building mutli language firmware" $MULTI_LANGUAGE_CHECK echo "Building multi language firmware" $MULTI_LANGUAGE_CHECK
echo "$(tput sgr 0)" echo "$(tput sgr 0)"
sleep 2 sleep 2
cd $SCRIPT_PATH/lang cd $SCRIPT_PATH/lang
echo "$(tput setaf 3)" echo "$(tput setaf 3)"
./config.sh || exit 15 ./config.sh || exit 15
echo "$(tput sgr 0)" echo "$(tput sgr 0)"
# Check if privious languages and firmware build exist and if so clean them up # Check if previous languages and firmware build exist and if so clean them up
if [ -f "lang_en.tmp" ]; then if [ -f "lang_en.tmp" ]; then
echo "" echo ""
echo "$(tput setaf 6)Previous lang build files already exist these will be cleaned up in 10 seconds.$(tput sgr 0)" echo "$(tput setaf 6)Previous lang build files already exist these will be cleaned up in 10 seconds.$(tput sgr 0)"
@ -469,7 +469,7 @@ do
# Combine compiled firmware with languages # Combine compiled firmware with languages
./fw-build.sh || exit 17 ./fw-build.sh || exit 17
echo "$(tput sgr 0)" echo "$(tput sgr 0)"
# Check if the motherboard is an EINSY and if so the only one hex file will generated # Check if the motherboard is an EINSY and if so only one hex file will generated
MOTHERBOARD=$(grep --max-count=1 "\bMOTHERBOARD\b" $SCRIPT_PATH/Firmware/variants/$VARIANT.h | sed -e's/ */ /g' |cut -d ' ' -f3) MOTHERBOARD=$(grep --max-count=1 "\bMOTHERBOARD\b" $SCRIPT_PATH/Firmware/variants/$VARIANT.h | sed -e's/ */ /g' |cut -d ' ' -f3)
# If the motherboard is an EINSY just copy one hexfile # If the motherboard is an EINSY just copy one hexfile
if [ "$MOTHERBOARD" = "BOARD_EINSY_1_0a" ]; then if [ "$MOTHERBOARD" = "BOARD_EINSY_1_0a" ]; then