Subversion Repositories livecd

Rev

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