Subversion Repositories livecd

Rev

Rev 402 | Rev 412 | 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
402 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
402 beyerleu 273
echo -e "\ngsettings set org.gnome.settings-daemon.plugins.updates active 'false' &>/dev/null || :" >> /home/liveuser/.bashrc
393 beyerleu 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
 
299
# bah, hal starts way too late
300
cat > /etc/rc.d/init.d/livesys-late << EOF
301
#!/bin/bash
302
#
303
# live: Late init script for live image
304
#
305
# chkconfig: 345 99 01
306
# description: Late init script for live image.
307
 
308
. /etc/init.d/functions
309
 
310
if ! strstr "\`cat /proc/cmdline\`" rd.live.image || [ "\$1" != "start" ] || [ -e /.liveimg-late-configured ] ; then
311
    exit 0
312
fi
313
 
314
exists() {
315
    which \$1 >/dev/null 2>&1 || return
316
    \$*
317
}
318
 
319
touch /.liveimg-late-configured
320
 
321
# read some variables out of /proc/cmdline
322
for o in \`cat /proc/cmdline\` ; do
323
    case \$o in
324
    ks=*)
325
        ks="--kickstart=\${o#ks=}"
326
        ;;
327
    xdriver=*)
328
        xdriver="\${o#xdriver=}"
329
        ;;
330
    esac
331
done
332
 
333
# if liveinst or textinst is given, start anaconda
334
if strstr "\`cat /proc/cmdline\`" liveinst ; then
335
   plymouth --quit
336
   /usr/sbin/liveinst \$ks
337
fi
338
if strstr "\`cat /proc/cmdline\`" textinst ; then
339
   plymouth --quit
340
   /usr/sbin/liveinst --text \$ks
341
fi
342
 
343
# configure X, allowing user to override xdriver
344
if [ -n "\$xdriver" ]; then
345
   cat > /etc/X11/xorg.conf.d/00-xdriver.conf <<FOE
346
Section "Device"
347
	Identifier	"Videocard0"
348
	Driver	"\$xdriver"
349
EndSection
350
FOE
351
fi
352
 
353
EOF
354
 
355
chmod 755 /etc/rc.d/init.d/livesys
356
/sbin/restorecon /etc/rc.d/init.d/livesys
357
/sbin/chkconfig --add livesys
358
 
359
chmod 755 /etc/rc.d/init.d/livesys-late
360
/sbin/restorecon /etc/rc.d/init.d/livesys-late
361
/sbin/chkconfig --add livesys-late
362
 
363
# enable tmpfs for /tmp
364
systemctl enable tmp.mount
365
 
366
# work around for poor key import UI in PackageKit
367
rm -f /var/lib/rpm/__db*
368
releasever=$(rpm -q --qf '%{version}\n' --whatprovides system-release)
369
basearch=$(uname -i)
370
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-*
371
echo "Packages within this LiveCD (with version)"
372
rpm -qa | sort
373
echo "Packages within this LiveCD"
374
rpm -qa --qf "%{name}\n" | sort
375
# Note that running rpm recreates the rpm db files which aren't needed or wanted
376
rm -f /var/lib/rpm/__db*
377
 
378
# go ahead and pre-make the man -k cache (#455968)
379
/usr/bin/mandb
380
 
381
# save a little bit of space at least...
382
rm -f /boot/initramfs*
383
# make sure there aren't core files lying around
384
rm -f /core*
385
 
386
# convince readahead not to collect
387
# FIXME: for systemd
388
 
389
cat >> /etc/rc.d/init.d/livesys << EOF
390
 
391
 
392
# disable updates plugin
393
cat >> /usr/share/glib-2.0/schemas/org.gnome.settings-daemon.plugins.updates.gschema.override << FOE
394
[org.gnome.settings-daemon.plugins.updates]
395
active=false
396
FOE
397
 
398
# Show the system-config-keyboard tool on the desktop
399
mkdir /home/liveuser/Desktop -p >/dev/null
400
cat /usr/share/applications/system-config-keyboard.desktop | sed '/NotShowIn/d' |sed 's/Terminal=false/Terminal=true/' > /home/liveuser/Desktop/system-config-keyboard.desktop
401
cat /usr/share/applications/liveinst.desktop | sed '/NoDisplay/d' > /home/liveuser/Desktop/liveinst.desktop 
402
chmod +x /home/liveuser/Desktop/*.desktop
403
chown -R liveuser:liveuser /home/liveuser
404
 
405
# Liveuser face
406
if [ -e /usr/share/icons/hicolor/96x96/apps/fedora-logo-icon.png ] ; then
407
    cp /usr/share/icons/hicolor/96x96/apps/fedora-logo-icon.png /home/liveuser/.face
408
    chown liveuser:liveuser /home/liveuser/.face
409
fi
410
 
411
# make the installer show up
412
if [ -f /usr/share/applications/liveinst.desktop ]; then
413
  # Show harddisk install in shell dash
414
  sed -i -e 's/NoDisplay=true/NoDisplay=false/' /usr/share/applications/liveinst.desktop 
415
  # need to move it to anaconda.desktop to make shell happy
416
  #cp /usr/share/applications/liveinst.desktop /usr/share/applications/anaconda.desktop
417
fi
418
  cat >> /usr/share/glib-2.0/schemas/org.gnome.shell.gschema.override << FOE
419
[org.gnome.shell]
420
favorite-apps=['liveinst.desktop','firefox.desktop', 'evolution.desktop', 'empathy.desktop', 'rhythmbox.desktop', 'shotwell.desktop', 'libreoffice-writer.desktop', 'nautilus.desktop', 'gnome-documents.desktop', 'anaconda.desktop']
421
FOE
422
 
423
 
424
# set up auto-login
425
cat > /etc/gdm/custom.conf << FOE
426
[daemon]
427
AutomaticLoginEnable=True
428
AutomaticLogin=liveuser
429
FOE
430
 
431
# Turn off PackageKit-command-not-found while uninstalled
432
if [ -f /etc/PackageKit/CommandNotFound.conf ]; then
433
  sed -i -e 's/^SoftwareSourceSearch=true/SoftwareSourceSearch=false/' /etc/PackageKit/CommandNotFound.conf
434
fi
435
 
436
# make sure to set the right permissions and selinux contexts
437
chown -R liveuser:liveuser /home/liveuser/
438
restorecon -R /home/liveuser/
439
 
400 beyerleu 440
# Fixing default locale to us - does not work for SL7.1
397 beyerleu 441
#localectl set-keymap us
442
#localectl set-x11-keymap us
393 beyerleu 443
EOF
444
 
445
# rebuild schema cache with any overrides we installed
446
glib-compile-schemas /usr/share/glib-2.0/schemas
447
 
448
 
449
%end