startup_progress() {
step=$(($step + $step_change))
- denominator=$(($num_steps + $first_step))
- if [ "$denominator" != "0" ]; then
- progress=$(($step * $progress_size / $denominator))
+ if [ "$num_steps" != "0" ]; then
+ progress=$((($step * $progress_size / $num_steps) + $first_step))
else
progress=$progress_size
fi
+ #echo "PROGRESS is $progress $runlevel $first_step + ($step of $num_steps) $step_change $progress_size"
if type psplash-write >/dev/null 2>&1; then
TMPDIR=/mnt/.psplash psplash-write "PROGRESS $progress" || true
fi
case "$runlevel" in
0|6)
- # Count down from 0 to -100 and use the entire bar
- first_step=0
+ # Count down from -100 to 0 and use the entire bar
+ first_step=-100
progress_size=100
- step_change=-1
+ step_change=1
;;
S)
# Begin where the initramfs left off and use 2/3
;;
esac
+ num_steps=0
+ for s in /etc/rc$runlevel.d/[SK]*; do
+ case "${s##/etc/rc$runlevel.d/S??}" in
+ gdm|xdm|kdm|reboot|halt)
+ break
+ ;;
+ esac
+ num_steps=$(($num_steps + 1))
+ done
+ step=0
+
# First, run the KILL scripts.
if [ $previous != N ]
then
done
fi
- num_steps=0
- for s in /etc/rc$runlevel.d/[SK]*; do
- case "${s##/etc/rc$runlevel.d/S??}" in
- gdm|xdm|kdm|reboot|halt)
- break
- ;;
- esac
- num_steps=$(($num_steps + 1))
- done
-
- step=0
-
# Now run the START scripts for this runlevel.
for i in /etc/rc$runlevel.d/S*
do
done
fi
+#Uncomment to cause psplash to exit manually, otherwise it exits when it sees a VC switch
#if [ "x$runlevel" != "xS" ]; then
# if type psplash-write >/dev/null 2>&1; then
# TMPDIR=/mnt/.psplash psplash-write "QUIT" || true