Subversion Repositories livecd

Rev

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

Rev 270 Rev 273
Line 97... Line 97...
97
cat > /etc/livesys.conf << 'EOF_livesysconf'
97
cat > /etc/livesys.conf << 'EOF_livesysconf'
98
###--------------------------------------------------------------------
98
###--------------------------------------------------------------------
99
### Configuration file for LiveCD
99
### Configuration file for LiveCD
100
###--------------------------------------------------------------------
100
###--------------------------------------------------------------------
101
 
101
 
102
## default LiveCD user
102
# default LiveCD user
103
LIVECD_DEF_USER="sluser"
103
LIVECD_DEF_USER="sluser"
104
 
104
 
105
# delay in sec. before auto login
105
# delay in sec. before auto login
106
LOGIN_DELAY=15
106
LOGIN_DELAY=15
107
 
107
 
-
 
108
# Services which are off (not running) on the LiveCD
-
 
109
SERVICES_OFF="mdmonitor setroubleshoot auditd crond atd readahead_early \
-
 
110
              readahead_later kdump microcode_ctl openct pcscd postfix"
-
 
111
 
108
EOF_livesysconf
112
EOF_livesysconf
109
 
113
 
110
 
114
 
111
cat > /etc/init.d/livesys.functions << 'EOF_livesysfunctions'
115
cat > /etc/init.d/livesys.functions << 'EOF_livesysfunctions'
112
###--------------------------------------------------------------------
116
###--------------------------------------------------------------------
Line 174... Line 178...
174
fi
178
fi
175
 
179
 
176
touch /.liveimg-configured
180
touch /.liveimg-configured
177
 
181
 
178
# read boot parameters out of /proc/cmdline
182
# read boot parameters out of /proc/cmdline
179
hostname=\\\$( cmdline_value hostanme )
183
hostname=\\\$( cmdline_value hostname )
-
 
184
CELL=\\\$( cmdline_value cell )
-
 
185
SERVICEON=\\\$( cmdline_value serviceon )
-
 
186
SERVICEOFF=\\\$( cmdline_value serviceoff )
180
 
187
 
181
# set livecd user
188
# set livecd user
182
LIVECD_USER=\\\$( cmdline_value user )
189
LIVECD_USER=\\\$( cmdline_value user )
183
[ ! "\\\$LIVECD_USER" ] && LIVECD_USER=\\\$LIVECD_DEF_USER
190
[ ! "\\\$LIVECD_USER" ] && LIVECD_USER=\\\$LIVECD_DEF_USER
184
 
191
 
Line 268... Line 275...
268
mount -t tmpfs -o mode=0755 varcacheyum /var/cache/yum
275
mount -t tmpfs -o mode=0755 varcacheyum /var/cache/yum
269
mount -t tmpfs tmp /tmp
276
mount -t tmpfs tmp /tmp
270
mount -t tmpfs vartmp /var/tmp
277
mount -t tmpfs vartmp /var/tmp
271
[ -x /sbin/restorecon ] && /sbin/restorecon /var/cache/yum /tmp /var/tmp >/dev/null 2>&1
278
[ -x /sbin/restorecon ] && /sbin/restorecon /var/cache/yum /tmp /var/tmp >/dev/null 2>&1
272
 
279
 
-
 
280
# turn off services, which are not useful on LiveCD, to preserve resources
-
 
281
if [ "\\\$SERVICE_OFF" ]; then
-
 
282
    for service in \\\$SERVICE_OFF ; do
-
 
283
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service off 2>/dev/null
-
 
284
    done
-
 
285
fi
-
 
286
 
-
 
287
# services off, from command line paramter
-
 
288
if [ "\\\$SERVICEOFF" ]; then
-
 
289
    for service in \\\$( echo "\\\$SERVICEOFF" | tr ':' ' ' ); do
-
 
290
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service off 2>/dev/null
-
 
291
    done
-
 
292
fi
-
 
293
 
-
 
294
# services on, from command line paramter
-
 
295
if [ "\\\$SERVICEON" ]; then
-
 
296
    for service in \\\$( echo "\\\$SERVICEON" | tr ':' ' ' ); do
-
 
297
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service on  2>/dev/null
-
 
298
    done
-
 
299
fi
-
 
300
 
-
 
301
# set afs cell if given by boot parameter
-
 
302
[ "\\\$CELL" ] && echo \\\$CELL > /usr/vice/etc/ThisCell
-
 
303
 
-
 
304
# set the LiveCD hostname
-
 
305
[ ! "\\\$hostname" ] && hostname="livecd.localdomain"
-
 
306
sed -i -e "s|HOSTNAME=.*|HOSTNAME=\\\$hostname|g" /etc/sysconfig/network
-
 
307
/bin/hostname \\\$hostname
-
 
308
 
-
 
309
 
-
 
310
###################################################
-
 
311
# EXIT here if LiveCD has already been configured #
-
 
312
###################################################
273
if [ -n "\\\$configdone" ]; then
313
if [ -n "\\\$configdone" ]; then
274
  exit 0
314
  exit 0
275
fi
315
fi
276
 
316
 
277
## fix various bugs and issues
317
## fix various bugs and issues
Line 279... Line 319...
279
exists alsaunmute 0 2> /dev/null
319
exists alsaunmute 0 2> /dev/null
280
 
320
 
281
# turn off firstboot for livecd boots
321
# turn off firstboot for livecd boots
282
echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot
322
echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot
283
 
323
 
284
# turn off services, which are not useful on LiveCD, to preserve resources
-
 
285
chkconfig mdmonitor       off 2>/dev/null
-
 
286
chkconfig setroubleshoot  off 2>/dev/null
-
 
287
chkconfig auditd          off 2>/dev/null
-
 
288
chkconfig crond           off 2>/dev/null
-
 
289
chkconfig atd             off 2>/dev/null
-
 
290
chkconfig readahead_early off 2>/dev/null
-
 
291
chkconfig readahead_later off 2>/dev/null
-
 
292
chkconfig kdump           off 2>/dev/null
-
 
293
chkconfig microcode_ctl   off 2>/dev/null
-
 
294
chkconfig openct          off 2>/dev/null
-
 
295
chkconfig pcscd           off 2>/dev/null
-
 
296
chkconfig postfix         off 2>/dev/null
-
 
297
 
-
 
298
# start afs with option -memcache (is this correct?)
324
# start afs with option -memcache (is this correct?)
299
[ -e /etc/sysconfig/afs ] && sed -i "s|^OPTIONS=.*|OPTIONS=\"-memcache\"|" /etc/sysconfig/afs
325
[ -e /etc/sysconfig/afs ] && sed -i "s|^OPTIONS=.*|OPTIONS=\"-memcache\"|" /etc/sysconfig/afs
300
 
326
 
301
# Stopgap fix for RH #217966; should be fixed in HAL instead
327
# Stopgap fix for RH #217966; should be fixed in HAL instead
302
touch /media/.hal-mtab
328
touch /media/.hal-mtab
303
 
329
 
304
# set the LiveCD hostname
-
 
305
[ ! "\\\$hostname" ] && hostname="livecd.localdomain"
-
 
306
sed -i -e 's/HOSTNAME=localhost.localdomain/HOSTNAME=\\\$hostname/g' /etc/sysconfig/network
-
 
307
/bin/hostname \\\$hostname
-
 
308
 
-
 
309
## create the LiveCD default user
330
## create the LiveCD default user
310
# add default user with no password
331
# add default user with no password
311
/usr/sbin/useradd -c "LiveCD default user" \\\$LIVECD_USER
332
/usr/sbin/useradd -c "LiveCD default user" \\\$LIVECD_USER
312
/usr/bin/passwd -d \\\$LIVECD_USER > /dev/null
333
/usr/bin/passwd -d \\\$LIVECD_USER > /dev/null
313
# give default user sudo privileges
334
# give default user sudo privileges