Fix a number of issues that caused more steps to be counted than calls
to startup_progress would happen in some situations, resulting in the
progress bar never reaching 100%:

- Use the same conditions when looping over initscripts for counting
  steps that are also used for running them
- When skipping a script, run startup_progress to avoid off-by-one

Signed-off-by: Nora Schiffer <[email protected]>
---
 meta/recipes-core/sysvinit/sysvinit/rc | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-core/sysvinit/sysvinit/rc 
b/meta/recipes-core/sysvinit/sysvinit/rc
index f1169ec3ac..d66a7cf1b0 100755
--- a/meta/recipes-core/sysvinit/sysvinit/rc
+++ b/meta/recipes-core/sysvinit/sysvinit/rc
@@ -116,8 +116,18 @@ then
        esac
 
        num_steps=0
-       for s in /etc/rc$runlevel.d/[SK]*; do
-               case "${s##/etc/rc$runlevel.d/S??}" in
+       if [ $previous != N ]
+       then
+               for i in /etc/rc$runlevel.d/K[0-9][0-9]*
+               do
+                       [ ! -f $i ] && continue
+                       num_steps=$(($num_steps + 1))
+               done
+       fi
+       for i in /etc/rc$runlevel.d/S*
+       do
+               [ ! -f $i ] && continue
+               case "${i##/etc/rc$runlevel.d/S??}" in
                        gdm|xdm|kdm|reboot|halt)
                                break
                                ;;
@@ -158,7 +168,11 @@ then
                        # and _no_ stop script in this level, we don't
                        # have to re-start the service.
                        #
-                       [ -f $previous_start ] && [ ! -f $stop ] && continue
+                       if [ -f $previous_start ] && [ ! -f $stop ]
+                       then
+                               startup_progress
+                               continue
+                       fi
                fi
                if [ x"${PSPLASH_TEXT_UPDATES}" = x"yes" ]; then
                        psplash-write "MSG $(basename $i .sh | cut -c 4-)" || 
true
-- 
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
https://www.tq-group.com/

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#244384): 
https://lists.openembedded.org/g/openembedded-core/message/244384
Mute This Topic: https://lists.openembedded.org/mt/120934171/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to