Magellan Linux

Contents of /trunk/splashutils-magellan/splash

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5 - (show annotations) (download)
Fri Mar 4 18:09:01 2005 UTC (19 years ago) by niro
File size: 3146 byte(s)
importet, ver 0.1

1 #!/bin/bash
2 # Copyright 1999-2004 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4 #
5 # splash - a script to handle rc_scripts events and execute appropriate
6 # fbsplash actions; loosely based on bootsplash /sbin/splash
7 #
8 # Author: Michal Januszewski <spock@gentoo.org>
9 #
10 # $Header: /root/magellan-cvs/src/splashutils-magellan/splash,v 1.1 2005-03-04 18:09:01 niro Exp $
11
12 # this is a little hack that we use to avoid a hell lot of error msgs
13 # when sourcing splash configuration files
14 function box() { true; }
15
16 test -f /etc/conf.d/splash && . /etc/conf.d/splash
17 test -f /etc/conf.d/rc && . /etc/conf.d/rc
18 test -z "${SPLASH_THEME}" && SPLASH_THEME="default"
19 test "$RUNLEVEL" == "6" -o "$RUNLEVEL" == "0" && SHUTDOWN="yes"
20
21 SPLUTIL="/sbin/splash_util.static"
22
23 [ ! -e /proc/fbsplash ] && exit 1
24 [ ! -e /dev/fbsplash ] && exit 1
25 [ ! -x /sbin/fbres ] && exit 1
26 [ ! -x /sbin/splash_util.static ] && exit 1
27
28 # kernel command line override for the splash theme
29 for param in `grep "theme:" /proc/cmdline`; do
30 t=${param%:*}
31 if [ "${t#*,}" == "theme" ]; then
32 SPLASH_THEME="${param#*:}"
33 fi
34 done
35
36 res=$(/sbin/fbres)
37 themefile="/etc/splash/${SPLASH_THEME}/$res.cfg"
38 test -f "${themefile}" && . "${themefile}"
39
40
41 print_text() {
42 text="Booting the system... Press F2 for verbose mode"
43 [ -n "${SPLASH_BOOT_MESSAGE}" ] && text="${SPLASH_BOOT_MESSAGE}"
44
45 if [ "${SHUTDOWN}" == "yes" ]; then
46 text="Shutting down the system... Press F2 for verbose mode"
47 [ -n "${SPLASH_SHUTDOWN_MESSAGE}" ] && text="${SPLASH_SHUTDOWN_MESSAGE}"
48
49 if [ "${RUNLEVEL}" == "6" ]; then
50 text="Rebooting the system... Press F2 for verbose mode"
51 [ -n "${SPLASH_REBOOT_MESSAGE}" ] && text="${SPLASH_REBOOT_MESSAGE}"
52 fi
53 fi
54
55 if [ -n "$text_x" -a -n "$text_y" -a -n "$text_color" -a -n "$text_size" ]
56 then
57 options="-x $text_x -y $text_y -t $text_color -s $text_size"
58 if [ -n "${SPLASH_FONT}" -a -f "/etc/splash/${SPLASH_FONT}" ]
59 then
60 options="$options -f \"/etc/splash/${SPLASH_FONT}\""
61 fi
62
63 eval "/sbin/fbtruetype.static $options \"$text\""
64 fi
65 }
66
67 paint_progress() {
68 progress=$(($spl_init + ($spl_count) * ($spl_rate - $spl_init) / $spl_scripts))
69 ${SPLUTIL} --vc=0 --progress=${progress} --theme=${SPLASH_THEME} --mode=s --cmd=paint
70 }
71
72 # Start silent splash on system shutdown/reboot
73 if [ "$1" == "start" ]; then
74
75 if [ -n "`${SPLUTIL} -c getmode 2>/dev/null | grep silent 2>/dev/null`" ] ||
76 [ -n "`grep silent /proc/cmdline 2>/dev/null`" -a "${SHUTDOWN}" = "yes" ] ; then
77
78 if [ -x /usr/bin/chvt ]; then
79 /usr/bin/chvt 1
80 fi
81
82 ${SPLUTIL} -c setmode -m s
83 ${SPLUTIL} -c repaint -m s --theme=${SPLASH_THEME}
84
85 if [ "$?" != 0 ]; then
86 ${SPLUTIL} -c setmode -m v
87 ${SPLUTIL} -c off
88 else
89 ${SPLUTIL} -c on 2>/dev/null
90 print_text
91 fi
92 fi
93
94 elif [ "$1" == "verbose" ]; then
95
96 if [ -n "`${SPLUTIL} -c getmode 2>/dev/null | grep silent 2>/dev/null`" ]; then
97 ${SPLUTIL} -c setmode -m v
98 fi
99
100 elif [ "$1" == "text" ]; then
101 if [ -n "`grep \"silent\" /proc/cmdline 2>/dev/null`" ]; then
102 print_text
103 fi
104 else
105 if [ -n "`${SPLUTIL} -c getmode | grep silent`" ]; then
106 paint_progress
107 fi
108 fi
109
110 exit 0

Properties

Name Value
svn:executable *