-
Notifications
You must be signed in to change notification settings - Fork 33
/
provision-sudo.sh
247 lines (231 loc) · 6.21 KB
/
provision-sudo.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
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
#!/bin/bash -x
# Remove unused packages to keep the size down
apt remove -y \
thunderbird \
transmission-gtk \
gnome-todo \
baobab \
rhythmbox \
cheese \
vino \
shotwell \
totem \
usb-creator-gtk \
deja-dup \
gnome-calendar \
remmina \
simple-scan \
thunderbird-gnome-support \
aisleriot \
gnome-mahjongg \
gnome-mines \
gnome-sudoku \
branding-ubuntu \
libreoffice-style-breeze \
libreoffice-gnome \
libreoffice-writer \
libreoffice-calc \
libreoffice-impress \
libreoffice-math \
libreoffice-ogltrans \
libreoffice-pdfimport \
example-content \
libreoffice-l10n-en-gb \
libreoffice-l10n-es \
libreoffice-l10n-zh-cn \
libreoffice-l10n-zh-tw \
libreoffice-l10n-pt \
libreoffice-l10n-pt-br \
libreoffice-l10n-de \
libreoffice-l10n-fr \
libreoffice-l10n-it \
libreoffice-l10n-ru \
libreoffice-l10n-en-za \
libreoffice-help-en-gb \
libreoffice-help-es \
libreoffice-help-zh-cn \
libreoffice-help-zh-tw \
libreoffice-help-pt \
libreoffice-help-pt-br \
libreoffice-help-de \
libreoffice-help-fr \
libreoffice-help-it \
libreoffice-help-ru \
libreoffice-help-en-us \
thunderbird-locale-en \
thunderbird-locale-en-gb \
thunderbird-locale-en-us \
thunderbird-locale-es \
thunderbird-locale-es-ar \
thunderbird-locale-es-es \
thunderbird-locale-zh-cn \
thunderbird-locale-zh-hans \
thunderbird-locale-zh-hant \
thunderbird-locale-zh-tw \
thunderbird-locale-pt \
thunderbird-locale-pt-br \
thunderbird-locale-pt-pt \
thunderbird-locale-de \
thunderbird-locale-fr \
thunderbird-locale-it \
thunderbird-locale-ru \
gir1.2-rb-3.0 \
gir1.2-totem-1.0 \
gir1.2-totemplparser-1.0 \
libabw-0.1-1 \
libavahi-ui-gtk3-0 \
libdmapsharing-3.0-2 \
libexttextcat-2.0-0 \
libexttextcat-data \
libfreehand-0.1-1 \
libgnome-games-support-1-3 \
libgnome-games-support-common \
libgom-1.0-0 \
libgrilo-0.3-0 \
liblangtag-common \
liblangtag1 \
libmessaging-menu0 \
libmhash2 \
libminiupnpc10 \
libmwaw-0.3-3 \
libmythes-1.2-0 \
libnatpmp1 \
libneon27-gnutls \
libpagemaker-0.0-0 \
librdf0 \
libreoffice-avmedia-backend-gstreamer \
libreoffice-base-core \
libreoffice-common \
libreoffice-core \
libreoffice-draw \
libreoffice-gtk3 \
libreoffice-style-elementary \
libreoffice-style-galaxy \
libreoffice-style-tango \
libraptor2-0 \
librasqal3 \
librevenge-0.0-0 \
librhythmbox-core10 \
libtotem0 \
libvisio-0.1-1 \
libwpd-0.10-10 \
libwpg-0.3-3 \
libwps-0.4-4 \
libyajl2 \
python3-uno \
rhythmbox-data \
rhythmbox-plugin-alternative-toolbar \
rhythmbox-plugins \
remmina-common \
remmina-plugin-rdp \
remmina-plugin-secret \
remmina-plugin-vnc \
duplicity \
seahorse-daemon \
shotwell-common \
totem-common \
totem-plugins \
transmission-common \
cheese-common \
gnome-todo-common \
libgnome-todo \
gnome-video-effects \
libcheese-gtk25 \
libcheese8 \
uno-libs3 \
ure \
zeitgeist-core \
hunspell-de-at-frami \
hunspell-de-ch-frami \
hunspell-de-de-frami \
hunspell-en-au \
hunspell-en-ca \
hunspell-en-gb \
hunspell-en-za \
hunspell-es \
hunspell-fr \
hunspell-fr-classical \
hunspell-it \
hunspell-pt-br \
hunspell-pt-pt \
hunspell-ru \
hyphen-de \
hyphen-en-ca \
hyphen-en-gb \
hyphen-en-us \
hyphen-fr \
hyphen-hr \
hyphen-it \
hyphen-pl \
hyphen-pt-br \
hyphen-pt-pt \
hyphen-ru \
mythes-de \
mythes-de-ch \
mythes-en-au \
mythes-en-us \
mythes-fr \
mythes-it \
mythes-pt-pt \
mythes-ru
# Installing VirtualBox GuestAdditions
VBOX_ISO=VBoxGuestAdditions.iso
mkdir /tmp/isomount
mount -o loop ~/$VBOX_ISO /tmp/isomount
sh /tmp/isomount/VBoxLinuxAdditions.run
umount /tmp/isomount
rm -rf isomount ~/$VBOX_ISO
# Update keys and repos
apt-key update
apt-get update
Install packages
apt-get -y install build-essential git sdcc python3-dev python3-pip qtcreator \
dfu-util openocd gcc-arm-none-eabi gdb-multiarch docker.io || { echo 'apt-get install failed' ; exit 1; }
snap install firefox
# Required for the VSCode embedded debug to work
ln -s /usr/bin/gdb-multiarch /usr/local/bin/arm-none-eabi-gdb
# Adding udev rules for Crazyradio and Crazyflie
usermod -a -G plugdev bitcraze
sh -c 'echo SUBSYSTEM==\"usb\", ATTRS{idVendor}==\"1915\", ATTRS{idProduct}==\"7777\", MODE=\"0664\", GROUP=\"plugdev\" > /etc/udev/rules.d/99-crazyradio.rules'
sh -c 'echo SUBSYSTEM==\"usb\", ATTRS{idVendor}==\"1915\", ATTRS{idProduct}==\"0101\", MODE=\"0664\", GROUP=\"plugdev\" >> /etc/udev/rules.d/99-crazyradio.rules'
sh -c 'echo SUBSYSTEM==\"usb\", ATTRS{idVendor}==\"0483\", ATTRS{idProduct}==\"5740\", MODE=\"0664\", GROUP=\"plugdev\" >> /etc/udev/rules.d/99-crazyflie.rules'
# Add user to dialout group, to give access to serial ports
usermod -a -G dialout bitcraze
# Add user to docker group
usermod -a -G docker bitcraze
# Clone the git repos
mkdir ~/projects
cd ~/projects
git clone https://github.com/bitcraze/crazyflie-clients-python.git
git clone https://github.com/bitcraze/crazyflie-lib-python.git
git clone https://github.com/bitcraze/crazyflie-firmware.git --recursive
git clone https://github.com/bitcraze/crazyflie-bootloader.git
git clone https://github.com/bitcraze/crazyradio-firmware.git
git clone https://github.com/bitcraze/crazyflie-android-client.git
git clone https://github.com/bitcraze/crazyflie2-exp-template-electronics.git
git clone https://github.com/bitcraze/crazyflie2-stm-bootloader.git
git clone https://github.com/bitcraze/crazyflie2-nrf-bootloader.git
git clone https://github.com/bitcraze/crazyflie2-nrf-firmware.git
git clone https://github.com/bitcraze/lps-node-firmware.git --recursive
cd ~/
chown bitcraze:bitcraze -R projects
ln -s ~/projects ~/Desktop/projects
# Install VSCode
snap install --classic code
# Install VSCode extensions
sudo -H -u bitcraze code --install-exteman nsion ms-python.python
sudo -H -u bitcraze code --install-extension ms-python.vscode-pylance
sudo -H -u bitcraze code --install-extension ms-vscode.cpptools
sudo -H -u bitcraze code --install-extension seanwu.vscode-qt-for-python
sudo -H -u bitcraze code --install-extension marus25.cortex-debug
# Add user to vboxsf group so shares with host can be used
usermod -a -G vboxsf bitcraze
# Set up crazyflie-clients-python to use crazyflie-lib-python from source
sudo -H -u bitcraze bash -c 'pip3 install --user -e ~/projects/crazyflie-lib-python'
sudo -H -u bitcraze bash -c 'pip3 install --user -e ~/projects/crazyflie-clients-python'
# Clean up VM to minimize image size
apt-get -y autoremove
apt-get -y autoclean
apt-get -y clean
e4defrag /
fstrim -v /