-
Notifications
You must be signed in to change notification settings - Fork 0
/
ks_arsandbox.cfg
414 lines (367 loc) · 10.8 KB
/
ks_arsandbox.cfg
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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
# Kickstart file
install
#text
#url --url http://mirror.centos.org/centos/7/os/x86_64
lang en_US.UTF-8
keyboard --vckeymap=us --xlayouts='us'
network --bootproto=dhcp
firewall --disabled
authconfig --useshadow --passalgo=sha512
selinux --disabled
timezone --utc America/New_York
bootloader --location=mbr
#
# create a default user
#
# set to "arsandbox" (you can generate it with (python -c 'import crypt; print(crypte.crypt("Your New Password"))' )
#
user --name=arsandbox --homedir=/home/arsandbox --shell=/bin/bash --password=$6$y1VANISK4xJ0hQCa$95rwBuMlynA8U.w0ML1y5BS.Y/m.VLRtv9nakXjNbi7n9QubAVn3IDhuL0ZkDO9IGMwsP5jFTU1FVQjXnJFki/ --iscrypted
%packages
@core
%end
%pre --log=/root/installation_pre.log
HostName=`hostname -f`
mkdir -p /mnt/ks
%end
%post --log=/root/installation_post.log
#---------------------------------------------
#
# Variable Declaration (edit for your setup)
#
#---------------------------------------------
#
hostname $HostName
echo ${HostName} > /etc/hostname
#
# install EPEL yum repo
#
yum -y install epel-release
#
# Install Graphical user interface
#
yum -y groupinstall gnome-apps kde-desktop kde-apps print-client x11
yum -y install mvapich2 gcc freeglut freeglut-devel gl-manpages libICE-devel libSM-devel libX11-devel libXau-devel libXdamage-devel libXext-devel libXi-devel libXmu-devel libXt-devel libXxf86vm-devel libdrm-devel libxcb-devel mesa-libGL-devel mesa-libGLU-devel xorg-x11-proto-devel
rpm -ev initial-setup-gui initial-setup
rpm -ev gnome-initial-setup
#
# set graphical login
#
systemctl set-default graphical.target
#
# Update OS
#
yum -y update
#
# Set up mail alias for root
# (enter your email address so messages from the admin account (root) will get sent to someone. Then uncomment the following three lines.)
#
#sed -i s/\#root\:/root\:/ /etc/aliases
#sed -i s/marc/<[email protected]>/ /etc/aliases
#newaliases
#
# Installation of Augmented Reality Sandbox (https://arsandbox.ucdavis.edu/)
#
#
# Install Requirements
#
yum -y install zlib zlib-devel \
libGL libGL-devel \
libusb libusb-devel \
mesa-libGLU mesa-libGLU-devel \
udev libudev-devel \
libusb1 libusb1-devel \
libpng libpng-devel \
libjpeg libjpeg-devel \
libtiff libtiff-devel \
alsa-lib alsa-lib-devel \
openal-soft openal-soft-devel \
libv4l libv4l-devel \
bluez-libs bluez-libs-devel \
libdc1394 libdc1394-devel \
libXrandr libXrandr-devel \
libXi libXi-devel \
speex speex-devel \
libogg libogg-devel \
libtheora libtheora-devel
#
# Git the software
#
yum -y install git gcc-c++
cd /opt
git clone https://github.com/KeckCAVES/Vrui.git
mv Vrui Vrui-4.2_006
git clone https://github.com/KeckCAVES/Kinect.git
mv Kinect Kinect-3.2
git clone https://github.com/KeckCAVES/SARndbox.git
mv SARndbox SARndbox-2.3
#
# configure Vrui
#
sed -i 's|# SYSTEM_HAVE_LIBUDEV = 0|SYSTEM_HAVE_LIBUDEV = 1|g' /opt/Vrui-4.2_006/makefile
sed -i 's|# SYSTEM_HAVE_LIBUSB1 = 0|SYSTEM_HAVE_LIBUSB1 = 1|g' /opt/Vrui-4.2_006/makefile
sed -i 's|# SYSTEM_HAVE_LIBPNG = 0|SYSTEM_HAVE_LIBPNG = 1|g' /opt/Vrui-4.2_006/makefile
sed -i 's|# SYSTEM_HAVE_LIBJPEG = 0|SYSTEM_HAVE_LIBJPEG = 1|g' /opt/Vrui-4.2_006/makefile
sed -i 's|# SYSTEM_HAVE_LIBTIFF = 0|SYSTEM_HAVE_LIBTIFF = 1|g' /opt/Vrui-4.2_006/makefile
sed -i 's|# SYSTEM_HAVE_ALSA = 0|SYSTEM_HAVE_ALSA = 1|g' /opt/Vrui-4.2_006/makefile
sed -i 's|# SYSTEM_HAVE_OPENAL = 0|SYSTEM_HAVE_OPENAL = 1|g' /opt/Vrui-4.2_006/makefile
sed -i 's|# SYSTEM_HAVE_BLUETOOTH = 0|SYSTEM_HAVE_BLUETOOTH = 1|g' /opt/Vrui-4.2_006/makefile
sed -i 's|# SYSTEM_HAVE_DC1394 = 0|SYSTEM_HAVE_DC1394 = 1|g' /opt/Vrui-4.2_006/makefile
sed -i 's|# SYSTEM_HAVE_XRANDR = 0|SYSTEM_HAVE_XRANDR = 1|g' /opt/Vrui-4.2_006/makefile
sed -i 's|# SYSTEM_HAVE_SPEEX = 0|SYSTEM_HAVE_SPEEX = 1|g' /opt/Vrui-4.2_006/makefile
sed -i 's|# SYSTEM_HAVE_THEORA = 0|SYSTEM_HAVE_THEORA = 1|g' /opt/Vrui-4.2_006/makefile
#
# configure SARndbox-2.3
#
sed -i 's|INSTALLDIR := $(PWD)|INSTALLDIR := /usr/local|g' /opt/SARndbox-2.3/makefile
#
# now build Vrui
#
cd Vrui-4.2_006
make
make install
cd ..
#
# Build Kinect
#
cd Kinect-3.2
make
make install
cd ..
#
# Build SARndbox
#
cd SARndbox-2.3
make
make install
cd ..
#
# set ownership of /opt and /usr/local to arsandbox
#
chown -R arsandbox:arsandbox /opt /usr/local
#
# Setup sudo for arsandbox
#
echo "arsandbox ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/arsandbox
#
# Additional software configuration
#
mkdir -p /home/arsandbox/.config/Vrui-4.2/Applications
touch /home/arsandbox/.config/Vrui-4.2/Applications/CalibrateProjector.cfg
touch /home/arsandbox/.config/Vrui-4.2/Applications/SARndbox.cfg
touch /home/arsandbox/.config/Vrui-4.2/Applications/XBackground.cfg
tee /home/arsandbox/.config/Vrui-4.2/Applications/CalibrateProjector.cfg <<EOF
section Vrui
section Desktop
section Window
windowFullscreen true
endsection
section Tools
section DefaultTools
section CalibrationTool
toolClass CaptureTool
bindings ((Mouse, 1, 2))
endsection
endsection
endsection
endsection
endsection
EOF
tee /home/arsandbox/.config/Vrui-4.2/Applications/SARndbox.cfg <<EOF
section Vrui
section Desktop
section MouseAdapter
mouseIdleTimeout 3.0
endsection
section Window
windowFullscreen true
endsection
section Tools
section DefaultTools
section WaterTool
toolClass GlobalWaterTool
bindings ((Mouse, 1, 2))
endsection
endsection
endsection
endsection
endsection
EOF
tee /home/arsandbox/.config/Vrui-4.2/Applications/XBackground.cfg <<EOF
section Vrui
section Desktop
section Window
windowFullscreen true
endsection
endsection
endsection
EOF
#
# Configure autologin for arsandbox user
#
sed -i 's|\[daemon\]|\[daemon\]\nAutomaticLoginEnable\=true\nAutomaticLogin\=arsandbox\n|g' /etc/gdm/custom.conf
#
# Setup arsandbox user menu's for SARnbox applications
#
mkdir -p /home/arsandbox/.local/share/applications
mkdir -p /home/arsandbox/.config/menus
touch /home/arsandbox/.local/share/applications/CalibrateProjector.desktop
touch /home/arsandbox/.local/share/applications/EditBoxLayout.desktop
touch /home/arsandbox/.local/share/applications/RawKinectViewer.desktop
touch /home/arsandbox/.local/share/applications/SARndbox.desktop
touch /home/arsandbox/.local/share/applications/UsingVruiApplications.desktop
touch /home/arsandbox/.local/share/applications/XBackground.desktop
touch /home/arsandbox/.config/menus/applications-kmenuedit.menu
tee /home/arsandbox/.local/share/applications/CalibrateProjector.desktop <<EOF
[Desktop Entry]
Comment=
Exec=sudo /usr/local/bin/CalibrateProjector -s 1024 768
Icon=video-projector
Name=CalibrateProjector
NoDisplay=false
Path[$e]=
StartupNotify=false
Terminal=1
TerminalOptions=
Type=Application
X-KDE-SubstituteUID=false
X-KDE-Username=
EOF
tee /home/arsandbox/.local/share/applications/EditBoxLayout.desktop <<EOF
[Desktop Entry]
Comment=
Exec=kwrite /usr/local/etc/SARndbox-2.3/BoxLayout.txt
GenericName=Open BoxLayout.txt in kwrite editor
Icon=accessories-text-editor
Name=Edit BoxLayout.txt
NoDisplay=false
Path[$e]=
StartupNotify=false
Terminal=0
TerminalOptions=
Type=Application
X-KDE-SubstituteUID=false
X-KDE-Username=
EOF
tee /home/arsandbox/.local/share/applications/RawKinectViewer.desktop <<EOF
[Desktop Entry]
Comment=
Exec=sudo /usr/local/bin/RawKinectViewer -compress 0
GenericName=Raw Kinect Viewer
Icon=camera-web
Name=RawKinectViewer
NoDisplay=false
Path[$e]=
StartupNotify=false
Terminal=1
TerminalOptions=
Type=Application
X-KDE-SubstituteUID=false
X-KDE-Username=
EOF
tee /home/arsandbox/.local/share/applications/SARndbox.desktop <<EOF
[Desktop Entry]
Comment="Augemented Reality Sandbox"
Exec=sudo /usr/local/bin/SARndbox -uhm -fpv
Icon=plasmaapplet-shelf
Name=SARndbox
NoDisplay=false
Path[$e]=
StartupNotify=false
Terminal=0
TerminalOptions=
Type=Application
X-KDE-SubstituteUID=false
X-KDE-Username=
EOF
tee /home/arsandbox/.local/share/applications/UsingVruiApplications.desktop <<EOF
[Desktop Entry]
Comment=
Exec=konqueror /usr/local/share/doc/Vrui-4.2/UsingVruiApplications.html
GenericName=Using Vrui Application Manual
Icon=accessories-dictionary
Name=Using Vrui Applications
NoDisplay=false
Path[$e]=
StartupNotify=false
Terminal=0
TerminalOptions=
Type=Application
X-KDE-SubstituteUID=false
X-KDE-Username=
EOF
tee /home/arsandbox/.local/share/applications/XBackground.desktop <<EOF
[Desktop Entry]
Comment=
Exec=/usr/local/bin/XBackground
GenericName=XBackground Vrui application
Icon=xorg
Name=XBackground
NoDisplay=false
Path[$e]=
StartupNotify=false
Terminal=0
TerminalOptions=
Type=Application
X-KDE-SubstituteUID=false
X-KDE-Username=
EOF
tee /home/arsandbox/.config/menus/applications-kmenuedit.menu <<EOF
DOCTYPE Menu PUBLIC '-//freedesktop//DTD Menu 1.0//EN' 'http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd'>
<Menu>
<Menu>
<Name>SARndbox</Name>
<Include>
<Filename>UsingVruiApplications.desktop</Filename>
<Filename>RawKinectViewer.desktop</Filename>
<Filename>SARndbox.desktop</Filename>
<Filename>XBackground.desktop</Filename>
<Filename>CalibrateProjector.desktop</Filename>
<Filename>EditBoxLayout.desktop</Filename>
</Include>
<Exclude/>
<Layout>
<Merge type="files"/>
<Filename>UsingVruiApplications.desktop</Filename>
<Filename>RawKinectViewer.desktop</Filename>
<Filename>EditBoxLayout.desktop</Filename>
<Filename>XBackground.desktop</Filename>
<Filename>CalibrateProjector.desktop</Filename>
<Filename>SARndbox.desktop</Filename>
</Layout>
</Menu>
<Layout>
<Merge type="menus"/>
<Menuname>System Settings</Menuname>
<Menuname>Development</Menuname>
<Menuname>Education</Menuname>
<Menuname>Games</Menuname>
<Menuname>Graphics</Menuname>
<Menuname>Internet</Menuname>
<Menuname>Office</Menuname>
<Menuname>SARndbox</Menuname>
<Menuname>Science</Menuname>
<Menuname>Settingsmenu</Menuname>
<Menuname>System</Menuname>
<Menuname>Utilities</Menuname>
<Menuname>Applications</Menuname>
<Menuname>Multimedia</Menuname>
<Merge type="files"/>
<Filename>kde4-kfind.desktop</Filename>
<Filename>kde4-Help.desktop</Filename>
<Filename>kde4-Home.desktop</Filename>
</Layout>
</Menu>
EOF
sed -i 's|DOCTYPE|\<\!DOCTYPE|g' /home/arsandbox/.config/menus/applications-kmenuedit.menu
#
# Set home directory permissions
#
chown -R arsandbox:arsandbox /home/arsandbox
echo ""
echo "#"
echo "# FINISHED with installation of this Linux host in ${SECONDS} seconds."
echo -n "#"
echo `date`
echo ""
reboot
%end