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