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 13... Line 13...
13
cat > /etc/livesys.conf << 'EOF_livesysconf'
13
cat > /etc/livesys.conf << 'EOF_livesysconf'
14
###--------------------------------------------------------------------
14
###--------------------------------------------------------------------
15
### Configuration file for LiveCD
15
### Configuration file for LiveCD
16
###--------------------------------------------------------------------
16
###--------------------------------------------------------------------
17
 
17
 
18
## default LiveCD user
18
# default LiveCD user
19
LIVECD_DEF_USER="sluser"
19
LIVECD_DEF_USER="sluser"
20
 
20
 
21
# delay in sec. before auto login
21
# delay in sec. before auto login
22
LOGIN_DELAY=15
22
LOGIN_DELAY=15
23
 
23
 
-
 
24
# Services which are off (not running) on the LiveCD
-
 
25
SERVICES_OFF="mdmonitor setroubleshoot auditd crond atd readahead_early \
-
 
26
              readahead_later kdump microcode_ctl openct pcscd postfix"
-
 
27
 
24
EOF_livesysconf
28
EOF_livesysconf
25
 
29
 
26
 
30
 
27
cat > /etc/init.d/livesys.functions << 'EOF_livesysfunctions'
31
cat > /etc/init.d/livesys.functions << 'EOF_livesysfunctions'
28
###--------------------------------------------------------------------
32
###--------------------------------------------------------------------
Line 90... Line 94...
90
fi
94
fi
91
 
95
 
92
touch /.liveimg-configured
96
touch /.liveimg-configured
93
 
97
 
94
# read boot parameters out of /proc/cmdline
98
# read boot parameters out of /proc/cmdline
95
hostname=\\\$( cmdline_value hostanme )
99
hostname=\\\$( cmdline_value hostname )
-
 
100
CELL=\\\$( cmdline_value cell )
-
 
101
SERVICEON=\\\$( cmdline_value serviceon )
-
 
102
SERVICEOFF=\\\$( cmdline_value serviceoff )
96
 
103
 
97
# set livecd user
104
# set livecd user
98
LIVECD_USER=\\\$( cmdline_value user )
105
LIVECD_USER=\\\$( cmdline_value user )
99
[ ! "\\\$LIVECD_USER" ] && LIVECD_USER=\\\$LIVECD_DEF_USER
106
[ ! "\\\$LIVECD_USER" ] && LIVECD_USER=\\\$LIVECD_DEF_USER
100
 
107
 
Line 184... Line 191...
184
mount -t tmpfs -o mode=0755 varcacheyum /var/cache/yum
191
mount -t tmpfs -o mode=0755 varcacheyum /var/cache/yum
185
mount -t tmpfs tmp /tmp
192
mount -t tmpfs tmp /tmp
186
mount -t tmpfs vartmp /var/tmp
193
mount -t tmpfs vartmp /var/tmp
187
[ -x /sbin/restorecon ] && /sbin/restorecon /var/cache/yum /tmp /var/tmp >/dev/null 2>&1
194
[ -x /sbin/restorecon ] && /sbin/restorecon /var/cache/yum /tmp /var/tmp >/dev/null 2>&1
188
 
195
 
-
 
196
# turn off services, which are not useful on LiveCD, to preserve resources
-
 
197
if [ "\\\$SERVICE_OFF" ]; then
-
 
198
    for service in \\\$SERVICE_OFF ; do
-
 
199
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service off 2>/dev/null
-
 
200
    done
-
 
201
fi
-
 
202
 
-
 
203
# services off, from command line paramter
-
 
204
if [ "\\\$SERVICEOFF" ]; then
-
 
205
    for service in \\\$( echo "\\\$SERVICEOFF" | tr ':' ' ' ); do
-
 
206
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service off 2>/dev/null
-
 
207
    done
-
 
208
fi
-
 
209
 
-
 
210
# services on, from command line paramter
-
 
211
if [ "\\\$SERVICEON" ]; then
-
 
212
    for service in \\\$( echo "\\\$SERVICEON" | tr ':' ' ' ); do
-
 
213
        [ -f /etc/init.d/\\\$service ] && chkconfig \\\$service on  2>/dev/null
-
 
214
    done
-
 
215
fi
-
 
216
 
-
 
217
# set afs cell if given by boot parameter
-
 
218
[ "\\\$CELL" ] && echo \\\$CELL > /usr/vice/etc/ThisCell
-
 
219
 
-
 
220
# set the LiveCD hostname
-
 
221
[ ! "\\\$hostname" ] && hostname="livecd.localdomain"
-
 
222
sed -i -e "s|HOSTNAME=.*|HOSTNAME=\\\$hostname|g" /etc/sysconfig/network
-
 
223
/bin/hostname \\\$hostname
-
 
224
 
-
 
225
 
-
 
226
###################################################
-
 
227
# EXIT here if LiveCD has already been configured #
-
 
228
###################################################
189
if [ -n "\\\$configdone" ]; then
229
if [ -n "\\\$configdone" ]; then
190
  exit 0
230
  exit 0
191
fi
231
fi
192
 
232
 
193
## fix various bugs and issues
233
## fix various bugs and issues
Line 195... Line 235...
195
exists alsaunmute 0 2> /dev/null
235
exists alsaunmute 0 2> /dev/null
196
 
236
 
197
# turn off firstboot for livecd boots
237
# turn off firstboot for livecd boots
198
echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot
238
echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot
199
 
239
 
200
# turn off services, which are not useful on LiveCD, to preserve resources
-
 
201
chkconfig mdmonitor       off 2>/dev/null
-
 
202
chkconfig setroubleshoot  off 2>/dev/null
-
 
203
chkconfig auditd          off 2>/dev/null
-
 
204
chkconfig crond           off 2>/dev/null
-
 
205
chkconfig atd             off 2>/dev/null
-
 
206
chkconfig readahead_early off 2>/dev/null
-
 
207
chkconfig readahead_later off 2>/dev/null
-
 
208
chkconfig kdump           off 2>/dev/null
-
 
209
chkconfig microcode_ctl   off 2>/dev/null
-
 
210
chkconfig openct          off 2>/dev/null
-
 
211
chkconfig pcscd           off 2>/dev/null
-
 
212
chkconfig postfix         off 2>/dev/null
-
 
213
 
-
 
214
# start afs with option -memcache (is this correct?)
240
# start afs with option -memcache (is this correct?)
215
[ -e /etc/sysconfig/afs ] && sed -i "s|^OPTIONS=.*|OPTIONS=\"-memcache\"|" /etc/sysconfig/afs
241
[ -e /etc/sysconfig/afs ] && sed -i "s|^OPTIONS=.*|OPTIONS=\"-memcache\"|" /etc/sysconfig/afs
216
 
242
 
217
# Stopgap fix for RH #217966; should be fixed in HAL instead
243
# Stopgap fix for RH #217966; should be fixed in HAL instead
218
touch /media/.hal-mtab
244
touch /media/.hal-mtab
219
 
245
 
220
# set the LiveCD hostname
-
 
221
[ ! "\\\$hostname" ] && hostname="livecd.localdomain"
-
 
222
sed -i -e 's/HOSTNAME=localhost.localdomain/HOSTNAME=\\\$hostname/g' /etc/sysconfig/network
-
 
223
/bin/hostname \\\$hostname
-
 
224
 
-
 
225
## create the LiveCD default user
246
## create the LiveCD default user
226
# add default user with no password
247
# add default user with no password
227
/usr/sbin/useradd -c "LiveCD default user" \\\$LIVECD_USER
248
/usr/sbin/useradd -c "LiveCD default user" \\\$LIVECD_USER
228
/usr/bin/passwd -d \\\$LIVECD_USER > /dev/null
249
/usr/bin/passwd -d \\\$LIVECD_USER > /dev/null
229
# give default user sudo privileges
250
# give default user sudo privileges