Subversion Repositories livecd

Rev

Rev 382 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
381 beyerleu 1
 
2
lang en_GB.UTF-8
3
keyboard us
4
timezone Europe/Brussels --isUtc
5
auth --useshadow --enablemd5
6
selinux --enforcing
7
firewall --enabled --service=mdns
8
xconfig --startxonboot
9
part / --size 8192 --fstype ext4
10
services --enabled=NetworkManager --disabled=network,sshd
11
 
12
 
13
# Root password
14
rootpw --iscrypted $6$K2nKf02kVKG68960$OywvoaViphSITuro/liKvCj7Pm/CH/xqzz/lsoXyaKSR1lYf0vHAqSUc483a9MCCBkIwfr/hNMfqwxqVO0OEg1
15
 
16
repo --name=base --baseurl=http://ftp.scientificlinux.org/linux/scientific/7.0/x86_64/os/
17
#repo --name=base --baseurl=http://mirror.switch.ch/ftp/mirror/scientificlinux/7.0/x86_64/os/
18
 
19
%packages
20
@base
21
@core
22
@dial-up
23
@directory-client
24
@fonts
25
@kde-desktop
26
@guest-agents
27
@guest-desktop-agents
28
@input-methods
29
@internet-browser
30
@java-platform
31
@multimedia
32
@network-file-system-client
33
@print-client
34
@x11
35
@internet-applications
36
@office-suite
37
@remote-desktop-clients
38
@kde-apps
39
@kde-media
40
 
41
 
42
#Live install tools
43
anaconda
44
system-config-keyboard
45
firefox
46
 
47
# For UEFI/Secureboot support
48
grub2
49
grub2-efi
50
efibootmgr
51
shim
52
 
53
%end
54
 
55
%post
56
# FIXME: it'd be better to get this installed from a package
57
cat > /etc/rc.d/init.d/livesys << EOF
58
#!/bin/bash
59
#
60
# live: Init script for live image
61
#
62
# chkconfig: 345 00 99
63
# description: Init script for live image.
64
### BEGIN INIT INFO
65
# X-Start-Before: display-manager
66
### END INIT INFO
67
 
68
. /etc/init.d/functions
69
 
70
if ! strstr "\`cat /proc/cmdline\`" rd.live.image || [ "\$1" != "start" ]; then
71
    exit 0
72
fi
73
 
74
if [ -e /.liveimg-configured ] ; then
75
    configdone=1
76
fi
77
 
78
exists() {
79
    which \$1 >/dev/null 2>&1 || return
80
    \$*
81
}
82
 
83
# Make sure we don't mangle the hardware clock on shutdown
84
ln -sf /dev/null /etc/systemd/system/hwclock-save.service
85
 
86
livedir="LiveOS"
87
for arg in \`cat /proc/cmdline\` ; do
88
  if [ "\${arg##rd.live.dir=}" != "\${arg}" ]; then
89
    livedir=\${arg##rd.live.dir=}
90
    return
91
  fi
92
  if [ "\${arg##live_dir=}" != "\${arg}" ]; then
93
    livedir=\${arg##live_dir=}
94
    return
95
  fi
96
done
97
 
98
# enable swaps unless requested otherwise
99
swaps=\`blkid -t TYPE=swap -o device\`
100
if ! strstr "\`cat /proc/cmdline\`" noswap && [ -n "\$swaps" ] ; then
101
  for s in \$swaps ; do
102
    action "Enabling swap partition \$s" swapon \$s
103
  done
104
fi
105
if ! strstr "\`cat /proc/cmdline\`" noswap && [ -f /run/initramfs/live/\${livedir}/swap.img ] ; then
106
  action "Enabling swap file" swapon /run/initramfs/live/\${livedir}/swap.img
107
fi
108
 
109
mountPersistentHome() {
110
  # support label/uuid
111
  if [ "\${homedev##LABEL=}" != "\${homedev}" -o "\${homedev##UUID=}" != "\${homedev}" ]; then
112
    homedev=\`/sbin/blkid -o device -t "\$homedev"\`
113
  fi
114
 
115
  # if we're given a file rather than a blockdev, loopback it
116
  if [ "\${homedev##mtd}" != "\${homedev}" ]; then
117
    # mtd devs don't have a block device but get magic-mounted with -t jffs2
118
    mountopts="-t jffs2"
119
  elif [ ! -b "\$homedev" ]; then
120
    loopdev=\`losetup -f\`
121
    if [ "\${homedev##/run/initramfs/live}" != "\${homedev}" ]; then
122
      action "Remounting live store r/w" mount -o remount,rw /run/initramfs/live
123
    fi
124
    losetup \$loopdev \$homedev
125
    homedev=\$loopdev
126
  fi
127
 
128
  # if it's encrypted, we need to unlock it
129
  if [ "\$(/sbin/blkid -s TYPE -o value \$homedev 2>/dev/null)" = "crypto_LUKS" ]; then
130
    echo
131
    echo "Setting up encrypted /home device"
132
    plymouth ask-for-password --command="cryptsetup luksOpen \$homedev EncHome"
133
    homedev=/dev/mapper/EncHome
134
  fi
135
 
136
  # and finally do the mount
137
  mount \$mountopts \$homedev /home
138
  # if we have /home under what's passed for persistent home, then
139
  # we should make that the real /home.  useful for mtd device on olpc
140
  if [ -d /home/home ]; then mount --bind /home/home /home ; fi
141
  [ -x /sbin/restorecon ] && /sbin/restorecon /home
142
  if [ -d /home/liveuser ]; then USERADDARGS="-M" ; fi
143
}
144
 
145
findPersistentHome() {
146
  for arg in \`cat /proc/cmdline\` ; do
147
    if [ "\${arg##persistenthome=}" != "\${arg}" ]; then
148
      homedev=\${arg##persistenthome=}
149
      return
150
    fi
151
  done
152
}
153
 
154
if strstr "\`cat /proc/cmdline\`" persistenthome= ; then
155
  findPersistentHome
156
elif [ -e /run/initramfs/live/\${livedir}/home.img ]; then
157
  homedev=/run/initramfs/live/\${livedir}/home.img
158
fi
159
 
160
# if we have a persistent /home, then we want to go ahead and mount it
161
if ! strstr "\`cat /proc/cmdline\`" nopersistenthome && [ -n "\$homedev" ] ; then
162
  action "Mounting persistent /home" mountPersistentHome
163
fi
164
 
165
# make it so that we don't do writing to the overlay for things which
166
# are just tmpdirs/caches
167
mount -t tmpfs -o mode=0755 varcacheyum /var/cache/yum
168
mount -t tmpfs vartmp /var/tmp
169
[ -x /sbin/restorecon ] && /sbin/restorecon /var/cache/yum /var/tmp >/dev/null 2>&1
170
 
171
if [ -n "\$configdone" ]; then
172
  exit 0
173
fi
174
 
175
# add live user with no passwd
176
action "Adding live user" useradd \$USERADDARGS -c "Live System User" liveuser
177
passwd -d liveuser > /dev/null
178
usermod -aG wheel liveuser > /dev/null
179
 
180
# Remove root password lock
181
passwd -d root > /dev/null
182
 
183
# turn off firstboot for livecd boots
184
systemctl --no-reload disable firstboot-text.service 2> /dev/null || :
185
systemctl --no-reload disable firstboot-graphical.service 2> /dev/null || :
186
systemctl stop firstboot-text.service 2> /dev/null || :
187
systemctl stop firstboot-graphical.service 2> /dev/null || :
188
 
189
# don't use prelink on a running live image
190
sed -i 's/PRELINKING=yes/PRELINKING=no/' /etc/sysconfig/prelink &>/dev/null || :
191
 
192
# turn off mdmonitor by default
193
systemctl --no-reload disable mdmonitor.service 2> /dev/null || :
194
systemctl --no-reload disable mdmonitor-takeover.service 2> /dev/null || :
195
systemctl stop mdmonitor.service 2> /dev/null || :
196
systemctl stop mdmonitor-takeover.service 2> /dev/null || :
197
 
198
# don't enable the gnome-settings-daemon packagekit plugin
199
gsettings set org.gnome.settings-daemon.plugins.updates active 'false' || :
200
 
201
# don't start cron/at as they tend to spawn things which are
202
# disk intensive that are painful on a live image
203
systemctl --no-reload disable crond.service 2> /dev/null || :
204
systemctl --no-reload disable atd.service 2> /dev/null || :
205
systemctl stop crond.service 2> /dev/null || :
206
systemctl stop atd.service 2> /dev/null || :
207
 
208
# Mark things as configured
209
touch /.liveimg-configured
210
 
211
# add static hostname to work around xauth bug
212
# https://bugzilla.redhat.com/show_bug.cgi?id=679486
213
echo "localhost" > /etc/hostname
214
 
215
# Fixing the lang install issue when other lang than English is selected . See http://bugs.centos.org/view.php?id=7217
216
/usr/bin/cp /usr/lib/python2.7/site-packages/blivet/size.py /usr/lib/python2.7/site-packages/blivet/size.py.orig
217
/usr/bin/sed -i "s#return self.humanReadable()#return self.humanReadable().encode('utf-8')#g" /usr/lib/python2.7/site-packages/blivet/size.py
218
 
219
EOF
220
 
221
# bah, hal starts way too late
222
cat > /etc/rc.d/init.d/livesys-late << EOF
223
#!/bin/bash
224
#
225
# live: Late init script for live image
226
#
227
# chkconfig: 345 99 01
228
# description: Late init script for live image.
229
 
230
. /etc/init.d/functions
231
 
232
if ! strstr "\`cat /proc/cmdline\`" rd.live.image || [ "\$1" != "start" ] || [ -e /.liveimg-late-configured ] ; then
233
    exit 0
234
fi
235
 
236
exists() {
237
    which \$1 >/dev/null 2>&1 || return
238
    \$*
239
}
240
 
241
touch /.liveimg-late-configured
242
 
243
# read some variables out of /proc/cmdline
244
for o in \`cat /proc/cmdline\` ; do
245
    case \$o in
246
    ks=*)
247
        ks="--kickstart=\${o#ks=}"
248
        ;;
249
    xdriver=*)
250
        xdriver="\${o#xdriver=}"
251
        ;;
252
    esac
253
done
254
 
255
# if liveinst or textinst is given, start anaconda
256
if strstr "\`cat /proc/cmdline\`" liveinst ; then
257
   plymouth --quit
258
   /usr/sbin/liveinst \$ks
259
fi
260
if strstr "\`cat /proc/cmdline\`" textinst ; then
261
   plymouth --quit
262
   /usr/sbin/liveinst --text \$ks
263
fi
264
 
265
# configure X, allowing user to override xdriver
266
if [ -n "\$xdriver" ]; then
267
   cat > /etc/X11/xorg.conf.d/00-xdriver.conf <<FOE
268
Section "Device"
269
	Identifier	"Videocard0"
270
	Driver	"\$xdriver"
271
EndSection
272
FOE
273
fi
274
 
275
EOF
276
 
277
chmod 755 /etc/rc.d/init.d/livesys
278
/sbin/restorecon /etc/rc.d/init.d/livesys
279
/sbin/chkconfig --add livesys
280
 
281
chmod 755 /etc/rc.d/init.d/livesys-late
282
/sbin/restorecon /etc/rc.d/init.d/livesys-late
283
/sbin/chkconfig --add livesys-late
284
 
285
# enable tmpfs for /tmp
286
systemctl enable tmp.mount
287
 
288
# work around for poor key import UI in PackageKit
289
rm -f /var/lib/rpm/__db*
290
releasever=$(rpm -q --qf '%{version}\n' --whatprovides system-release)
291
basearch=$(uname -i)
292
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
293
echo "Packages within this LiveCD"
294
rpm -qa
295
# Note that running rpm recreates the rpm db files which aren't needed or wanted
296
rm -f /var/lib/rpm/__db*
297
 
298
# go ahead and pre-make the man -k cache (#455968)
299
/usr/bin/mandb
300
 
301
# save a little bit of space at least...
302
rm -f /boot/initramfs*
303
# make sure there aren't core files lying around
304
rm -f /core*
305
 
306
# convince readahead not to collect
307
# FIXME: for systemd
308
 
309
cat >> /etc/rc.d/init.d/livesys << EOF
310
 
311
 
312
# disable updates plugin
313
cat >> /usr/share/glib-2.0/schemas/org.gnome.settings-daemon.plugins.updates.gschema.override << FOE
314
[org.gnome.settings-daemon.plugins.updates]
315
active=false
316
FOE
317
 
318
# Show the system-config-keyboard tool on the desktop
319
mkdir /home/liveuser/Desktop -p >/dev/null
320
cat /usr/share/applications/system-config-keyboard.desktop | sed '/NotShowIn/d' |sed 's/Terminal=false/Terminal=true/' > /home/liveuser/Desktop/system-config-keyboard.desktop
321
cat /usr/share/applications/liveinst.desktop | sed '/NoDisplay/d' > /home/liveuser/Desktop/liveinst.desktop 
322
chmod +x /home/liveuser/Desktop/*.desktop
323
chown -R liveuser:liveuser /home/liveuser
324
 
325
# Liveuser face
326
if [ -e /usr/share/icons/hicolor/96x96/apps/fedora-logo-icon.png ] ; then
327
    cp /usr/share/icons/hicolor/96x96/apps/fedora-logo-icon.png /home/liveuser/.face
328
    chown liveuser:liveuser /home/liveuser/.face
329
fi
330
 
331
# make the installer show up
332
if [ -f /usr/share/applications/liveinst.desktop ]; then
333
  # Show harddisk install in shell dash
334
  sed -i -e 's/NoDisplay=true/NoDisplay=false/' /usr/share/applications/liveinst.desktop 
335
  # need to move it to anaconda.desktop to make shell happy
336
  #cp /usr/share/applications/liveinst.desktop /usr/share/applications/anaconda.desktop
337
fi
338
  cat >> /usr/share/glib-2.0/schemas/org.gnome.shell.gschema.override << FOE
339
[org.gnome.shell]
340
favorite-apps=['liveinst.desktop','firefox.desktop', 'evolution.desktop', 'empathy.desktop', 'rhythmbox.desktop', 'shotwell.desktop', 'libreoffice-writer.desktop', 'nautilus.desktop', 'gnome-documents.desktop', 'anaconda.desktop']
341
FOE
342
 
343
# add liveinst.desktop to favorites menu
344
mkdir -p /home/liveuser/.kde/share/config/
345
cat > /home/liveuser/.kde/share/config/kickoffrc << MENU_EOF
346
[Favorites]
347
FavoriteURLs=/usr/share/applications/kde4/konqbrowser.desktop,/usr/share/applications/kde4/dolphin.desktop,/usr/share/applications/kde4/systemsettings.desktop,/usr/share/applications/liveinst.desktop
348
MENU_EOF
349
 
350
# set up auto-login
351
cat > /etc/gdm/custom.conf << FOE
352
[daemon]
353
AutomaticLoginEnable=True
354
AutomaticLogin=liveuser
355
FOE
356
 
357
# Turn off PackageKit-command-not-found while uninstalled
358
if [ -f /etc/PackageKit/CommandNotFound.conf ]; then
359
  sed -i -e 's/^SoftwareSourceSearch=true/SoftwareSourceSearch=false/' /etc/PackageKit/CommandNotFound.conf
360
fi
361
 
362
# make sure to set the right permissions and selinux contexts
363
chown -R liveuser:liveuser /home/liveuser/
364
restorecon -R /home/liveuser/
365
 
366
# Fixing default locale to us
367
localectl set-keymap us
368
localectl set-x11-keymap us
369
EOF
370
 
371
# rebuild schema cache with any overrides we installed
372
glib-compile-schemas /usr/share/glib-2.0/schemas
373
 
374
 
375
%end