[Pkg-sysvinit-commits] r369 - in sysvinit/trunk/debian: . sysv-rc/etc/init.d

Petter Reinholdtsen pere at costa.debian.org
Wed Dec 14 19:08:03 UTC 2005


Author: pere
Date: 2005-12-14 19:08:03 +0000 (Wed, 14 Dec 2005)
New Revision: 369

Modified:
   sysvinit/trunk/debian/changelog
   sysvinit/trunk/debian/sysv-rc/etc/init.d/rc
Log:
Implement progress bar support for splash screen.  Enabled when
usplash_write is in PATH.  Patch from Scott James Remnant and Ubuntu.


Modified: sysvinit/trunk/debian/changelog
===================================================================
--- sysvinit/trunk/debian/changelog	2005-12-14 18:52:42 UTC (rev 368)
+++ sysvinit/trunk/debian/changelog	2005-12-14 19:08:03 UTC (rev 369)
@@ -6,6 +6,8 @@
     *.sh scripts for runlevel 'S'.  This is preparation for fixing
     #339955.  Actually fixing it has to wait until other packages
     remove "exit" from their .sh scripts.
+  * Implement progress bar support for splash screen.  Enabled when
+    usplash_write is in PATH.  Patch from Scott James Remnant and Ubuntu.
 
   [ Thomas Hood ]
   * *.sh: Make sure that these do their thing when they aren't given any

Modified: sysvinit/trunk/debian/sysv-rc/etc/init.d/rc
===================================================================
--- sysvinit/trunk/debian/sysv-rc/etc/init.d/rc	2005-12-14 18:52:42 UTC (rev 368)
+++ sysvinit/trunk/debian/sysv-rc/etc/init.d/rc	2005-12-14 19:08:03 UTC (rev 369)
@@ -171,14 +171,31 @@
 	  0|6)
 		ACTION=stop
 		;;
+	  S)
+		ACTION=start
+		first_step=0
+		;;
 	  *)
 		ACTION=start
+		first_step=0
 		;;
 	esac
 
+	# Count the number of scripts we need to run (for usplash progress bar)
+	num_steps=0
+	for s in /etc/rc$runlevel.d/S*; do
+		num_steps=$(($num_steps + 1))
+		case "${s##/etc/rc$runlevel.d/S??}" in
+		  gdm|xdm|kdm)
+			break
+			;;
+		esac
+	done
+
 	# Now run the START scripts for this runlevel.
 	# Run all scripts with the same level in parallel
 	CURLEVEL=""
+	step=0
 	for s in /etc/rc$runlevel.d/S*
 	do
 		level=$(echo $s | sed 's/.*\/S\([0-9][0-9]\).*/\1/')
@@ -211,6 +228,14 @@
 			SCRIPTS="$SCRIPTS $i"
 		done
 		startup $ACTION $SCRIPTS
+
+		# Use 50% of the progress bar for rcS and the rest for the
+		# runlevel we want to end up in
+		step=$(($step + 1))
+		progress=$(($step * 50 / $num_steps + $first_step))
+		if type usplash_write >/dev/null 2>&1; then
+			usplash_write "PROGRESS $progress" || true
+		fi
 	done
 fi
 




More information about the Pkg-sysvinit-commits mailing list