diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b4c8e4a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +test-scratch.sh \ No newline at end of file diff --git a/README.md b/README.md index 2696dec..85de608 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ # esp-idf custom installer/reinstaller installs/reinstalls full esp-idf with my own additions on linux. -pulls from master so its the very latest \ No newline at end of file +pulls from master so its the very latest + +built for debian-like systems + +`git clone https://github.com/PrincessPi3/esp-install-custom.git ~` +`bash ~/reinstall-esp-idf.sh` \ No newline at end of file diff --git a/add-to-export-sh.txt b/add-to-export-sh.txt index 70cfdbe..afb4d4b 100644 --- a/add-to-export-sh.txt +++ b/add-to-export-sh.txt @@ -24,20 +24,21 @@ ttyselect=$devarr[(($tty+1))] echo "Set esp target (esp32, esp32s3, esp32c6, esp8266, etc)" read esp -ESPPORT="$ttyselect" +# ESPPORT="${ttyselect}" echo "Setting environment variables" -echo "Adding Custom bins to PATH:" -export PATH=~/esp/.custom_bin:$PATH -echo "ESPPORT = $ESPPORT" -export ESPPORT -export ESPBAUD=921600 -echo "ESPBAUD = $ESPBAUD" -export ESPTARGET=$esp -echo "ESPTARGET = $ESPTARGET" +echo "Adding Custom bins to PATH" +export PATH="${HOME}/esp/.custom_bin:${PATH}" +echo "ESPPORT = ${ESPPORT}" +export ESPPORT="${ttyselect}" +export ESPBAUD=460800 -echo "Changing dir to ~/esp" -cd ~/esp +echo "ESPBAUD = ${ESPBAUD}" +export ESPTARGET=$esp +echo "ESPTARGET = ${ESPTARGET}" + +echo "Changing dir to ${HOME}/esp" +cd "${HOME}/esp" echo "\nAll done :3\n" diff --git a/.custom_bin/build b/custom_bin/build similarity index 100% rename from .custom_bin/build rename to custom_bin/build diff --git a/custom_bin/changebaud b/custom_bin/changebaud new file mode 100644 index 0000000..63df161 --- /dev/null +++ b/custom_bin/changebaud @@ -0,0 +1,31 @@ +#!/bin/bash + +echo -e "\nChanging ESPBAUD\n" +read -p "Select New Baudrate:\n\t1: 9600\n\t2: 115200\n\t3: 230400\n\t4: 460800\n\t5: 1152000\n\t6: 1500000\nDefault: ${ESPBAUD}" baud + +baud=${baud:-$ESPBAUD} + +echo "Select New Baudrate:\n\t1: 9600\n\t2: 115200\n\t3: 230400\n\t4: 460800\n\t5: 1152000\n\t6: 1500000" +read baud +if [ "${baud}" == 1 ]; then + selection=9600 +elif [ "${baud}" == 2 ]; then + selection=115200 +elif [ "${baud}" == 3 ]; then + selection=230400 +elif [ "${baud}" == 4 ]; then + selection=460800 +elif [ "${baud}" == 5 ]; then + selection=1152000 +elif [ "${baud}" == 5 ]; then + selection=1152000 +elif [ "${baud}" == 6 ]; then + selection=1500000 +else + echo "\nBad Selection\n" + return +fi + +export ESPBAUD=$selection + +echo "\nAll done :3\n" \ No newline at end of file diff --git a/custom_bin/changeesp b/custom_bin/changeesp new file mode 100644 index 0000000..88ef110 --- /dev/null +++ b/custom_bin/changeesp @@ -0,0 +1,8 @@ +echo "\nChanging ESPTARGET\n" +echo "Set esp target (esp32, esp32s3, esp32c6, esp8266, etc)" +read esp + +export ESPTARGET="${esp}" + +echo "\nESPTARGET set to ${ESPTARGET}\n" +echo "\nall done :3\n" \ No newline at end of file diff --git a/custom_bin/changeport b/custom_bin/changeport new file mode 100644 index 0000000..915aeb4 --- /dev/null +++ b/custom_bin/changeport @@ -0,0 +1,16 @@ +echo "\nChanging ESPPORT\n" +echo "TTY devices found in dmesg:" +COUNTER=0 +devarr=() +for line in $(dmesg | tail -50 | grep -o -E "tty[A-Z]{3}[0-9]{0,2}" | sort -u); do + echo "$COUNTER /dev/$line" + devarr+=("/dev/$line") + COUNTER=$((COUNTER+1)) +done + +echo "\nEnter TTY Number You'd Like:" +read tty +ttyselect=$devarr[(($tty+1))] +export ESPPORT="${ttyselect}" +echo "\nESPPORT set to ${ESPPORT}\n" +echo "\nall done :3\n" \ No newline at end of file diff --git a/.custom_bin/clean b/custom_bin/clean similarity index 100% rename from .custom_bin/clean rename to custom_bin/clean diff --git a/.custom_bin/flashmonitor b/custom_bin/flashmonitor similarity index 100% rename from .custom_bin/flashmonitor rename to custom_bin/flashmonitor diff --git a/.custom_bin/fullclean b/custom_bin/fullclean similarity index 100% rename from .custom_bin/fullclean rename to custom_bin/fullclean diff --git a/.custom_bin/menuconfig b/custom_bin/menuconfig similarity index 100% rename from .custom_bin/menuconfig rename to custom_bin/menuconfig diff --git a/.custom_bin/rebuildfull b/custom_bin/rebuildfull similarity index 100% rename from .custom_bin/rebuildfull rename to custom_bin/rebuildfull diff --git a/.custom_bin/setup b/custom_bin/setup similarity index 100% rename from .custom_bin/setup rename to custom_bin/setup diff --git a/reinstall-esp-idf.sh b/reinstall-esp-idf.sh index cf0b8fb..f5292a2 100644 --- a/reinstall-esp-idf.sh +++ b/reinstall-esp-idf.sh @@ -1,5 +1,4 @@ #!/bin/bash -set -e # exit on any error runningDir="$( cd "$( dirname "$0" )" && pwd )" @@ -18,6 +17,7 @@ idfDir="${installDir}/esp-idf" echo -e "\nInstalling to ${installDir} esp-idf path will be ${idfDir}\n" echo -e "\nCleaning up environment\n" + if ! [ -d $installDir ]; then echo -e "\n${installDir} not found, creating\n" mkdir $installDir @@ -47,27 +47,28 @@ else fi echo -e "\nPlacing and enabeling custom bins\n" -cp -r "${runningDir}/.custom_bin" $installDir -chmod +x "${installDir}/.custom_bin/"* +cp -r "${runningDir}/custom_bin" "${installDir}/.custom_bin" +chmod -R +x "${installDir}/.custom_bin" echo -e "\nPulling latest esp-idf code from github\n" git clone --recursive --jobs 5 https://github.com/espressif/esp-idf.git $idfDir echo -e "\nRunning install script\n" -bash "${idfDir}/install.sh all" +bash $idfDir/install.sh all echo -e "\nInstalling optional tools\n" -python "${idfDir}/tools/idf_tools.py install all" +python $idfDir/tools/idf_tools.py install all if ! [ -z $(alias | grep get_idf) ]; then echo -e "\nget_idf alias not found, appending to ${HOME}/.zshrc\n" - echo "alias get_idf='. ${idfDir}export.sh'" >> ~/.zshrc + echo "alias get_idf='. ${idfDir}/export.sh'" >> "${HOME}/.zshrc" else echo -e "\nget_idf alias already installed, skipping\n" fi echo -e "\nMaking a backup of ${idfDir}/export.sh to ${idfDir}/export.sh.bak\n" + cp "${idfDir}/export.sh" "${idfDir}/export.sh.bak" echo -e "\nEditing ${idfDir}/export.sh\n" @@ -79,8 +80,8 @@ cat "${runningDir}/add-to-export-sh.txt" >> "${idfDir}/export.sh" echo -e "\nCreating version/commit and date file at ${idfDir}/version-date.txt\n" datestamp=$(date +"%A, %B %-d %Y at %r %Z (epoch %s)") -commitHash=$(git -C "${idfDir} rev-parse HEAD") -gitBranch=$(git -C "${idfDir} rev-parse --abbrev-ref HEAD") +commitHash=$(git -C "${idfDir}" rev-parse HEAD) +gitBranch=$(git -C "${idfDir}" rev-parse --abbrev-ref HEAD) echo -e "Installed at:\n\t${datestamp}\n\tat commit ${commitHash}\n\tfrom branch ${gitBranch}\n\tsource: https://github.com/espressif/esp-idf" > "${idfDir}/version-data.txt"