Skip to content

Commit 7f7abca

Browse files
JaytidaAAadityaShankari02Copilot
authored
Feature/updated installation script (#165)
* Changed the Installations Instructions as instructed and updated the MacOS instructions * Made changes to the git clone instruction for MacOS * Made changes to the initial project setup for Windows to make use of 1_led_blink instead of hello_world * Removed unnecessary files created by vim * Made changes to the Linux installation instructions * Removed explicit installtion of Drivers for the USB to UART bridge * Cleaned up the pictures and renamed to fit the sequence 1, 2, ... * Updated install script for Arch Linux * Updated the creation of the dialout group * Changed users new group from dialout to uucp * Fixed unnecessary escape for pipe * Fixed tabspaces * Changed echo message from group updation failure. * Added archlinux container to matrix * Changed actions to use checkout version 4 instead of 3 * Changed all instances of pacman to use --noconfirm option except the first. * Updated installation script to make use of Sudo version 1.9.16p2 Sudoers policy plugin version 1.9.16p2 Sudoers file grammar version 50 Sudoers I/O plugin version 1.9.16p2 Sudoers audit plugin version 1.9.16p2 instead of /usr/bin/sudo as is not a part of GNU coreutils as I had thought before * Changed the order of pacman updates * Added a noconfirm flag for installing sudo * Major changes to the install script of Arch Linux section * Update the non-use of sudo in CI, which I had forgotten * added noconfirm flag for pacman -Sy * Fixed the warnings from using yamllint by adding a single line at the top. Fixed some other errors as well. * Update wall_e_install.sh From GitHub copilot. Using `visudo` instead of `echo >>` Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update wall_e_install.sh Use the `command` function as an alternative of `which` because if `sudo` is not installed then `sudo --version` will just give an error and not be an empty string leading to the if block being evaluated as well. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Aaditya <jojo@SymphonisingSemiconductor.localdomain> Co-authored-by: Shankari <shankari.ak0208@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 7e918cd commit 7f7abca

4 files changed

Lines changed: 70 additions & 17 deletions

File tree

.github/workflows/test-build-app.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Test Build of Wall-E
23
on: [push, pull_request, workflow_dispatch]
34

@@ -28,4 +29,4 @@ jobs:
2829
run: |
2930
. $IDF_PATH/export.sh
3031
cd ${{ matrix.test-apps }}
31-
idf.py build
32+
idf.py build

.github/workflows/test-install-script.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: test-install-script
23

34
concurrency:
@@ -32,14 +33,19 @@ jobs:
3233
host_runner: ubuntu-latest
3334
package_manager: apt
3435
docker_image: ubuntu:20.04
36+
- name: Arch Latest
37+
host_runner: ubuntu-latest
38+
package_manager: pacman
39+
docker_image: archlinux:latest
40+
3541

3642
name: ${{ matrix.name }}
3743
runs-on: ${{ matrix.host_runner }}
3844
container:
3945
image: ${{ matrix.docker_image }}
4046

4147
steps:
42-
- uses: actions/checkout@v3
48+
- uses: actions/checkout@v4
4349
with:
4450
fetch-depth: 0
4551

@@ -57,7 +63,7 @@ jobs:
5763
runs-on: ${{ matrix.host_runner }}
5864

5965
steps:
60-
- uses: actions/checkout@v3
66+
- uses: actions/checkout@v4
6167
with:
6268
fetch-depth: 0
6369

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1+
---
12
name: Validate-YAML
23

34
on:
45
push:
5-
branches: [ master ]
6+
branches:
7+
- master
68
paths:
79
- '.github/workflows/test-install-script.yml'
810
pull_request:
9-
branches: [ master ]
11+
branches:
12+
- master
1013
paths:
1114
- '.github/workflows/test-install-script.yml'
1215

1316
jobs:
1417
validate-yaml:
1518
runs-on: ubuntu-latest
1619
steps:
17-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
1821
- name: Validate test-install-script.yml
1922
run: yamllint .github/workflows/test-install-script.yml

wall_e_install.sh

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,61 @@ else
1212
unameOut="$(uname -s)"
1313
case "${unameOut}" in
1414
Linux*)
15-
su -c "apt update && apt install sudo -y"
16-
sudo apt install tzdata -y
15+
# Check the version of Linux
16+
if grep -q "Arch" /etc/os-release; then
17+
if [ "$CI" = "true" ]; then
18+
echo "Running in Docker Container."
19+
# Update the core and extra databases
20+
pacman -Sy --noconfirm
21+
pacman -S --noconfirm git wget flex bison gperf python python-pip python-setuptools cmake ninja ccache libffi openssl dfu-util libusb
22+
pacman -S --noconfirm python-virtualenv
23+
pacman -Syu --noconfirm
24+
else
25+
echo "Running on Arch Linux host."
26+
# Update the core and extra databases
27+
su -c "pacman -Sy"
28+
29+
if [ -z "$(command -v sudo)" ]; then
30+
# Steps to be taken if sudo is not installed
31+
su -c "pacman -S --noconfirm sudo"
32+
su -c "usermod -aG wheel $USER"
33+
echo 'wheel ALL=(ALL:ALL) ALL' | su -c "EDITOR='tee -a' visudo"
34+
echo "Reboot and run this script again for changes to take place"
35+
exit 0
36+
fi
37+
38+
sudo pacman -S --noconfirm tzdata
39+
40+
# Time to change the system time
41+
currentTimezone="$(readlink /etc/localtime)"
42+
sudo ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime
43+
sudo hwclock --systohc
44+
45+
sudo groupadd -f uucp
46+
sudo usermod -aG uucp $USER || echo "Failed to add user to uucp group"
47+
sudo pacman -S --noconfirm git wget flex bison gperf python python-pip python-setuptools cmake ninja ccache libffi openssl dfu-util libusb
48+
sudo pacman -S --noconfirm python-virtualenv
49+
sudo pacman -Syu
50+
51+
# Change system time back to original
52+
sudo ln -fs "$currentTimezone" /etc/localtime
53+
fi
54+
elif grep -q -E "Ubuntu|Debian" /etc/os-release; then
55+
56+
echo "Running on Ubuntu host."
57+
su -c "apt update && apt install sudo -y"
58+
sudo apt install tzdata -y
1759

18-
# Set timezone non-interactively
19-
export DEBIAN_FRONTEND=noninteractive
20-
sudo ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime
21-
echo "Etc/UTC" | sudo tee /etc/timezone > /dev/null
22-
sudo dpkg-reconfigure --frontend noninteractive tzdata
60+
# Set timezone non-interactively
61+
export DEBIAN_FRONTEND=noninteractive
62+
sudo ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime
63+
echo "Etc/UTC" | sudo tee /etc/timezone > /dev/null
64+
sudo dpkg-reconfigure --frontend noninteractive tzdata
2365

24-
sudo usermod -aG dialout $USER || echo "Failed to add user to dialout group"
25-
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
26-
sudo apt install python3-venv -y
66+
sudo usermod -aG dialout $USER || echo "Failed to add user to dialout group"
67+
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
68+
sudo apt install python3-venv -y
69+
fi
2770
;;
2871
Darwin*)
2972
if brew --version | grep -q 'Homebrew'; then
@@ -43,7 +86,7 @@ esac
4386
pushd "$HOME"/esp || (echo "Error: Cannot Make Directory" && exit 1)
4487

4588
# Clone ESP-IDF Repository
46-
git clone -b release/v5.1 --recursive https://github.com/espressif/esp-idf.git
89+
git clone -b release/v5.1 --recursive https://github.com/espressif/esp-idf.git --depth 1
4790
cd $HOME/esp/esp-idf
4891
./install.sh esp32
4992

0 commit comments

Comments
 (0)