-
Notifications
You must be signed in to change notification settings - Fork 3
/
ras-image-setup.sh
64 lines (49 loc) · 1.71 KB
/
ras-image-setup.sh
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
cd /home/pi/
# Install requirements
apt update && apt install -yq \
python3-smbus i2c-tools git python3-dev python3-pip \
libfreetype6-dev libjpeg-dev build-essential libsdl-dev \
libportmidi-dev libsdl-ttf2.0-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libopenjp2-7 \
python3-RPi.GPIO hostapd
rm -rf /var/lib/apt/lists/*
if [ ! -d /home/pi/ras ]
then
git clone https://github.com/Eficent/ras.git
else
cd ras
git fetch origin
git reset --hard origin/master
fi
pip3 install -r /home/pi/ras/requeriments.txt
cp -f /home/pi/ras-image-setup/config.txt /boot/
cp -f /home/pi/ras-image-setup/modules /etc/
cp -f /home/pi/ras-image-setup/rc.local /etc/
mv /home/pi/ras/dicts/credentials.json.sample /home/pi/ras/dicts/credentials.json
git clone https://github.com/lthiery/SPI-Py.git
cd SPI-Py
python3 setup.py install
cd ..
rm -R SPI-Py
# systemctl stop dhcpcd
# systemctl disable dhcpcd
# systemctl enable NetworkManager
# systemctl start NetworkManager
# Setup ras portal service
cp -f /home/pi/ras-image-setup/ras-portal.service /lib/systemd/system/
chmod 755 /lib/systemd/system/ras-portal.service
chown root: /lib/systemd/system/ras-portal.service
# systemctl enable ras-portal.service
# systemctl start ras-portal.service
# Setup ras launcher service
cp -f /home/pi/ras-image-setup/ras-launcher.service /lib/systemd/system/
chmod 755 /lib/systemd/system/ras-launcher.service
chown root: /lib/systemd/system/ras-launcher.service
# systemctl enable ras-launcher.service
# systemctl start ras-launcher.service
# Setup resin-wifi-connect
apt update && \
apt install -y -d network-manager && \
apt install -y network-manager
bash /home/pi/ras-image-setup/wifi-connect-raspbian-install.sh
apt clean