1 |
# fedora-live-mini.ks |
2 |
# |
3 |
# Defines the basics for all kickstarts in the fedora-mini branch |
4 |
|
5 |
lang en_US.UTF-8 |
6 |
keyboard us |
7 |
timezone US/Eastern |
8 |
auth --useshadow --enablemd5 |
9 |
selinux --permissive |
10 |
firewall --enabled --service=mdns |
11 |
xconfig --startxonboot |
12 |
part / --size 4096 --fstype ext4 |
13 |
services --enabled=NetworkManager,messagebus --disabled=network,sshd |
14 |
|
15 |
# To compose against the current release tree, use the following "repo" (enabled by default) |
16 |
repo --name=released --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-13&arch=$basearch |
17 |
# To include updates, use the following "repo" (enabled by default) |
18 |
#repo --name=updates --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f13&arch=$basearch |
19 |
|
20 |
# To compose against rawhide, use the following "repo" (disabled by default) |
21 |
#repo --name=rawhide --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=rawhide&arch=$basearch |
22 |
|
23 |
# To compose against local trees, (edit and) use: |
24 |
#repo --name=f11 --baseurl=http://localrepo/fedora/releases/11/Everything/$basearch/os/ |
25 |
|
26 |
%packages |
27 |
@base-x |
28 |
@base |
29 |
@core |
30 |
@hardware-support |
31 |
@fonts |
32 |
@input-methods |
33 |
kernel |
34 |
memtest86+ |
35 |
|
36 |
# Remove default base packages we don't want |
37 |
-ccid |
38 |
-coolkey |
39 |
-device-mapper-multipath |
40 |
-dos2unix |
41 |
-dump |
42 |
-finger |
43 |
-fprintd-pam |
44 |
-hunspell |
45 |
-irda-utils |
46 |
-jwhois |
47 |
-lftp |
48 |
-mcelog |
49 |
-mlocate |
50 |
-nano |
51 |
-nc |
52 |
-nfs-utils |
53 |
-nss_db |
54 |
-nss_ldap |
55 |
-numactl |
56 |
-pcmciautils |
57 |
-perf |
58 |
-pm-utils |
59 |
-prctl |
60 |
-rdate |
61 |
-rdist |
62 |
-rsh |
63 |
-rsync |
64 |
-sendmail |
65 |
-sos |
66 |
-specspo |
67 |
-stunnel |
68 |
-system-config-firewall-tui |
69 |
-system-config-network-tui |
70 |
-talk |
71 |
-time |
72 |
-tree |
73 |
-unix2dos |
74 |
-words |
75 |
-ypbind |
76 |
|
77 |
# Remove default base-x packages we don't want |
78 |
-bitmap-fonts |
79 |
-cups-pk-helper |
80 |
-glx-utils |
81 |
-system-config-date |
82 |
-system-config-firewall |
83 |
-system-config-network |
84 |
-system-config-printer |
85 |
-system-config-services |
86 |
-system-config-users |
87 |
|
88 |
# Remove default core packages we don't want |
89 |
-ppc64-utils |
90 |
-s390utils |
91 |
-sendmail |
92 |
-silo |
93 |
-yaboot |
94 |
|
95 |
# Remove default unwanted hardware firmware and support we don't want |
96 |
-b43-fwcutter |
97 |
-foo2hiperc |
98 |
-foo2hp |
99 |
-foo2lava |
100 |
-foo2qpdl |
101 |
-foo2slx |
102 |
-foo2xqx |
103 |
-foo2zjs |
104 |
-ivtv-firmware |
105 |
-printer-filters |
106 |
-ql2100-firmware |
107 |
-ql2200-firmware |
108 |
-ql23xx-firmware |
109 |
-ql2400-firmware |
110 |
-ql2500-firmware |
111 |
# These are listed somewhere other than hardware support! |
112 |
-irda-utils |
113 |
-fprintd* |
114 |
|
115 |
# Remove unwanted default fonts we don't want |
116 |
-abyssinica-fonts |
117 |
-cjkuni-uming-fonts |
118 |
-jomolhari-fonts |
119 |
-kacst* |
120 |
-khmeros-base-fonts |
121 |
-lklug-fonts |
122 |
-lohit* |
123 |
-padauk-fonts |
124 |
-paktype* |
125 |
-smc-meera-fonts |
126 |
-stix-fonts |
127 |
-thai-scalable-waree-fonts |
128 |
-un-core-dotum-fonts |
129 |
-vlgothic-fonts |
130 |
|
131 |
# Remove default input-methods we don't want |
132 |
-ibus* |
133 |
-m17n* |
134 |
|
135 |
# dictionaries are big |
136 |
-aspell-* |
137 |
-hunspell-* |
138 |
-man-pages* |
139 |
-words |
140 |
|
141 |
# livecd bits to set up the livecd and be able to install |
142 |
anaconda |
143 |
|
144 |
# Add some useful utils |
145 |
system-config-firewall-base |
146 |
gnome-packagekit |
147 |
powertop |
148 |
gnupg2 |
149 |
yum-presto |
150 |
# Add this so we don't pull in sendmail/exim |
151 |
ssmtp |
152 |
|
153 |
%end |
154 |
|
155 |
%post |
156 |
# FIXME: it'd be better to get this installed from a package |
157 |
cat > /etc/rc.d/init.d/livesys << EOF |
158 |
#!/bin/bash |
159 |
# |
160 |
# live: Init script for live image |
161 |
# |
162 |
# chkconfig: 345 00 99 |
163 |
# description: Init script for live image. |
164 |
|
165 |
. /etc/init.d/functions |
166 |
|
167 |
if ! strstr "\`cat /proc/cmdline\`" liveimg || [ "\$1" != "start" ]; then |
168 |
exit 0 |
169 |
fi |
170 |
|
171 |
if [ -e /.liveimg-configured ] ; then |
172 |
configdone=1 |
173 |
fi |
174 |
|
175 |
exists() { |
176 |
which \$1 >/dev/null 2>&1 || return |
177 |
\$* |
178 |
} |
179 |
|
180 |
touch /.liveimg-configured |
181 |
|
182 |
# mount live image |
183 |
if [ -b \`readlink -f /dev/live\` ]; then |
184 |
mkdir -p /mnt/live |
185 |
mount -o ro /dev/live /mnt/live 2>/dev/null || mount /dev/live /mnt/live |
186 |
fi |
187 |
|
188 |
livedir="LiveOS" |
189 |
for arg in \`cat /proc/cmdline\` ; do |
190 |
if [ "\${arg##live_dir=}" != "\${arg}" ]; then |
191 |
livedir=\${arg##live_dir=} |
192 |
return |
193 |
fi |
194 |
done |
195 |
|
196 |
# enable swaps unless requested otherwise |
197 |
swaps=\`blkid -t TYPE=swap -o device\` |
198 |
if ! strstr "\`cat /proc/cmdline\`" noswap && [ -n "\$swaps" ] ; then |
199 |
for s in \$swaps ; do |
200 |
action "Enabling swap partition \$s" swapon \$s |
201 |
done |
202 |
fi |
203 |
if ! strstr "\`cat /proc/cmdline\`" noswap && [ -f /mnt/live/\${livedir}/swap.img ] ; then |
204 |
action "Enabling swap file" swapon /mnt/live/\${livedir}/swap.img |
205 |
fi |
206 |
|
207 |
mountPersistentHome() { |
208 |
# support label/uuid |
209 |
if [ "\${homedev##LABEL=}" != "\${homedev}" -o "\${homedev##UUID=}" != "\${homedev}" ]; then |
210 |
homedev=\`/sbin/blkid -o device -t "\$homedev"\` |
211 |
fi |
212 |
|
213 |
# if we're given a file rather than a blockdev, loopback it |
214 |
if [ "\${homedev##mtd}" != "\${homedev}" ]; then |
215 |
# mtd devs don't have a block device but get magic-mounted with -t jffs2 |
216 |
mountopts="-t jffs2" |
217 |
elif [ ! -b "\$homedev" ]; then |
218 |
loopdev=\`losetup -f\` |
219 |
if [ "\${homedev##/mnt/live}" != "\${homedev}" ]; then |
220 |
action "Remounting live store r/w" mount -o remount,rw /mnt/live |
221 |
fi |
222 |
losetup \$loopdev \$homedev |
223 |
homedev=\$loopdev |
224 |
fi |
225 |
|
226 |
# if it's encrypted, we need to unlock it |
227 |
if [ "\$(/sbin/blkid -s TYPE -o value \$homedev 2>/dev/null)" = "crypto_LUKS" ]; then |
228 |
echo |
229 |
echo "Setting up encrypted /home device" |
230 |
plymouth ask-for-password --command="cryptsetup luksOpen \$homedev EncHome" |
231 |
homedev=/dev/mapper/EncHome |
232 |
fi |
233 |
|
234 |
# and finally do the mount |
235 |
mount \$mountopts \$homedev /home |
236 |
# if we have /home under what's passed for persistent home, then |
237 |
# we should make that the real /home. useful for mtd device on olpc |
238 |
if [ -d /home/home ]; then mount --bind /home/home /home ; fi |
239 |
[ -x /sbin/restorecon ] && /sbin/restorecon /home |
240 |
if [ -d /home/liveuser ]; then USERADDARGS="-M" ; fi |
241 |
} |
242 |
|
243 |
findPersistentHome() { |
244 |
for arg in \`cat /proc/cmdline\` ; do |
245 |
if [ "\${arg##persistenthome=}" != "\${arg}" ]; then |
246 |
homedev=\${arg##persistenthome=} |
247 |
return |
248 |
fi |
249 |
done |
250 |
} |
251 |
|
252 |
if strstr "\`cat /proc/cmdline\`" persistenthome= ; then |
253 |
findPersistentHome |
254 |
elif [ -e /mnt/live/\${livedir}/home.img ]; then |
255 |
homedev=/mnt/live/\${livedir}/home.img |
256 |
fi |
257 |
|
258 |
# if we have a persistent /home, then we want to go ahead and mount it |
259 |
if ! strstr "\`cat /proc/cmdline\`" nopersistenthome && [ -n "\$homedev" ] ; then |
260 |
action "Mounting persistent /home" mountPersistentHome |
261 |
fi |
262 |
|
263 |
# make it so that we don't do writing to the overlay for things which |
264 |
# are just tmpdirs/caches |
265 |
mount -t tmpfs -o mode=0755 varcacheyum /var/cache/yum |
266 |
mount -t tmpfs tmp /tmp |
267 |
mount -t tmpfs vartmp /var/tmp |
268 |
[ -x /sbin/restorecon ] && /sbin/restorecon /var/cache/yum /tmp /var/tmp >/dev/null 2>&1 |
269 |
|
270 |
if [ -n "\$configdone" ]; then |
271 |
exit 0 |
272 |
fi |
273 |
|
274 |
# add fedora user with no passwd |
275 |
action "Adding live user" useradd \$USERADDARGS -c "Live System User" liveuser |
276 |
passwd -d liveuser > /dev/null |
277 |
|
278 |
# turn off firstboot for livecd boots |
279 |
chkconfig --level 345 firstboot off 2>/dev/null |
280 |
|
281 |
# don't start yum-updatesd for livecd boots |
282 |
chkconfig --level 345 yum-updatesd off 2>/dev/null |
283 |
|
284 |
# turn off mdmonitor by default |
285 |
chkconfig --level 345 mdmonitor off 2>/dev/null |
286 |
|
287 |
# turn off setroubleshoot on the live image to preserve resources |
288 |
chkconfig --level 345 setroubleshoot off 2>/dev/null |
289 |
|
290 |
# don't do packagekit checking by default |
291 |
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t string /apps/gnome-packagekit/frequency_get_updates never >/dev/null |
292 |
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t string /apps/gnome-packagekit/frequency_get_upgrades never >/dev/null |
293 |
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t string /apps/gnome-packagekit/frequency_refresh_cache never >/dev/null |
294 |
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/notify_available false >/dev/null |
295 |
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/notify_distro_upgrades false >/dev/null |
296 |
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_check_firmware false >/dev/null |
297 |
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_check_hardware false >/dev/null |
298 |
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_codec_helper false >/dev/null |
299 |
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_font_helper false >/dev/null |
300 |
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_mime_type_helper false >/dev/null |
301 |
|
302 |
|
303 |
# don't start cron/at as they tend to spawn things which are |
304 |
# disk intensive that are painful on a live image |
305 |
chkconfig --level 345 crond off 2>/dev/null |
306 |
chkconfig --level 345 atd off 2>/dev/null |
307 |
chkconfig --level 345 readahead_early off 2>/dev/null |
308 |
chkconfig --level 345 readahead_later off 2>/dev/null |
309 |
|
310 |
# Stopgap fix for RH #217966; should be fixed in HAL instead |
311 |
touch /media/.hal-mtab |
312 |
|
313 |
# workaround clock syncing on shutdown that we don't want (#297421) |
314 |
sed -i -e 's/hwclock/no-such-hwclock/g' /etc/rc.d/init.d/halt |
315 |
|
316 |
# and hack so that we eject the cd on shutdown if we're using a CD... |
317 |
if strstr "\`cat /proc/cmdline\`" CDLABEL= ; then |
318 |
cat >> /sbin/halt.local << FOE |
319 |
#!/bin/bash |
320 |
# we want to eject the cd on halt, but let's also try to avoid |
321 |
# io errors due to not being able to get files... |
322 |
cat /sbin/halt > /dev/null |
323 |
cat /sbin/reboot > /dev/null |
324 |
/usr/sbin/eject -p -m \$(readlink -f /dev/live) >/dev/null 2>&1 |
325 |
echo "Please remove the CD from your drive and press Enter to finish restarting" |
326 |
read -t 30 < /dev/console |
327 |
FOE |
328 |
chmod +x /sbin/halt.local |
329 |
fi |
330 |
|
331 |
EOF |
332 |
|
333 |
# bah, hal starts way too late |
334 |
cat > /etc/rc.d/init.d/livesys-late << EOF |
335 |
#!/bin/bash |
336 |
# |
337 |
# live: Late init script for live image |
338 |
# |
339 |
# chkconfig: 345 99 01 |
340 |
# description: Late init script for live image. |
341 |
|
342 |
. /etc/init.d/functions |
343 |
|
344 |
if ! strstr "\`cat /proc/cmdline\`" liveimg || [ "\$1" != "start" ] || [ -e /.liveimg-late-configured ] ; then |
345 |
exit 0 |
346 |
fi |
347 |
|
348 |
exists() { |
349 |
which \$1 >/dev/null 2>&1 || return |
350 |
\$* |
351 |
} |
352 |
|
353 |
touch /.liveimg-late-configured |
354 |
|
355 |
# read some variables out of /proc/cmdline |
356 |
for o in \`cat /proc/cmdline\` ; do |
357 |
case \$o in |
358 |
ks=*) |
359 |
ks="\${o#ks=}" |
360 |
;; |
361 |
xdriver=*) |
362 |
xdriver="--set-driver=\${o#xdriver=}" |
363 |
;; |
364 |
esac |
365 |
done |
366 |
|
367 |
# if liveinst or textinst is given, start anaconda |
368 |
if strstr "\`cat /proc/cmdline\`" liveinst ; then |
369 |
plymouth --quit |
370 |
/usr/sbin/liveinst \$ks |
371 |
fi |
372 |
if strstr "\`cat /proc/cmdline\`" textinst ; then |
373 |
plymouth --quit |
374 |
/usr/sbin/liveinst --text \$ks |
375 |
fi |
376 |
|
377 |
# configure X, allowing user to override xdriver |
378 |
if [ -n "\$xdriver" ]; then |
379 |
exists system-config-display --noui --reconfig --set-depth=24 \$xdriver |
380 |
fi |
381 |
|
382 |
EOF |
383 |
|
384 |
chmod 755 /etc/rc.d/init.d/livesys |
385 |
/sbin/restorecon /etc/rc.d/init.d/livesys |
386 |
/sbin/chkconfig --add livesys |
387 |
|
388 |
chmod 755 /etc/rc.d/init.d/livesys-late |
389 |
/sbin/restorecon /etc/rc.d/init.d/livesys-late |
390 |
/sbin/chkconfig --add livesys-late |
391 |
|
392 |
# work around for poor key import UI in PackageKit |
393 |
rm -f /var/lib/rpm/__db* |
394 |
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora |
395 |
|
396 |
# go ahead and pre-make the man -k cache (#455968) |
397 |
/usr/sbin/makewhatis -w |
398 |
|
399 |
# save a little bit of space at least... |
400 |
rm -f /boot/initrd* |
401 |
# make sure there aren't core files lying around |
402 |
rm -f /core* |
403 |
|
404 |
%end |
405 |
|
406 |
|
407 |
%post |
408 |
cp $INSTALL_ROOT/usr/share/doc/*-release-*/GPL $LIVE_ROOT/GPL |
409 |
cp $INSTALL_ROOT/usr/share/doc/HTML/readme-live-image/en_US/readme-live-image-en_US.txt $LIVE_ROOT/README |
410 |
|
411 |
# only works on x86, x86_64 |
412 |
if [ "$(uname -i)" = "i386" -o "$(uname -i)" = "x86_64" ]; then |
413 |
if [ ! -d $LIVE_ROOT/LiveOS ]; then mkdir -p $LIVE_ROOT/LiveOS ; fi |
414 |
cp /usr/bin/livecd-iso-to-disk $LIVE_ROOT/LiveOS |
415 |
fi |
416 |
%end |