Subversion Repositories livecd

Rev

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