sysvinit: Various progress bar fixes, especially reboot/halt handling

git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1406 311d38ba-8fff-0310-9ca6-ca027cbcb966
This commit is contained in:
Richard Purdie
2007-03-28 15:46:02 +00:00
parent 4641d219d2
commit 2693f8dd3e
2 changed files with 19 additions and 19 deletions

View File

@@ -20,12 +20,12 @@ export VERBOSE
startup_progress() { startup_progress() {
step=$(($step + $step_change)) step=$(($step + $step_change))
denominator=$(($num_steps + $first_step)) if [ "$num_steps" != "0" ]; then
if [ "$denominator" != "0" ]; then progress=$((($step * $progress_size / $num_steps) + $first_step))
progress=$(($step * $progress_size / $denominator))
else else
progress=$progress_size progress=$progress_size
fi 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 if type psplash-write >/dev/null 2>&1; then
TMPDIR=/mnt/.psplash psplash-write "PROGRESS $progress" || true TMPDIR=/mnt/.psplash psplash-write "PROGRESS $progress" || true
fi fi
@@ -91,10 +91,10 @@ startup() {
case "$runlevel" in case "$runlevel" in
0|6) 0|6)
# Count down from 0 to -100 and use the entire bar # Count down from -100 to 0 and use the entire bar
first_step=0 first_step=-100
progress_size=100 progress_size=100
step_change=-1 step_change=1
;; ;;
S) S)
# Begin where the initramfs left off and use 2/3 # Begin where the initramfs left off and use 2/3
@@ -111,6 +111,17 @@ startup() {
;; ;;
esac 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. # First, run the KILL scripts.
if [ $previous != N ] if [ $previous != N ]
then then
@@ -124,18 +135,6 @@ startup() {
done done
fi 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. # Now run the START scripts for this runlevel.
for i in /etc/rc$runlevel.d/S* for i in /etc/rc$runlevel.d/S*
do do
@@ -168,6 +167,7 @@ startup() {
done done
fi fi
#Uncomment to cause psplash to exit manually, otherwise it exits when it sees a VC switch
#if [ "x$runlevel" != "xS" ]; then #if [ "x$runlevel" != "xS" ]; then
# if type psplash-write >/dev/null 2>&1; then # if type psplash-write >/dev/null 2>&1; then
# TMPDIR=/mnt/.psplash psplash-write "QUIT" || true # TMPDIR=/mnt/.psplash psplash-write "QUIT" || true

View File

@@ -2,7 +2,7 @@ DESCRIPTION = "System-V like init."
SECTION = "base" SECTION = "base"
LICENSE = "GPL" LICENSE = "GPL"
HOMEPAGE = "http://freshmeat.net/projects/sysvinit/" HOMEPAGE = "http://freshmeat.net/projects/sysvinit/"
PR = "r27" PR = "r28"
# USE_VT and SERIAL_CONSOLE are generally defined by the MACHINE .conf. # USE_VT and SERIAL_CONSOLE are generally defined by the MACHINE .conf.
# Set PACKAGE_ARCH appropriately. # Set PACKAGE_ARCH appropriately.