Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/soas-sugar.ks
blob: c428924b41222ada6d1052e37668a285a41fb50f (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
%include soas-base.ks

repo --name=sugar --baseurl=http://download.sugarlabs.org/soas/repositories/1/

%packages

# @sugar-desktop
sugar-fructose
sugar-glucose

# honey
sugar-analyze-activity
sugar-paint-activity
sugar-drgeo-activity
sugar-readetexts-activity

# use tamtam from rpm to save space
# (tamtam from ASLO contains common data per each activity)
sugar-tamtam-jam-activity
sugar-tamtam-edit-activity
sugar-tamtam-mini-activity
sugar-tamtam-synthlab-activity

# additional system stuff
alsa-utils
gtksourceview2

# e-mail client
alpine

# display manager
slim

# flash implementation
gnash-plugin

# support video streams in Browse
totem-mozplugin

# exclude input methods
-scim*
-m17n*

# dictionaries are big
-aspell-*
-hunspell-*
-man-pages-*
-words

# no printing
-system-config-printer
-cups*
-foomatic*
-gutenprint*

# remove SELinux stack
-setroubleshoot
-policycoreutils
-policycoreutils-gui
-checkpolicy
-selinux-policy*
-libselinux-python
-libselinux

# save more space
-anaconda
-firstboot
-bluez
-samba*
-smolt*
-solar-backgrounds

# strip fedora trademarks
-fedora-logos
generic-logos

%end

%post
cat > /etc/sysconfig/desktop <<EOF
DISPLAYMANAGER=/usr/bin/slim-dynwm
EOF

# 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

cat >> /etc/rc.d/init.d/livesys << EOF

chkconfig --level 5 setroubleshoot off 2>/dev/null
chkconfig --level 5 sendmail off 2>/dev/null
chkconfig --level 5 bluetooth off 2>/dev/null
chkconfig --level 5 cupsd off 2>/dev/null

# 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

# setup auto-login for slim
cat >> /etc/slim.conf << FOE
auto_login	yes
default_user	liveuser
FOE

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

# setup Xclients
cat >> /home/liveuser/.Xclients << FOE
xsetroot -def

RESOLUTION=\\\$(xdpyinfo | grep resolution | sed "s/.* \\([0-9][0-9]*\\)x.*/\\1/")
if [ "\\\$RESOLUTION" -gt 150 ]; then
    SUGAR_SCALING=100
else
    SUGAR_SCALING=72
fi

SUGAR_SCALING=\\\$SUGAR_SCALING sugar
FOE

chmod a+x /home/liveuser/.Xclients
chown liveuser:liveuser /home/liveuser/.Xclients

# setup support for QEMU
grep QEMU /sys/firmware/acpi/tables/APIC >/dev/null \
    && cat > /etc/X11/xorg.conf <<FOE
Section "ServerLayout"
        Identifier     "Default layout"
        Screen      0  "Screen0" 0 0
        InputDevice    "Keyboard0" "CoreKeyboard"
EndSection
 
Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
        Option      "XkbModel" "pc105+inet"
        Option      "XkbLayout" "us"
EndSection
 
Section "Monitor"
        Identifier   "Monitor0"
        ModelName    "Monitor 1024x768"
        HorizSync    31.5 - 61.0
        VertRefresh  50.0 - 75.0
        Option      "dpms"
EndSection
 
Section "Device"
        Identifier  "Videocard0"
        Driver      "cirrus"
EndSection
 
Section "Screen"
        Identifier "Screen0"
        Device     "Videocard0"
        Monitor    "Monitor0"
        DefaultDepth     24
        SubSection "Display"
                Viewport   0 0
                Depth     24
        EndSubSection
EndSection
FOE

# setup activity directory
mkdir -p /home/liveuser/Activities
chown liveuser:liveuser /home/liveuser/Activities
for bundle in \`find /usr/share/sugar/bundles -maxdepth 1\` ; do
  ln -s \$bundle /home/liveuser/Activities
done

# free the alsa
echo 'chmod 0666 /dev/snd/*' >> /etc/rc.d/rc.local

# if system doesn't support hardware mixing
aplay -l | grep '\/[0-9]\+$' | head -n1 | grep '\/1$' \
    && cat > /etc/asound.conf <<FOE
pcm.!default {
    type plug
    slave.pcm "dmixer"
}
pcm.dmixer {
    type dmix
    ipc_key 1024
    ipc_perm 0666
    slave {
        pcm "hw:\`aplay -l | grep -o '^card [0-9]\+' | head -n1 | awk '{print \$2}'\`,0"
        period_time 0
        period_size 1024
        buffer_size 8192
    }
}
bindings {
    0 0
    1 1
}
FOE

EOF

%end

%post --nochroot

ASLO="4041" # Pippy
ASLO="$ASLO 4042" # InfoSlicer
ASLO="$ASLO 4034" # Moon
ASLO="$ASLO 4046" # JigsawPuzzle
ASLO="$ASLO 4047" # SliderPuzzle
ASLO="$ASLO 4063" # Memorize
ASLO="$ASLO 4038" # Speak
ASLO="$ASLO 4026" # Typing Turtle
ASLO="$ASLO 4040" # Finance
ASLO="$ASLO 4037" # CartoonBuilder
ASLO="$ASLO 4044" # FlipSticks
ASLO="$ASLO 4064" # JokeMachine
ASLO="$ASLO 4029" # IRC
ASLO="$ASLO 4054" # FreeCell
ASLO="$ASLO 4039" # ViewSlides
ASLO="$ASLO 4055" # Bounce
ASLO="$ASLO 4050" # Colors
ASLO="$ASLO 4073" # StoryBuilder
ASLO="$ASLO 4071" # Maze
ASLO="$ASLO 4074" # Poll
ASLO="$ASLO 4058" # Develop

WD=$PWD
BUNDLES_DIR=$INSTALL_ROOT/usr/share/sugar/bundles

mkdir -p $BUNDLES_DIR
cd $BUNDLES_DIR

for id in $ASLO ; do
  curl -L http://activities.sugarlabs.org/en-US/sugar/downloads/latest/$id > $id.xo
done

for file in *.xo ; do
    unzip $file
    rm $file
done

cd $WD

%end