3 # splash.sh - This shell script triggers bootsplash actions during
4 # system boot/shutdown. It can be run by the init scripts repeatedly
5 # specifying the currently executed system script.
7 # This script is used to play animations/sounds/show text/move the
10 # We call this function from /etc/rc.status:rc_splash()
12 # This program is free software; you may redistribute it under
13 # the terms of the GNU General Public License. This program has
14 # absolutely no warranty.
16 # written 2002-2003 Stefan Reinauer, <stepan@suse.de>
18 # this script expects the following environment variables for an operable
21 # sscripts = number of start scripts to be executed for runlevel change
22 # kscripts = number of stop scripts to be executed for runlevel change
23 # progress = number of currently executed start/stop script
24 # RUNLEVEL = runlevel to be reached.
26 # To play animations, it's advised that you have an animations.cfg in your
27 # theme's config directory specifying the initscript name for an event and
28 # the command to be executed:
30 # fsck start:bootanim start bounce.mng
31 # master:bootanim stop
33 # See http://www.bootsplash.org/ for more information.
35 # Modified for PLD (arekm@pld-linux.org)
37 [ -f /etc/sysconfig/bootsplash ] && . /etc/sysconfig/bootsplash
39 _procsplash=$(cat /proc/splash 2> /dev/null)
41 if [ -f /etc/bootsplash/themes/$THEME/config/animations.cfg ]; then
42 COMMAND="$(cat /etc/bootsplash/themes/$THEME/config/animations.cfg | grep "^$1"| cut -f2 -d\:)"
47 [ -e /proc/splash ] || exit 0
48 [ -z "$progress" -a -z "$num" ] && exit 0
49 [ -z "$(echo $_procsplash | grep on)" ] && exit 0
51 # We chose verbose in grub
52 cat /proc/cmdline | grep -v -q "splash=silent" && exit 0
54 if [ "$previous" == "3" -o "$previous" == "5" ] ; then
55 if [ "$runlevel" = "3" -o "$runlevel" == "5" ] ; then
62 num=$(( $sscripts + 2 ))
65 cat /proc/splash | grep -q silent && _silent="yes"
66 [ "$runlevel" == "6" -o "$runlevel" == "0" ] && _shutdown="yes"
67 [ "$_shutdown" == "yes" ] && num=$(( $kscripts + 2 ))
69 function box() { true; } # ignore box descriptions in the config file
71 if [ -f "/etc/bootsplash/themes/$THEME/config/bootsplash-`/bin/fbresolution`.cfg" ]; then
72 . /etc/bootsplash/themes/$THEME/config/bootsplash-`/bin/fbresolution`.cfg
75 # Print text string. (Booting/Shutting down the system. Press
76 # F2 for verbose mode)
79 if [ "$progress" == 1 -o "$1" == "splash start" ]; then
80 [ "$_shutdown" == "yes" ] && ( echo "silent" > /proc/splash ; chvt 1)
82 [ "$_shutdown" == "yes" ] && _boot=$SHUTDOWN_TXT
84 if [ "$text_x" != "" -a "$text_y" != "" \
85 -a "$text_color" != "" -a "$text_size" != "" -a "$_silent" == "yes" ];
87 fbtruetype -x $text_x -y $text_y -t $text_color -s $text_size "$_boot"
91 # Now paint the progressbar. This is done via the proc
92 # interface of the bootsplash.
94 echo "show $(( 65534 * ( $progress + 1 ) / $num ))" > /proc/splash