Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/soas-xo.ks
blob: f0fec4c070e1ab64dc90386a24fa0eb9ccab844a (plain)
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
%include soas-sugar.ks
%include soas-aslo-and-content.ks

repo --name=olpc-kernel-xo-1 --cost=2 --baseurl=http://dev.laptop.org/~mdengler/xo-1
repo --name=olpc --cost=3 --baseurl=http://dev.laptop.org/~dsd/xo1.5-rpms

%packages --excludedocs --instLangs en:es:ar:pl:pt_BR:pt:it:fr:ht:el:mn:mr_IN:th:am_ET:km_KH:ne_NP:ur_PK:rw:ja:de:tr:te:ps:fa_AF:si

bootchart
fbida

ntpdate
ohm
xcompmgr

olpc-kbdshim
olpc-powerd

olpc-utils

olpc-bootanim

kernel-2.6.30_xo1
-mkinitrd
-kpartx
-dmraid
-mdadm
-lvm2

# sound backend
-alsa-plugins-pulseaudio
-pulseaudio

%end

%post



##################
# BEGIN olpc.fth
cat > /boot/olpc.fth <<EOF
\ olpc.fth

" root=mtd0 rootfstype=jffs2 console=tty0 console=ttyS0,115200 fbcon=font:SUN12x22" to boot-file
" nand:\boot\vmlinuz" to boot-device
" nand:\boot\initrd.img" to ramdisk

setup-smbios
unfreeze
dcon-unfreeze
visible

boot
EOF

# END olpc.fth
##################



##################
# BEGIN dcon-unfreeze-failsafe


cat > /etc/event.d/dcon-unfreeze-failsafe <<EOF
# this service unfreezes the DCON
# Sugar should do this but a) it might not; and b) we might not be running Sugar
#


description "unfreeze DCON"
author      "Martin Dengler <martin@martindengler.com>"

start on started prefdm
stop on stopping prefdm
stop on starting shutdown

stop on runlevel 0
stop on runlevel 1
stop on runlevel 6

script
echo 0 > /sys/devices/platform/dcon/freeze
end script
EOF

chmod a+rx /etc/event.d/dcon-unfreeze-failsafe

# END dcon-unfreeze-failsafe
##################



CREATE_USERNAME=olpc

##################
# BEGIN avoid livesys script at every boot


cat >> /etc/fstab <<EOF
/tmp            /tmp            tmpfs         rw          0 0
varcacheyum     /var/cache/yum  tmpfs         rw,mode=755 0 0
vartmp          /var/tmp        tmpfs         rw          0 0
none            /ofw            promfs		  defaults    0 0
EOF

mkdir /ofw


/usr/sbin/useradd -m -c "SoaS user" -G audio $CREATE_USERNAME
/usr/bin/passwd -d $CREATE_USERNAME


# permanently set %__dbi_cdb rpm macro to work around jffs2's lack of writeable mmap()
mkdir -p /etc/rpm
echo "%__dbi_cdb create private nommap" > /etc/rpm/macros.rpmdb


# amend build
sed -i -e 's/SoaS/SoaS-XO/g' /etc/fedora-release


# disable screensaver locking
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-screensaver/lock_enabled false >/dev/null


# disable the logout menu item in Sugar
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /desktop/sugar/show_logout false >/dev/null


# nicer console font for our little screen
# FIXME: olpc-configure sets this up too, but it's too late for first boot.
# but perhaps we could fix that so that it gets applied.
echo "SYSFONT=sun12x22" >> /etc/sysconfig/i18n


# make sure the fonts are not too big in GNOME
# FIXME: remove when http://dev.laptop.org/ticket/9331 is fixed
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t float /desktop/gnome/font_rendering/dpi 201 >/dev/null


# make sure the fonts are not too big in Sugar
# FIXME: remove when http://dev.laptop.org/ticket/9331 is fixed
echo "Xft.dpi: 201" > /home/$CREATE_USERNAME/.Xresources
chown $CREATE_USERNAME:$CREATE_USERNAME /home/$CREATE_USERNAME/.Xresources


# use smaller font size for XO
# FIXME: fix upstream at http://dev.sugarlabs.org/ticket/954
sed -i -e 's/Sans Serif 10/Sans Serif 7/g' /usr/share/sugar/data/sugar-100.gtkrc


# install activities
BUNDLES_DIR=/usr/share/sugar/bundles
ACTIVITIES_DIR=/home/$CREATE_USERNAME/Activities
chown -R $CREATE_USERNAME:$CREATE_USERNAME $BUNDLES_DIR
mkdir /home/$CREATE_USERNAME/Activities
chown -R $CREATE_USERNAME:$CREATE_USERNAME $ACTIVITIES_DIR
cd $BUNDLES_DIR
chmod a+x install-activity.py
for file in *.xo; do
    su $CREATE_USERNAME -c "./install-activity.py $file"
done
rm -f install-activity.py

# execute sample content script and clean up afterwards
chmod a+x copy-to-datastore.py
su $CREATE_USERNAME -c ./copy-to-datastore.py
rm -f *.pdf copy-to-datastore.py


# add more activities to the favorites
cat > /usr/share/sugar/data/activities.defaults << FOE
com.garycmartin.Moon
org.laptop.AbiWordActivity
org.laptop.Calculate
org.laptop.Chat
org.laptop.Memorize
org.laptop.Pippy
org.laptop.TurtleArtActivity
org.laptop.WebActivity
org.vpri.EtoysActivity
org.laptop.Oficina
org.laptop.RecordActivity
org.gnome.Labyrinth
org.laptop.physics
vu.lux.olpc.Speak
org.worldwideworkshop.olpc.JigsawPuzzle
FOE

# END avoid livesys scripts at every boot
##################


##################
# BEGIN liveuser .xsession

cat >> /home/$CREATE_USERNAME/.xsession <<EOF

# full debugging on
export LM_DEBUG=net
export GABBLE_DEBUG=all
export GABBLE_LOGFILE=/home/$CREATE_USERNAME/.sugar/default/logs/telepathy-gabble.log
export SALUT_DEBUG=all
export SALUT_LOGFILE=/home/$CREATE_USERNAME/.sugar/default/logs/telepathy-salut.log
export GIBBER_DEBUG=all
export PRESENCESERVICE_DEBUG=1
export SUGAR_LOGGER_LEVEL=debug

# Uncomment the following line to enable core dumps
#ulimit -c unlimited

# Uncomment the following line to debug sugar startup problems
#exec xterm

# If you drop out of this script, the normal olpc-session will proceed
# Uncomment the following line to prevent it
#exit 0

(sleep 5 ; xcompmgr ) &

EOF

# END olpc .xsession
##################



##################
# BEGIN ntpdate

ntpdate_file=/etc/NetworkManager/dispatcher.d/42-ntpdate
if [ ! -e $ntpdate_file ] ; then
   cat >  $ntpdate_file <<EOF
#!/bin/bash

if [ "\$2" = "up" ] ; then
    sleep 5
    /usr/sbin/ntpdate 0.pool.ntp.org >> /tmp/ntpdate.log 2>&1
fi
EOF

chmod u+rx $ntpdate_file

fi

# END ntpdate
##################



##################
# BEGIN smolt

smolt_file=/etc/NetworkManager/dispatcher.d/43-smolt
if [ ! -e $smolt_file ] ; then
   cat >  $smolt_file <<EOF
#!/bin/bash

if [ "\$2" = "up" ] ; then
    sleep 15
    ( nice /usr/bin/smoltSendProfile -a --submitOnly -b -c ||  /usr/sbin/smoltSentProfile -a --submitOnly -b ) >> /tmp/smolt.log 2>&1
fi
EOF

fi

chmod u+rx $smolt_file

# END smolt
##################


##################
# BEGIN make sugar default
cat > /home/$CREATE_USERNAME/.dmrc <<EOF
[Desktop]
Layout=olpc
Session=sugar
EOF
# END make sugar default
##################



##################
# BEGIN set sugar power management on
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /desktop/sugar/power/automatic True >/dev/null
# END set sugar power management on
##################



##################
# BEGIN enable serial console

echo ttyS0 >> /etc/securetty

cat > /etc/event.d/ttyS0 <<EOF
# ttyS0 - serial console
start on stopped rc2
start on stopped rc3
start on stopped rc4
start on stopped prefdm

stop on runlevel 0
stop on runlevel 1
stop on runlevel 6

respawn
exec agetty ttyS0 115200
EOF

# END enable serial console
##################



##################
# BEGIN make /var/log/messages a+r so Log activity can see it
chmod a+r /var/log/messages
# END make /var/log/messages a+r so Log activity can see it
##################


##################
# BEGIN add yum repos
cat >> /etc/yum.repos.d/sugar.repo << FOE
[sugar]
name=Sugar
failovermethod=priority
baseurl=http://download.sugarlabs.org/soas/repositories/2/
enabled=1
gpgcheck=0
FOE

cat >> /etc/yum.repos.d/olpc-xo-1.repo << FOE
[olpc-xo-1]
name=OLPC XO-1
failovermethod=priority
baseurl=http://dev.laptop.org/~mdengler/xo-1
enabled=1
gpgcheck=0
FOE

# END add yum repos
##################


##################
# BEGIN setup services
for service in auditd cpuspeed cups dnsmasq exim firstboot iptables ip6tables irda mdmonitor netfs network nfs nfslock nscd portreserve rpcbind rpcgssd rpcidmapd ; do
    /sbin/chkconfig --level 2345 $service off
done

mv /etc/event.d/powerd /root

for service in avahi-daemon sshd ; do
    /sbin/chkconfig --level 2345 $service on
done
# something triggers prompting, so just turn it off with a big hammer
sed -i -e 's/PROMPT=yes/PROMPT=no/;' /etc/sysconfig/init
# END setup services
##################

%end