]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
More progress bar support (bootsplash): it moves now!
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Sun, 21 Dec 2003 00:58:41 +0000 (00:58 +0000)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Sun, 21 Dec 2003 00:58:41 +0000 (00:58 +0000)
svn-id: @3043

rc.d/init.d/functions
rc.d/rc
rc.d/rc.shutdown
rc.d/rc.sysinit

index 8a25e03791889907fb2671f8acdee305e9bf3418..e25c41243fd38f8058b3252110a761eaebb61a27 100644 (file)
@@ -208,6 +208,8 @@ rc_splash()
        if ! is_no "$BOOT_SPLASH"; then
                [ -x /bin/splash ] && /bin/splash "$action"
        fi
+
+       : $((progress++))
 }
 
 msg_network_down()
diff --git a/rc.d/rc b/rc.d/rc
index 421edb1ee1e7b5aea3608ebe9a9535dcd439f74c..9033116c5920ea0fdec068a5131f72e6634eb28c 100755 (executable)
--- a/rc.d/rc
+++ b/rc.d/rc
@@ -93,7 +93,24 @@ if [ "$previous" = "N" ]; then
                nls "Entering non-interactive startup"
        fi
 fi
-                                         
+
+# calculate bootsplash variables
+sscripts=$(ls -1 /etc/rc.d/rc${runlevel}.d/ 2> /dev/null | grep -c "^S")
+export sscripts
+
+if test "$previous" != "N" ; then
+       kscripts=$(ls -1 /etc/rc.d/rc${previous}.d/ 2> /dev/null | grep -c "^K")
+       export kscripts
+fi
+
+if test "$revious" == "N" -a "$runlevel" == "5" ; then
+       export progress=16
+       sscripts=$(( $sscripts + 15 ))
+else
+       export progress=0
+fi
+
+
 # set onlcr to avoid staircase effect and do not lock scrolling
 stty onlcr -ixon 0>&1
 
index 3ac5aa696b43e142e450f49edf5e607f09e710e9..bcfd02676dc3c6d5c5c7b32987017b88f5cea27f 100755 (executable)
@@ -16,6 +16,12 @@ cd /
 
 . /etc/rc.d/init.d/functions
 
+# avoid keyboard interruption
+trap "echo" INT SEGV QUIT TERM
+set +e
+
+rc_splash "reboot"
+
 # Kill all processes.
 [ "${BASH+bash}" = bash ] && enable kill
 
index 8208f92dd72e4a0fa5c939e62bf9453df8441d81..d93d6ab421d068b2ad478d9cf8ffd9785ea4a966 100755 (executable)
 PATH=/bin:/sbin:/usr/bin:/usr/sbin
 export PATH
 
+# reasonable start values for bootsplash progress.
+export progress=0
+export sscripts=45
+export kscripts=45
+
 # Read functions
 . /etc/rc.d/init.d/functions
 
@@ -76,6 +81,9 @@ else
        RUN_LDCONFIG=yes
 fi
 
+# Disable splash when requested
+[ -e /proc/splash ] && is_no "$BOOT_SPLASH" && echo "0" > /proc/splash
+                                   
 # Print welcome message
 nls "\t\t\t%sPowered by %sPLD Linux Distribution%s" "$(termput setaf 6)" "$(termput setaf 2)" "$(termput setaf 7)"
 if is_yes "$PROMPT"; then
@@ -233,6 +241,7 @@ if [ -z "$fastboot" -a "$_ROOTFS_TYPE" != "nfs" -a "$_ROOTFS_TYPE" != "romfs" ];
 
        # A return of 4 or higher means there were serious problems.
        if [ $rc -gt 3 ]; then
+               [ -e /proc/splash ] && echo "verbose" > /proc/splash
                # don't use '\n' in nls macro !
                echo
                echo
@@ -254,6 +263,7 @@ if [ -z "$fastboot" -a "$_ROOTFS_TYPE" != "nfs" -a "$_ROOTFS_TYPE" != "romfs" ];
        # A return of 2 or 3 means that filesystem was repaired but we need
        # to reboot.
        elif [ "$rc" = "2" -o "$rc" = "3" ]; then
+               [ -e /proc/splash ] && echo "verbose" > /proc/splash
                echo
                nls "*** Filesystem was repaired but system needs to be"
                nls "*** rebooted before mounting it."
@@ -502,6 +512,7 @@ if [ -x /sbin/mdadm -a -f /etc/mdadm.conf ] || [ -f /etc/raidtab ]; then
 
            # A non-zero return means there were problems
            if [ $rc -gt 0 ]; then
+               [ -e /proc/splash ] && echo "verbose" > /proc/splash
                show "Starting up RAID devices"; fail
                echo
                echo
@@ -540,6 +551,7 @@ if [ -z "$fastboot" ] && ! grep -q nofsck /proc/cmdline; then
 
        # A return of 2 or higher means there were serious problems
        if [ $rc -gt 1 ]; then
+               [ -e /proc/splash ] && echo "verbose" > /proc/splash
                echo
                echo
                nls "*** An error occurred during the file system check."
@@ -596,7 +608,9 @@ if grep "^[^#].*encryption=" /etc/fstab | grep -v -q "noauto"; then
 
        # A return of 2 or higher means there were serious problems.
        if [ $rc -gt 1 ]; then
-               echo "\n\n"
+               [ -e /proc/splash ] && echo "verbose" > /proc/splash
+               echo
+               echo
                nls "*** An error occurred during the file system check."
                nls "*** Dropping you to a shell; the system will reboot"
                nls "*** when you leave the shell."
This page took 0.051252 seconds and 4 git commands to generate.