Subversion Repositories livecd

Rev

Rev 397 | Rev 401 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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