Subversion Repositories livecd

Rev

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

Rev 275 Rev 277
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
# Services which should be on, but are not on per default
145
# Services which should be on, but are not on per default
146
SERVICES_ON=""
146
SERVICES_ON=""
147
 
147
 
148
EOF_livesysconf
148
EOF_livesysconf
149
 
149
 
150
 
150
 
151
cat > /etc/init.d/livesys.functions << 'EOF_livesysfunctions'
151
cat > /etc/init.d/livesys.functions << 'EOF_livesysfunctions'
152
###--------------------------------------------------------------------
152
###--------------------------------------------------------------------
153
### livesys functions
153
### livesys functions
154
###--------------------------------------------------------------------
154
###--------------------------------------------------------------------
155
 
155
 
156
# egrep_o is a replacement for "egrep -o". It prints only the last matching text
156
# egrep_o is a replacement for "egrep -o". It prints only the last matching text
157
egrep_o() {
157
egrep_o() {
158
   cat | egrep "$1" | sed -r "s/.*($1).*/\\1/"
158
   cat | egrep "$1" | sed -r "s/.*($1).*/\\1/"
159
}
159
}
160
 
160
 
161
# boot parameter
161
# boot parameter
162
cmdline_parameter() {
162
cmdline_parameter() {
163
   CMDLINE=/proc/cmdline
163
   CMDLINE=/proc/cmdline
164
   cat "$CMDLINE" | egrep_o "(^|[[:space:]]+)$1(\$|=|[[:space:]]+)" | egrep_o "$1"
164
   cat "$CMDLINE" | egrep_o "(^|[[:space:]]+)$1(\$|=|[[:space:]]+)" | egrep_o "$1"
165
}
165
}
166
 
166
 
167
# boot parameter value
167
# boot parameter value
168
cmdline_value()
168
cmdline_value()
169
{
169
{
170
   CMDLINE=/proc/cmdline
170
   CMDLINE=/proc/cmdline
171
   cat "$CMDLINE" | egrep_o "(^|[[:space:]]+)$1=([^[:space:]]+)" | egrep_o "=.*" | cut -b 2- | tail -n 1
171
   cat "$CMDLINE" | egrep_o "(^|[[:space:]]+)$1=([^[:space:]]+)" | egrep_o "=.*" | cut -b 2- | tail -n 1
172
}
172
}
173
 
173
 
174
exists() {
174
exists() {
175
    which $1 >/dev/null 2>&1 || return
175
    which $1 >/dev/null 2>&1 || return
176
    $*
176
    $*
177
}
177
}
178
 
178
 
179
EOF_livesysfunctions
179
EOF_livesysfunctions
180
 
180
 
181
 
181
 
182
 
182
 
183
########################################################################
183
########################################################################
184
# Create a sub-script so the output can be captured
184
# Create a sub-script so the output can be captured
185
# Must change "$" to "\$" and "`" to "\`" to avoid shell quoting
185
# Must change "$" to "\$" and "`" to "\`" to avoid shell quoting
186
########################################################################
186
########################################################################
187
 
187
 
188
cat > /root/post-install << EOF_post
188
cat > /root/post-install << EOF_post
189
#!/bin/bash
189
#!/bin/bash
190
 
190
 
191
 
191
 
192
echo ###################################################################
192
echo ###################################################################
193
echo ## Creating the livesys init script - livesys
193
echo ## Creating the livesys init script - livesys
194
echo ###################################################################
194
echo ###################################################################
195
 
195
 
196
cat > /etc/rc.d/init.d/livesys << EOF_initscript
196
cat > /etc/rc.d/init.d/livesys << EOF_initscript
197
#!/bin/bash
197
#!/bin/bash
198
#
198
#
199
# live: Init script for live image
199
# live: Init script for live image
200
#
200
#
201
# chkconfig: 345 00 99
201
# chkconfig: 345 00 99
202
# description: Init script for live image.
202
# description: Init script for live image.
203
 
203
 
204
. /etc/init.d/functions
204
. /etc/init.d/functions
205
. /etc/livesys.conf
205
. /etc/livesys.conf
206
. /etc/init.d/livesys.functions
206
. /etc/init.d/livesys.functions
207
 
207
 
208
# exit if not running from LiveCD
208
# exit if not running from LiveCD
209
if ! strstr "\\\`cat /proc/cmdline\\\`" liveimg || [ "\\\$1" != "start" ]; then
209
if ! strstr "\\\`cat /proc/cmdline\\\`" liveimg || [ "\\\$1" != "start" ]; then
210
    exit 0
210
    exit 0
211
fi
211
fi
212
 
212
 
213
[ -e /.liveimg-configured ] && configdone=1
213
[ -e /.liveimg-configured ] && configdone=1
214
 
214
 
215
touch /.liveimg-configured
215
touch /.liveimg-configured
216
 
216
 
217
# read boot parameters out of /proc/cmdline
217
# read boot parameters out of /proc/cmdline
218
 
218
 
219
# hostname
219
# hostname
220
hostname=\\\$( cmdline_value hostname )
220
hostname=\\\$( cmdline_value hostname )
221
 
221
 
222
# afs cell
222
# afs cell
223
CELL=\\\$( cmdline_value cell )
223
CELL=\\\$( cmdline_value cell )
224
 
224
 
225
# services to turn on / off
225
# services to turn on / off
226
SERVICEON=\\\$( cmdline_value serviceon )
226
SERVICEON=\\\$( cmdline_value serviceon )
227
SERVICEOFF=\\\$( cmdline_value serviceoff )
227
SERVICEOFF=\\\$( cmdline_value serviceoff )
228
 
228
 
229
# cups server
229
# cups server
230
CUPS=\\\$( cmdline_value cups )
230
CUPS=\\\$( cmdline_value cups )
231
 
231
 
232
# set livecd user
232
# set livecd user
233
LIVECD_USER=\\\$( cmdline_value user )
233
LIVECD_USER=\\\$( cmdline_value user )
234
[ ! "\\\$LIVECD_USER" ] && LIVECD_USER=\\\$LIVECD_DEF_USER
234
[ ! "\\\$LIVECD_USER" ] && LIVECD_USER=\\\$LIVECD_DEF_USER
235
 
235
 
236
# mount live image
236
# mount live image
237
if [ -b \\\`readlink -f /dev/live\\\` ]; then
237
if [ -b \\\`readlink -f /dev/live\\\` ]; then
238
   mkdir -p /mnt/live
238
   mkdir -p /mnt/live
239
   mount -o ro /dev/live /mnt/live 2>/dev/null || mount /dev/live /mnt/live
239
   mount -o ro /dev/live /mnt/live 2>/dev/null || mount /dev/live /mnt/live
240
fi
240
fi
241
 
241
 
242
livedir="LiveOS"
242
livedir="LiveOS"
243
for arg in \\\`cat /proc/cmdline\\\` ; do
243
for arg in \\\`cat /proc/cmdline\\\` ; do
244
  if [ "\\\${arg##live_dir=}" != "\\\${arg}" ]; then
244
  if [ "\\\${arg##live_dir=}" != "\\\${arg}" ]; then
245
    livedir=\\\${arg##live_dir=}
245
    livedir=\\\${arg##live_dir=}
246
    return
246
    return
247
  fi
247
  fi
248
done
248
done
249
 
249
 
250
# enable swaps unless requested otherwise
250
# enable swaps unless requested otherwise
251
swaps=\\\`blkid -t TYPE=swap -o device\\\`
251
swaps=\\\`blkid -t TYPE=swap -o device\\\`
252
if ! strstr "\\\`cat /proc/cmdline\\\`" noswap && [ -n "\\\$swaps" ] ; then
252
if ! strstr "\\\`cat /proc/cmdline\\\`" noswap && [ -n "\\\$swaps" ] ; then
253
  for s in \\\$swaps ; do
253
  for s in \\\$swaps ; do
254
    action "Enabling swap partition \\\$s" swapon \\\$s
254
    action "Enabling swap partition \\\$s" swapon \\\$s
255
  done
255
  done
256
fi
256
fi
257
if ! strstr "\\\`cat /proc/cmdline\\\`" noswap && [ -f /mnt/live/\\\${livedir}/swap.img ] ; then
257
if ! strstr "\\\`cat /proc/cmdline\\\`" noswap && [ -f /mnt/live/\\\${livedir}/swap.img ] ; then
258
  action "Enabling swap file" swapon /mnt/live/\\\${livedir}/swap.img
258
  action "Enabling swap file" swapon /mnt/live/\\\${livedir}/swap.img
259
fi
259
fi
260
 
260
 
261
mountPersistentHome() {
261
mountPersistentHome() {
262
  # support label/uuid
262
  # support label/uuid
263
  if [ "\\\${homedev##LABEL=}" != "\\\${homedev}" -o "\\\${homedev##UUID=}" != "\\\${homedev}" ]; then
263
  if [ "\\\${homedev##LABEL=}" != "\\\${homedev}" -o "\\\${homedev##UUID=}" != "\\\${homedev}" ]; then
264
    homedev=\\\`/sbin/blkid -o device -t "\\\$homedev"\\\`
264
    homedev=\\\`/sbin/blkid -o device -t "\\\$homedev"\\\`
265
  fi
265
  fi
266
 
266
 
267
  # if we're given a file rather than a blockdev, loopback it
267
  # if we're given a file rather than a blockdev, loopback it
268
  if [ "\\\${homedev##mtd}" != "\\\${homedev}" ]; then
268
  if [ "\\\${homedev##mtd}" != "\\\${homedev}" ]; then
269
    # mtd devs don't have a block device but get magic-mounted with -t jffs2
269
    # mtd devs don't have a block device but get magic-mounted with -t jffs2
270
    mountopts="-t jffs2"
270
    mountopts="-t jffs2"
271
  elif [ ! -b "\\\$homedev" ]; then
271
  elif [ ! -b "\\\$homedev" ]; then
272
    loopdev=\\\`losetup -f\\\`
272
    loopdev=\\\`losetup -f\\\`
273
    if [ "\\\${homedev##/mnt/live}" != "\\\${homedev}" ]; then
273
    if [ "\\\${homedev##/mnt/live}" != "\\\${homedev}" ]; then
274
      action "Remounting live store r/w" mount -o remount,rw /mnt/live
274
      action "Remounting live store r/w" mount -o remount,rw /mnt/live
275
    fi
275
    fi
276
    losetup \\\$loopdev \\\$homedev
276
    losetup \\\$loopdev \\\$homedev
277
    homedev=\\\$loopdev
277
    homedev=\\\$loopdev
278
  fi
278
  fi
279
 
279
 
280
  # if it's encrypted, we need to unlock it
280
  # if it's encrypted, we need to unlock it
281
  if [ "\\\$(/sbin/blkid -s TYPE -o value \\\$homedev 2>/dev/null)" = "crypto_LUKS" ]; then
281
  if [ "\\\$(/sbin/blkid -s TYPE -o value \\\$homedev 2>/dev/null)" = "crypto_LUKS" ]; then
282
    echo
282
    echo
283
    echo "Setting up encrypted /home device"
283
    echo "Setting up encrypted /home device"
284
    plymouth ask-for-password --command="cryptsetup luksOpen \\\$homedev EncHome"
284
    plymouth ask-for-password --command="cryptsetup luksOpen \\\$homedev EncHome"
285
    homedev=/dev/mapper/EncHome
285
    homedev=/dev/mapper/EncHome
286
  fi
286
  fi
287
 
287
 
288
  # and finally do the mount
288
  # and finally do the mount
289
  mount \\\$mountopts \\\$homedev /home
289
  mount \\\$mountopts \\\$homedev /home
290
  # if we have /home under what's passed for persistent home, then
290
  # if we have /home under what's passed for persistent home, then
291
  # we should make that the real /home.  useful for mtd device on olpc
291
  # we should make that the real /home.  useful for mtd device on olpc
292
  if [ -d /home/home ]; then mount --bind /home/home /home ; fi
292
  if [ -d /home/home ]; then mount --bind /home/home /home ; fi
293
  [ -x /sbin/restorecon ] && /sbin/restorecon /home
293
  [ -x /sbin/restorecon ] && /sbin/restorecon /home
294
  if [ -d /home/\\\$LIVECD_USER ]; then USERADDARGS="-M" ; fi
294
  if [ -d /home/\\\$LIVECD_USER ]; then USERADDARGS="-M" ; fi
295
}
295
}
296
 
296
 
297
findPersistentHome() {
297
findPersistentHome() {
298
  for arg in \\\`cat /proc/cmdline\\\` ; do
298
  for arg in \\\`cat /proc/cmdline\\\` ; do
299
    if [ "\\\${arg##persistenthome=}" != "\\\${arg}" ]; then
299
    if [ "\\\${arg##persistenthome=}" != "\\\${arg}" ]; then
300
      homedev=\\\${arg##persistenthome=}
300
      homedev=\\\${arg##persistenthome=}
301
      return
301
      return
302
    fi
302
    fi
303
  done
303
  done
304
}
304
}
305
 
305
 
306
if strstr "\\\`cat /proc/cmdline\\\`" persistenthome= ; then
306
if strstr "\\\`cat /proc/cmdline\\\`" persistenthome= ; then
307
  findPersistentHome
307
  findPersistentHome
308
elif [ -e /mnt/live/\\\${livedir}/home.img ]; then
308
elif [ -e /mnt/live/\\\${livedir}/home.img ]; then
309
  homedev=/mnt/live/\\\${livedir}/home.img
309
  homedev=/mnt/live/\\\${livedir}/home.img
310
fi
310
fi
311
 
311
 
312
# if we have a persistent /home, then we want to go ahead and mount it
312
# if we have a persistent /home, then we want to go ahead and mount it
313
if ! strstr "\\\`cat /proc/cmdline\\\`" nopersistenthome && [ -n "\\\$homedev" ] ; then
313
if ! strstr "\\\`cat /proc/cmdline\\\`" nopersistenthome && [ -n "\\\$homedev" ] ; then
314
  action "Mounting persistent /home" mountPersistentHome
314
  action "Mounting persistent /home" mountPersistentHome
315
fi
315
fi
316
 
316
 
317
# make it so that we don't do writing to the overlay for things which
317
# make it so that we don't do writing to the overlay for things which
318
# are just tmpdirs/caches
318
# are just tmpdirs/caches
319
mount -t tmpfs -o mode=0755 varcacheyum /var/cache/yum
319
mount -t tmpfs -o mode=0755 varcacheyum /var/cache/yum
320
mount -t tmpfs tmp /tmp
320
mount -t tmpfs tmp /tmp
321
mount -t tmpfs vartmp /var/tmp
321
mount -t tmpfs vartmp /var/tmp
322
[ -x /sbin/restorecon ] && /sbin/restorecon /var/cache/yum /tmp /var/tmp >/dev/null 2>&1
322
[ -x /sbin/restorecon ] && /sbin/restorecon /var/cache/yum /tmp /var/tmp >/dev/null 2>&1
323
 
323
 
324
# set afs cell if given by boot parameter
324
# set afs cell if given by boot parameter
325
if [ "\\\$CELL" ]; then
325
if [ "\\\$CELL" ]; then
326
    [ -e /usr/vice/etc/ThisCell ] && echo \\\$CELL > /usr/vice/etc/ThisCell
326
    [ -e /usr/vice/etc/ThisCell ] && echo \\\$CELL > /usr/vice/etc/ThisCell
327
fi
327
fi
328
 
328
 
329
# set cups server
329
# set cups server
330
if [ "\\\$CUPS" ]; then
330
if [ "\\\$CUPS" ]; then
331
    if [ -e /etc/cups/client.conf ]; then
331
    if [ -e /etc/cups/client.conf ]; then
332
        sed -i "s|.*ServerName .*|ServerName  \\\$CUPS|" /etc/cups/client.conf
332
        sed -i "s|.*ServerName .*|ServerName  \\\$CUPS|" /etc/cups/client.conf
333
        grep -q ServerName /etc/cups/client.conf || echo "ServerName  \\\$CUPS" >> /etc/cups/client.conf 
333
        grep -q ServerName /etc/cups/client.conf || echo "ServerName  \\\$CUPS" >> /etc/cups/client.conf 
334
    fi
334
    fi
335
fi
335
fi
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
# happens if you start the LiveCD with persistent changes #
345
# happens if you start the LiveCD with persistent changes #
346
###########################################################
346
###########################################################
347
[ "\\\$configdone" ] && exit 0
347
[ "\\\$configdone" ] && exit 0
348
 
348
 
349
# turn off services, which are not useful on LiveCD, to preserve resources
349
# turn off services, which are not useful on LiveCD, to preserve resources
350
if [ "\\\$SERVICES_OFF" ]; then
350
if [ "\\\$SERVICES_OFF" ]; then
351
    for service in \\\$SERVICES_OFF ; do
351
    for service in \\\$SERVICES_OFF ; do
352
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service off 2>/dev/null
352
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service off 2>/dev/null
353
    done
353
    done
354
fi
354
fi
355
 
355
 
356
# turn on services, which are off by default
356
# turn on services, which are off by default
357
if [ "\\\$SERVICES_ON" ]; then
357
if [ "\\\$SERVICES_ON" ]; then
358
    for service in \\\$SERVICES_ON ; do
358
    for service in \\\$SERVICES_ON ; do
359
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service ofn  2>/dev/null
359
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service ofn  2>/dev/null
360
    done
360
    done
361
fi
361
fi
362
 
362
 
363
# services off, from command line parameter (turn it off once again)
363
# services off, from command line parameter (turn it off once again)
364
if [ "\\\$SERVICEOFF" ]; then
364
if [ "\\\$SERVICEOFF" ]; then
365
    for service in \\\$( echo "\\\$SERVICEOFF" | tr ':' ' ' ); do
365
    for service in \\\$( echo "\\\$SERVICEOFF" | tr ':' ' ' ); do
366
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service off 2>/dev/null
366
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service off 2>/dev/null
367
    done
367
    done
368
fi
368
fi
369
 
369
 
370
# services on, from command line parameter (turn it ofn once again)
370
# services on, from command line parameter (turn it ofn once again)
371
if [ "\\\$SERVICEON" ]; then
371
if [ "\\\$SERVICEON" ]; then
372
    for service in \\\$( echo "\\\$SERVICEON" | tr ':' ' ' ); do
372
    for service in \\\$( echo "\\\$SERVICEON" | tr ':' ' ' ); do
373
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service on  2>/dev/null
373
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service on  2>/dev/null
374
    done
374
    done
375
fi
375
fi
376
 
376
 
377
## fix various bugs and issues
377
## fix various bugs and issues
378
# unmute sound card
378
# unmute sound card
379
exists alsaunmute 0 2> /dev/null
379
exists alsaunmute 0 2> /dev/null
380
 
380
 
381
# turn off firstboot for livecd boots
381
# turn off firstboot for livecd boots
382
echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot
382
echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot
383
 
383
 
384
# start afs with option -memcache (is this correct?)
384
# start afs with option -memcache (is this correct?)
385
[ -e /etc/sysconfig/afs ] && sed -i "s|^OPTIONS=.*|OPTIONS=\"-memcache\"|" /etc/sysconfig/afs
385
[ -e /etc/sysconfig/afs ] && sed -i "s|^OPTIONS=.*|OPTIONS=\"-memcache\"|" /etc/sysconfig/afs
386
 
386
 
387
# Stopgap fix for RH #217966; should be fixed in HAL instead
387
# Stopgap fix for RH #217966; should be fixed in HAL instead
388
touch /media/.hal-mtab
388
touch /media/.hal-mtab
389
 
389
 
390
## create the LiveCD default user
390
## create the LiveCD default user
391
# add default user with no password
391
# add default user with no password
392
/usr/sbin/useradd -c "LiveCD default user" \\\$LIVECD_USER
392
/usr/sbin/useradd -c "LiveCD default user" \\\$LIVECD_USER
393
/usr/bin/passwd -d \\\$LIVECD_USER > /dev/null
393
/usr/bin/passwd -d \\\$LIVECD_USER > /dev/null
394
# give default user sudo privileges
394
# give default user sudo privileges
395
echo "\\\$LIVECD_USER     ALL=(ALL)     NOPASSWD: ALL" >> /etc/sudoers
395
echo "\\\$LIVECD_USER     ALL=(ALL)     NOPASSWD: ALL" >> /etc/sudoers
396
 
396
 
397
## configure default user's desktop
397
## configure default user's desktop
398
# set up timed auto-login at 10 seconds
398
# set up timed auto-login at 10 seconds
399
cat >> /etc/gdm/custom.conf << FOE
399
cat >> /etc/gdm/custom.conf << FOE
400
[daemon]
400
[daemon]
401
TimedLoginEnable=true
401
TimedLoginEnable=true
402
TimedLogin=LIVECD_USER
402
TimedLogin=LIVECD_USER
403
TimedLoginDelay=$LOGIN_DELAY
403
TimedLoginDelay=$LOGIN_DELAY
404
FOE
404
FOE
405
sed -i "s|LIVECD_USER|\\\$LIVECD_USER|" /etc/gdm/custom.conf
405
sed -i "s|LIVECD_USER|\\\$LIVECD_USER|" /etc/gdm/custom.conf
406
 
406
 
407
# add keyboard and display configuration utilities to the desktop
407
# add keyboard and display configuration utilities to the desktop
408
mkdir -p /home/\\\$LIVECD_USER/Desktop >/dev/null
408
mkdir -p /home/\\\$LIVECD_USER/Desktop >/dev/null
409
cp /usr/share/applications/gnome-keyboard.desktop           /home/\\\$LIVECD_USER/Desktop/
409
cp /usr/share/applications/gnome-keyboard.desktop           /home/\\\$LIVECD_USER/Desktop/
410
cp /usr/share/applications/gnome-display-properties.desktop /home/\\\$LIVECD_USER/Desktop/
410
cp /usr/share/applications/gnome-display-properties.desktop /home/\\\$LIVECD_USER/Desktop/
411
 
411
 
412
# disable screensaver locking
412
# disable screensaver locking
413
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool   /apps/gnome-screensaver/lock_enabled "false" >/dev/null
413
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool   /apps/gnome-screensaver/lock_enabled "false" >/dev/null
414
 
414
 
415
# disable PackageKit update checking by default
415
# disable PackageKit update checking by default
416
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
416
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
417
 
417
 
-
 
418
 
418
# detecting disk partitions and logical volumes 
419
### detecting disk partitions and logical volumes (disabled by default)
-
 
420
### use boot parameter automount to enable it
-
 
421
 
419
CreateDesktopIconHD()
422
CreateDesktopIconHD()
420
{
423
{
421
cat > /home/\\\$LIVECD_USER/Desktop/Local\ hard\ drives.desktop << EOF_HDicon
424
cat > /home/\\\$LIVECD_USER/Desktop/Local\ hard\ drives.desktop << EOF_HDicon
422
[Desktop Entry]
425
[Desktop Entry]
423
Encoding=UTF-8
426
Encoding=UTF-8
424
Version=1.0
427
Version=1.0
425
Type=Link
428
Type=Link
426
Name=Local hard drives
429
Name=Local hard drives
427
Name[en_US]=Local hard drives
430
Name[en_US]=Local hard drives
428
Name[fr_CA]=Disques durs locaux
431
Name[fr_CA]=Disques durs locaux
429
URL=/mnt/disc
432
URL=/mnt/disc
430
Icon=/usr/share/icons/gnome/32x32/devices/gnome-dev-harddisk.png
433
Icon=/usr/share/icons/gnome/32x32/devices/gnome-dev-harddisk.png
431
EOF_HDicon
434
EOF_HDicon
432
 
435
 
433
chmod 755 /home/\\\$LIVECD_USER/Desktop/Local\ hard\ drives.desktop
436
chmod 755 /home/\\\$LIVECD_USER/Desktop/Local\ hard\ drives.desktop
434
}
437
}
435
 
438
 
436
CreateDesktopIconLVM()
439
CreateDesktopIconLVM()
437
{
440
{
438
mkdir -p /home/\\\$LIVECD_USER/Desktop >/dev/null
441
mkdir -p /home/\\\$LIVECD_USER/Desktop >/dev/null
439
 
442
 
440
cat > /home/\\\$LIVECD_USER/Desktop/Local\ logical\ volumes.desktop << EOF_LVMicon
443
cat > /home/\\\$LIVECD_USER/Desktop/Local\ logical\ volumes.desktop << EOF_LVMicon
441
[Desktop Entry]
444
[Desktop Entry]
442
Encoding=UTF-8
445
Encoding=UTF-8
443
Version=1.0
446
Version=1.0
444
Type=Link
447
Type=Link
445
Name=Local logical volumes
448
Name=Local logical volumes
446
Name[en_US]=Local logical volumes
449
Name[en_US]=Local logical volumes
447
Name[fr_CA]=Volumes logiques locaux
450
Name[fr_CA]=Volumes logiques locaux
448
URL=/mnt/lvm
451
URL=/mnt/lvm
449
Icon=/usr/share/icons/gnome/32x32/devices/gnome-dev-harddisk.png
452
Icon=/usr/share/icons/gnome/32x32/devices/gnome-dev-harddisk.png
450
EOF_LVMicon
453
EOF_LVMicon
451
 
454
 
452
chmod 755 /home/\\\$LIVECD_USER/Desktop/Local\ logical\ volumes.desktop
455
chmod 755 /home/\\\$LIVECD_USER/Desktop/Local\ logical\ volumes.desktop
453
}
456
}
454
 
457
 
455
# don't mount disk partitions if 'nodiskmount' is given as a boot option
458
# mount disk partitions if 'automount' is given as a boot option
456
if ! strstr "\\\`cat /proc/cmdline\\\`" nodiskmount ; then
459
if [ "\\\$( cmdline_parameter automount )" ]; then
457
	MOUNTOPTION="ro"
460
	MOUNTOPTION="rw"
458
	HARD_DISKS=\\\`egrep "[sh]d.\\\$" /proc/partitions | tr -s ' ' | sed 's/^  *//' | cut -d' ' -f4\\\`
461
	HARD_DISKS=\\\`egrep "[sh]d.\\\$" /proc/partitions | tr -s ' ' | sed 's/^  *//' | cut -d' ' -f4\\\`
459
 
462
 
460
	echo "Mounting hard disk partitions... "
463
	echo "Mounting hard disk partitions... "
461
	for DISK in \\\$HARD_DISKS; do
464
	for DISK in \\\$HARD_DISKS; do
462
	    # Get the device and system info from fdisk (but only for fat and linux partitions).
465
	    # Get the device and system info from fdisk (but only for fat and linux partitions).
463
	    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-\\\`
466
	    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-\\\`
464
	    for FDISK_ENTRY in \\\$FDISK_INFO; do
467
	    for FDISK_ENTRY in \\\$FDISK_INFO; do
465
		PARTITION=\\\`echo \\\$FDISK_ENTRY | cut -d':' -f1\\\`
468
		PARTITION=\\\`echo \\\$FDISK_ENTRY | cut -d':' -f1\\\`
466
		MOUNTPOINT="/mnt/disc/\\\${PARTITION##/dev/}"
469
		MOUNTPOINT="/mnt/disc/\\\${PARTITION##/dev/}"
467
		mkdir -p \\\$MOUNTPOINT
470
		mkdir -p \\\$MOUNTPOINT
468
		MOUNTED=FALSE
471
		MOUNTED=FALSE
469
 
472
 
470
		# get the partition type
473
		# get the partition type
471
		case \\\`echo \\\$FDISK_ENTRY | cut -d':' -f2-\\\` in
474
		case \\\`echo \\\$FDISK_ENTRY | cut -d':' -f2-\\\` in
472
		*fat*) 
475
		*fat*) 
473
		    FSTYPES="vfat"
476
		    FSTYPES="vfat"
474
		    EXTRAOPTIONS=",uid=500";;
477
		    EXTRAOPTIONS=",uid=500";;
475
		*)
478
		*)
476
		    FSTYPES="ext4 ext3 ext2"
479
		    FSTYPES="ext4 ext3 ext2"
477
		    EXTRAOPTIONS="";;
480
		    EXTRAOPTIONS="";;
478
		esac
481
		esac
479
 
482
 
480
		# try to mount the partition
483
		# try to mount the partition
481
		for FSTYPE in \\\$FSTYPES; do
484
		for FSTYPE in \\\$FSTYPES; do
482
		    if mount -o "\\\${MOUNTOPTION}\\\${EXTRAOPTIONS}" -t \\\$FSTYPE \\\$PARTITION \\\$MOUNTPOINT &>/dev/null; then
485
		    if mount -o "\\\${MOUNTOPTION}\\\${EXTRAOPTIONS}" -t \\\$FSTYPE \\\$PARTITION \\\$MOUNTPOINT &>/dev/null; then
483
			echo "\\\$PARTITION \\\$MOUNTPOINT \\\$FSTYPE noauto,\\\${MOUNTOPTION}\\\${EXTRAOPTIONS} 0 0" >> /etc/fstab
486
			echo "\\\$PARTITION \\\$MOUNTPOINT \\\$FSTYPE noauto,\\\${MOUNTOPTION}\\\${EXTRAOPTIONS} 0 0" >> /etc/fstab
484
			echo -n "\\\$PARTITION "
487
			echo -n "\\\$PARTITION "
485
			MOUNTED=TRUE
488
			MOUNTED=TRUE
486
			CreateDesktopIconHD
489
			CreateDesktopIconHD
487
		    fi
490
		    fi
488
		done
491
		done
489
		[ \\\$MOUNTED = "FALSE" ] && rmdir \\\$MOUNTPOINT
492
		[ \\\$MOUNTED = "FALSE" ] && rmdir \\\$MOUNTPOINT
490
	    done
493
	    done
491
	done
494
	done
492
	echo
495
	echo
493
fi
496
fi
494
 
497
 
495
# don't mount logical volumes if 'nolvmmount' is given as a boot option
498
# mount logical volumes if 'automount' is given as a boot option
496
if ! strstr "\\\`cat /proc/cmdline\\\`" nolvmmount ; then
499
if [ "\\\$( cmdline_parameter automount )" ]; then
497
        MOUNTOPTION="ro"
500
        MOUNTOPTION="rw"
498
	FSTYPES="ext4 ext3 ext2"
501
	FSTYPES="ext4 ext3 ext2"
499
	echo "Scanning for logical volumes..."
502
	echo "Scanning for logical volumes..."
500
	if ! lvm vgscan 2>&1 | grep "No volume groups"; then
503
	if ! lvm vgscan 2>&1 | grep "No volume groups"; then
501
	    echo "Activating logical volumes ..."
504
	    echo "Activating logical volumes ..."
502
	    modprobe dm_mod >/dev/null
505
	    modprobe dm_mod >/dev/null
503
	    lvm vgchange -ay
506
	    lvm vgchange -ay
504
	    LOGICAL_VOLUMES=\\\`lvm lvdisplay -c | sed "s/^  *//" | cut -d: -f1\\\`
507
	    LOGICAL_VOLUMES=\\\`lvm lvdisplay -c | sed "s/^  *//" | cut -d: -f1\\\`
505
	    if [ ! -z "\\\$LOGICAL_VOLUMES" ]; then
508
	    if [ ! -z "\\\$LOGICAL_VOLUMES" ]; then
506
		echo "Making device nodes ..."
509
		echo "Making device nodes ..."
507
		lvm vgmknodes
510
		lvm vgmknodes
508
		echo -n "Mounting logical volumes ... "
511
		echo -n "Mounting logical volumes ... "
509
		for VOLUME_NAME in \\\$LOGICAL_VOLUMES; do
512
		for VOLUME_NAME in \\\$LOGICAL_VOLUMES; do
510
		    VG_NAME=\\\`echo \\\$VOLUME_NAME | cut -d/ -f3\\\`
513
		    VG_NAME=\\\`echo \\\$VOLUME_NAME | cut -d/ -f3\\\`
511
		    LV_NAME=\\\`echo \\\$VOLUME_NAME | cut -d/ -f4\\\`
514
		    LV_NAME=\\\`echo \\\$VOLUME_NAME | cut -d/ -f4\\\`
512
		    MOUNTPOINT="/mnt/lvm/\\\${VG_NAME}-\\\${LV_NAME}"
515
		    MOUNTPOINT="/mnt/lvm/\\\${VG_NAME}-\\\${LV_NAME}"
513
		    mkdir -p \\\$MOUNTPOINT
516
		    mkdir -p \\\$MOUNTPOINT
514
 
517
 
515
		    MOUNTED=FALSE
518
		    MOUNTED=FALSE
516
		    for FSTYPE in \\\$FSTYPES; do
519
		    for FSTYPE in \\\$FSTYPES; do
517
			if mount -o \\\$MOUNTOPTION -t \\\$FSTYPE \\\$VOLUME_NAME \\\$MOUNTPOINT &>/dev/null; then
520
			if mount -o \\\$MOUNTOPTION -t \\\$FSTYPE \\\$VOLUME_NAME \\\$MOUNTPOINT &>/dev/null; then
518
			    echo "\\\$VOLUME_NAME \\\$MOUNTPOINT \\\$FSTYPE defaults,\\\${MOUNTOPTION} 0 0" >> /etc/fstab
521
			    echo "\\\$VOLUME_NAME \\\$MOUNTPOINT \\\$FSTYPE defaults,\\\${MOUNTOPTION} 0 0" >> /etc/fstab
519
			    echo -n "\\\$VOLUME_NAME "
522
			    echo -n "\\\$VOLUME_NAME "
520
			    MOUNTED=TRUE
523
			    MOUNTED=TRUE
521
			    CreateDesktopIconLVM
524
			    CreateDesktopIconLVM
522
			    break
525
			    break
523
			fi
526
			fi
524
		    done
527
		    done
525
		    [ \\\$MOUNTED = FALSE ] && rmdir \\\$MOUNTPOINT
528
		    [ \\\$MOUNTED = FALSE ] && rmdir \\\$MOUNTPOINT
526
		done
529
		done
527
		echo
530
		echo
528
 
531
 
529
	    else
532
	    else
530
		echo "No logical volumes found"
533
		echo "No logical volumes found"
531
	    fi
534
	    fi
532
	fi
535
	fi
533
fi
536
fi
534
 
537
 
535
# give back ownership to the default user
538
# give back ownership to the default user
536
chown -R \\\$LIVECD_USER:\\\$LIVECD_USER /home/\\\$LIVECD_USER
539
chown -R \\\$LIVECD_USER:\\\$LIVECD_USER /home/\\\$LIVECD_USER
537
 
540
 
538
EOF_initscript
541
EOF_initscript
539
echo ###################################################################
542
echo ###################################################################
540
echo ## End of livesys script
543
echo ## End of livesys script
541
echo ###################################################################
544
echo ###################################################################
542
 
545
 
543
 
546
 
544
 
547
 
545
echo ###################################################################
548
echo ###################################################################
546
echo ## Creating the livesys init script - livesys-late
549
echo ## Creating the livesys init script - livesys-late
547
echo ###################################################################
550
echo ###################################################################
548
 
551
 
549
cat > /etc/rc.d/init.d/livesys-late << EOF_lateinitscript
552
cat > /etc/rc.d/init.d/livesys-late << EOF_lateinitscript
550
#!/bin/bash
553
#!/bin/bash
551
#
554
#
552
# live: Late init script for live image
555
# live: Late init script for live image
553
#
556
#
554
# chkconfig: 345 99 01
557
# chkconfig: 345 99 01
555
# description: Late init script for live image.
558
# description: Late init script for live image.
556
 
559
 
557
. /etc/init.d/functions
560
. /etc/init.d/functions
558
. /etc/livesys.conf
561
. /etc/livesys.conf
559
. /etc/init.d/livesys.functions
562
. /etc/init.d/livesys.functions
560
 
563
 
561
# exit if not running from LiveCD
564
# exit if not running from LiveCD
562
if ! strstr "\\\`cat /proc/cmdline\\\`" liveimg || [ "\\\$1" != "start" ]; then
565
if ! strstr "\\\`cat /proc/cmdline\\\`" liveimg || [ "\\\$1" != "start" ]; then
563
    exit 0
566
    exit 0
564
fi
567
fi
565
 
568
 
566
touch /.liveimg-late-configured
569
touch /.liveimg-late-configured
567
 
570
 
568
# read boot parameters out of /proc/cmdline
571
# read boot parameters out of /proc/cmdline
569
ks=\\\$( cmdline_value ks )
572
ks=\\\$( cmdline_value ks )
570
xdriver=\\\$( cmdline_value xdriver )
573
xdriver=\\\$( cmdline_value xdriver )
571
kb=\\\$( cmdline_value kb )
574
kb=\\\$( cmdline_value kb )
572
 
575
 
573
# if liveinst or textinst is given, start anaconda
576
# if liveinst or textinst is given, start anaconda
574
if [ "\\\$( cmdline_parameter liveinst )" ]; then
577
if [ "\\\$( cmdline_parameter liveinst )" ]; then
575
   plymouth --quit
578
   plymouth --quit
576
   /usr/sbin/liveinst \\\$ks
579
   /usr/sbin/liveinst \\\$ks
577
fi
580
fi
578
if [ "\\\$( cmdline_parameter textinst )" ] ; then
581
if [ "\\\$( cmdline_parameter textinst )" ] ; then
579
   plymouth --quit
582
   plymouth --quit
580
   /usr/sbin/liveinst --text \\\$ks
583
   /usr/sbin/liveinst --text \\\$ks
581
fi
584
fi
582
 
585
 
583
# configure X, allowing user to override xdriver
586
# configure X, allowing user to override xdriver
584
if [ "\\\$xdriver" ]; then
587
if [ "\\\$xdriver" ]; then
585
    exists system-config-display --noui --reconfig --set-depth=24 --set-driver=\\\$xdriver
588
    exists system-config-display --noui --reconfig --set-depth=24 --set-driver=\\\$xdriver
586
fi
589
fi
587
 
590
 
588
# configure keyboard
591
# configure keyboard
589
if [ "\\\$kb" ]; then
592
if [ "\\\$kb" ]; then
590
    exists system-config-keyboard --noui \\\$kb 
593
    exists system-config-keyboard --noui \\\$kb 
591
fi
594
fi
592
 
595
 
593
EOF_lateinitscript
596
EOF_lateinitscript
594
echo ###################################################################
597
echo ###################################################################
595
echo ## End of livesys-late script
598
echo ## End of livesys-late script
596
echo ###################################################################
599
echo ###################################################################
597
 
600
 
598
 
601
 
599
 
602
 
600
echo ###################################################################
603
echo ###################################################################
601
echo ## Configure the LiveCD
604
echo ## Configure the LiveCD
602
echo ###################################################################
605
echo ###################################################################
603
 
606
 
604
# workaround avahi segfault (#279301)
607
# workaround avahi segfault (#279301)
605
touch /etc/resolv.conf
608
touch /etc/resolv.conf
606
/sbin/restorecon /etc/resolv.conf
609
/sbin/restorecon /etc/resolv.conf
607
 
610
 
608
chmod 755 /etc/rc.d/init.d/livesys
611
chmod 755 /etc/rc.d/init.d/livesys
609
/sbin/restorecon /etc/rc.d/init.d/livesys
612
/sbin/restorecon /etc/rc.d/init.d/livesys
610
/sbin/chkconfig --add livesys
613
/sbin/chkconfig --add livesys
611
 
614
 
612
chmod 755 /etc/rc.d/init.d/livesys-late
615
chmod 755 /etc/rc.d/init.d/livesys-late
613
/sbin/restorecon /etc/rc.d/init.d/livesys-late
616
/sbin/restorecon /etc/rc.d/init.d/livesys-late
614
/sbin/chkconfig --add livesys-late
617
/sbin/chkconfig --add livesys-late
615
 
618
 
616
# go ahead and pre-make the man -k cache (#455968)
619
# go ahead and pre-make the man -k cache (#455968)
617
/usr/sbin/makewhatis -w
620
/usr/sbin/makewhatis -w
618
 
621
 
619
# save a little bit of space at least...
622
# save a little bit of space at least...
620
rm -f /var/lib/rpm/__db*
623
rm -f /var/lib/rpm/__db*
621
rm -f /boot/initrd*
624
rm -f /boot/initrd*
622
rm -f /boot/initramfs*
625
rm -f /boot/initramfs*
623
# make sure there aren't core files lying around
626
# make sure there aren't core files lying around
624
rm -f /core*
627
rm -f /core*
625
 
628
 
626
# convince readahead not to collect
629
# convince readahead not to collect
627
rm -f /.readahead_collect
630
rm -f /.readahead_collect
628
touch /var/lib/readahead/early.sorted
631
touch /var/lib/readahead/early.sorted
629
 
632
 
630
# workaround clock syncing on shutdown that we don't want (#297421)
633
# workaround clock syncing on shutdown that we don't want (#297421)
631
sed -i -e 's/hwclock/no-such-hwclock/g' /etc/rc.d/init.d/halt
634
sed -i -e 's/hwclock/no-such-hwclock/g' /etc/rc.d/init.d/halt
632
 
635
 
633
# import RPM GPG keys
636
# import RPM GPG keys
634
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta
637
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta
635
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
638
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
636
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-sl6
639
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-sl6
637
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-dawson
640
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-dawson
638
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-sl
641
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-sl
639
 
642
 
640
# evolution is in the gnome launch panel (workaround to start thunderbird instead)
643
# evolution is in the gnome launch panel (workaround to start thunderbird instead)
641
[ ! -e /usr/bin/evolution ] && ln -s /usr/bin/thunderbird /usr/bin/evolution
644
[ ! -e /usr/bin/evolution ] && ln -s /usr/bin/thunderbird /usr/bin/evolution
642
 
645
 
643
EOF_post
646
EOF_post
644
 
647
 
645
# run post-install script
648
# run post-install script
646
/bin/bash -x /root/post-install 2>&1 | tee /root/post-install.log
649
/bin/bash -x /root/post-install 2>&1 | tee /root/post-install.log
647
 
650
 
648
%end
651
%end
649
########################################################################
652
########################################################################
650
# End of configure LiveCD in chroot
653
# End of configure LiveCD in chroot
651
########################################################################
654
########################################################################
652
 
655
 
653
 
656
 
654
 
657
 
655
%post --nochroot
658
%post --nochroot
656
########################################################################
659
########################################################################
657
# Post install in no chroot
660
# Post install in no chroot
658
# Must change "$" to "\$" and "`" to "\`" to avoid shell quoting
661
# Must change "$" to "\$" and "`" to "\`" to avoid shell quoting
659
########################################################################
662
########################################################################
660
cat > /root/postnochroot-install << EOF_postnochroot
663
cat > /root/postnochroot-install << EOF_postnochroot
661
#!/bin/bash
664
#!/bin/bash
662
 
665
 
663
# Copy licensing information
666
# Copy licensing information
664
cp $INSTALL_ROOT/usr/share/doc/*-release-*/GPL $LIVE_ROOT/GPL
667
cp $INSTALL_ROOT/usr/share/doc/*-release-*/GPL $LIVE_ROOT/GPL
665
 
668
 
666
# add livecd-iso-to-disk utility on the LiveCD
669
# add livecd-iso-to-disk utility on the LiveCD
667
# only works on x86, x86_64
670
# only works on x86, x86_64
668
if [ "\$(uname -i)" = "i386" -o "\$(uname -i)" = "x86_64" ]; then
671
if [ "\$(uname -i)" = "i386" -o "\$(uname -i)" = "x86_64" ]; then
669
  if [ ! -d \$LIVE_ROOT/LiveOS ]; then mkdir -p \$LIVE_ROOT/LiveOS ; fi
672
  if [ ! -d \$LIVE_ROOT/LiveOS ]; then mkdir -p \$LIVE_ROOT/LiveOS ; fi
670
  cp /usr/bin/livecd-iso-to-disk \$LIVE_ROOT/LiveOS
673
  cp /usr/bin/livecd-iso-to-disk \$LIVE_ROOT/LiveOS
671
fi
674
fi
672
 
675
 
673
# customize boot menu entries
676
# customize boot menu entries
674
grep -B4 'menu default'  \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/default.txt
677
grep -B4 'menu default'  \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/default.txt
675
grep -B3 'xdriver=vesa'  \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/basicvideo.txt
678
grep -B3 'xdriver=vesa'  \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/basicvideo.txt
676
grep -A3 'label check0'  \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/check.txt
679
grep -A3 'label check0'  \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/check.txt
677
grep -A2 'label memtest' \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/memtest.txt
680
grep -A2 'label memtest' \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/memtest.txt
678
grep -A2 'label local'   \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/localboot.txt
681
grep -A2 'label local'   \$LIVE_ROOT/isolinux/isolinux.cfg > \$LIVE_ROOT/isolinux/localboot.txt
679
 
682
 
680
sed "s/label linux0/label linuxtext0/"   \$LIVE_ROOT/isolinux/default.txt > \$LIVE_ROOT/isolinux/textboot.txt
683
sed "s/label linux0/label linuxtext0/"   \$LIVE_ROOT/isolinux/default.txt > \$LIVE_ROOT/isolinux/textboot.txt
681
sed -i "s/Boot/Boot (Text Mode)/"                                           \$LIVE_ROOT/isolinux/textboot.txt
684
sed -i "s/Boot/Boot (Text Mode)/"                                           \$LIVE_ROOT/isolinux/textboot.txt
682
sed -i "s/liveimg/liveimg 3/"                                               \$LIVE_ROOT/isolinux/textboot.txt
685
sed -i "s/liveimg/liveimg 3/"                                               \$LIVE_ROOT/isolinux/textboot.txt
683
sed -i "/menu default/d"                                                    \$LIVE_ROOT/isolinux/textboot.txt
686
sed -i "/menu default/d"                                                    \$LIVE_ROOT/isolinux/textboot.txt
684
 
687
 
685
sed "s/label linux0/label install0/"     \$LIVE_ROOT/isolinux/default.txt > \$LIVE_ROOT/isolinux/install.txt
688
sed "s/label linux0/label install0/"     \$LIVE_ROOT/isolinux/default.txt > \$LIVE_ROOT/isolinux/install.txt
686
sed -i "s/Boot/Install/"                                                    \$LIVE_ROOT/isolinux/install.txt
689
sed -i "s/Boot/Install/"                                                    \$LIVE_ROOT/isolinux/install.txt
687
sed -i "s/liveimg/liveimg liveinst noswap nolvmmount/"                      \$LIVE_ROOT/isolinux/install.txt
690
sed -i "s/liveimg/liveimg liveinst noswap/"                                 \$LIVE_ROOT/isolinux/install.txt
688
sed -i "s/ quiet / /"                                                       \$LIVE_ROOT/isolinux/install.txt
691
sed -i "s/ quiet / /"                                                       \$LIVE_ROOT/isolinux/install.txt
689
sed -i "s/ rhgb / /"                                                        \$LIVE_ROOT/isolinux/install.txt
692
sed -i "s/ rhgb / /"                                                        \$LIVE_ROOT/isolinux/install.txt
690
sed -i "/menu default/d"                                                    \$LIVE_ROOT/isolinux/install.txt
693
sed -i "/menu default/d"                                                    \$LIVE_ROOT/isolinux/install.txt
691
 
694
 
692
sed "s/label linux0/label textinstall0/" \$LIVE_ROOT/isolinux/default.txt > \$LIVE_ROOT/isolinux/textinstall.txt
695
sed "s/label linux0/label textinstall0/" \$LIVE_ROOT/isolinux/default.txt > \$LIVE_ROOT/isolinux/textinstall.txt
693
sed -i "s/Boot/Install (Text Mode)/"                                        \$LIVE_ROOT/isolinux/textinstall.txt
696
sed -i "s/Boot/Install (Text Mode)/"                                        \$LIVE_ROOT/isolinux/textinstall.txt
694
sed -i "s/liveimg/liveimg textinst noswap nolvmmount/"                      \$LIVE_ROOT/isolinux/textinstall.txt
697
sed -i "s/liveimg/liveimg textinst noswap/"                                 \$LIVE_ROOT/isolinux/textinstall.txt
695
sed -i "s/ quiet / /"                                                       \$LIVE_ROOT/isolinux/textinstall.txt
698
sed -i "s/ quiet / /"                                                       \$LIVE_ROOT/isolinux/textinstall.txt
696
sed -i "s/ rhgb / /"                                                        \$LIVE_ROOT/isolinux/textinstall.txt
699
sed -i "s/ rhgb / /"                                                        \$LIVE_ROOT/isolinux/textinstall.txt
697
sed -i "/menu default/d"                                                    \$LIVE_ROOT/isolinux/textinstall.txt
700
sed -i "/menu default/d"                                                    \$LIVE_ROOT/isolinux/textinstall.txt
698
 
701
 
699
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
702
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
700
diff \$LIVE_ROOT/isolinux/isolinux.cfg \$LIVE_ROOT/isolinux/current.txt | sed '/^[0-9][0-9]*/d; s/^. //; /^---$/d' > \$LIVE_ROOT/isolinux/cleaned.txt
703
diff \$LIVE_ROOT/isolinux/isolinux.cfg \$LIVE_ROOT/isolinux/current.txt | sed '/^[0-9][0-9]*/d; s/^. //; /^---$/d' > \$LIVE_ROOT/isolinux/cleaned.txt
701
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
704
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
702
rm -f \$LIVE_ROOT/isolinux/*.txt
705
rm -f \$LIVE_ROOT/isolinux/*.txt
703
 
706
 
704
EOF_postnochroot
707
EOF_postnochroot
705
 
708
 
706
# run postnochroot-install script
709
# run postnochroot-install script
707
/bin/bash -x /root/postnochroot-install 2>&1 | tee /root/postnochroot-install.log
710
/bin/bash -x /root/postnochroot-install 2>&1 | tee /root/postnochroot-install.log
708
 
711
 
709
%end
712
%end
710
########################################################################
713
########################################################################
711
# End of configure LiveCD in nochroot
714
# End of configure LiveCD in nochroot
712
########################################################################
715
########################################################################