Subversion Repositories livecd

Rev

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

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