-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
75 lines (67 loc) · 2.17 KB
/
build.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
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
#install script ActionPi by Seil0
#version 0.2
echo "ActionPi install script by Seil0 version 0.1"
cd ~/Downloads/
echo "downloading and installing raspicam c++ lib ..."
wget -O raspicam_c++-lib.zip https://sourceforge.net/projects/raspicam/files/raspicam-0.1.3.zip/download#
unzip raspicam_c++-lib.zip
cd raspicam-0.1.3/
cmake install
mkdir build
cd build/
cmake ..
sudo make install
sudo ldconfig
echo "finished installing raspicam c++ lib, start downloading bcm2835 lib ..."
wget -O bcm2835-1.50.tar.gz http://www.airspayce.com/mikem/bcm2835/bcm2835-1.50.tar.gz
tar zxvf bcm2835-1.50.tar.gz
cd bcm2835-1.50/
./configure
make
sudo make check
sudo make install
echo "finished installing bcm2835 lib, removing unused files ..."
cd ~/Downloads/
sudo rm raspicam_c++-lib.zip
sudo rm -r raspicam-0.1.3
echo "starting to compile ActionPi Software ..."
cd ActionPi-master
g++ -Wall ActionPi.cpp -oActionPi -l raspicam -l bcm2835 -std=c++0x
mkdir ~/ActionPi
mv -i ActionPi ~/ActionPi/ActionPi
cd ~/ActionPi/
chmod +x ActionPi
echo "Do you wish to autostart the ActionPi Software?"
echo "!WARNING! this is not tested use only if you know what you do!"
select yn in "Yes" "No"; do
case $yn in
Yes ) sudo echo "sudo ~/ActionPi./ActionPi" > /etc/rc.local; break;;
No ) break;;
esac
done
echo "Do you wish to add i2c configuration for real time clock?"
echo "!WARNING! this is not tested use only if you know what you do!"
select yn in "Yes" "No"; do
case $yn in
Yes ) sudo i2cdetect -y 1; sudo modprobe rtc-ds1307; sudo echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device; break;;
No ) break;;
esac
done
echo "Do you wish to deactivate dhcpcd? (Not recommended)"
echo "!WARNING! this is not tested use only if you know what you do!"
select yn in "Yes" "No"; do
case $yn in
Yes ) sudo service dhcpcd stop; sudo systemctl disable dhcpcd break;;
No ) break;;
esac
done
echo "Installation completed!"
echo "Would you like to reboot now (recommenden)?"
echo "!WARNING! this is not tested use only if you know what you do!"
select yn in "Yes" "No"; do
case $yn in
Yes ) sudo reboot; break;;
No ) break;;
esac
done