Subversion Repositories livecd

Rev

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