Subversion Repositories livecd

Rev

Rev 393 | Rev 396 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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