From b5b8d3f31dfefec70c79b93e3c77fb06af04c65d Mon Sep 17 00:00:00 2001 From: PrincessPi3 Date: Sun, 27 Oct 2024 06:31:43 -0600 Subject: [PATCH] updoots and fixans --- .custom_bin/build | 2 ++ .custom_bin/clean | 3 +++ .custom_bin/fullclean | 19 +++++++++++++- .custom_bin/fullcleanrebuild | 17 ------------- .custom_bin/rebuildfull | 39 ++++++++++++++++++++++++++++ .custom_bin/setup | 4 ++- add-to-export-sh.txt | 5 +++- reinstall-esp-idf.sh | 49 ++++++++++++++++++------------------ 8 files changed, 94 insertions(+), 44 deletions(-) create mode 100644 .custom_bin/clean delete mode 100644 .custom_bin/fullcleanrebuild create mode 100644 .custom_bin/rebuildfull diff --git a/.custom_bin/build b/.custom_bin/build index 685ed81..5190789 100644 --- a/.custom_bin/build +++ b/.custom_bin/build @@ -1 +1,3 @@ +echo "\nBuilding\n" idf.py build +echo "\nAll done :3\n" diff --git a/.custom_bin/clean b/.custom_bin/clean new file mode 100644 index 0000000..eef65b7 --- /dev/null +++ b/.custom_bin/clean @@ -0,0 +1,3 @@ +echo "\nCleaning...\n" +idf.py clean +echo "\nAll done :3\n" \ No newline at end of file diff --git a/.custom_bin/fullclean b/.custom_bin/fullclean index c6f9eea..1c15498 100644 --- a/.custom_bin/fullclean +++ b/.custom_bin/fullclean @@ -1 +1,18 @@ -idf.py fullclean && rmdir build && rm sdkconfig sdkconfig.old +idf.py fullclean + +if [ -d build ]; then + echo "\nDeleting build dir\n" + rm -rf build +fi + +if [ -f sdkconfig ]; then + echo "\nDeleting sdkconfig\n" + rm sdkconfig +fi + +if [ -f sdkconfig.old ]; then + echo "\nDeleting sdkconfig.old\n" + rm sdkconfig.old +fi + +echo "\nAll done :3\n" \ No newline at end of file diff --git a/.custom_bin/fullcleanrebuild b/.custom_bin/fullcleanrebuild deleted file mode 100644 index 0ac67a3..0000000 --- a/.custom_bin/fullcleanrebuild +++ /dev/null @@ -1,17 +0,0 @@ -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/rebuildfull b/.custom_bin/rebuildfull new file mode 100644 index 0000000..28e0d69 --- /dev/null +++ b/.custom_bin/rebuildfull @@ -0,0 +1,39 @@ +#!/bin/bash + +idf.py fullclean + +if [ -f build ]; then + echo -e "\nDeleting build dir\n" + rm -rf build +fi + +if [ -f sdkconfig ]; then + echo -e "\nDeleting sdkconfig\n" + rm sdkconfig +fi + +if [ -f sdkconfig.old ]; then + echo -e "\nDeleting sdkconfig.old\n" + rm sdkconfig.old +fi + +echo -e "\nSetting up project for $ESPTARGET\n" +idf.py set-target $ESPTARGET + +echo -e "\nErase flash? y/n" +read wipe +if [ "$wipe" == "y" ]; then + idf.py erase-flash + echo -e "\nFlash wiped\n" +fi + +idf.py menuconfig + +echo -e "\nBuild now? y/n" +read build +if [ "$build" == "y" ]; then + idf.py build + echo -e "\nBuild complete\n" +fi + +echo -e "\nAll done :3\n" \ No newline at end of file diff --git a/.custom_bin/setup b/.custom_bin/setup index d507126..eac2977 100644 --- a/.custom_bin/setup +++ b/.custom_bin/setup @@ -1,2 +1,4 @@ +echo "\nSetting up for $ESPTARGET\n" idf.py set-target $ESPTARGET -idf.py menuconfig \ No newline at end of file +idf.py menuconfig +echo -e "\nAll done :3\n" \ No newline at end of file diff --git a/add-to-export-sh.txt b/add-to-export-sh.txt index ede549a..459adf0 100644 --- a/add-to-export-sh.txt +++ b/add-to-export-sh.txt @@ -1,3 +1,6 @@ + + + ############################################### # begin esp-idf stuffss I made ################ ############################################### @@ -36,7 +39,7 @@ echo "ESPTARGET = $ESPTARGET" echo "Changing dir to ~/esp" cd ~/esp -echo "All done :3 Enjoy your esp-idf environment" +echo "All done :3\n\tEnjoy your esp-idf environment" ############################################### # end esp-idf stuffss I made ################## diff --git a/reinstall-esp-idf.sh b/reinstall-esp-idf.sh index dc15246..14cc2ba 100644 --- a/reinstall-esp-idf.sh +++ b/reinstall-esp-idf.sh @@ -1,63 +1,64 @@ -echo "===== LFGGGGGGGG ======" +echo "\n===== LFGGGGGGGG ======\n" -echo "Setting up environment" -current_dir=$PWD +echo "\nInstalling prerequisites\n" +sudo apt install -y git wget flex bison gperf python3 python3-pip python3-venv cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0 -echo "cleaning up environment" +echo "\nCleaning up environment\n" if ! [ -d ~/esp ]; then - echo "~/esp not found, creating\n" + echo "\n~/esp not found, creating\n" mkdir ~/esp else - echo "~/esp found, skipping\n" + echo "\n~/esp found, skipping\n" fi if [ -d ~/esp/esp-idf ]; then - echo "~/esp/esp-idf found, deleting\n" + echo "\n~/esp/esp-idf found, deleting\n" rm -rf ~/esp/esp-idf else - echo "~/esp/esp-idf not found, skipping\n" + echo "\n~/esp/esp-idf not found, skipping\n" fi if [ -d ~/.espressif ]; then - echo "~/.espressif found, deleting\n" + echo "\n~/.espressif found, deleting\n" rm -rf ~/.espressif else - echo "~/.espressif not found, skipping\n" + echo "\n~/.espressif not found, skipping\n" fi if [ -d ~/esp/.custom_bin ]; then - echo "~/esp/.custom_bin found, deleting\n" + echo "\n~/esp/.custom_bin found, deleting\n" rm -rf ~/esp/.custom_bin fi -echo "nPlacing and enablig custom bins\n" +echo "\nPlacing and enabeling custom bins\n" cp -r .custom_bin ~/esp chmod +x ~/esp/.custom_bin/* -echo "\n\nPulling latest esp-idf code from github\n\n" +echo "\nPulling latest esp-idf code from github\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 "\nRunning install script\n" +bash ~/esp/esp-idf/install.sh all -echo "\n\nInstalling optional tools\n\n" +echo "\nInstalling optional tools\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 "\nget_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" + echo "\nget_idf alias already installed, skipping\n" fi -echo "Making copy of ~/esp/esp-idf/export.sh to ~/esp/esp-idf/export.sh.bak\n" +echo "\nMaking a backup 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" +echo "\nEditing ~/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 "\nAppending custom additions to ~/esp/esp-idf/export.sh\n" +cat ./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" +echo '\nRestart shell with `source ~/.zshrc` and run `get_idf` to use\n' +echo "\nEnjoy your new esp-idf install and environment\n" +echo "\nAll done :3\n"