Subversion Repositories livecd

Rev

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

Rev 281 Rev 282
1
########################################################################
1
########################################################################
2
#
2
#
3
# sl6-live-base.ks
3
# sl6-live-base.ks
4
#
4
#
5
# Defines the basics for all kickstarts of sl6-live
5
# Defines the basics for all kickstarts of sl6-live
6
# Kickstarts including this template can override these settings
6
# Kickstarts including this template can override these settings
7
#
7
#
8
########################################################################
8
########################################################################
9
 
9
 
10
lang en_US.UTF-8
10
lang en_US.UTF-8
11
keyboard us
11
keyboard us
12
timezone US/Eastern
12
timezone US/Eastern
13
auth --useshadow --enablemd5
13
auth --useshadow --enablemd5
14
selinux --enforcing
14
selinux --enforcing
15
firewall --enabled --service=mdns
15
firewall --enabled --service=mdns
16
repo --name=base      --baseurl=http://ftp.scientificlinux.org/linux/scientific/6rolling/$basearch/os/
16
repo --name=base      --baseurl=http://ftp.scientificlinux.org/linux/scientific/6rolling/$basearch/os/
17
repo --name=security  --baseurl=http://ftp.scientificlinux.org/linux/scientific/6rolling/$basearch/updates/security/
17
repo --name=security  --baseurl=http://ftp.scientificlinux.org/linux/scientific/6rolling/$basearch/updates/security/
18
# fastbugs repo disabled per default
18
#fastbugs repo disabled per default
19
repo --name=fastbugs  --baseurl=http://ftp.scientificlinux.org/linux/scientific/6rolling/$basearch/updates/fastbugs/
19
#repo --name=fastbugs  --baseurl=http://ftp.scientificlinux.org/linux/scientific/6rolling/$basearch/updates/fastbugs/
20
xconfig --startxonboot
20
xconfig --startxonboot
21
services --enabled=NetworkManager --disabled=network,sshd
21
services --enabled=NetworkManager --disabled=network,sshd
22
 
22
 
23
 
23
 
24
########################################################################
24
########################################################################
25
#
25
#
26
# Basic software packages
26
# Basic software packages
27
#
27
#
28
########################################################################
28
########################################################################
29
%packages
29
%packages
30
syslinux
30
syslinux
31
kernel
31
kernel
32
 
32
 
33
# basic software groups
33
# basic software groups
34
@base
34
@base
35
# package added to @base
35
# package added to @base
36
squashfs-tools
36
squashfs-tools
37
@core
37
@core
38
@graphical-admin-tools
38
@graphical-admin-tools
39
@network-file-system-client
39
@network-file-system-client
40
@network-tools
40
@network-tools
41
# package added to @network-tools
41
# package added to @network-tools
42
nmap
42
nmap
43
@remote-desktop-clients
43
@remote-desktop-clients
44
# packages added to @remote-desktop-clients
44
# packages added to @remote-desktop-clients
45
rdesktop
45
rdesktop
46
tsclient
46
tsclient
47
@x11
47
@x11
48
@openafs-client
48
@openafs-client
49
 
49
 
50
# other usefull packages
50
# other usefull packages
51
busybox
51
busybox
52
mailx
52
mailx
53
memtest86+
53
memtest86+
54
livecd-tools
54
livecd-tools
55
 
55
 
56
# livecd bits to set up the livecd and be able to install
56
# livecd bits to set up the livecd and be able to install
57
anaconda
57
anaconda
58
device-mapper-multipath
58
device-mapper-multipath
59
isomd5sum
59
isomd5sum
60
 
60
 
61
%end
61
%end
62
 
62
 
63
########################################################################
63
########################################################################
64
#
64
#
65
#  LiveCD post install in chroot 
65
#  LiveCD post install in chroot 
66
#
66
#
67
########################################################################
67
########################################################################
68
%post
68
%post
69
 
69
 
70
#***********************************************************************
70
#***********************************************************************
71
# Create LiveCD configuration file and LiveCD functions
71
# Create LiveCD configuration file and LiveCD functions
72
#***********************************************************************
72
#***********************************************************************
73
 
73
 
74
cat > /etc/livesys.conf << 'EOF_livesysconf'
74
cat > /etc/livesys.conf << 'EOF_livesysconf'
75
#--------------------------------------------------------------------
75
#--------------------------------------------------------------------
76
# Configuration file for LiveCD
76
# Configuration file for LiveCD
77
#--------------------------------------------------------------------
77
#--------------------------------------------------------------------
78
 
78
 
79
# default LiveCD user
79
# default LiveCD user
80
LIVECD_DEF_USER="sluser"
80
LIVECD_DEF_USER="sluser"
81
 
81
 
82
# delay in sec. before auto login
82
# delay in sec. before auto login
83
LOGIN_DELAY=15
83
LOGIN_DELAY=15
84
 
84
 
85
# Services which are off (not running) on the LiveCD
85
# Services which are off (not running) on the LiveCD
86
SERVICES_OFF="mdmonitor setroubleshoot auditd crond atd readahead_early \
86
SERVICES_OFF="mdmonitor setroubleshoot auditd crond atd readahead_early \
87
              readahead_later kdump microcode_ctl openct pcscd postfix"
87
              readahead_later kdump microcode_ctl openct pcscd postfix"
88
 
88
 
89
# Services which should be on, but are not on per default
89
# Services which should be on, but are not on per default
90
SERVICES_ON=""
90
SERVICES_ON=""
91
 
91
 
92
EOF_livesysconf
92
EOF_livesysconf
93
 
93
 
94
 
94
 
95
cat > /etc/init.d/livesys.functions << 'EOF_livesysfunctions'
95
cat > /etc/init.d/livesys.functions << 'EOF_livesysfunctions'
96
#--------------------------------------------------------------------
96
#--------------------------------------------------------------------
97
# livesys functions
97
# livesys functions
98
#--------------------------------------------------------------------
98
#--------------------------------------------------------------------
99
 
99
 
100
# egrep_o is a replacement for "egrep -o". It prints only the last matching text
100
# egrep_o is a replacement for "egrep -o". It prints only the last matching text
101
egrep_o() {
101
egrep_o() {
102
   cat | egrep "$1" | sed -r "s/.*($1).*/\\1/"
102
   cat | egrep "$1" | sed -r "s/.*($1).*/\\1/"
103
}
103
}
104
 
104
 
105
# boot parameter
105
# boot parameter
106
cmdline_parameter() {
106
cmdline_parameter() {
107
   CMDLINE=/proc/cmdline
107
   CMDLINE=/proc/cmdline
108
   cat "$CMDLINE" | egrep_o "(^|[[:space:]]+)$1(\$|=|[[:space:]]+)" | egrep_o "$1"
108
   cat "$CMDLINE" | egrep_o "(^|[[:space:]]+)$1(\$|=|[[:space:]]+)" | egrep_o "$1"
109
}
109
}
110
 
110
 
111
# boot parameter value
111
# boot parameter value
112
cmdline_value()
112
cmdline_value()
113
{
113
{
114
   CMDLINE=/proc/cmdline
114
   CMDLINE=/proc/cmdline
115
   cat "$CMDLINE" | egrep_o "(^|[[:space:]]+)$1=([^[:space:]]+)" | egrep_o "=.*" | cut -b 2- | tail -n 1
115
   cat "$CMDLINE" | egrep_o "(^|[[:space:]]+)$1=([^[:space:]]+)" | egrep_o "=.*" | cut -b 2- | tail -n 1
116
}
116
}
117
 
117
 
118
exists() {
118
exists() {
119
    which $1 >/dev/null 2>&1 || return
119
    which $1 >/dev/null 2>&1 || return
120
    $*
120
    $*
121
}
121
}
122
 
122
 
123
EOF_livesysfunctions
123
EOF_livesysfunctions
124
 
124
 
125
 
125
 
126
#***********************************************************************
126
#***********************************************************************
127
# Create /root/post-install
127
# Create /root/post-install
128
# Must change "$" to "\$" and "`" to "\`" to avoid shell quoting
128
# Must change "$" to "\$" and "`" to "\`" to avoid shell quoting
129
#***********************************************************************
129
#***********************************************************************
130
 
130
 
131
cat > /root/post-install << EOF_post
131
cat > /root/post-install << EOF_post
132
#!/bin/bash
132
#!/bin/bash
133
 
133
 
134
#***********************************************************************
134
#***********************************************************************
135
# Create the livesys init script - /etc/rc.d/init.d/livesys
135
# Create the livesys init script - /etc/rc.d/init.d/livesys
136
#***********************************************************************
136
#***********************************************************************
137
 
137
 
138
echo "Creating the livesys init script - livesys"
138
echo "Creating the livesys init script - livesys"
139
 
139
 
140
cat > /etc/rc.d/init.d/livesys << EOF_initscript
140
cat > /etc/rc.d/init.d/livesys << EOF_initscript
141
#!/bin/bash
141
#!/bin/bash
142
#
142
#
143
# live: Init script for live image
143
# live: Init script for live image
144
#
144
#
145
# chkconfig: 345 00 99
145
# chkconfig: 345 00 99
146
# description: Init script for live image.
146
# description: Init script for live image.
147
 
147
 
148
. /etc/init.d/functions
148
. /etc/init.d/functions
149
. /etc/livesys.conf
149
. /etc/livesys.conf
150
. /etc/init.d/livesys.functions
150
. /etc/init.d/livesys.functions
151
 
151
 
152
# exit if not running from LiveCD
152
# exit if not running from LiveCD
153
if ! strstr "\\\`cat /proc/cmdline\\\`" liveimg || [ "\\\$1" != "start" ]; then
153
if ! strstr "\\\`cat /proc/cmdline\\\`" liveimg || [ "\\\$1" != "start" ]; then
154
    exit 0
154
    exit 0
155
fi
155
fi
156
 
156
 
157
[ -e /.liveimg-configured ] && configdone=1
157
[ -e /.liveimg-configured ] && configdone=1
158
 
158
 
159
touch /.liveimg-configured
159
touch /.liveimg-configured
160
 
160
 
161
# read boot parameters out of /proc/cmdline
161
# read boot parameters out of /proc/cmdline
162
 
162
 
163
# hostname
163
# hostname
164
hostname=\\\$( cmdline_value hostname )
164
hostname=\\\$( cmdline_value hostname )
165
 
165
 
166
# afs cell
166
# afs cell
167
CELL=\\\$( cmdline_value cell )
167
CELL=\\\$( cmdline_value cell )
168
 
168
 
169
# services to turn on / off
169
# services to turn on / off
170
SERVICEON=\\\$( cmdline_value serviceon )
170
SERVICEON=\\\$( cmdline_value serviceon )
171
SERVICEOFF=\\\$( cmdline_value serviceoff )
171
SERVICEOFF=\\\$( cmdline_value serviceoff )
172
 
172
 
173
# cups server
173
# cups server
174
CUPS=\\\$( cmdline_value cups )
174
CUPS=\\\$( cmdline_value cups )
175
 
175
 
176
# set livecd user
176
# set livecd user
177
LIVECD_USER=\\\$( cmdline_value user )
177
LIVECD_USER=\\\$( cmdline_value user )
178
[ ! "\\\$LIVECD_USER" ] && LIVECD_USER=\\\$LIVECD_DEF_USER
178
[ ! "\\\$LIVECD_USER" ] && LIVECD_USER=\\\$LIVECD_DEF_USER
179
 
179
 
180
# mount live image
180
# mount live image
181
if [ -b \\\`readlink -f /dev/live\\\` ]; then
181
if [ -b \\\`readlink -f /dev/live\\\` ]; then
182
   mkdir -p /mnt/live
182
   mkdir -p /mnt/live
183
   mount -o ro /dev/live /mnt/live 2>/dev/null || mount /dev/live /mnt/live
183
   mount -o ro /dev/live /mnt/live 2>/dev/null || mount /dev/live /mnt/live
184
fi
184
fi
185
 
185
 
186
livedir="LiveOS"
186
livedir="LiveOS"
187
for arg in \\\`cat /proc/cmdline\\\` ; do
187
for arg in \\\`cat /proc/cmdline\\\` ; do
188
  if [ "\\\${arg##live_dir=}" != "\\\${arg}" ]; then
188
  if [ "\\\${arg##live_dir=}" != "\\\${arg}" ]; then
189
    livedir=\\\${arg##live_dir=}
189
    livedir=\\\${arg##live_dir=}
190
    return
190
    return
191
  fi
191
  fi
192
done
192
done
193
 
193
 
194
# enable swaps unless requested otherwise
194
# enable swaps unless requested otherwise
195
swaps=\\\`blkid -t TYPE=swap -o device\\\`
195
swaps=\\\`blkid -t TYPE=swap -o device\\\`
196
if ! strstr "\\\`cat /proc/cmdline\\\`" noswap && [ -n "\\\$swaps" ] ; then
196
if ! strstr "\\\`cat /proc/cmdline\\\`" noswap && [ -n "\\\$swaps" ] ; then
197
  for s in \\\$swaps ; do
197
  for s in \\\$swaps ; do
198
    action "Enabling swap partition \\\$s" swapon \\\$s
198
    action "Enabling swap partition \\\$s" swapon \\\$s
199
  done
199
  done
200
fi
200
fi
201
if ! strstr "\\\`cat /proc/cmdline\\\`" noswap && [ -f /mnt/live/\\\${livedir}/swap.img ] ; then
201
if ! strstr "\\\`cat /proc/cmdline\\\`" noswap && [ -f /mnt/live/\\\${livedir}/swap.img ] ; then
202
  action "Enabling swap file" swapon /mnt/live/\\\${livedir}/swap.img
202
  action "Enabling swap file" swapon /mnt/live/\\\${livedir}/swap.img
203
fi
203
fi
204
 
204
 
205
mountPersistentHome() {
205
mountPersistentHome() {
206
  # support label/uuid
206
  # support label/uuid
207
  if [ "\\\${homedev##LABEL=}" != "\\\${homedev}" -o "\\\${homedev##UUID=}" != "\\\${homedev}" ]; then
207
  if [ "\\\${homedev##LABEL=}" != "\\\${homedev}" -o "\\\${homedev##UUID=}" != "\\\${homedev}" ]; then
208
    homedev=\\\`/sbin/blkid -o device -t "\\\$homedev"\\\`
208
    homedev=\\\`/sbin/blkid -o device -t "\\\$homedev"\\\`
209
  fi
209
  fi
210
 
210
 
211
  # if we're given a file rather than a blockdev, loopback it
211
  # if we're given a file rather than a blockdev, loopback it
212
  if [ "\\\${homedev##mtd}" != "\\\${homedev}" ]; then
212
  if [ "\\\${homedev##mtd}" != "\\\${homedev}" ]; then
213
    # mtd devs don't have a block device but get magic-mounted with -t jffs2
213
    # mtd devs don't have a block device but get magic-mounted with -t jffs2
214
    mountopts="-t jffs2"
214
    mountopts="-t jffs2"
215
  elif [ ! -b "\\\$homedev" ]; then
215
  elif [ ! -b "\\\$homedev" ]; then
216
    loopdev=\\\`losetup -f\\\`
216
    loopdev=\\\`losetup -f\\\`
217
    if [ "\\\${homedev##/mnt/live}" != "\\\${homedev}" ]; then
217
    if [ "\\\${homedev##/mnt/live}" != "\\\${homedev}" ]; then
218
      action "Remounting live store r/w" mount -o remount,rw /mnt/live
218
      action "Remounting live store r/w" mount -o remount,rw /mnt/live
219
    fi
219
    fi
220
    losetup \\\$loopdev \\\$homedev
220
    losetup \\\$loopdev \\\$homedev
221
    homedev=\\\$loopdev
221
    homedev=\\\$loopdev
222
  fi
222
  fi
223
 
223
 
224
  # if it's encrypted, we need to unlock it
224
  # if it's encrypted, we need to unlock it
225
  if [ "\\\$(/sbin/blkid -s TYPE -o value \\\$homedev 2>/dev/null)" = "crypto_LUKS" ]; then
225
  if [ "\\\$(/sbin/blkid -s TYPE -o value \\\$homedev 2>/dev/null)" = "crypto_LUKS" ]; then
226
    echo
226
    echo
227
    echo "Setting up encrypted /home device"
227
    echo "Setting up encrypted /home device"
228
    plymouth ask-for-password --command="cryptsetup luksOpen \\\$homedev EncHome"
228
    plymouth ask-for-password --command="cryptsetup luksOpen \\\$homedev EncHome"
229
    homedev=/dev/mapper/EncHome
229
    homedev=/dev/mapper/EncHome
230
  fi
230
  fi
231
 
231
 
232
  # and finally do the mount
232
  # and finally do the mount
233
  mount \\\$mountopts \\\$homedev /home
233
  mount \\\$mountopts \\\$homedev /home
234
  # if we have /home under what's passed for persistent home, then
234
  # if we have /home under what's passed for persistent home, then
235
  # we should make that the real /home.  useful for mtd device on olpc
235
  # we should make that the real /home.  useful for mtd device on olpc
236
  if [ -d /home/home ]; then mount --bind /home/home /home ; fi
236
  if [ -d /home/home ]; then mount --bind /home/home /home ; fi
237
  [ -x /sbin/restorecon ] && /sbin/restorecon /home
237
  [ -x /sbin/restorecon ] && /sbin/restorecon /home
238
  if [ -d /home/\\\$LIVECD_USER ]; then USERADDARGS="-M" ; fi
238
  if [ -d /home/\\\$LIVECD_USER ]; then USERADDARGS="-M" ; fi
239
}
239
}
240
 
240
 
241
findPersistentHome() {
241
findPersistentHome() {
242
  for arg in \\\`cat /proc/cmdline\\\` ; do
242
  for arg in \\\`cat /proc/cmdline\\\` ; do
243
    if [ "\\\${arg##persistenthome=}" != "\\\${arg}" ]; then
243
    if [ "\\\${arg##persistenthome=}" != "\\\${arg}" ]; then
244
      homedev=\\\${arg##persistenthome=}
244
      homedev=\\\${arg##persistenthome=}
245
      return
245
      return
246
    fi
246
    fi
247
  done
247
  done
248
}
248
}
249
 
249
 
250
if strstr "\\\`cat /proc/cmdline\\\`" persistenthome= ; then
250
if strstr "\\\`cat /proc/cmdline\\\`" persistenthome= ; then
251
  findPersistentHome
251
  findPersistentHome
252
elif [ -e /mnt/live/\\\${livedir}/home.img ]; then
252
elif [ -e /mnt/live/\\\${livedir}/home.img ]; then
253
  homedev=/mnt/live/\\\${livedir}/home.img
253
  homedev=/mnt/live/\\\${livedir}/home.img
254
fi
254
fi
255
 
255
 
256
# if we have a persistent /home, then we want to go ahead and mount it
256
# if we have a persistent /home, then we want to go ahead and mount it
257
if ! strstr "\\\`cat /proc/cmdline\\\`" nopersistenthome && [ -n "\\\$homedev" ] ; then
257
if ! strstr "\\\`cat /proc/cmdline\\\`" nopersistenthome && [ -n "\\\$homedev" ] ; then
258
  action "Mounting persistent /home" mountPersistentHome
258
  action "Mounting persistent /home" mountPersistentHome
259
fi
259
fi
260
 
260
 
261
# make it so that we don't do writing to the overlay for things which
261
# make it so that we don't do writing to the overlay for things which
262
# are just tmpdirs/caches
262
# are just tmpdirs/caches
263
mount -t tmpfs -o mode=0755 varcacheyum /var/cache/yum
263
mount -t tmpfs -o mode=0755 varcacheyum /var/cache/yum
264
mount -t tmpfs tmp /tmp
264
mount -t tmpfs tmp /tmp
265
mount -t tmpfs vartmp /var/tmp
265
mount -t tmpfs vartmp /var/tmp
266
[ -x /sbin/restorecon ] && /sbin/restorecon /var/cache/yum /tmp /var/tmp >/dev/null 2>&1
266
[ -x /sbin/restorecon ] && /sbin/restorecon /var/cache/yum /tmp /var/tmp >/dev/null 2>&1
267
 
267
 
268
# set afs cell if given by boot parameter
268
# set afs cell if given by boot parameter
269
if [ "\\\$CELL" ]; then
269
if [ "\\\$CELL" ]; then
270
    [ -e /usr/vice/etc/ThisCell ] && echo \\\$CELL > /usr/vice/etc/ThisCell
270
    [ -e /usr/vice/etc/ThisCell ] && echo \\\$CELL > /usr/vice/etc/ThisCell
271
fi
271
fi
272
 
272
 
273
# set cups server
273
# set cups server
274
if [ "\\\$CUPS" ]; then
274
if [ "\\\$CUPS" ]; then
275
    if [ -e /etc/cups/client.conf ]; then
275
    if [ -e /etc/cups/client.conf ]; then
276
        sed -i "s|.*ServerName .*|ServerName  \\\$CUPS|" /etc/cups/client.conf
276
        sed -i "s|.*ServerName .*|ServerName  \\\$CUPS|" /etc/cups/client.conf
277
        grep -q ServerName /etc/cups/client.conf || echo "ServerName  \\\$CUPS" >> /etc/cups/client.conf 
277
        grep -q ServerName /etc/cups/client.conf || echo "ServerName  \\\$CUPS" >> /etc/cups/client.conf 
278
    fi
278
    fi
279
fi
279
fi
280
 
280
 
281
# set the LiveCD hostname
281
# set the LiveCD hostname
282
[ ! "\\\$hostname" ] && hostname="livecd.localdomain"
282
[ ! "\\\$hostname" ] && hostname="livecd.localdomain"
283
sed -i -e "s|HOSTNAME=.*|HOSTNAME=\\\$hostname|g" /etc/sysconfig/network
283
sed -i -e "s|HOSTNAME=.*|HOSTNAME=\\\$hostname|g" /etc/sysconfig/network
284
/bin/hostname \\\$hostname
284
/bin/hostname \\\$hostname
285
 
285
 
286
#-----------------------------------------------------------------------
286
#-----------------------------------------------------------------------
287
# EXIT here if LiveCD has already been configured         
287
# EXIT here if LiveCD has already been configured         
288
# happens if you start the LiveCD with persistent changes 
288
# happens if you start the LiveCD with persistent changes 
289
#-----------------------------------------------------------------------
289
#-----------------------------------------------------------------------
290
 
290
 
291
[ "\\\$configdone" ] && exit 0
291
[ "\\\$configdone" ] && exit 0
292
 
292
 
293
# turn off services, which are not useful on LiveCD, to preserve resources
293
# turn off services, which are not useful on LiveCD, to preserve resources
294
if [ "\\\$SERVICES_OFF" ]; then
294
if [ "\\\$SERVICES_OFF" ]; then
295
    for service in \\\$SERVICES_OFF ; do
295
    for service in \\\$SERVICES_OFF ; do
296
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service off 2>/dev/null
296
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service off 2>/dev/null
297
    done
297
    done
298
fi
298
fi
299
 
299
 
300
# turn on services, which are off by default
300
# turn on services, which are off by default
301
if [ "\\\$SERVICES_ON" ]; then
301
if [ "\\\$SERVICES_ON" ]; then
302
    for service in \\\$SERVICES_ON ; do
302
    for service in \\\$SERVICES_ON ; do
303
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service ofn  2>/dev/null
303
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service ofn  2>/dev/null
304
    done
304
    done
305
fi
305
fi
306
 
306
 
307
# services off, from command line parameter (turn it off once again)
307
# services off, from command line parameter (turn it off once again)
308
if [ "\\\$SERVICEOFF" ]; then
308
if [ "\\\$SERVICEOFF" ]; then
309
    for service in \\\$( echo "\\\$SERVICEOFF" | tr ':' ' ' ); do
309
    for service in \\\$( echo "\\\$SERVICEOFF" | tr ':' ' ' ); do
310
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service off 2>/dev/null
310
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service off 2>/dev/null
311
    done
311
    done
312
fi
312
fi
313
 
313
 
314
# services on, from command line parameter (turn it ofn once again)
314
# services on, from command line parameter (turn it ofn once again)
315
if [ "\\\$SERVICEON" ]; then
315
if [ "\\\$SERVICEON" ]; then
316
    for service in \\\$( echo "\\\$SERVICEON" | tr ':' ' ' ); do
316
    for service in \\\$( echo "\\\$SERVICEON" | tr ':' ' ' ); do
317
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service on  2>/dev/null
317
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service on  2>/dev/null
318
    done
318
    done
319
fi
319
fi
320
 
320
 
321
## fix various bugs and issues
321
## fix various bugs and issues
322
# unmute sound card
322
# unmute sound card
323
exists alsaunmute 0 2> /dev/null
323
exists alsaunmute 0 2> /dev/null
324
 
324
 
325
# turn off firstboot for livecd boots
325
# turn off firstboot for livecd boots
326
echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot
326
echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot
327
 
327
 
328
# start afs with option -memcache (is this correct?)
328
# start afs with option -memcache (is this correct?)
329
[ -e /etc/sysconfig/afs ] && sed -i "s|^OPTIONS=.*|OPTIONS=\"-memcache\"|" /etc/sysconfig/afs
329
[ -e /etc/sysconfig/afs ] && sed -i "s|^OPTIONS=.*|OPTIONS=\"-memcache\"|" /etc/sysconfig/afs
330
 
330
 
331
# Stopgap fix for RH #217966; should be fixed in HAL instead
331
# Stopgap fix for RH #217966; should be fixed in HAL instead
332
touch /media/.hal-mtab
332
touch /media/.hal-mtab
333
 
333
 
334
## create the LiveCD default user
334
## create the LiveCD default user
335
# add default user with no password
335
# add default user with no password
336
/usr/sbin/useradd -c "LiveCD default user" \\\$LIVECD_USER
336
/usr/sbin/useradd -c "LiveCD default user" \\\$LIVECD_USER
337
/usr/bin/passwd -d \\\$LIVECD_USER > /dev/null
337
/usr/bin/passwd -d \\\$LIVECD_USER > /dev/null
338
# give default user sudo privileges
338
# give default user sudo privileges
339
# echo "\\\$LIVECD_USER     ALL=(ALL)     NOPASSWD: ALL" >> /etc/sudoers
339
# echo "\\\$LIVECD_USER     ALL=(ALL)     NOPASSWD: ALL" >> /etc/sudoers
340
 
340
 
341
## configure default user's desktop
341
## configure default user's desktop
342
# set up timed auto-login at 10 seconds
342
# set up timed auto-login at 10 seconds
343
cat >> /etc/gdm/custom.conf << FOE
343
cat >> /etc/gdm/custom.conf << FOE
344
[daemon]
344
[daemon]
345
TimedLoginEnable=true
345
TimedLoginEnable=true
346
TimedLogin=LIVECD_USER
346
TimedLogin=LIVECD_USER
347
TimedLoginDelay=$LOGIN_DELAY
347
TimedLoginDelay=$LOGIN_DELAY
348
FOE
348
FOE
349
sed -i "s|LIVECD_USER|\\\$LIVECD_USER|" /etc/gdm/custom.conf
349
sed -i "s|LIVECD_USER|\\\$LIVECD_USER|" /etc/gdm/custom.conf
350
 
350
 
351
# add keyboard and display configuration utilities to the desktop
351
# add keyboard and display configuration utilities to the desktop
352
mkdir -p /home/\\\$LIVECD_USER/Desktop >/dev/null
352
mkdir -p /home/\\\$LIVECD_USER/Desktop >/dev/null
353
cp /usr/share/applications/gnome-keyboard.desktop           /home/\\\$LIVECD_USER/Desktop/
353
cp /usr/share/applications/gnome-keyboard.desktop           /home/\\\$LIVECD_USER/Desktop/
354
cp /usr/share/applications/gnome-display-properties.desktop /home/\\\$LIVECD_USER/Desktop/
354
cp /usr/share/applications/gnome-display-properties.desktop /home/\\\$LIVECD_USER/Desktop/
355
 
355
 
356
# disable screensaver locking
356
# disable screensaver locking
357
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool   /apps/gnome-screensaver/lock_enabled "false" >/dev/null
357
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool   /apps/gnome-screensaver/lock_enabled "false" >/dev/null
358
 
358
 
359
# don't do packagekit checking by default
359
# don't do packagekit checking by default
360
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t int /apps/gnome-packagekit/update-icon/frequency_get_updates "0" >/dev/null
360
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t int /apps/gnome-packagekit/update-icon/frequency_get_updates "0" >/dev/null
361
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t string /apps/gnome-packagekit/update-icon/frequency_get_updates never >/dev/null
361
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t string /apps/gnome-packagekit/update-icon/frequency_get_updates never >/dev/null
362
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t string /apps/gnome-packagekit/update-icon/frequency_get_upgrades never >/dev/null
362
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t string /apps/gnome-packagekit/update-icon/frequency_get_upgrades never >/dev/null
363
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t string /apps/gnome-packagekit/update-icon/frequency_refresh_cache never >/dev/null
363
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t string /apps/gnome-packagekit/update-icon/frequency_refresh_cache never >/dev/null
364
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/update-icon/notify_available false >/dev/null
364
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/update-icon/notify_available false >/dev/null
365
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/update-icon/notify_distro_upgrades false >/dev/null
365
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/update-icon/notify_distro_upgrades false >/dev/null
366
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_check_firmware false >/dev/null
366
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_check_firmware false >/dev/null
367
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_check_hardware false >/dev/null
367
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_check_hardware false >/dev/null
368
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_codec_helper false >/dev/null
368
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_codec_helper false >/dev/null
369
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_font_helper false >/dev/null
369
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_font_helper false >/dev/null
370
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_mime_type_helper false >/dev/null
370
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_mime_type_helper false >/dev/null
371
 
371
 
372
# start system-config-firewall with su 
372
# start system-config-firewall with su 
373
# (bugfix: system-config-firewall does not work when root has no password)
373
# (bugfix: system-config-firewall does not work when root has no password)
374
sed -i "s|^Exec=.*|Exec=su - -c /usr/bin/system-config-firewall|" /usr/share/applications/system-config-firewall.desktop
374
sed -i "s|^Exec=.*|Exec=su - -c /usr/bin/system-config-firewall|" /usr/share/applications/system-config-firewall.desktop
375
sed -i "s|^Terminal=.*|Terminal=true|"                            /usr/share/applications/system-config-firewall.desktop
375
sed -i "s|^Terminal=.*|Terminal=true|"                            /usr/share/applications/system-config-firewall.desktop
376
 
376
 
377
#-----------------------------------------------------------------------
377
#-----------------------------------------------------------------------
378
# detecting disk partitions and logical volumes (disabled by default)
378
# detecting disk partitions and logical volumes (disabled by default)
379
# use boot parameter automount to enable it
379
# use boot parameter automount to enable it
380
#-----------------------------------------------------------------------
380
#-----------------------------------------------------------------------
381
 
381
 
382
CreateDesktopIconHD()
382
CreateDesktopIconHD()
383
{
383
{
384
cat > /home/\\\$LIVECD_USER/Desktop/Local\ hard\ drives.desktop << EOF_HDicon
384
cat > /home/\\\$LIVECD_USER/Desktop/Local\ hard\ drives.desktop << EOF_HDicon
385
[Desktop Entry]
385
[Desktop Entry]
386
Encoding=UTF-8
386
Encoding=UTF-8
387
Version=1.0
387
Version=1.0
388
Type=Link
388
Type=Link
389
Name=Local hard drives
389
Name=Local hard drives
390
Name[en_US]=Local hard drives
390
Name[en_US]=Local hard drives
391
Name[fr_CA]=Disques durs locaux
391
Name[fr_CA]=Disques durs locaux
392
URL=/mnt/disc
392
URL=/mnt/disc
393
Icon=/usr/share/icons/gnome/32x32/devices/gnome-dev-harddisk.png
393
Icon=/usr/share/icons/gnome/32x32/devices/gnome-dev-harddisk.png
394
EOF_HDicon
394
EOF_HDicon
395
 
395
 
396
chmod 755 /home/\\\$LIVECD_USER/Desktop/Local\ hard\ drives.desktop
396
chmod 755 /home/\\\$LIVECD_USER/Desktop/Local\ hard\ drives.desktop
397
}
397
}
398
 
398
 
399
CreateDesktopIconLVM()
399
CreateDesktopIconLVM()
400
{
400
{
401
mkdir -p /home/\\\$LIVECD_USER/Desktop >/dev/null
401
mkdir -p /home/\\\$LIVECD_USER/Desktop >/dev/null
402
 
402
 
403
cat > /home/\\\$LIVECD_USER/Desktop/Local\ logical\ volumes.desktop << EOF_LVMicon
403
cat > /home/\\\$LIVECD_USER/Desktop/Local\ logical\ volumes.desktop << EOF_LVMicon
404
[Desktop Entry]
404
[Desktop Entry]
405
Encoding=UTF-8
405
Encoding=UTF-8
406
Version=1.0
406
Version=1.0
407
Type=Link
407
Type=Link
408
Name=Local logical volumes
408
Name=Local logical volumes
409
Name[en_US]=Local logical volumes
409
Name[en_US]=Local logical volumes
410
Name[fr_CA]=Volumes logiques locaux
410
Name[fr_CA]=Volumes logiques locaux
411
URL=/mnt/lvm
411
URL=/mnt/lvm
412
Icon=/usr/share/icons/gnome/32x32/devices/gnome-dev-harddisk.png
412
Icon=/usr/share/icons/gnome/32x32/devices/gnome-dev-harddisk.png
413
EOF_LVMicon
413
EOF_LVMicon
414
 
414
 
415
chmod 755 /home/\\\$LIVECD_USER/Desktop/Local\ logical\ volumes.desktop
415
chmod 755 /home/\\\$LIVECD_USER/Desktop/Local\ logical\ volumes.desktop
416
}
416
}
417
 
417
 
418
# mount disk partitions if 'automount' is given as a boot option
418
# mount disk partitions if 'automount' is given as a boot option
419
if [ "\\\$( cmdline_parameter automount )" ]; then
419
if [ "\\\$( cmdline_parameter automount )" ]; then
420
	MOUNTOPTION="rw"
420
	MOUNTOPTION="rw"
421
	HARD_DISKS=\\\`egrep "[sh]d.\\\$" /proc/partitions | tr -s ' ' | sed 's/^  *//' | cut -d' ' -f4\\\`
421
	HARD_DISKS=\\\`egrep "[sh]d.\\\$" /proc/partitions | tr -s ' ' | sed 's/^  *//' | cut -d' ' -f4\\\`
422
 
422
 
423
	echo "Mounting hard disk partitions... "
423
	echo "Mounting hard disk partitions... "
424
	for DISK in \\\$HARD_DISKS; do
424
	for DISK in \\\$HARD_DISKS; do
425
	    # Get the device and system info from fdisk (but only for fat and linux partitions).
425
	    # Get the device and system info from fdisk (but only for fat and linux partitions).
426
	    FDISK_INFO=\\\`fdisk -l /dev/\\\$DISK | tr [A-Z] [a-z] | egrep "fat|linux" | egrep -v "swap|extended|lvm" | sed 's/*//' | tr -s ' ' | tr ' ' ':' | cut -d':' -f1,6-\\\`
426
	    FDISK_INFO=\\\`fdisk -l /dev/\\\$DISK | tr [A-Z] [a-z] | egrep "fat|linux" | egrep -v "swap|extended|lvm" | sed 's/*//' | tr -s ' ' | tr ' ' ':' | cut -d':' -f1,6-\\\`
427
	    for FDISK_ENTRY in \\\$FDISK_INFO; do
427
	    for FDISK_ENTRY in \\\$FDISK_INFO; do
428
		PARTITION=\\\`echo \\\$FDISK_ENTRY | cut -d':' -f1\\\`
428
		PARTITION=\\\`echo \\\$FDISK_ENTRY | cut -d':' -f1\\\`
429
		MOUNTPOINT="/mnt/disc/\\\${PARTITION##/dev/}"
429
		MOUNTPOINT="/mnt/disc/\\\${PARTITION##/dev/}"
430
		mkdir -p \\\$MOUNTPOINT
430
		mkdir -p \\\$MOUNTPOINT
431
		MOUNTED=FALSE
431
		MOUNTED=FALSE
432
 
432
 
433
		# get the partition type
433
		# get the partition type
434
		case \\\`echo \\\$FDISK_ENTRY | cut -d':' -f2-\\\` in
434
		case \\\`echo \\\$FDISK_ENTRY | cut -d':' -f2-\\\` in
435
		*fat*) 
435
		*fat*) 
436
		    FSTYPES="vfat"
436
		    FSTYPES="vfat"
437
		    EXTRAOPTIONS=",uid=500";;
437
		    EXTRAOPTIONS=",uid=500";;
438
		*)
438
		*)
439
		    FSTYPES="ext4 ext3 ext2"
439
		    FSTYPES="ext4 ext3 ext2"
440
		    EXTRAOPTIONS="";;
440
		    EXTRAOPTIONS="";;
441
		esac
441
		esac
442
 
442
 
443
		# try to mount the partition
443
		# try to mount the partition
444
		for FSTYPE in \\\$FSTYPES; do
444
		for FSTYPE in \\\$FSTYPES; do
445
		    if mount -o "\\\${MOUNTOPTION}\\\${EXTRAOPTIONS}" -t \\\$FSTYPE \\\$PARTITION \\\$MOUNTPOINT &>/dev/null; then
445
		    if mount -o "\\\${MOUNTOPTION}\\\${EXTRAOPTIONS}" -t \\\$FSTYPE \\\$PARTITION \\\$MOUNTPOINT &>/dev/null; then
446
			echo "\\\$PARTITION \\\$MOUNTPOINT \\\$FSTYPE noauto,\\\${MOUNTOPTION}\\\${EXTRAOPTIONS} 0 0" >> /etc/fstab
446
			echo "\\\$PARTITION \\\$MOUNTPOINT \\\$FSTYPE noauto,\\\${MOUNTOPTION}\\\${EXTRAOPTIONS} 0 0" >> /etc/fstab
447
			echo -n "\\\$PARTITION "
447
			echo -n "\\\$PARTITION "
448
			MOUNTED=TRUE
448
			MOUNTED=TRUE
449
			CreateDesktopIconHD
449
			CreateDesktopIconHD
450
		    fi
450
		    fi
451
		done
451
		done
452
		[ \\\$MOUNTED = "FALSE" ] && rmdir \\\$MOUNTPOINT
452
		[ \\\$MOUNTED = "FALSE" ] && rmdir \\\$MOUNTPOINT
453
	    done
453
	    done
454
	done
454
	done
455
	echo
455
	echo
456
fi
456
fi
457
 
457
 
458
# mount logical volumes if 'automount' is given as a boot option
458
# mount logical volumes if 'automount' is given as a boot option
459
if [ "\\\$( cmdline_parameter automount )" ]; then
459
if [ "\\\$( cmdline_parameter automount )" ]; then
460
        MOUNTOPTION="rw"
460
        MOUNTOPTION="rw"
461
	FSTYPES="ext4 ext3 ext2"
461
	FSTYPES="ext4 ext3 ext2"
462
	echo "Scanning for logical volumes..."
462
	echo "Scanning for logical volumes..."
463
	if ! lvm vgscan 2>&1 | grep "No volume groups"; then
463
	if ! lvm vgscan 2>&1 | grep "No volume groups"; then
464
	    echo "Activating logical volumes ..."
464
	    echo "Activating logical volumes ..."
465
	    modprobe dm_mod >/dev/null
465
	    modprobe dm_mod >/dev/null
466
	    lvm vgchange -ay
466
	    lvm vgchange -ay
467
	    LOGICAL_VOLUMES=\\\`lvm lvdisplay -c | sed "s/^  *//" | cut -d: -f1\\\`
467
	    LOGICAL_VOLUMES=\\\`lvm lvdisplay -c | sed "s/^  *//" | cut -d: -f1\\\`
468
	    if [ ! -z "\\\$LOGICAL_VOLUMES" ]; then
468
	    if [ ! -z "\\\$LOGICAL_VOLUMES" ]; then
469
		echo "Making device nodes ..."
469
		echo "Making device nodes ..."
470
		lvm vgmknodes
470
		lvm vgmknodes
471
		echo -n "Mounting logical volumes ... "
471
		echo -n "Mounting logical volumes ... "
472
		for VOLUME_NAME in \\\$LOGICAL_VOLUMES; do
472
		for VOLUME_NAME in \\\$LOGICAL_VOLUMES; do
473
		    VG_NAME=\\\`echo \\\$VOLUME_NAME | cut -d/ -f3\\\`
473
		    VG_NAME=\\\`echo \\\$VOLUME_NAME | cut -d/ -f3\\\`
474
		    LV_NAME=\\\`echo \\\$VOLUME_NAME | cut -d/ -f4\\\`
474
		    LV_NAME=\\\`echo \\\$VOLUME_NAME | cut -d/ -f4\\\`
475
		    MOUNTPOINT="/mnt/lvm/\\\${VG_NAME}-\\\${LV_NAME}"
475
		    MOUNTPOINT="/mnt/lvm/\\\${VG_NAME}-\\\${LV_NAME}"
476
		    mkdir -p \\\$MOUNTPOINT
476
		    mkdir -p \\\$MOUNTPOINT
477
 
477
 
478
		    MOUNTED=FALSE
478
		    MOUNTED=FALSE
479
		    for FSTYPE in \\\$FSTYPES; do
479
		    for FSTYPE in \\\$FSTYPES; do
480
			if mount -o \\\$MOUNTOPTION -t \\\$FSTYPE \\\$VOLUME_NAME \\\$MOUNTPOINT &>/dev/null; then
480
			if mount -o \\\$MOUNTOPTION -t \\\$FSTYPE \\\$VOLUME_NAME \\\$MOUNTPOINT &>/dev/null; then
481
			    echo "\\\$VOLUME_NAME \\\$MOUNTPOINT \\\$FSTYPE defaults,\\\${MOUNTOPTION} 0 0" >> /etc/fstab
481
			    echo "\\\$VOLUME_NAME \\\$MOUNTPOINT \\\$FSTYPE defaults,\\\${MOUNTOPTION} 0 0" >> /etc/fstab
482
			    echo -n "\\\$VOLUME_NAME "
482
			    echo -n "\\\$VOLUME_NAME "
483
			    MOUNTED=TRUE
483
			    MOUNTED=TRUE
484
			    CreateDesktopIconLVM
484
			    CreateDesktopIconLVM
485
			    break
485
			    break
486
			fi
486
			fi
487
		    done
487
		    done
488
		    [ \\\$MOUNTED = FALSE ] && rmdir \\\$MOUNTPOINT
488
		    [ \\\$MOUNTED = FALSE ] && rmdir \\\$MOUNTPOINT
489
		done
489
		done
490
		echo
490
		echo
491
 
491
 
492
	    else
492
	    else
493
		echo "No logical volumes found"
493
		echo "No logical volumes found"
494
	    fi
494
	    fi
495
	fi
495
	fi
496
fi
496
fi
497
 
497
 
498
# give back ownership to the default user
498
# give back ownership to the default user
499
chown -R \\\$LIVECD_USER:\\\$LIVECD_USER /home/\\\$LIVECD_USER
499
chown -R \\\$LIVECD_USER:\\\$LIVECD_USER /home/\\\$LIVECD_USER
500
 
500
 
501
EOF_initscript
501
EOF_initscript
502
#***********************************************************************
502
#***********************************************************************
503
# End of livesys script
503
# End of livesys script
504
#***********************************************************************
504
#***********************************************************************
505
 
505
 
506
 
506
 
507
#***********************************************************************
507
#***********************************************************************
508
# Create the livesys init script - /etc/rc.d/init.d/livesys-late
508
# Create the livesys init script - /etc/rc.d/init.d/livesys-late
509
#***********************************************************************
509
#***********************************************************************
510
 
510
 
511
echo "Creating the livesys init script - livesys-late"
511
echo "Creating the livesys init script - livesys-late"
512
 
512
 
513
cat > /etc/rc.d/init.d/livesys-late << EOF_lateinitscript
513
cat > /etc/rc.d/init.d/livesys-late << EOF_lateinitscript
514
#!/bin/bash
514
#!/bin/bash
515
#
515
#
516
# live: Late init script for live image
516
# live: Late init script for live image
517
#
517
#
518
# chkconfig: 345 99 01
518
# chkconfig: 345 99 01
519
# description: Late init script for live image.
519
# description: Late init script for live image.
520
 
520
 
521
. /etc/init.d/functions
521
. /etc/init.d/functions
522
. /etc/livesys.conf
522
. /etc/livesys.conf
523
. /etc/init.d/livesys.functions
523
. /etc/init.d/livesys.functions
524
 
524
 
525
# exit if not running from LiveCD
525
# exit if not running from LiveCD
526
if ! strstr "\\\`cat /proc/cmdline\\\`" liveimg || [ "\\\$1" != "start" ]; then
526
if ! strstr "\\\`cat /proc/cmdline\\\`" liveimg || [ "\\\$1" != "start" ]; then
527
    exit 0
527
    exit 0
528
fi
528
fi
529
 
529
 
530
touch /.liveimg-late-configured
530
touch /.liveimg-late-configured
531
 
531
 
532
# read boot parameters out of /proc/cmdline
532
# read boot parameters out of /proc/cmdline
533
ks=\\\$( cmdline_value ks )
533
ks=\\\$( cmdline_value ks )
534
xdriver=\\\$( cmdline_value xdriver )
534
xdriver=\\\$( cmdline_value xdriver )
535
kb=\\\$( cmdline_value kb )
535
kb=\\\$( cmdline_value kb )
536
 
536
 
537
# if liveinst or textinst is given, start anaconda
537
# if liveinst or textinst is given, start anaconda
538
if [ "\\\$( cmdline_parameter liveinst )" ]; then
538
if [ "\\\$( cmdline_parameter liveinst )" ]; then
539
   plymouth --quit
539
   plymouth --quit
540
   /usr/sbin/liveinst \\\$ks
540
   /usr/sbin/liveinst \\\$ks
541
fi
541
fi
542
if [ "\\\$( cmdline_parameter textinst )" ] ; then
542
if [ "\\\$( cmdline_parameter textinst )" ] ; then
543
   plymouth --quit
543
   plymouth --quit
544
   /usr/sbin/liveinst --text \\\$ks
544
   /usr/sbin/liveinst --text \\\$ks
545
fi
545
fi
546
 
546
 
547
# configure X, allowing user to override xdriver
547
# configure X, allowing user to override xdriver
548
if [ "\\\$xdriver" ]; then
548
if [ "\\\$xdriver" ]; then
549
    exists system-config-display --noui --reconfig --set-depth=24 --set-driver=\\\$xdriver
549
    exists system-config-display --noui --reconfig --set-depth=24 --set-driver=\\\$xdriver
550
fi
550
fi
551
 
551
 
552
# configure keyboard
552
# configure keyboard
553
if [ "\\\$kb" ]; then
553
if [ "\\\$kb" ]; then
554
    exists system-config-keyboard --noui \\\$kb 
554
    exists system-config-keyboard --noui \\\$kb 
555
fi
555
fi
556
 
556
 
557
EOF_lateinitscript
557
EOF_lateinitscript
558
#***********************************************************************
558
#***********************************************************************
559
# End of livesys-late script
559
# End of livesys-late script
560
#***********************************************************************
560
#***********************************************************************
561
 
561
 
562
 
562
 
563
#***********************************************************************
563
#***********************************************************************
564
# Configure the LiveCD
564
# Configure the LiveCD
565
# Everthing configured here will survive LiveCD install to harddisk !
565
# Everthing configured here will survive LiveCD install to harddisk !
566
#***********************************************************************
566
#***********************************************************************
567
 
567
 
568
echo "Configure the LiveCD"
568
echo "Configure the LiveCD"
569
 
569
 
570
# workaround avahi segfault (#279301)
570
# workaround avahi segfault (#279301)
571
touch /etc/resolv.conf
571
touch /etc/resolv.conf
572
/sbin/restorecon /etc/resolv.conf
572
/sbin/restorecon /etc/resolv.conf
573
 
573
 
574
chmod 755 /etc/rc.d/init.d/livesys
574
chmod 755 /etc/rc.d/init.d/livesys
575
/sbin/restorecon /etc/rc.d/init.d/livesys
575
/sbin/restorecon /etc/rc.d/init.d/livesys
576
/sbin/chkconfig --add livesys
576
/sbin/chkconfig --add livesys
577
 
577
 
578
chmod 755 /etc/rc.d/init.d/livesys-late
578
chmod 755 /etc/rc.d/init.d/livesys-late
579
/sbin/restorecon /etc/rc.d/init.d/livesys-late
579
/sbin/restorecon /etc/rc.d/init.d/livesys-late
580
/sbin/chkconfig --add livesys-late
580
/sbin/chkconfig --add livesys-late
581
 
581
 
582
# go ahead and pre-make the man -k cache (#455968)
582
# go ahead and pre-make the man -k cache (#455968)
583
/usr/sbin/makewhatis -w
583
/usr/sbin/makewhatis -w
584
 
584
 
585
# create locate db
585
# create locate db
586
/etc/cron.daily/mlocate.cron
586
/etc/cron.daily/mlocate.cron
587
 
587
 
588
# run prelinking
588
# run prelinking
589
/etc/cron.daily/prelink
589
/etc/cron.daily/prelink
590
 
590
 
591
# save a little bit of space at least...
591
# save a little bit of space at least...
592
rm -f /var/lib/rpm/__db*
592
rm -f /var/lib/rpm/__db*
593
rm -f /boot/initrd*
593
rm -f /boot/initrd*
594
rm -f /boot/initramfs*
594
rm -f /boot/initramfs*
595
# make sure there aren't core files lying around
595
# make sure there aren't core files lying around
596
rm -f /core*
596
rm -f /core*
597
 
597
 
598
# convince readahead not to collect
598
# convince readahead not to collect
599
rm -f /.readahead_collect
599
rm -f /.readahead_collect
600
touch /var/lib/readahead/early.sorted
600
touch /var/lib/readahead/early.sorted
601
 
601
 
602
# workaround clock syncing on shutdown that we don't want (#297421)
602
# workaround clock syncing on shutdown that we don't want (#297421)
603
sed -i -e 's/hwclock/no-such-hwclock/g' /etc/rc.d/init.d/halt
603
sed -i -e 's/hwclock/no-such-hwclock/g' /etc/rc.d/init.d/halt
604
 
604
 
605
# import RPM GPG keys
605
# import RPM GPG keys
606
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta
606
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta
607
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
607
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
608
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-sl6
608
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-sl6
609
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-dawson
609
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-dawson
610
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-sl
610
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-sl
611
 
611
 
612
# evolution is in the gnome launch panel (bad workaround to start thunderbird instead)
612
# evolution is in the gnome launch panel (bad workaround to start thunderbird instead)
613
[ ! -e /usr/bin/evolution ] && ln -s /usr/bin/thunderbird /usr/bin/evolution
613
[ ! -e /usr/bin/evolution ] && ln -s /usr/bin/thunderbird /usr/bin/evolution
614
 
614
 
615
EOF_post
615
EOF_post
616
 
616
 
617
# run post-install script
617
# run post-install script
618
/bin/bash -x /root/post-install 2>&1 | tee /root/post-install.log
618
/bin/bash -x /root/post-install 2>&1 | tee /root/post-install.log
619
 
619
 
620
%end
620
%end
621
########################################################################
621
########################################################################
622
#
622
#
623
# End of configure LiveCD in chroot
623
# End of configure LiveCD in chroot
624
#
624
#
625
########################################################################
625
########################################################################
626
 
626
 
627
 
627
 
628
########################################################################
628
########################################################################
629
#
629
#
630
#  LiveCD post no chroot install 
630
#  LiveCD post no chroot install 
631
#
631
#
632
########################################################################
632
########################################################################
633
%post --nochroot
633
%post --nochroot
634
 
634
 
635
#***********************************************************************
635
#***********************************************************************
636
# Create /root/postnochroot-install
636
# Create /root/postnochroot-install
637
# Must change "$" to "\$" and "`" to "\`" to avoid shell quoting
637
# Must change "$" to "\$" and "`" to "\`" to avoid shell quoting
638
#***********************************************************************
638
#***********************************************************************
639
 
639
 
640
cat > /root/postnochroot-install << EOF_postnochroot
640
cat > /root/postnochroot-install << EOF_postnochroot
641
#!/bin/bash
641
#!/bin/bash
642
 
642
 
643
# Copy licensing information
643
# Copy licensing information
644
cp $INSTALL_ROOT/usr/share/doc/*-release-*/GPL $LIVE_ROOT/GPL
644
cp $INSTALL_ROOT/usr/share/doc/*-release-*/GPL $LIVE_ROOT/GPL
645
 
645
 
646
# add livecd-iso-to-disk utility on the LiveCD
646
# add livecd-iso-to-disk utility on the LiveCD
647
# only works on x86, x86_64
647
# only works on x86, x86_64
648
if [ "\$(uname -i)" = "i386" -o "\$(uname -i)" = "x86_64" ]; then
648
if [ "\$(uname -i)" = "i386" -o "\$(uname -i)" = "x86_64" ]; then
649
  if [ ! -d \$LIVE_ROOT/LiveOS ]; then mkdir -p \$LIVE_ROOT/LiveOS ; fi
649
  if [ ! -d \$LIVE_ROOT/LiveOS ]; then mkdir -p \$LIVE_ROOT/LiveOS ; fi
650
  cp /usr/bin/livecd-iso-to-disk \$LIVE_ROOT/LiveOS
650
  cp /usr/bin/livecd-iso-to-disk \$LIVE_ROOT/LiveOS
651
fi
651
fi
652
 
652
 
653
# customize boot menu entries
653
# customize boot menu entries
654
grep -B4 'menu default'  \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/default.txt
654
grep -B4 'menu default'  \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/default.txt
655
grep -B3 'xdriver=vesa'  \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/basicvideo.txt
655
grep -B3 'xdriver=vesa'  \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/basicvideo.txt
656
grep -A3 'label check0'  \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/check.txt
656
grep -A3 'label check0'  \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/check.txt
657
grep -A2 'label memtest' \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/memtest.txt
657
grep -A2 'label memtest' \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/memtest.txt
658
grep -A2 'label local'   \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/localboot.txt
658
grep -A2 'label local'   \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/localboot.txt
659
 
659
 
660
sed "s/label linux0/label linuxtext0/"   \$LIVE_ROOT/isolinux/default.txt > \$LIVE_ROOT/isolinux/textboot.txt
660
sed "s/label linux0/label linuxtext0/"   \$LIVE_ROOT/isolinux/default.txt > \$LIVE_ROOT/isolinux/textboot.txt
661
sed -i "s/Boot/Boot (Text Mode)/"                                           \$LIVE_ROOT/isolinux/textboot.txt
661
sed -i "s/Boot/Boot (Text Mode)/"                                           \$LIVE_ROOT/isolinux/textboot.txt
662
sed -i "s/liveimg/liveimg 3/"                                               \$LIVE_ROOT/isolinux/textboot.txt
662
sed -i "s/liveimg/liveimg 3/"                                               \$LIVE_ROOT/isolinux/textboot.txt
663
sed -i "/menu default/d"                                                    \$LIVE_ROOT/isolinux/textboot.txt
663
sed -i "/menu default/d"                                                    \$LIVE_ROOT/isolinux/textboot.txt
664
 
664
 
665
sed "s/label linux0/label install0/"     \$LIVE_ROOT/isolinux/default.txt > \$LIVE_ROOT/isolinux/install.txt
665
sed "s/label linux0/label install0/"     \$LIVE_ROOT/isolinux/default.txt > \$LIVE_ROOT/isolinux/install.txt
666
sed -i "s/Boot/Install/"                                                    \$LIVE_ROOT/isolinux/install.txt
666
sed -i "s/Boot/Install/"                                                    \$LIVE_ROOT/isolinux/install.txt
667
sed -i "s/liveimg/liveimg liveinst noswap/"                                 \$LIVE_ROOT/isolinux/install.txt
667
sed -i "s/liveimg/liveimg liveinst noswap/"                                 \$LIVE_ROOT/isolinux/install.txt
668
sed -i "s/ quiet / /"                                                       \$LIVE_ROOT/isolinux/install.txt
668
sed -i "s/ quiet / /"                                                       \$LIVE_ROOT/isolinux/install.txt
669
sed -i "s/ rhgb / /"                                                        \$LIVE_ROOT/isolinux/install.txt
669
sed -i "s/ rhgb / /"                                                        \$LIVE_ROOT/isolinux/install.txt
670
sed -i "/menu default/d"                                                    \$LIVE_ROOT/isolinux/install.txt
670
sed -i "/menu default/d"                                                    \$LIVE_ROOT/isolinux/install.txt
671
 
671
 
672
sed "s/label linux0/label textinstall0/" \$LIVE_ROOT/isolinux/default.txt > \$LIVE_ROOT/isolinux/textinstall.txt
672
sed "s/label linux0/label textinstall0/" \$LIVE_ROOT/isolinux/default.txt > \$LIVE_ROOT/isolinux/textinstall.txt
673
sed -i "s/Boot/Install (Text Mode)/"                                        \$LIVE_ROOT/isolinux/textinstall.txt
673
sed -i "s/Boot/Install (Text Mode)/"                                        \$LIVE_ROOT/isolinux/textinstall.txt
674
sed -i "s/liveimg/liveimg textinst noswap/"                                 \$LIVE_ROOT/isolinux/textinstall.txt
674
sed -i "s/liveimg/liveimg textinst noswap/"                                 \$LIVE_ROOT/isolinux/textinstall.txt
675
sed -i "s/ quiet / /"                                                       \$LIVE_ROOT/isolinux/textinstall.txt
675
sed -i "s/ quiet / /"                                                       \$LIVE_ROOT/isolinux/textinstall.txt
676
sed -i "s/ rhgb / /"                                                        \$LIVE_ROOT/isolinux/textinstall.txt
676
sed -i "s/ rhgb / /"                                                        \$LIVE_ROOT/isolinux/textinstall.txt
677
sed -i "/menu default/d"                                                    \$LIVE_ROOT/isolinux/textinstall.txt
677
sed -i "/menu default/d"                                                    \$LIVE_ROOT/isolinux/textinstall.txt
678
 
678
 
679
cat \$LIVE_ROOT/isolinux/default.txt \$LIVE_ROOT/isolinux/basicvideo.txt \$LIVE_ROOT/isolinux/check.txt \$LIVE_ROOT/isolinux/memtest.txt \$LIVE_ROOT/isolinux/localboot.txt > \$LIVE_ROOT/isolinux/current.txt
679
cat \$LIVE_ROOT/isolinux/default.txt \$LIVE_ROOT/isolinux/basicvideo.txt \$LIVE_ROOT/isolinux/check.txt \$LIVE_ROOT/isolinux/memtest.txt \$LIVE_ROOT/isolinux/localboot.txt > \$LIVE_ROOT/isolinux/current.txt
680
diff \$LIVE_ROOT/isolinux/isolinux.cfg \$LIVE_ROOT/isolinux/current.txt | sed '/^[0-9][0-9]*/d; s/^. //; /^---$/d' > \$LIVE_ROOT/isolinux/cleaned.txt
680
diff \$LIVE_ROOT/isolinux/isolinux.cfg \$LIVE_ROOT/isolinux/current.txt | sed '/^[0-9][0-9]*/d; s/^. //; /^---$/d' > \$LIVE_ROOT/isolinux/cleaned.txt
681
cat \$LIVE_ROOT/isolinux/cleaned.txt \$LIVE_ROOT/isolinux/default.txt \$LIVE_ROOT/isolinux/textboot.txt \$LIVE_ROOT/isolinux/basicvideo.txt \$LIVE_ROOT/isolinux/install.txt \$LIVE_ROOT/isolinux/textinstall.txt \$LIVE_ROOT/isolinux/memtest.txt \$LIVE_ROOT/isolinux/localboot.txt > \$LIVE_ROOT/isolinux/isolinux.cfg
681
cat \$LIVE_ROOT/isolinux/cleaned.txt \$LIVE_ROOT/isolinux/default.txt \$LIVE_ROOT/isolinux/textboot.txt \$LIVE_ROOT/isolinux/basicvideo.txt \$LIVE_ROOT/isolinux/install.txt \$LIVE_ROOT/isolinux/textinstall.txt \$LIVE_ROOT/isolinux/memtest.txt \$LIVE_ROOT/isolinux/localboot.txt > \$LIVE_ROOT/isolinux/isolinux.cfg
682
rm -f \$LIVE_ROOT/isolinux/*.txt
682
rm -f \$LIVE_ROOT/isolinux/*.txt
683
 
683
 
684
EOF_postnochroot
684
EOF_postnochroot
685
 
685
 
686
# run postnochroot-install script
686
# run postnochroot-install script
687
/bin/bash -x /root/postnochroot-install 2>&1 | tee /root/postnochroot-install.log
687
/bin/bash -x /root/postnochroot-install 2>&1 | tee /root/postnochroot-install.log
688
 
688
 
689
%end
689
%end
690
########################################################################
690
########################################################################
691
#
691
#
692
# End of configure LiveCD in nochroot
692
# End of configure LiveCD in nochroot
693
#
693
#
694
########################################################################
694
########################################################################