--- trunk/busybox/splash-funtions.rc 2011/01/28 19:08:48 1264 +++ trunk/busybox/splash-functions.rc 2011/02/04 21:34:23 1277 @@ -5,6 +5,9 @@ splash() { + # only run fbsplash if theme was found + [[ ! -e ${SPLASH_THEMES}/${SPLASH_THEME} ]] && return + case $1 in rc_init) rc_init ;; rc_verbose|rc_exit) rc_exit ;; @@ -19,6 +22,7 @@ splash_cursor disable chvt ${SPLASH_TTY} + sleep 0.5 if [[ $runlevel = boot ]] || [[ ${runlevel} = sysinit ]] then @@ -28,6 +32,7 @@ -f ${SPLASH_FIFO} \ ${SPLASH_OPTS} & + wait_for_fbsplash splash_control "write:${SPLASH_BOOT_MESSAGE}" fi @@ -39,6 +44,7 @@ -f ${SPLASH_FIFO} \ ${SPLASH_OPTS} & + wait_for_fbsplash splash_control "write:${SPLASH_SHUTDOWN_MESSAGE}" fi @@ -50,6 +56,7 @@ -f ${SPLASH_FIFO} \ ${SPLASH_OPTS} & + wait_for_fbsplash splash_control "write:${SPLASH_REBOOT_MESSAGE}" fi fi @@ -61,7 +68,12 @@ then splash_control "exit" splash_cursor enable - chvt 1 + if [[ -n ${SPLASH_X11_TTY} ]] + then + chvt ${SPLASH_X11_TTY} + else + chvt 1 + fi fi } @@ -70,6 +82,14 @@ fbres } +wait_for_fbsplash() +{ + while [[ -z $(pidof fbsplash) ]] + do + sleep 0.1 + done +} + splash_control() { # only write to fifo if the fbsplash process is runnning @@ -77,6 +97,10 @@ if [[ -n $(pidof fbsplash) ]] then echo "$@" > ${SPLASH_FIFO} + else + # exit here + splash_cursor enable + chvt 1 fi }