Subversion Repositories livecd

Rev

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

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