Subversion Repositories livecd

Rev

Rev 270 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 270 Rev 273
Line 110... Line 110...
110
cat > /etc/livesys.conf << 'EOF_livesysconf'
110
cat > /etc/livesys.conf << 'EOF_livesysconf'
111
###--------------------------------------------------------------------
111
###--------------------------------------------------------------------
112
### Configuration file for LiveCD
112
### Configuration file for LiveCD
113
###--------------------------------------------------------------------
113
###--------------------------------------------------------------------
114
 
114
 
115
## default LiveCD user
115
# default LiveCD user
116
LIVECD_DEF_USER="sluser"
116
LIVECD_DEF_USER="sluser"
117
 
117
 
118
# delay in sec. before auto login
118
# delay in sec. before auto login
119
LOGIN_DELAY=15
119
LOGIN_DELAY=15
120
 
120
 
-
 
121
# Services which are off (not running) on the LiveCD
-
 
122
SERVICES_OFF="mdmonitor setroubleshoot auditd crond atd readahead_early \
-
 
123
              readahead_later kdump microcode_ctl openct pcscd postfix"
-
 
124
 
121
EOF_livesysconf
125
EOF_livesysconf
122
 
126
 
123
 
127
 
124
cat > /etc/init.d/livesys.functions << 'EOF_livesysfunctions'
128
cat > /etc/init.d/livesys.functions << 'EOF_livesysfunctions'
125
###--------------------------------------------------------------------
129
###--------------------------------------------------------------------
Line 187... Line 191...
187
fi
191
fi
188
 
192
 
189
touch /.liveimg-configured
193
touch /.liveimg-configured
190
 
194
 
191
# read boot parameters out of /proc/cmdline
195
# read boot parameters out of /proc/cmdline
192
hostname=\\\$( cmdline_value hostanme )
196
hostname=\\\$( cmdline_value hostname )
-
 
197
CELL=\\\$( cmdline_value cell )
-
 
198
SERVICEON=\\\$( cmdline_value serviceon )
-
 
199
SERVICEOFF=\\\$( cmdline_value serviceoff )
193
 
200
 
194
# set livecd user
201
# set livecd user
195
LIVECD_USER=\\\$( cmdline_value user )
202
LIVECD_USER=\\\$( cmdline_value user )
196
[ ! "\\\$LIVECD_USER" ] && LIVECD_USER=\\\$LIVECD_DEF_USER
203
[ ! "\\\$LIVECD_USER" ] && LIVECD_USER=\\\$LIVECD_DEF_USER
197
 
204
 
Line 281... Line 288...
281
mount -t tmpfs -o mode=0755 varcacheyum /var/cache/yum
288
mount -t tmpfs -o mode=0755 varcacheyum /var/cache/yum
282
mount -t tmpfs tmp /tmp
289
mount -t tmpfs tmp /tmp
283
mount -t tmpfs vartmp /var/tmp
290
mount -t tmpfs vartmp /var/tmp
284
[ -x /sbin/restorecon ] && /sbin/restorecon /var/cache/yum /tmp /var/tmp >/dev/null 2>&1
291
[ -x /sbin/restorecon ] && /sbin/restorecon /var/cache/yum /tmp /var/tmp >/dev/null 2>&1
285
 
292
 
-
 
293
# turn off services, which are not useful on LiveCD, to preserve resources
-
 
294
if [ "\\\$SERVICE_OFF" ]; then
-
 
295
    for service in \\\$SERVICE_OFF ; do
-
 
296
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service off 2>/dev/null
-
 
297
    done
-
 
298
fi
-
 
299
 
-
 
300
# services off, from command line paramter
-
 
301
if [ "\\\$SERVICEOFF" ]; then
-
 
302
    for service in \\\$( echo "\\\$SERVICEOFF" | tr ':' ' ' ); do
-
 
303
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service off 2>/dev/null
-
 
304
    done
-
 
305
fi
-
 
306
 
-
 
307
# services on, from command line paramter
-
 
308
if [ "\\\$SERVICEON" ]; then
-
 
309
    for service in \\\$( echo "\\\$SERVICEON" | tr ':' ' ' ); do
-
 
310
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service on  2>/dev/null
-
 
311
    done
-
 
312
fi
-
 
313
 
-
 
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
###################################################
286
if [ -n "\\\$configdone" ]; then
326
if [ -n "\\\$configdone" ]; then
287
  exit 0
327
  exit 0
288
fi
328
fi
289
 
329
 
290
## fix various bugs and issues
330
## fix various bugs and issues
Line 292... Line 332...
292
exists alsaunmute 0 2> /dev/null
332
exists alsaunmute 0 2> /dev/null
293
 
333
 
294
# turn off firstboot for livecd boots
334
# turn off firstboot for livecd boots
295
echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot
335
echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot
296
 
336
 
297
# turn off services, which are not useful on LiveCD, to preserve resources
-
 
298
chkconfig mdmonitor       off 2>/dev/null
-
 
299
chkconfig setroubleshoot  off 2>/dev/null
-
 
300
chkconfig auditd          off 2>/dev/null
-
 
301
chkconfig crond           off 2>/dev/null
-
 
302
chkconfig atd             off 2>/dev/null
-
 
303
chkconfig readahead_early off 2>/dev/null
-
 
304
chkconfig readahead_later off 2>/dev/null
-
 
305
chkconfig kdump           off 2>/dev/null
-
 
306
chkconfig microcode_ctl   off 2>/dev/null
-
 
307
chkconfig openct          off 2>/dev/null
-
 
308
chkconfig pcscd           off 2>/dev/null
-
 
309
chkconfig postfix         off 2>/dev/null
-
 
310
 
-
 
311
# start afs with option -memcache (is this correct?)
337
# start afs with option -memcache (is this correct?)
312
[ -e /etc/sysconfig/afs ] && sed -i "s|^OPTIONS=.*|OPTIONS=\"-memcache\"|" /etc/sysconfig/afs
338
[ -e /etc/sysconfig/afs ] && sed -i "s|^OPTIONS=.*|OPTIONS=\"-memcache\"|" /etc/sysconfig/afs
313
 
339
 
314
# Stopgap fix for RH #217966; should be fixed in HAL instead
340
# Stopgap fix for RH #217966; should be fixed in HAL instead
315
touch /media/.hal-mtab
341
touch /media/.hal-mtab
316
 
342
 
317
# set the LiveCD hostname
-
 
318
[ ! "\\\$hostname" ] && hostname="livecd.localdomain"
-
 
319
sed -i -e 's/HOSTNAME=localhost.localdomain/HOSTNAME=\\\$hostname/g' /etc/sysconfig/network
-
 
320
/bin/hostname \\\$hostname
-
 
321
 
-
 
322
## create the LiveCD default user
343
## create the LiveCD default user
323
# add default user with no password
344
# add default user with no password
324
/usr/sbin/useradd -c "LiveCD default user" \\\$LIVECD_USER
345
/usr/sbin/useradd -c "LiveCD default user" \\\$LIVECD_USER
325
/usr/bin/passwd -d \\\$LIVECD_USER > /dev/null
346
/usr/bin/passwd -d \\\$LIVECD_USER > /dev/null
326
# give default user sudo privileges
347
# give default user sudo privileges