Lines 51-56
Link Here
|
51 |
try mount -n /proc; \ |
51 |
try mount -n /proc; \ |
52 |
eend $? |
52 |
eend $? |
53 |
|
53 |
|
|
|
54 |
# We set the forced softlevel from the kernel command line |
55 |
# It needs to be run right after proc is mounted for the |
56 |
# boot runlevel |
57 |
for copt in `cat /proc/cmdline` |
58 |
do |
59 |
if [ "${copt%=*}" = "softlevel" ] |
60 |
then |
61 |
CONFSUFFIX=".${copt##*=}" |
62 |
elif [ "${copt%=*}" = "bootlevel" ] |
63 |
then |
64 |
BOOTLEVEL="${copt##*=}" |
65 |
fi |
66 |
done |
67 |
|
68 |
if [ -d /etc/runlevels/boot${CONFSUFFIX} \ |
69 |
-o -L /etc/runlevels/boot${CONFSUFFIX} \ |
70 |
-a ! "${BOOTLEVEL}" ] |
71 |
then |
72 |
BOOTLEVEL="boot${CONFSUFFIX}" |
73 |
else |
74 |
BOOTLEVEL="boot" |
75 |
fi |
76 |
|
54 |
# check if the user disabled devfs |
77 |
# check if the user disabled devfs |
55 |
devfs="yes" |
78 |
devfs="yes" |
56 |
get_bootparam "nodevfs" |
79 |
get_bootparam "nodevfs" |
Lines 154-230
Link Here
|
154 |
|
177 |
|
155 |
/sbin/depscan.sh |
178 |
/sbin/depscan.sh |
156 |
|
179 |
|
157 |
# Saving the kernel attributed hostname to a file for future |
180 |
# swap needs to be activated *after* devfs has been mounted and *after* |
158 |
# initialisation selection: see /etc/init.d/switch. |
181 |
# devfsd has been started, so that the fstab can be properly parsed |
159 |
get_bootparam "adelie" && cat /proc/sys/kernel/hostname > ${svcdir}/hostname |
182 |
# and only if the server is initialized |
160 |
|
183 |
ebegin "Activating swap" |
161 |
get_bootparam "adelie" && einfo "Server/Node low-level initialisation..." |
184 |
/sbin/swapon -a &>/dev/null |
162 |
if checkserver |
185 |
eend 0 |
163 |
then |
|
|
164 |
get_bootparam "adelie" && einfo "Server detected." |
165 |
|
166 |
# swap needs to be activated *after* devfs has been mounted and *after* |
167 |
# devfsd has been started, so that the fstab can be properly parsed |
168 |
# and only if the server is initialized |
169 |
ebegin "Activating swap" |
170 |
/sbin/swapon -a &>/dev/null |
171 |
eend 0 |
172 |
else |
173 |
# |
174 |
# Low-level Node Initialisation |
175 |
# |
176 |
einfo "Node detected." |
177 |
ebegin "Importing local userspace on node" |
178 |
|
179 |
try mount -t tmpfs none ${shmdir} |
180 |
|
181 |
for DIR in /etc /var /root; |
182 |
do |
183 |
|
186 |
|
184 |
if grep -q -v "^${DIR}[[:space:]]" /etc/exports |
187 |
argv1="${BOOTLEVEL}" |
185 |
then |
|
|
186 |
mount -o nolock -n server:${DIR} ${DIR} |
187 |
fi |
188 |
|
189 |
if [ -e /etc/conf.d/exclude/${DIR} ] |
190 |
then |
191 |
find ${DIR} -type d | grep -v -f /etc/conf.d/exclude/${DIR} > ${shmdir}/${DIR}.lst |
192 |
else |
193 |
find ${DIR} -type d > ${shmdir}/${DIR}.lst |
194 |
fi |
195 |
|
196 |
for SUBDIR in $(cat ${shmdir}/${DIR}.lst); |
197 |
do |
198 |
mkdir ${shmdir}/${SUBDIR} |
199 |
chmod --reference=${SUBDIR} ${shmdir}/${SUBDIR} |
200 |
cp -dp ${SUBDIR}/* ${shmdir}/${SUBDIR} &>/dev/null |
201 |
done |
202 |
|
203 |
if [ -e /etc/conf.d/exclude/${DIR} ] |
204 |
then |
205 |
for EMPTYDIR in $(cat /etc/conf.d/exclude/${DIR}); |
206 |
do |
207 |
mkdir ${shmdir}/${EMPTYDIR} |
208 |
chmod --reference=${SUBDIR} ${shmdir}/${SUBDIR} |
209 |
done |
210 |
fi |
211 |
|
212 |
umount -n ${DIR} > /dev/null |
213 |
mount -n -o bind ${shmdir}/${DIR} ${DIR} |
214 |
done |
215 |
|
216 |
mkdir ${shmdir}/tmp |
217 |
chmod 0777 ${shmdir}/tmp |
218 |
mount -n -o bind ${shmdir}/tmp /tmp |
219 |
|
220 |
cat /proc/mounts > /etc/mtab |
221 |
|
222 |
cp -f /etc/inittab.node /etc/inittab |
223 |
[ -e /etc/fstab.node ] && cp -f /etc/fstab.node /etc/fstab |
224 |
killall -1 init |
225 |
|
226 |
eend 0 |
227 |
fi |
228 |
|
188 |
|
229 |
# set the console loglevel to 1 for a cleaner boot |
189 |
# set the console loglevel to 1 for a cleaner boot |
230 |
# the logger should anyhow dump the ring-0 buffer at start to the |
190 |
# the logger should anyhow dump the ring-0 buffer at start to the |
Lines 245-254
Link Here
|
245 |
then |
205 |
then |
246 |
export SOFTLEVEL="$(cat ${svcdir}/softlevel)" |
206 |
export SOFTLEVEL="$(cat ${svcdir}/softlevel)" |
247 |
else |
207 |
else |
248 |
export SOFTLEVEL="boot" |
208 |
export SOFTLEVEL="${BOOTLEVEL}" |
249 |
fi |
209 |
fi |
250 |
else |
210 |
else |
251 |
export SOFTLEVEL="${argv1}" |
211 |
[ -f ${svcdir}/softlevel ] && \ |
|
|
212 |
LAST_SOFTLEVEL="$(cat ${svcdir}/softlevel)" |
213 |
if [ "${LAST_SOFTLEVEL:0:4}" = "boot" -a "${argv1}" = "default" \ |
214 |
-a "${forcedlevel}" ] |
215 |
then |
216 |
export SOFTLEVEL="${forcedlevel}" |
217 |
else |
218 |
export SOFTLEVEL="${argv1}" |
219 |
fi |
252 |
fi |
220 |
fi |
253 |
|
221 |
|
254 |
if [ ! -f ${svcdir}/softlevel ] |
222 |
if [ ! -f ${svcdir}/softlevel ] |
Lines 273-283
Link Here
|
273 |
exit 1 |
241 |
exit 1 |
274 |
else |
242 |
else |
275 |
myscripts="" |
243 |
myscripts="" |
276 |
if [ "${SOFTLEVEL}" != "boot" ] |
244 |
if [ "${SOFTLEVEL}" != "${BOOTLEVEL}" ] |
277 |
then |
245 |
then |
278 |
# normal runlevels *include* boot scripts |
246 |
# normal runlevels *include* boot scripts |
279 |
mylevels="$(dolisting /etc/runlevels/${SOFTLEVEL}/)" |
247 |
mylevels="$(dolisting /etc/runlevels/${SOFTLEVEL}/)" |
280 |
mylevels="${mylevels} $(dolisting /etc/runlevels/boot/)" |
248 |
mylevels="${mylevels} $(dolisting /etc/runlevels/${BOOTLEVEL}/)" |
281 |
else |
249 |
else |
282 |
# non-normal runlevels don't include boot scripts as default |
250 |
# non-normal runlevels don't include boot scripts as default |
283 |
mylevels="$(dolisting /etc/runlevels/${SOFTLEVEL}/)" |
251 |
mylevels="$(dolisting /etc/runlevels/${SOFTLEVEL}/)" |