Subversion Repositories livecd

Rev

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