Subversion Repositories livecd

Rev

Rev 274 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 274 Rev 275
Line 89... Line 89...
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
-
 
95
cups-pk-helper
94
 
96
 
95
%end
97
%end
96
 
98
 
97
 
99
 
98
########################################################################
100
########################################################################
Line 120... Line 122...
120
 
122
 
121
# Services which are off (not running) on the LiveCD
123
# Services which are off (not running) on the LiveCD
122
SERVICES_OFF="mdmonitor setroubleshoot auditd crond atd readahead_early \
124
SERVICES_OFF="mdmonitor setroubleshoot auditd crond atd readahead_early \
123
              readahead_later kdump microcode_ctl openct pcscd postfix"
125
              readahead_later kdump microcode_ctl openct pcscd postfix"
124
 
126
 
-
 
127
# Services which should be on, but are not on per default
-
 
128
SERVICES_ON=""
-
 
129
 
125
EOF_livesysconf
130
EOF_livesysconf
126
 
131
 
127
 
132
 
128
cat > /etc/init.d/livesys.functions << 'EOF_livesysfunctions'
133
cat > /etc/init.d/livesys.functions << 'EOF_livesysfunctions'
129
###--------------------------------------------------------------------
134
###--------------------------------------------------------------------
Line 180... Line 185...
180
 
185
 
181
. /etc/init.d/functions
186
. /etc/init.d/functions
182
. /etc/livesys.conf
187
. /etc/livesys.conf
183
. /etc/init.d/livesys.functions
188
. /etc/init.d/livesys.functions
184
 
189
 
-
 
190
# exit if not running from LiveCD
185
if ! strstr "\\\`cat /proc/cmdline\\\`" liveimg || [ "\\\$1" != "start" ]; then
191
if ! strstr "\\\`cat /proc/cmdline\\\`" liveimg || [ "\\\$1" != "start" ]; then
186
    exit 0
192
    exit 0
187
fi
193
fi
188
 
194
 
189
if [ -e /.liveimg-configured ] ; then
195
[ -e /.liveimg-configured ] && configdone=1
190
    configdone=1
-
 
191
fi
-
 
192
 
196
 
193
touch /.liveimg-configured
197
touch /.liveimg-configured
194
 
198
 
195
# read boot parameters out of /proc/cmdline
199
# read boot parameters out of /proc/cmdline
-
 
200
 
-
 
201
# hostname
196
hostname=\\\$( cmdline_value hostname )
202
hostname=\\\$( cmdline_value hostname )
-
 
203
 
-
 
204
# afs cell
197
CELL=\\\$( cmdline_value cell )
205
CELL=\\\$( cmdline_value cell )
-
 
206
 
-
 
207
# services to turn on / off
198
SERVICEON=\\\$( cmdline_value serviceon )
208
SERVICEON=\\\$( cmdline_value serviceon )
199
SERVICEOFF=\\\$( cmdline_value serviceoff )
209
SERVICEOFF=\\\$( cmdline_value serviceoff )
200
 
210
 
-
 
211
# cups server
-
 
212
CUPS=\\\$( cmdline_value cups )
-
 
213
 
201
# set livecd user
214
# set livecd user
202
LIVECD_USER=\\\$( cmdline_value user )
215
LIVECD_USER=\\\$( cmdline_value user )
203
[ ! "\\\$LIVECD_USER" ] && LIVECD_USER=\\\$LIVECD_DEF_USER
216
[ ! "\\\$LIVECD_USER" ] && LIVECD_USER=\\\$LIVECD_DEF_USER
204
 
217
 
205
# mount live image
218
# mount live image
Line 288... Line 301...
288
mount -t tmpfs -o mode=0755 varcacheyum /var/cache/yum
301
mount -t tmpfs -o mode=0755 varcacheyum /var/cache/yum
289
mount -t tmpfs tmp /tmp
302
mount -t tmpfs tmp /tmp
290
mount -t tmpfs vartmp /var/tmp
303
mount -t tmpfs vartmp /var/tmp
291
[ -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
292
 
305
 
-
 
306
# set afs cell if given by boot parameter
-
 
307
if [ "\\\$CELL" ]; then
-
 
308
    [ -e /usr/vice/etc/ThisCell ] && echo \\\$CELL > /usr/vice/etc/ThisCell
-
 
309
fi
-
 
310
 
-
 
311
# set cups server
-
 
312
if [ "\\\$CUPS" ]; then
-
 
313
    if [ -e /etc/cups/client.conf ]; then
-
 
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 
-
 
316
    fi
-
 
317
fi
-
 
318
 
-
 
319
# set the LiveCD hostname
-
 
320
[ ! "\\\$hostname" ] && hostname="livecd.localdomain"
-
 
321
sed -i -e "s|HOSTNAME=.*|HOSTNAME=\\\$hostname|g" /etc/sysconfig/network
-
 
322
/bin/hostname \\\$hostname
-
 
323
 
-
 
324
 
-
 
325
###########################################################
-
 
326
# EXIT here if LiveCD has already been configured         #
-
 
327
# happens if you start the LiveCD with persistent changes #
-
 
328
###########################################################
-
 
329
[ "\\\$configdone" ] && exit 0
-
 
330
 
293
# 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
294
if [ "\\\$SERVICES_OFF" ]; then
332
if [ "\\\$SERVICES_OFF" ]; then
295
    for service in \\\$SERVICES_OFF ; do
333
    for service in \\\$SERVICES_OFF ; do
296
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service off 2>/dev/null
334
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service off 2>/dev/null
297
    done
335
    done
298
fi
336
fi
299
 
337
 
-
 
338
# turn on services, which are off by default
-
 
339
if [ "\\\$SERVICES_ON" ]; then
-
 
340
    for service in \\\$SERVICES_ON ; do
-
 
341
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service ofn  2>/dev/null
-
 
342
    done
-
 
343
fi
-
 
344
 
300
# services off, from command line paramter
345
# services off, from command line parameter (turn it off once again)
301
if [ "\\\$SERVICEOFF" ]; then
346
if [ "\\\$SERVICEOFF" ]; then
302
    for service in \\\$( echo "\\\$SERVICEOFF" | tr ':' ' ' ); do
347
    for service in \\\$( echo "\\\$SERVICEOFF" | tr ':' ' ' ); do
303
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service off 2>/dev/null
348
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service off 2>/dev/null
304
    done
349
    done
305
fi
350
fi
306
 
351
 
307
# services on, from command line paramter
352
# services on, from command line parameter (turn it ofn once again)
308
if [ "\\\$SERVICEON" ]; then
353
if [ "\\\$SERVICEON" ]; then
309
    for service in \\\$( echo "\\\$SERVICEON" | tr ':' ' ' ); do
354
    for service in \\\$( echo "\\\$SERVICEON" | tr ':' ' ' ); do
310
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service on  2>/dev/null
355
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service on  2>/dev/null
311
    done
356
    done
312
fi
357
fi
313
 
358
 
314
# set afs cell if given by boot parameter
-
 
315
[ "\\\$CELL" ] && echo \\\$CELL > /usr/vice/etc/ThisCell
-
 
316
 
-
 
317
# set the LiveCD hostname
-
 
318
[ ! "\\\$hostname" ] && hostname="livecd.localdomain"
-
 
319
sed -i -e "s|HOSTNAME=.*|HOSTNAME=\\\$hostname|g" /etc/sysconfig/network
-
 
320
/bin/hostname \\\$hostname
-
 
321
 
-
 
322
 
-
 
323
###################################################
-
 
324
# EXIT here if LiveCD has already been configured #
-
 
325
###################################################
-
 
326
if [ -n "\\\$configdone" ]; then
-
 
327
  exit 0
-
 
328
fi
-
 
329
 
-
 
330
## fix various bugs and issues
359
## fix various bugs and issues
331
# unmute sound card
360
# unmute sound card
332
exists alsaunmute 0 2> /dev/null
361
exists alsaunmute 0 2> /dev/null
333
 
362
 
334
# turn off firstboot for livecd boots
363
# turn off firstboot for livecd boots
Line 509... Line 538...
509
 
538
 
510
. /etc/init.d/functions
539
. /etc/init.d/functions
511
. /etc/livesys.conf
540
. /etc/livesys.conf
512
. /etc/init.d/livesys.functions
541
. /etc/init.d/livesys.functions
513
 
542
 
-
 
543
# exit if not running from LiveCD
514
if ! strstr "\\\`cat /proc/cmdline\\\`" liveimg || [ "\\\$1" != "start" ] || [ -e /.liveimg-late-configured ] ; then
544
if ! strstr "\\\`cat /proc/cmdline\\\`" liveimg || [ "\\\$1" != "start" ]; then
515
    exit 0
545
    exit 0
516
fi
546
fi
517
 
547
 
518
touch /.liveimg-late-configured
548
touch /.liveimg-late-configured
519
 
549