Skip to content

Commit

Permalink
installations script updated (#153)
Browse files Browse the repository at this point in the history
* installations script updated

* not installing pip explicitly

* removed popd

* version changed from 5.1.2 to 5.1

* _sudo changes to sudo

* download sudo command

* Added user to sudo group

* syntax corrected

* Update wall_e_install.sh

* Added debugging logs

* auto yes

* Setting timezone non-interactively

* Update wall_e_install.sh

* install tzdata

* Remove Ubuntu-18.04 from test-install-script.yml

---------

Co-authored-by: Shankari02 <shankari.ak0208@gmail.com>
  • Loading branch information
AryanNanda17 and Shankari02 authored Dec 7, 2024
1 parent 23eeb62 commit f4bdc61
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 38 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/test-install-script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ jobs:
host_runner: ubuntu-latest
package_manager: apt
docker_image: ubuntu:20.04
- name: Ubuntu 18.04
host_runner: ubuntu-latest
package_manager: apt
docker_image: ubuntu:18.04

name: ${{ matrix.name }}
runs-on: ${{ matrix.host_runner }}
Expand Down
72 changes: 38 additions & 34 deletions wall_e_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,26 @@ set -e
echo "installing ESP IDF"

_shell_="${SHELL#${SHELL%/*}/}"

_sudo(){
if ! command -v sudo &> /dev/null
then
if ! [ $(id -u) = 0 ]; then
echo "The script need to be run as root." >&2
exit 1
fi
"$@"
else
sudo "$@"
fi
}

# Check whether esp-idf has already been installed
if [ -d $HOME/esp/esp-idf ]; then
echo "You have installed esp-idf" && exit 0
fi

unameOut="$(uname -s)"
echo "You have already installed esp-idf!"
else
# System Detection and ESP-IDF Installation
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*)
su -c "apt update && apt install sudo -y"
sudo apt install tzdata -y

# Set timezone non-interactively
export DEBIAN_FRONTEND=noninteractive
_sudo apt update && _sudo apt upgrade -y
_sudo apt install git wget flex bison gperf python3 python3-pip python3-setuptools cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0 -y
sudo ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime
echo "Etc/UTC" | sudo tee /etc/timezone > /dev/null
sudo dpkg-reconfigure --frontend noninteractive tzdata

sudo usermod -aG dialout $USER || echo "Failed to add user to dialout group"
sudo apt install git wget flex bison gperf python3 python3-pip python3-setuptools cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0 -y
sudo apt install python3-venv -y
;;
Darwin*)
if brew --version | grep -q 'Homebrew'; then
Expand All @@ -38,24 +33,33 @@ case "${unameOut}" in
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo "homebrew installed successfully"
fi
brew install git cmake ninja dfu-util python3 pip
brew install git cmake ninja dfu-util python3
;;
*) echo "Not supported :${unameOut}"
esac

mkdir -p "$HOME/esp"
pushd "$HOME"/esp || (echo "Error: Cannot Make Directory" && exit 1)
# Create ESP Directory
mkdir -p "$HOME/esp"
pushd "$HOME"/esp || (echo "Error: Cannot Make Directory" && exit 1)

#ESP Toolchain & ESP-IDF
git clone -b v4.4.3 --recursive https://github.com/espressif/esp-idf.git
pushd esp-idf
./install.sh
popd
popd
# Clone ESP-IDF Repository
git clone -b release/v5.1 --recursive https://github.com/espressif/esp-idf.git
cd $HOME/esp/esp-idf
./install.sh esp32

#Check if installation is successfull
. $HOME/esp/esp-idf/export.sh
idf.py --version | (grep "v4.4" && echo "Installation successfull! Please restart your computer for the changes to take effect.") \
|| (echo "installation failed" && exit 1)
# Check if installation is successful
. $HOME/esp/esp-idf/export.sh
idf.py --version | (grep "v5.1" && echo "Installation successful! Please restart your computer for the changes to take effect.") \
|| (echo "Installation failed" && exit 1)
# Set IDF Alias
echo "alias get_idf='. $HOME/esp/esp-idf/export.sh'" >> $HOME/."$_shell_"rc
fi

echo "alias get_idf='. $HOME/esp/esp-idf/export.sh'" >> $HOME/."$_shell_"rc
# Clone Wall-E repository
if [ ! -d "$HOME/Wall-E" ]; then
cd "$HOME" || (echo "Error: Could not navigate to Home" && exit 1)
echo "Cloning Wall-E"
git clone --recursive https://github.com/SRA-VJTI/Wall-E.git
else
echo "You have already Cloned Wall-E Repository!"
fi

0 comments on commit f4bdc61

Please sign in to comment.