Subversion Repositories livecd

Rev

Rev 402 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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