SOURCES: splashutils.init - works with fbcondecor - autodetect tty...

glen glen at pld-linux.org
Sat Apr 26 20:50:02 CEST 2008


Author: glen                         Date: Sat Apr 26 18:50:02 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- works with fbcondecor
- autodetect tty-s if unset

---- Files affected:
SOURCES:
   splashutils.init (1.10 -> 1.11) 

---- Diffs:

================================================================
Index: SOURCES/splashutils.init
diff -u SOURCES/splashutils.init:1.10 SOURCES/splashutils.init:1.11
--- SOURCES/splashutils.init:1.10	Thu Apr 24 03:40:44 2008
+++ SOURCES/splashutils.init	Sat Apr 26 20:49:56 2008
@@ -18,47 +18,50 @@
 # Get service config - may override defaults
 [ -f /etc/sysconfig/splash ] && . /etc/sysconfig/splash
 
-test -z "$SPLASH_THEME" && SPLASH_THEME="default"
-test -z "$SPLASH_TTYS" && SPLASH_TTYS="0 1 2 3 4 5 6 7"
-
 start() {
 	# Check if the service is already running?
-	if [ ! -f /var/lock/subsys/splash ]; then
-		for engine in fbcondecor fbsplash; do
-			if [ ! -e /dev/$engine ] || [ ! -e /proc/sys/kernel/$engine ] || [ ! -f /etc/splash/$SPLASH_THEME/$RES.cfg ]; then
-				continue
-			fi
-			show "Setting framebuffer console images for theme '%s'" $SPLASH_THEME; busy
-			for TTY in $SPLASH_TTYS; do
-				theme=$SPLASH_THEME
-
-				if [ -n "$SPLASH_TTY_MAP" ]; then
-					for i in $SPLASH_TTY_MAP; do
-						if [ "${i%:*}" = "$TTY" ]; then
-							theme="${i#*:}"
-						fi
-					done
-				fi
-
-				case "$engine" in
-				fbcondecor)
-					tool=fbcondecor_ctl
-					;;
-				*)
-					tool=splash_util
-					;;
-				esac
-
-				$tool --vc="$TTY" v -t "$theme" -c setcfg
-				[ "${TTY}" -eq 0 ] && $tool --vc=0 -m v -t "$theme" -c setpic
-				$tool --vc="$TTY" -c on
-			done
-			ok
-		done
-		touch /var/lock/subsys/splash
-	else
+	if [ -f /var/lock/subsys/splash ]; then
 		msg_already_running splash
+		return
+	fi
+
+	# if fbcondecor not initialized, exit
+	if [ ! -e /dev/fbcondecor ] || [ ! -e /proc/sys/kernel/fbcondecor ]; then
+		return
+	fi
+
+	[ "$SPLASH_THEME" ] || SPLASH_THEME="default"
+
+	# no theme or no resolution for this theme, exit too
+	if [ ! -f /etc/splash/$SPLASH_THEME/$RES.cfg ]; then
+		return
+	fi
+
+	if [ -z "$SPLASH_TTYS" -a -d /sys/class/vc ]; then
+		SPLASH_TTYS=$(ls -d /sys/class/vc/vcsa* | awk '{print substr($0, length("/sys/class/vc/vcsa") + 1)}')
+	fi
+	if [ -z "$SPLASH_TTYS" ]; then
+		SPLASH_TTYS=$(awk -F: '/^[0-9]*:/{print $1}' /etc/inittab)
 	fi
+
+	show "Setting framebuffer console images for theme '%s'" $SPLASH_THEME; busy
+	for TTY in $SPLASH_TTYS; do
+		theme=$SPLASH_THEME
+
+		if [ -n "$SPLASH_TTY_MAP" ]; then
+			for i in $SPLASH_TTY_MAP; do
+				if [ "${i%:*}" = "$TTY" ]; then
+					theme="${i#*:}"
+				fi
+			done
+		fi
+
+		fbcondecor_ctl --vc="$TTY" v -t "$theme" -c setcfg
+		[ "$TTY" -eq 0 ] && fbcondecor_ctl --vc=0 v -t "$theme" -c setpic
+		fbcondecor_ctl --vc="$TTY" -c on
+	done
+	ok
+	touch /var/lock/subsys/splash
 }
 
 stop() {
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/splashutils.init?r1=1.10&r2=1.11&f=u



More information about the pld-cvs-commit mailing list