-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
172 lines (144 loc) · 5.19 KB
/
Copy pathinstall.sh
File metadata and controls
172 lines (144 loc) · 5.19 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
#!/bin/sh
# Released to the public domain.
#
# raspi-config # locale
cat << E_O_F
This is a pseudo installer.
Please consider it as a guide for a dedicated installation.
To make the easiest possible turn-key dedicated STFX effects-slave,
executing all of these commands will overwrite key system files.
So this has been dissabled for you safety.
If you REALLY want to do so then edit this installer to run.
E_O_F
exit 0 ; # comment out this line to run the installer as-is.
if [ "$(id -u)" = "0" ] ; then
printf "Please run this as the normal pi user, not root.\n"
exit 1
fi
# Because ~ becomes /root/ when sudo-ing:
PH=/home/pi ; export PH
# remove unwanted stuff, probably some redundancy here:
sudo tasksel remove desktop
sudo apt-get -y remove task-desktop
sudo apt-get -y remove x-window-system-core xserver-xorg
sudo apt-get -y remove x11-common midori lxde
sudo apt-get -y autoremove
sudo sh -c 'dpkg -l | egrep "^rc" | cut -d " " -f 3 | xargs dpkg --purge'
sudo apt-get clean
sudo rm `find /var/log/ -type f`
rm -rf ${PH}/python_games
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get install -y hostapd udhcpd
sudo apt-get install -y samba samba-common-bin
sudo apt-get install -y sox
sudo apt-get install -y fbi
sudo apt-get install -y cec-utils
sudo apt-get install -y imagemagick
sudo apt-get install -y git-core
sudo apt-get install -y git libtool build-essential pkg-config autoconf
sudo apt-get install -y libraspberrypi-dev
sudo apt-get install -y python-dev
sudo apt-get install -y python-rpi.gpio
sudo apt-get install -y python-smbus
sudo apt-get install -y i2c-tools
cd ${PH}/
[ ! -d git ] && mkdir git
cd ${PH}/git
git clone git://git.drogon.net/wiringPi
cd wiringPi
git pull origin
sudo ./build
cd ${PH}/
gpio -v
gpio readall
cd ${PH}/git
git clone https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code.git
cd Adafruit-Raspberry-Pi-Python-Code/Adafruit_CharLCDPlate/
cd ${PH}/
cd ${PH}/git
git clone https://github.com/aufder/RaspberryPiLcdMenu.git
cd RaspberryPiLcdMenu
ln -s /home/pi/git/Adafruit-Raspberry-Pi-Python-Code/Adafruit_I2C/Adafruit_I2C.py ./
ln -s /home/pi/git/Adafruit-Raspberry-Pi-Python-Code/Adafruit_MCP230xx/Adafruit_MCP230xx.py ./
ln -s /home/pi/git/Adafruit-Raspberry-Pi-Python-Code/Adafruit_CharLCDPlate/Adafruit_CharLCDPlate.py ./
cd ${PH}/
cd ${PH}/git
git clone https://github.com/richardghirst/PiBits.git
cd PiBits/ServoBlaster/user
make
sudo make install
cd ${PH}/
sudo update-rc.d servoblaster disable
sudo servod --pcm
ps -ef | egrep "servo[d]"
sudo killall servod
cd ${PH}/git
git clone https://github.com/Pulse-Eight/libcec.git
cd libcec
./bootstrap
ARGS="--prefix=/usr --enable-rpi --with-rpi-include-path=/opt/vc/include --with-rpi-lib-path=/opt/vc/include"
LDFLAGS="-s -L/usr/lib -L/usr/lib -L/opt/vc/lib" ./configure $ARGS
make
cd ${PH}/
cec-client -l
cd ${PH}/
[ ! -d PiFm ] && mkdir PiFm
cd PiFm
wget http://omattos.com/pifm.tar.gz
gunzip < pifm.tar.gz | tar -xvf -
sudo ./pifm left_right.wav 87.5
cd ${PH}/
[ ! -d stfx ] && mkdir stfx
cd ${PH}/stfx
ln -s /home/pi/git/Adafruit-Raspberry-Pi-Python-Code/Adafruit_I2C/Adafruit_I2C.py ./
ln -s /home/pi/git/Adafruit-Raspberry-Pi-Python-Code/Adafruit_MCP230xx/Adafruit_MCP230xx.py ./
ln -s /home/pi/git/Adafruit-Raspberry-Pi-Python-Code/Adafruit_CharLCDPlate/Adafruit_CharLCDPlate.py ./
ln -s /home/pi/git/RaspberryPiLcdMenu/ListSelector.py ./
python -m compileall .
mkdir -p cache public/Movies
ln links.html public/
ln 'The Room.stfx' public/Movies/'The Room.stfx'
ln -s public/VLCPortable/Data/settings/vlcrc ./
mkdir -p public/VLCPortable/Data/settings
true >> vlcrc
cat vlcrc.template > vlcrc
ln -s public/WinSCPPortable/Data/settings/winscp.ini ./
mkdir -p public/WinSCPPortable/Data/settings
true >> winscp.ini
cat winscp.ini.template > winscp.ini
ln -s public/PuTTYPortable/Data/settings/putty.reg ./
mkdir -p public/PuTTYPortable/Data/settings
true >> putty.reg
cat putty.reg.template > putty.reg
cccc() { # I should learn how to use 'make'
rm -f lint $1 a.out
gcc -I/usr/local/include -L/usr/local/lib -lwiringPi -lm -Wall -O $1.c 2>lint && strip a.out && mv a.out $1
[ -f lint ] && [ ! -s lint ] && rm -f lint
[ -s lint ] && cat lint
}
cccc led_strip_car-fuzz1
cccc led_strip_car-knightrider
cccc led_strip_car-plod1
cccc led_strip_grey
rm -f cksum.log blank.fb lint a.out *.pyc cache/*
[ ! -w /dev/i2c-0 -o ! -w /dev/i2c-1 ] && gpio load i2c
[ ! -w /dev/spidev0.0 -o ! -w /dev/spidev0.1 ] && gpio load spi
sudo cp i2cdetectany.sh /usr/local/bin/
# should ask before over-writing the various system config files
ls -l `cat ammended.lof`
tar -T ammended.lof -czf before-ammendment-$(date +"%Y%m%d%H%M%S").tgz > /dev/null 2>&1
sudo tar -C / -xzf ammended.tgz
sudo chown -R pi:pi .
cd ${PH}/
sudo update-rc.d hostapd disable
sudo update-rc.d udhcpd enable
sudo update-rc.d ssh enable
which rpi-update >/dev/null || sudo apt-get install -y rpi-update
# sudo rpi-update
sudo shutdown -F -r now
# build the install file - just for my notes
# rm -f stfx.tgz ; tar -czf stfx.tgz links.html vlcrc.template winscp.ini.template putty.reg.template \
# led_strip_car-fuzz1.c led_strip_car-knightrider.c led_strip_car-plod1.c led_strip_grey.c \
# install.sh ammended.lof ammended.tgz i2cdetectany.sh lcdmenu.py lcdmenu.xml stfx.sh stfx.config \
# 'The Room.stfx'