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