-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·40 lines (28 loc) · 911 Bytes
/
setup.sh
File metadata and controls
executable file
·40 lines (28 loc) · 911 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
echo "Starting OpenCAL setup..."
sudo apt-get update
if [ -f "apt-requirements.txt" ]; then
echo "Installing system dependencies from apt-requirements.txt..."
grep -v '^#' apt-requirements.txt | xargs sudo apt-get install -y
else
echo "apt-requirements.txt not found, skipping system packages."
fi
sudo apt-get install -y python3-venv python3-pip
# Hardware interface config
sudo raspi-config nonint do_i2c 0
echo "I2C Enabled"
sudo raspi-config nonint do_spi 0
echo "SPI Enabled"
sudo usermod -a -G i2c,spi opencal
VENV_DIR=".venv"
if [ ! -d "$VENV_DIR" ]; then
echo "Creating Python virtual environment"
python3 -m venv --system-site-packages $VENV_DIR
fi
if [ -f "requirements.txt" ]; then
$VENV_DIR/bin/pip install --upgrade pip
$VENV_DIR/bin/pip install -r requirements.txt
else
echo "requirements.txt not found, skipping Python packages."
fi
echo "Setup complete"