commit 0f21b03a1f9eeef98623f599bbb0f72ddb34b6ea Author: PrincessPi3 Date: Tue Oct 15 01:37:33 2024 -0600 initial commit diff --git a/.custom_bin/build b/.custom_bin/build new file mode 100644 index 0000000..685ed81 --- /dev/null +++ b/.custom_bin/build @@ -0,0 +1 @@ +idf.py build diff --git a/.custom_bin/flashmonitor b/.custom_bin/flashmonitor new file mode 100644 index 0000000..0054388 --- /dev/null +++ b/.custom_bin/flashmonitor @@ -0,0 +1 @@ +idf.py flash monitor diff --git a/.custom_bin/fullclean b/.custom_bin/fullclean new file mode 100644 index 0000000..c6f9eea --- /dev/null +++ b/.custom_bin/fullclean @@ -0,0 +1 @@ +idf.py fullclean && rmdir build && rm sdkconfig sdkconfig.old diff --git a/.custom_bin/fullcleanrebuild b/.custom_bin/fullcleanrebuild new file mode 100644 index 0000000..0ac67a3 --- /dev/null +++ b/.custom_bin/fullcleanrebuild @@ -0,0 +1,17 @@ +idf.py fullclean + +if [ -f build ]; then + rm -rf build +fi + +if [ -f sdkconfig ]; then + rm sdkconfig +fi + +if [ -f sdkconfig.old ]; then + rm sdkconfig.old +fi + +idf.py set-target $ESPTARGET +idf.py menuconfig +idf.py build diff --git a/.custom_bin/setup b/.custom_bin/setup new file mode 100644 index 0000000..d507126 --- /dev/null +++ b/.custom_bin/setup @@ -0,0 +1,2 @@ +idf.py set-target $ESPTARGET +idf.py menuconfig \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..2696dec --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# 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 diff --git a/add-to-export-sh.txt b/add-to-export-sh.txt new file mode 100644 index 0000000..db220dd --- /dev/null +++ b/add-to-export-sh.txt @@ -0,0 +1,46 @@ +############################################### +# begin esp-idf stuffss I made ################ +############################################### + + +echo "\n=======CUSTOM=======\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))] + +ESPPORT="$ttyselect" +echo "Changing dir to ~/esp" +cd ~/esp + +echo "Setting environment variables" +echo "ESPPORT = $ESPPORT" +export ESPPORT +export ESPBAUD=921600 +echo "ESPBAUD = $ESPBAUD" + +echo "Adding Custom bins to PATH:" +export PATH=~/esp/.custom_bin:$PATH + +echo "Set esp target (esp32, esp32s3, esp32c6, esp8266, etc)" +read $esp + +export ESPTARGET=$esp +echo "ESPTARGET = $ESPTARGET" + +echo "All done :3 Enjoy your esp-idf environment" + +############################################### +# end esp-idf stuffss I made ################## +############################################### + + diff --git a/reinstall-esp-idf.sh b/reinstall-esp-idf.sh new file mode 100644 index 0000000..8d5489d --- /dev/null +++ b/reinstall-esp-idf.sh @@ -0,0 +1,63 @@ +echo "===== LFGGGGGGGG ======" + +echo "Setting up environment" +current_dir=$PWD + +echo "cleaning up environment" +if ! [ -d ~/esp ]; then + echo "~/esp not found, creating\n" + mkdir ~/esp + else + echo "~/esp found, skipping\n" +fi + +if [ -d ~/esp/esp-idf ]; then + echo "~/esp/esp-idf found, deleting\n" + rm -rf ~/esp/esp-idf + else + echo "~/esp/esp-idf not found, skipping\n" +fi + +if [ -d ~/.espressif ]; then + echo "~/.espressif found, deleting\n" + rm -rf ~/.espressif + else + echo "~/.espressif not found, skipping\n" +fi + +if [ -d ~/esp/.custom_bin ]; then + echo "~/esp/.custom_bin found, deleting\n" + rm -rf ~/esp/.custom_bin +fi + +echo "\n\nPlacing and enablig custom bins\n\n" +cp -r .custom_bin ~/esp +chmod +x ~/esp/.custom_bin/* + +echo "\n\nPulling latest esp-idf code from github\n\n" +git clone --recursive --jobs 5 https://github.com/espressif/esp-idf.git ~/esp/esp-idf + +echo "\n\nRunning install script\n\n" +~/esp/esp-idf/install.sh all --enable-* + +echo "\n\nInstalling optional tools\n\n" +python ~/esp/esp-idf/tools/idf_tools.py install all + +if ! [ -z $(alias | grep get_idf) ]; then + echo "get_idf alias not found, appending to ~/.zshrc\n" + echo "alias get_idf='. ~/esp/esp-idf/export.sh'" >> ~/.zshrc + else + echo "get_idf alias already installed, skipping\n" +fi + +echo "Making copy of ~/esp/esp-idf/export.sh to ~/esp/esp-idf/export.sh.bak\n" +cp ~/esp/esp-idf/export.sh ~/esp/esp-idf/export.sh.bak + +echo "editing ~/esp/esp-idf/export.sh\n" +sed -i 's/return 0/# return 0/g' ~/esp/esp-idf/export.sh + +echo "appending custom additions to ~/esp/esp-idf/export.sh\n" +cat $current_dir/add-to-export-sh.txt >> ~/esp/esp-idf/export.sh + +echo 'Restart shell with `source ~/.zshrc` and run `get_idf` to use\n' +echo "All done :3 Enjoy your new esp-idf install and environment"