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