[Demudi-commits] r638 - / bootsplash bootsplash/branches bootsplash/branches/upstream bootsplash/branches/upstream/current bootsplash/branches/upstream/current/Scripts bootsplash/branches/upstream/current/Utilities

Free Ekanayaka free-guest at costa.debian.org
Mon Feb 6 02:13:50 UTC 2006


Author: free-guest
Date: 2006-02-06 02:13:47 +0000 (Mon, 06 Feb 2006)
New Revision: 638

Added:
   bootsplash/
   bootsplash/branches/
   bootsplash/branches/upstream/
   bootsplash/branches/upstream/current/
   bootsplash/branches/upstream/current/Scripts/
   bootsplash/branches/upstream/current/Scripts/bootanim
   bootsplash/branches/upstream/current/Scripts/splash.sh
   bootsplash/branches/upstream/current/Utilities/
   bootsplash/branches/upstream/current/Utilities/Makefile
   bootsplash/tags/
Log:
[svn-inject] Installing original source of bootsplash

Added: bootsplash/branches/upstream/current/Scripts/bootanim
===================================================================
--- bootsplash/branches/upstream/current/Scripts/bootanim	2006-02-06 02:13:28 UTC (rev 637)
+++ bootsplash/branches/upstream/current/Scripts/bootanim	2006-02-06 02:13:47 UTC (rev 638)
@@ -0,0 +1,143 @@
+#!/bin/bash
+#
+# bootanim - boot animation wrapper script for fbmngplay
+# 
+# This program parses /etc/bootsplash/[THEME]/config/bootsplash-XxY.cfg
+# to determine the correct animation position.
+# 
+# This program is free software; you may redistribute it under the terms 
+# of the GNU General Public License. This program has absolutely no warranty.
+#
+# (C) 2002,2003 SuSE Linux AG. Written by Stefan Reinauer <stepan at suse.de>
+#
+# See http://www.bootsplash.org/ for more information.
+#
+
+usage()
+{
+    echo "usage: $0 [start|stop|kill|next] -m [-r XxY] [-d dir] mng1 [mng2..]"
+    cat << EOF
+
+  Available commands:
+	start		starts given animation
+	stop		fades out all running animations
+	kill		immediately stops all animations
+	next		continue to next animation.
+
+  Options for use with start command:
+	-r XxY		screen resolution to use if unable to autodetect.
+	-d dir		directory containing the animation files
+	-m 		play multiple animations
+	mng1|mng2	animation filename(s). Specify -m if multiple.
+
+EOF
+
+}
+
+if [ "$UID" -ne "0" ]; then
+    echo "$0 must be started as user root!!!"
+    echo "Exiting..."
+    exit 1
+fi
+
+THEME="No theme selected"
+test -f /etc/sysconfig/bootsplash && . /etc/sysconfig/bootsplash
+
+if [ ! -d /etc/bootsplash/themes/$THEME ]
+then
+  echo "$0: could not find theme $THEME in /etc/bootsplash/themes."
+  exit 0
+fi
+
+MODE=`/sbin/fbresolution 2>/dev/null`
+DIRECTORY=/etc/bootsplash/themes/$THEME/animations
+OPTIONS="-b -c 1"
+FILES=""
+
+case "$1" in
+start)
+	# echo "$0 start"
+	# We fall through here.
+	;;
+stop)
+	# echo "$0 stop"
+	killall -q -2 fbmngplay
+	exit 0
+	;;
+kill)
+	# echo "$0 kill"
+	killall -q fbmngplay
+	exit 0
+	;;
+next) 
+	# echo "$0 next"
+	killall -q -USR1 fbmngplay
+	exit 0
+	;;
+*)
+	usage;
+	echo "  Error: illegal parameter.";
+	exit 1
+	;;
+esac
+
+shift
+
+# We end up in bootanim start 
+
+TEMP=`getopt -o mr:d:  -- "$@"`
+eval set -- "$TEMP"
+
+while true ; do
+	# echo "loop: $*"
+        case "$1" in
+        -d) # directory
+		shift
+		if [ ! -d "$1" ]; then
+			echo "Not a valid directory."
+			exit 1
+		fi
+		DIRECTORY=$1
+		shift
+		;;
+	-r) # resolution 
+		shift
+		MODE=$1;
+		shift
+		;;
+	-m) # multiple files
+		shift
+		OPTIONS="$OPTIONS -s"
+		;;
+	--) # end
+		shift
+		break;;
+	*) # Weird
+		echo "Internal Error."
+		exit 1
+		;;
+	esac
+done
+
+function box() { true; } # ignore box descriptions in the config file
+
+# Sourcing config file
+if [ -f /etc/bootsplash/themes/$THEME/config/bootsplash-$MODE.cfg ]; then
+    . /etc/bootsplash/themes/$THEME/config/bootsplash-$MODE.cfg
+else
+    echo "$0: No config file found for theme $THEME ($MODE)."
+    exit 1
+fi
+
+# echo "Dir:   $DIRECTORY"
+# echo "Files: $*"
+# echo "Mode:  $MODE"
+# echo "Pos:  $ax,$ay"
+# echo "options: $OPTIONS"
+
+CMDLINE="fbmngplay -x $ax -y $ay $OPTIONS"
+for i in $*; do
+    CMDLINE="$CMDLINE $DIRECTORY/$i"
+done
+
+eval "$CMDLINE &"

Added: bootsplash/branches/upstream/current/Scripts/splash.sh
===================================================================
--- bootsplash/branches/upstream/current/Scripts/splash.sh	2006-02-06 02:13:28 UTC (rev 637)
+++ bootsplash/branches/upstream/current/Scripts/splash.sh	2006-02-06 02:13:47 UTC (rev 638)
@@ -0,0 +1,103 @@
+#!/bin/bash
+#
+# splash.sh - This shell script triggers bootsplash actions during
+# system boot/shutdown. It can be run by the init scripts repeatedly
+# specifying the currently executed system script.
+# 
+# This script is used to play animations/sounds/show text/move the
+# progress bar, etc.
+# 
+# We call this function from /etc/rc.status:rc_splash() 
+#
+# This program is free software; you may redistribute it under 
+# the terms of the GNU General Public License. This program has 
+# absolutely no warranty.
+#
+# written 2002-2003 Stefan Reinauer, <stepan at suse.de>
+#
+# this script expects the following environment variables for an operable
+# progress bar:
+#
+#  sscripts = number of start scripts to be executed for runlevel change
+#  kscripts = number of stop scripts to be executed for runlevel change
+#  progress = number of currently executed start/stop script
+#  RUNLEVEL = runlevel to be reached.
+#
+# To play animations, it's advised that you have an animations.cfg in your
+# theme's config directory specifying the initscript name for an event and
+# the command to be executed:
+#
+#   fsck start:bootanim start bounce.mng
+#   master:bootanim stop
+#
+# See http://www.bootsplash.org/ for more information.
+#
+
+_procsplash="`cat /proc/splash 2>/dev/null`"
+
+THEME="No bootsplash theme selected"
+test -f /etc/sysconfig/bootsplash && . /etc/sysconfig/bootsplash
+test ! -d "/etc/bootsplash/themes/$THEME" && exit 0
+
+# parse animations.cfg. This part should not be handled by the
+# splash binary.
+
+if [ -f /etc/bootsplash/themes/$THEME/config/animations.cfg ]; then
+  COMMAND="`cat /etc/bootsplash/themes/$THEME/config/animations.cfg| grep "^$1"|cut -f2 -d\:`"
+  eval $COMMAND
+fi
+
+# assertions
+test -r /proc/splash || exit 0
+test -z "$progress" -a -z "$num" && exit 0
+test -z "`echo $_procsplash|grep on`" && exit 0
+test "$1" == "bootnetwork stop" -o "$1" == "YaST" && exit 0 # no progress
+
+# We chose verbose in grub
+test "`cat /proc/cmdline |grep \"splash=silent\"`" == "" && exit 0 
+
+if [ "$PREVLEVEL" == "3" -o "$PREVLEVEL" == "5" ] ; then
+  if [ "$RUNLEVEL"  = "3" -o "$RUNLEVEL" == "5" ] ; then
+    exit 0
+  fi
+fi
+
+# acquire data
+# 
+num=$(( $sscripts + 2 ))
+_shutdown="no"
+_silent="no"
+test "`cat /proc/splash |grep silent`" && _silent="yes"
+test "$RUNLEVEL" == "6" -o "$RUNLEVEL" == "0" && _shutdown="yes"
+test "$_shutdown" == "yes" && num=$(( $kscripts + 2 ))
+
+function box() { true; } # ignore box descriptions in the config file
+
+test -f "/etc/bootsplash/themes/$THEME/config/bootsplash-`fbresolution`.cfg" && \
+  . /etc/bootsplash/themes/$THEME/config/bootsplash-`fbresolution`.cfg
+
+#
+# Print text string. (Booting/Shutting down the system. Press
+# F2 for verbose mode)
+#
+
+if [ "$progress" == 1 -o "$1" == "splash start" ]; then
+  test "$_shutdown" == "yes" && ( echo "silent" >/proc/splash; chvt 1)
+  _boot="Booting"; test "$_shutdown" == "yes" && _boot="Shutting down"
+
+  if [ "$text_x" != "" -a "$text_y" != "" \
+       -a "$text_color" != "" -a "$text_size" != "" -a "$_silent" == "yes" ]; 
+  then
+    fbtruetype -x $text_x -y $text_y -t $text_color -s $text_size \
+  			"$_boot the system... Press F2 for verbose mode"
+  fi
+fi
+
+#
+# Now paint the progressbar. This is done via the proc 
+# interface of the bootsplash.
+#
+
+test -z "$progress_enable" && exit 0
+echo "show $(( 65534 * ( $progress + 1 ) / $num ))" > /proc/splash
+

Added: bootsplash/branches/upstream/current/Utilities/Makefile
===================================================================
--- bootsplash/branches/upstream/current/Utilities/Makefile	2006-02-06 02:13:28 UTC (rev 637)
+++ bootsplash/branches/upstream/current/Utilities/Makefile	2006-02-06 02:13:47 UTC (rev 638)
@@ -0,0 +1,59 @@
+# Makefile for bootsplash utilities. 
+# written by Stefan Reinauer <stepan at suse.de> in 2003
+#
+
+CC       = gcc
+STRIP	 = strip
+
+# Triggering lib64 path from spec file.
+PREFIX   ?= /usr
+LIB      ?= lib
+
+LIBDIR   = $(PREFIX)/$(LIB)
+
+PROGRAMS        = splash splashpbm fbresolution fbtruetype fbmngplay 
+PROGRAMS_STATIC = fbtruetype.static fbmngplay.static
+
+OBJECTS_FT2  = fbtruetype.o fbtruetype-messages.o console.o ttf.o luxisri.o
+OBJECTS_MNG  = fbmngplay.o fbmngplay-messages.o mng.o console.o 
+
+LDFLAGS  =  -L$(LIBDIR)
+
+LIBSS_FT2    = $(LIBDIR)/libfreetype.a $(LIBDIR)/libz.a -lm
+LIBSD_FT2    = -lfreetype -lm
+
+LIBSS_MNG    = $(LIBDIR)/libmng-mini.a $(LIBDIR)/libz.a -lm
+LIBSD_MNG    = -lmng -lz -lm
+
+CFLAGS   = -Os -Wall -I/usr/include/freetype2
+
+LINKS    = $(CC) $(CFLAGS) $(LDFLAGS) -static -o $@
+LINKD    = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
+
+all: $(PROGRAMS) strip
+
+.SUFFIXES: .c .o
+
+mostlyclean:
+	-rm -f *.o core *~
+clean:	mostlyclean
+	-rm -f $(PROGRAMS) $(PROGRAMS_STATIC)
+
+fbtruetype: $(OBJECTS_FT2) 
+	@rm -f fbtruetype
+	$(LINKD) $(LDFLAGS) $(OBJECTS_FT2) $(LIBSD_FT2)
+fbtruetype.static: $(OBJECTS_FT2)
+	@rm -f fbtruetype.static
+	$(LINKS) $(LDFLAGS) $(OBJECTS_FT2) $(LIBSS_FT2)
+
+fbmngplay: $(OBJECTS_MNG) 
+	@rm -f fbmngplay
+	$(LINKD) $(LDFLAGS) $(OBJECTS_MNG) $(LIBSD_MNG)
+fbmngplay.static: $(OBJECTS_MNG)
+	@rm -f fbmngplay.static
+	$(LINKS) $(LDFLAGS) $(OBJECTS_MNG) $(LIBSS_MNG)
+
+strip: $(PROGRAMS)
+	$(STRIP) -s $(PROGRAMS)
+
+.PHONY: mostlyclean clean fbtruetype fbtruetype.static all strip




More information about the Demudi-commits mailing list