#!/bin/bash # $Header: /root/magellan-cvs/src/splashutils-magellan/init-splash,v 1.3 2005-03-04 18:32:33 niro Exp $ #%rlevels: 1:s 2:s 3:s 4:s 5:s #%start: 99 #%stop: #deps #%needs: #%before: #%after: source /etc/sysconfig/rc source $rc_functions source /etc/conf.d/splash # default settings test -z "${SPLASH_THEME}" && SPLASH_THEME="default" if [ -z "${SPLASH_TTYS}" ]; then if [ -n "${RC_TTY_NUMBER}" ]; then SPLASH_TTYS=$(seq 0 "${RC_TTY_NUMBER}") else SPLASH_TTYS="0 1 2 3 4 5 6" fi fi # dummy function to handle sourcing of fbconfig file box () { return; } parse_cmdline () { line=`egrep -o 'splash=[^ ]+' /proc/cmdline` line="${line#splash=}" t="${IFS}" IFS="," for param in ${line} do if [ "${param%:*}" = "theme" ]; then SPLASH_THEME="${param#*:}" else SPLASH_MODE="${param}" fi done IFS="${t}" } case "$1" in start) # only do this if the kernel supports fbsplash if [ -e /dev/fbsplash ] && [ -e /proc/fbsplash ] then echo -e ${COLOREDSTAR}"Setting framebuffer console images" parse_cmdline for TTY in ${SPLASH_TTYS} do theme="${SPLASH_THEME}" if [ "${TTY}" -eq 0 -a -z "$(splash_util -c getstate --vc=0 | grep off)" ] then continue fi if [ -n "${SPLASH_TTY_MAP}" ] then for i in ${SPLASH_TTY_MAP} do if [ "${i%:*}" = "${TTY}" ] then theme="${i#*:}" fi done fi /sbin/splash_util --vc="${TTY}" -m v -t "${theme}" -c setcfg 2>/dev/null /sbin/splash_util --vc="${TTY}" -m v -t "${theme}" -c setpic 2>/dev/null /sbin/splash_util --vc="${TTY}" -c on 2>/dev/null done evaluate_retval fi splash svc_started splash 0 ;; stop) if [ -e /dev/fbsplash ] && [ -e /proc/fbsplash ] then echo -e ${COLOREDSTAR}"Removing splash-screens ..." for TTY in ${SPLASH_TTYS} do /sbin/splash_util --vc="${TTY}" --cmd=off done fi #to prevent the flow effect source /etc/sysconfig/rc source $rc_functions evaluate_retval splash svc_stopped splash 0 ;; restart) $0 stop sleep 1 $0 start ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 ;; esac