Subversion Repositories livecd

Rev

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

Rev 73 Rev 84
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#
2
#
3
# Fix things during bootup - run first 
3
# Fix things during bootup - run first 
-
 
4
# For example: Enable services, etc ...
4
# Executed at the very end of /etc/rc.d/rc.sysinit
5
# Executed at the very end of /etc/rc.d/rc.sysinit
5
#
6
#
6
# Urs Beyerle, PSI
7
# Urs Beyerle, PSI
7
#
8
#
8
 
9
 
9
### -----------------------------------------------------------
10
### -----------------------------------------------------------
10
### definitions
11
### Definitions
11
### -----------------------------------------------------------
12
### -----------------------------------------------------------
12
 
13
 
13
# dir of mounted /$MOUNTDIR/live
14
# dir of mounted /$MOUNTDIR/live
14
MOUNTDIR=livecd
15
MOUNTDIR=livecd
15
 
16
 
Line 59... Line 60...
59
SERVICEON=$( cmdline_value serviceon )
60
SERVICEON=$( cmdline_value serviceon )
60
SERVICEOFF=$( cmdline_value serviceoff )
61
SERVICEOFF=$( cmdline_value serviceoff )
61
 
62
 
62
 
63
 
63
### -----------------------------------------------------------
64
### -----------------------------------------------------------
64
### Main
65
### Configure services
65
### -----------------------------------------------------------
66
### -----------------------------------------------------------
66
 
67
 
67
### disable rpcidmapd, if LiveCD mounted over NFS
68
### disable rpcidmapd, if LiveCD mounted over NFS
68
if [ $NFSROOT ]; then
69
if [ $NFSROOT ]; then
69
    chkconfig rpcidmapd off
70
    chkconfig rpcidmapd off
70
fi
71
fi
71
 
72
 
72
### restore blacklist (modified in runveryfirst)
-
 
73
if [ $NFSROOT ]; then
-
 
74
    [ -e /etc/hotplug/blacklist ] && BLACKLIST_FILE=/etc/hotplug/blacklist
-
 
75
    [ -e /etc/modprobe.d/blacklist ] && BLACKLIST_FILE=/etc/modprobe.d/blacklist
-
 
76
    mv -f ${BLACKLIST_FILE}.backup ${BLACKLIST_FILE}
-
 
77
fi
-
 
78
 
-
 
79
### get resolv.conf
-
 
80
# if we have the LiveCD mounted over NFS
-
 
81
if [ $NFSROOT ]; then
-
 
82
    cp -f /$MOUNTDIR/live/etc/resolv.conf /etc/
-
 
83
fi
-
 
84
 
-
 
85
### disable shutdown of network and nfs, 
73
### disable shutdown of network and nfs, 
86
# if we have the LiveCD mounted over NFS
74
# if we have the LiveCD mounted over NFS
87
if [ $NFSROOT ]; then
75
if [ $NFSROOT ]; then
88
    if [ $ONEMASTER ]; then
76
    if [ $ONEMASTER ]; then
89
        # "network off" is only necessary, 
77
        # "network off" is only necessary, 
Line 100... Line 88...
100
    rm -f /etc/rc.d/rc0.d/K86nfslock
88
    rm -f /etc/rc.d/rc0.d/K86nfslock
101
    rm -f /etc/rc.d/rc0.d/K87portmap
89
    rm -f /etc/rc.d/rc0.d/K87portmap
102
    rm -f /etc/rc.d/rc0.d/K90network
90
    rm -f /etc/rc.d/rc0.d/K90network
103
fi
91
fi
104
 
92
 
105
### create AFS mount point
-
 
106
mkdir -p /afs
-
 
107
 
-
 
108
### enable AFS during start up, if given by boot parameter
93
### enable AFS during start up, if given by boot parameter
109
if [ $AFS ]; then
94
if [ $AFS ]; then
110
    chkconfig afs on
95
    chkconfig afs on
111
fi
96
fi
112
 
97
 
Line 133... Line 118...
133
### enable SSH server during start up, if given by boot parameter
118
### enable SSH server during start up, if given by boot parameter
134
if [ $SSH ]; then
119
if [ $SSH ]; then
135
    chkconfig sshd on
120
    chkconfig sshd on
136
fi
121
fi
137
 
122
 
-
 
123
### activate ipw3945d daemon, if we have Intel IPW3945 WLAN 
-
 
124
if [ ! $NONET ]; then
-
 
125
    lspci | grep -q Intel.*3945ABG
-
 
126
    if [ "$?" = "0" ]; then
-
 
127
	chkconfig ipw3945d on 2>/dev/null
-
 
128
    fi
-
 
129
fi
-
 
130
 
-
 
131
### enable 915resolution on Intel Mobile Display controller
-
 
132
lspci | grep -q Display.*Intel.*Mobile
-
 
133
if [ "$?" = "0" ]; then 
-
 
134
    chkconfig 915resolution on 2>/dev/null
-
 
135
fi
-
 
136
 
138
### services on
137
### services on
139
if [ -n $SERVICEON ]; then
138
if [ -n $SERVICEON ]; then
140
    for service in `echo "$SERVICEON" | tr ':' ' '`; do
139
    for service in `echo "$SERVICEON" | tr ':' ' '`; do
141
	if [ -f /etc/init.d/$service ]; then
140
	if [ -f /etc/init.d/$service ]; then
142
	    chkconfig $service on
141
	    chkconfig $service on
Line 151... Line 150...
151
	    chkconfig $service off
150
	    chkconfig $service off
152
	fi
151
	fi
153
    done
152
    done
154
fi
153
fi
155
 
154
 
-
 
155
 
-
 
156
### -----------------------------------------------------------
-
 
157
### Main
-
 
158
### -----------------------------------------------------------
-
 
159
 
-
 
160
### get resolv.conf, if we have the LiveCD mounted over NFS
-
 
161
if [ $NFSROOT ]; then
-
 
162
    cp -f /$MOUNTDIR/live/etc/resolv.conf /etc/
-
 
163
fi
-
 
164
 
-
 
165
### restore blacklist (modified in runveryfirst)
-
 
166
if [ $NFSROOT ]; then
-
 
167
    [ -e /etc/hotplug/blacklist ] && BLACKLIST_FILE=/etc/hotplug/blacklist
-
 
168
    [ -e /etc/modprobe.d/blacklist ] && BLACKLIST_FILE=/etc/modprobe.d/blacklist
-
 
169
    mv -f ${BLACKLIST_FILE}.backup ${BLACKLIST_FILE}
-
 
170
fi
-
 
171
 
-
 
172
### create AFS mount point
-
 
173
mkdir -p /afs
-
 
174
 
-
 
175
### set afs cell, if given by boot parameter
-
 
176
if [ $CELL ]; then
-
 
177
    echo $CELL > /usr/vice/etc/ThisCell
-
 
178
fi
-
 
179
 
156
### fix perm of /tmp
180
### fix perm of /tmp
157
chmod 1777 /tmp
181
chmod 1777 /tmp
158
 
182
 
159
### link /opt -> /usr/opt !
183
### link /opt -> /usr/opt !
160
ln -s /usr/opt /opt
184
ln -s /usr/opt /opt
Line 176... Line 200...
176
if [ $PSI ]; then
200
if [ $PSI ]; then
177
    mkdir -p /mnt/master
201
    mkdir -p /mnt/master
178
    echo "pxeserv01:/master       /mnt/master             nfs     nfsvers=2,noauto,nolock,ro 0 0" >> /etc/fstab
202
    echo "pxeserv01:/master       /mnt/master             nfs     nfsvers=2,noauto,nolock,ro 0 0" >> /etc/fstab
179
fi
203
fi
180
 
204
 
181
### set afs cell, if given by boot parameter
-
 
182
if [ $CELL ]; then
-
 
183
    echo $CELL > /usr/vice/etc/ThisCell
-
 
184
fi
-
 
185
 
-