Lines 206-212
Link Here
|
206 |
pb_scripts=0 |
206 |
pb_scripts=0 |
207 |
pb_rate=0 |
207 |
pb_rate=0 |
208 |
|
208 |
|
209 |
[ ! -e /proc/splash -o ! -e /sbin/splash ] && return 0 |
209 |
if [ ! -x /sbin/splash ] || \ |
|
|
210 |
[ -e /proc/version -a ! -e /proc/splash ] |
211 |
then |
212 |
return 0 |
213 |
fi |
210 |
|
214 |
|
211 |
if [ -f /etc/conf.d/bootsplash.conf ] |
215 |
if [ -f /etc/conf.d/bootsplash.conf ] |
212 |
then |
216 |
then |
Lines 227-262
Link Here
|
227 |
export pb_init pb_count pb_scripts pb_rate |
231 |
export pb_init pb_count pb_scripts pb_rate |
228 |
} |
232 |
} |
229 |
# |
233 |
# |
230 |
# void splash_calc (char *argv1, char *svcdir) |
234 |
# void splash_calc (void) |
231 |
# |
235 |
# |
232 |
splash_calc() { |
236 |
splash_calc() { |
233 |
pb_runs=(/etc/runlevels/$1/*) |
237 |
pb_runs=($(dolisting "/etc/runlevels/${SOFTLEVEL}/")) |
234 |
pb_runb=(/etc/runlevels/boot/*) |
238 |
pb_runb=($(dolisting "/etc/runlevels/${BOOTLEVEL}/")) |
235 |
pb_scripts=${#pb_runs[*]} |
239 |
pb_scripts=${#pb_runs[*]} |
236 |
pb_boot=${#pb_runb[*]} |
240 |
pb_boot=${#pb_runb[*]} |
237 |
|
241 |
|
238 |
[ ! -e /proc/splash -o ! -e /sbin/splash ] && return 0 |
242 |
[ ! -e /proc/splash -o ! -x /sbin/splash ] && return 0 |
239 |
|
243 |
|
240 |
if [ -f /etc/conf.d/bootsplash.conf ] |
244 |
if [ -f /etc/conf.d/bootsplash.conf ] |
241 |
then |
245 |
then |
242 |
. /etc/conf.d/bootsplash.conf |
246 |
. /etc/conf.d/bootsplash.conf |
243 |
|
247 |
|
244 |
if [ -n "${PROGRESS_SYSINIT_RATE}" ] |
248 |
if [ -n "${PROGRESS_SYSINIT_RATE}" ] |
245 |
then |
249 |
then |
246 |
init_rate=$((65535*${PROGRESS_SYSINIT_RATE}/100)) |
250 |
init_rate=$((65535*${PROGRESS_SYSINIT_RATE}/100)) |
247 |
fi |
251 |
fi |
248 |
|
252 |
|
249 |
if [ -n "${PROGRESS_BOOT_RATE}" ] |
253 |
if [ -n "${PROGRESS_BOOT_RATE}" ] |
250 |
then |
254 |
then |
251 |
boot_rate=$((65535*${PROGRESS_BOOT_RATE}/100)) |
255 |
boot_rate=$((65535*${PROGRESS_BOOT_RATE}/100)) |
252 |
fi |
256 |
fi |
253 |
fi |
257 |
fi |
254 |
|
258 |
|
255 |
# In runlevel boot we have 5 already started scripts |
259 |
# In runlevel boot we have 5 already started scripts |
256 |
# |
260 |
# |
257 |
if [ "${RUNLEVEL}" = "S" -a "${1}" = "boot" ] |
261 |
if [ "${RUNLEVEL}" = "S" -a "${SOFTLEVEL}" = "boot" ] |
258 |
then |
262 |
then |
259 |
pb_started=($(dolisting "${2}/started/")) |
263 |
pb_started=($(dolisting "${svcdir}/started/")) |
260 |
pb_scripts=$((${pb_boot} - ${#pb_started[*]})) |
264 |
pb_scripts=$((${pb_boot} - ${#pb_started[*]})) |
261 |
pb_init=16383 |
265 |
pb_init=16383 |
262 |
pb_rate=26213 |
266 |
pb_rate=26213 |
Lines 266-274
Link Here
|
266 |
pb_init="${init_rate}" |
270 |
pb_init="${init_rate}" |
267 |
pb_rate=$((${init_rate} + ${boot_rate})) |
271 |
pb_rate=$((${init_rate} + ${boot_rate})) |
268 |
fi |
272 |
fi |
269 |
elif [ "${RUNLEVEL}" = "0" -o "${RUNLEVEL}" = "6" ] |
273 |
elif [ "${SOFTLEVEL}" = "reboot" -o "${SOFTLEVEL}" = "shutdown" ] |
270 |
then |
274 |
then |
271 |
pb_started=($(dolisting "${2}/started/")) |
275 |
pb_started=($(dolisting "${svcdir}/started/")) |
272 |
pb_scripts=${#pb_started[*]} |
276 |
pb_scripts=${#pb_started[*]} |
273 |
pb_rate=65534 |
277 |
pb_rate=65534 |
274 |
else |
278 |
else |
Lines 280-352
Link Here
|
280 |
fi |
284 |
fi |
281 |
fi |
285 |
fi |
282 |
|
286 |
|
283 |
echo "pb_init=${pb_init}" > "${2}/progress" |
287 |
echo "pb_init=${pb_init}" > "${svcdir}/progress" |
284 |
echo "pb_rate=${pb_rate}" >> "${2}/progress" |
288 |
echo "pb_rate=${pb_rate}" >> "${svcdir}/progress" |
285 |
echo "pb_count=${pb_count}" >> "${2}/progress" |
289 |
echo "pb_count=${pb_count}" >> "${svcdir}/progress" |
286 |
echo "pb_scripts=${pb_scripts}" >> "${2}/progress" |
290 |
echo "pb_scripts=${pb_scripts}" >> "${svcdir}/progress" |
287 |
} |
291 |
} |
288 |
# |
292 |
# |
289 |
# void splash_update (char *svcdir, char *myscript, char *action) |
293 |
# void splash_update (char *fsstate, char *myscript, char *action) |
290 |
# |
294 |
# |
291 |
splash_update() { |
295 |
splash_update() { |
292 |
[ ! -e /proc/splash -o ! -e /sbin/splash ] && return 0 |
296 |
local fsstate="$1" |
|
|
297 |
local myscript="$2" |
298 |
local action="$3" |
299 |
|
300 |
[ ! -e /proc/splash -o ! -x /sbin/splash ] && return 0 |
293 |
|
301 |
|
294 |
if [ "${1}" = "inline" ] |
302 |
if [ "${fsstate}" = "inline" ] |
295 |
then |
303 |
then |
296 |
/sbin/splash "$2" "$3" |
304 |
/sbin/splash "${myscript}" "${action}" |
297 |
pb_count=$((${pb_count} + 1)) |
305 |
pb_count=$((${pb_count} + 1)) |
298 |
|
306 |
|
299 |
# Only needed for splash_debug() |
307 |
# Only needed for splash_debug() |
300 |
pb_execed="${pb_execed} ${2:-inline}" |
308 |
pb_execed="${pb_execed} ${myscript:-inline}" |
301 |
else |
309 |
else |
302 |
# Update only runlevel scripts, no dependancies (only true for startup) |
310 |
# Update only runlevel scripts, no dependancies (only true for startup) |
303 |
if [ -z "$(ls -1 \"${1}/softscripts/\" 2> /dev/null | grep \"${2}\")" ] |
311 |
if [ ! -L "${svcdir}/softscripts/${myscript}" ] |
304 |
then |
312 |
then |
305 |
[ "${RUNLEVEL}" != "0" -a "${RUNLEVEL}" != "6" ] && return |
313 |
[ "${SOFTLEVEL}" != "reboot" -a \ |
|
|
314 |
"${SOFTLEVEL}" != "shutdown" ] && return |
306 |
fi |
315 |
fi |
307 |
# Source the current progress bar state |
316 |
# Source the current progress bar state |
308 |
test -f "${1}/progress" && source "${1}/progress" |
317 |
[ -f "${svcdir}/progress" ] && source "${svcdir}/progress" |
309 |
|
318 |
|
310 |
# Do not update an already executed script |
319 |
# Do not update an already executed script |
311 |
for x in ${pb_execed} |
320 |
for x in ${pb_execed} |
312 |
do |
321 |
do |
313 |
[ "${x}" = "${2}" ] && return |
322 |
[ "${x}" = "${myscript}" ] && return |
314 |
done |
323 |
done |
315 |
|
324 |
|
316 |
/sbin/splash "$2" "$3" |
325 |
/sbin/splash "${myscript}" "${action}" |
317 |
pb_count=$((${pb_count} + 1)) |
326 |
pb_count=$((${pb_count} + 1)) |
318 |
|
327 |
|
319 |
echo "pb_init=${pb_init}" > "${1}/progress" |
328 |
echo "pb_init=${pb_init}" > "${svcdir}/progress" |
320 |
echo "pb_rate=${pb_rate}" >> "${1}/progress" |
329 |
echo "pb_rate=${pb_rate}" >> "${svcdir}/progress" |
321 |
echo "pb_count=${pb_count}" >> "${1}/progress" |
330 |
echo "pb_count=${pb_count}" >> "${svcdir}/progress" |
322 |
echo "pb_scripts=${pb_scripts}" >> "${1}/progress" |
331 |
echo "pb_scripts=${pb_scripts}" >> "${svcdir}/progress" |
323 |
echo "pb_execed=\"${pb_execed} ${2}\"" >> "${1}/progress" |
332 |
echo "pb_execed=\"${pb_execed} ${myscript}\"" >> "${svcdir}/progress" |
324 |
fi |
333 |
fi |
325 |
} |
334 |
} |
326 |
# |
335 |
# |
327 |
# void splash_debug (char *argv1) |
336 |
# void splash_debug (char *softlevel) |
328 |
# |
337 |
# |
329 |
splash_debug() { |
338 |
splash_debug() { |
|
|
339 |
local softlevel="$1" |
340 |
|
341 |
[ ! -e /proc/splash -o ! -x /sbin/splash ] && return 0 |
342 |
|
330 |
if [ -f /etc/conf.d/bootsplash.conf ] |
343 |
if [ -f /etc/conf.d/bootsplash.conf ] |
331 |
then |
344 |
then |
332 |
source /etc/conf.d/bootsplash.conf |
345 |
source /etc/conf.d/bootsplash.conf |
333 |
|
346 |
|
334 |
[ "${BOOTSPLASH_DEBUG}" = "yes" -a -n "${1}" ] || return |
347 |
[ "${BOOTSPLASH_DEBUG}" = "yes" -a -n "${softlevel}" ] || return |
335 |
|
348 |
|
336 |
if [ -f "${svcdir}/progress" ] |
349 |
if [ -f "${svcdir}/progress" ] |
337 |
then |
350 |
then |
338 |
cat "${svcdir}/progress" > "/var/log/bootsplash.${1}" |
351 |
cat "${svcdir}/progress" > "/var/log/bootsplash.${softlevel}" |
339 |
else |
352 |
else |
340 |
echo "pb_init=${pb_init}" > "/var/log/bootsplash.${1}" |
353 |
echo "pb_init=${pb_init}" > "/var/log/bootsplash.${softlevel}" |
341 |
echo "pb_rate=${pb_rate}" >> "/var/log/bootsplash.${1}" |
354 |
echo "pb_rate=${pb_rate}" >> "/var/log/bootsplash.${softlevel}" |
342 |
echo "pb_count=${pb_count}" >> "/var/log/bootsplash.${1}" |
355 |
echo "pb_count=${pb_count}" >> "/var/log/bootsplash.${softlevel}" |
343 |
echo "pb_scripts=${pb_scripts}" >> "/var/log/bootsplash.${1}" |
356 |
echo "pb_scripts=${pb_scripts}" >> "/var/log/bootsplash.${softlevel}" |
344 |
echo "pb_execed=\"${pb_execed}\"" >> "/var/log/bootsplash.${1}" |
357 |
echo "pb_execed=\"${pb_execed}\"" >> "/var/log/bootsplash.${softlevel}" |
345 |
fi |
358 |
fi |
346 |
fi |
359 |
fi |
347 |
} |
360 |
} |
348 |
|
361 |
|
349 |
if [ -e /proc/splash -a -e /sbin/splash ] |
362 |
if [ -x /sbin/splash ] && \ |
|
|
363 |
[ -e /proc/version -a -e /proc/splash ] |
350 |
then |
364 |
then |
351 |
rc_splash() { |
365 |
rc_splash() { |
352 |
/sbin/splash $* |
366 |
/sbin/splash $* |