Subversion Repositories livecd

Rev

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

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