updoots and fixans

This commit is contained in:
2024-10-27 06:31:43 -06:00
parent de42d5f13d
commit b5b8d3f31d
8 changed files with 94 additions and 44 deletions
+25 -24
View File
@@ -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"