forked from RPi-Distro/spindle
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathwheezy-stage5-openpi
executable file
·148 lines (125 loc) · 3.39 KB
/
wheezy-stage5-openpi
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
#!/bin/sh
# Part of spindle http://asbradbury.org/projects/spindle
#
# See LICENSE file for copyright and license details
set -ex
. ./common
WORKDIR=work
OUTDIR=out
CURIMG=stage5-openpi.$IMGFORMAT
install_packages() {
ssh_in_to_qemu chroot /mnt sh -l -ex - <<\EOF
apt-get update
apt-get install -y screen minicom putty vim
apt-get install -y python-setuptools
easy_install pip
apt-get install -y i2c-tools
apt-get install -y lirc
EOF
}
install_arduino() {
onvm_chroot sh -l -e - <<\EOF
apt-get update
apt-get install -y arduino
##arduino desktop icon
#cat <<\EOF1 > /home/pi/Desktop/Arduino.desktop
#[Desktop Entry]
#Type=Application
#Name=Arduino IDE
#GenericName=Create physical computing projects
#Exec=arduino
#Icon=arduino
#Terminal=false
#Categories=Development;Engineering;Electronics;
#MimeType=text/x-arduino
#EOF1
cat <<\EOF2 > /etc/udev/rules.d/99-tty.rules
KERNEL=="ttyAMA0",SYMLINK+="ttyS1" GROUP="dialout"
EOF2
EOF
}
install_mono() {
onvm_chroot sh -l -e - <<\EOF
apt-get update
apt-get install -y mono-complete mono-vbnc
EOF
}
install_pilite() { # pi plite python stuff
onvm_chroot sh -l -ex - <<\EOF
apt-get update
apt-get install -y python-requests
pip install arrow
pip install xively-python
pip install python-twitter
EOF
}
install_wikfiles() {
onvm_chroot sh -l -e - <<\EOF
if [ ! -d /home/pi/Desktop ]; then
mkdir /home/pi/Desktop
chown pi:pi /home/pi/Desktop
fi
mkdir /home/pi/Desktop/WIK_Files
mkdir /home/pi/Desktop/WIK_Files/Download
wget -P /home/pi/Desktop/WIK_Files/Download http://files.ciseco.co.uk/WIK/WIK_1.02.zip
unzip /home/pi/Desktop/WIK_Files/Download/WIK_1.02.zip -d /home/pi/Desktop/WIK_Files
mkdir /home/pi/sketchbook/
cp -r /home/pi/Desktop/WIK_Files/Arduino/. /home/pi/sketchbook/
chown -R pi:pi /home/pi/
EOF
}
install_llapfiles() {
onvm_chroot sh -l -e - <<\EOF
if [ ! -d /home/pi/Desktop ]; then
mkdir /home/pi/Desktop
chown pi:pi /home/pi/Desktop
fi
mkdir /home/pi/Desktop/LLAP_Files
mkdir /home/pi/Desktop/LLAP_Files/Download
wget -P /home/pi/Desktop/LLAP_Files/Download http://files.ciseco.co.uk/LLAP/LLAP_0.12.zip
unzip /home/pi/Desktop/LLAP_Files/Download/LLAP_0.12.zip -d /home/pi/Desktop/LLAP_Files
chown -R pi:pi /home/pi/
EOF
}
enable_rtc() {
onvm_chroot sh -l -e - <<\EOF
patch -f -l -p1 -d / <<\EOF2
--- /etc/init.d/hwclock.sh 2012-12-22 05:57:47.000000000 +0000
+++ /etc/init.d/hwclock.sh 2015-06-22 14:31:03.732358696 +0000
@@ -61,9 +61,9 @@
printf "0.0 0 0.0\n0\nUTC" > /etc/adjtime
fi
- if [ -d /run/udev ] || [ -d /dev/.udev ]; then
- return 0
- fi
+# if [ -d /run/udev ] || [ -d /dev/.udev ]; then
+# return 0
+# fi
if [ "$HWCLOCKACCESS" != no ]; then
log_action_msg "Setting the system clock"
hwclock.patch (END)
EOF2
#apt-get remove -y fake-hwclock
rm /etc/cron.hourly/fake-hwclock
update-rc.d -f fake-hwclock remove
#rm /etc/init.d/fake-hwclock
update-rc.d hwclock.sh enable
EOF
}
cd $WORKDIR
dotask branch_image ../$OUTDIR/stage4-lxde-edu.$IMGFORMAT $CURIMG
dotask run_qemu $CURIMG
dotask disable_starting_services
dotask mount_apt_cache
dotask install_packages
dotask install_arduino
#dotask install_mono
dotask install_wikfiles
dotask install_llapfiles
dotask enable_rtc
dotask save_space_using_hardlink
dotask allow_starting_services
dotask fingerprint_debian
dotask update_issue
dotask shutdown_qemu
dotask finish_image