aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/splash.sh48
1 files changed, 47 insertions, 1 deletions
diff --git a/scripts/splash.sh b/scripts/splash.sh
index 789a0e7..27787bc 100644
--- a/scripts/splash.sh
+++ b/scripts/splash.sh
@@ -17,6 +17,8 @@ TEXTDOMAIN=bootsplash
TEXTDOMAINDIR=/etc/locale
LOCPATH=/etc/locale
+service=$1
+
# execute splash binary utility because we are a wrapper:
if [ "$1" == "-s" -o "$1" == "-u" -o "$1" == "-n" -o "$1" == "-f" ]; then
exec /sbin/splash $*
@@ -46,9 +48,29 @@ bootsplash_write() {
[ "$splash_mode" = "bootsplash" ] && echo $* > /proc/splash
}
+splashy_is_running() {
+ [ -e /dev/.splashy.pid ]
+}
+
+splashy_check() {
+ [ "$splash_mode" != "splashy" ] || splashy_is_running || exit 0
+}
+
+splashy_exit() {
+ if [ "$splash_mode" = "splashy" ] && splashy_is_running; then
+ /sbin/splashy_update exit
+ clear >/dev/tty8
+ if [ "$service" != "dm" ]; then
+ chvt 1
+ fi
+ fi
+}
+
update_progress() {
if [ "$splash_mode" = "bootsplash" ]; then
bootsplash_write "show $(( 65534 * ( $progress + 1 ) / $num ))"
+ elif [ "$splash_mode" = "splashy" ]; then
+ /sbin/splashy_update "progress $(( 100 * $progress / $nbservices ))"
fi
}
@@ -73,14 +95,27 @@ fi
_shutdown="no"
_silent="no"
-grep -q silent /proc/cmdline && grep -q silent /proc/splash && _silent="yes"
+if grep -q silent /proc/cmdline; then
+ if grep -q silent /proc/splash || [ "$splash_mode" = "splashy" ]; then
+ _silent="yes"
+ fi
+fi
test "$runlevel" == "6" -o "$runlevel" == "0" && _shutdown="yes"
if [ "$1" == "verbose" ]; then
bootsplash_write 'verbose'
fi
+if [ "$1" == "dm" -a "$splash_mode" = "splashy" -a "$rc_mode" = "S" ]; then
+ splashy_exit
+ exit 0
+fi
+
if [ "$1" == "stop" -a $_shutdown == "no" ]; then
+ if [ "$splash_mode" = "splashy" ]; then
+ splashy_exit
+ exit 0
+ fi
if [[ $LOGO_CONSOLE == No ]] || [[ $LOGO_CONSOLE == no ]] || [[ $LOGO_CONSOLE == NO ]]; then
bootsplash_write 0
exit 0
@@ -214,6 +249,11 @@ if [ "$progress" == 1 -o "$1" == "start" -o "$1" == "suspend" ]; then
[[ -f /etc/bootsplash/themes/$theme/config/bootsplash-$res.cfg ]] && bootsplash_run -s -u 0 /etc/bootsplash/themes/$theme/config/bootsplash-$res.cfg
bootsplash_write "silent"
chvt 1
+ elif [ "$splash_mode" = "splashy" ]; then
+ /sbin/splashy_chvt 8
+ /sbin/splashy shutdown
+ pidof splashy > /dev/.splashy.pid
+ cat /dev/.splashy.pid >> /var/run/sendsigs.omit
fi
elif [ "$1" == "suspend" ]; then
gprintf "Suspending the system..."
@@ -221,8 +261,13 @@ if [ "$progress" == 1 -o "$1" == "start" -o "$1" == "suspend" ]; then
[[ -f /etc/bootsplash/themes/$theme/config/hibernate-$res.cfg ]] && bootsplash_run -s -u 0 /etc/bootsplash/themes/$theme/config/hibernate-$res.cfg
bootsplash_write "silent"
chvt 1
+ elif [ "$splash_mode" = "splashy" ]; then
+ /sbin/splashy_chvt 8
+ /sbin/splashy shutdown
+ pidof splashy > /dev/.splashy.pid
fi
else
+ splashy_check
if [ "$font" != "default" -a "$progress" != "1" -a -d /usr/share/bootsplash -a "$_silent" == "yes" ]; then
if [[ -f /etc/bootsplash/themes/$theme/config/bootsplash-$res.cfg ]]; then
bootsplash_run -s -u 0 /etc/bootsplash/themes/$theme/config/bootsplash-$res.cfg
@@ -242,4 +287,5 @@ fi
# Paint progressbar..
test -z "$progress_enable" && exit 0
+splashy_check
update_progress