Hello, the idea of putting an alernative to the usplash scripts that sysv-rc expects to find is not totally possible because bootsplash expects to receive the script that is running in every moment (for start and stop animations) and usplash don't, but at least is possible to use the progress percent calculated for the uplash.
I adapted the sysv-rc and /sbin/splash.sh scripts for bootsplash trying to reuse the code for usplash. I don't know if it is the better way to do it, but it works good enought for me. I've attached the adapted splash.sh script and the patch for the sysv-rc. Greetings, -- Pablo Chinea [EMAIL PROTECTED] http://www.khertz.net/
*** rc.sysv-rc 2006-07-25 18:51:00.000000000 +0100 --- rc.bootsplash 2006-08-28 09:01:38.000000000 +0100 *************** *** 12,17 **** --- 12,19 ---- # Authors: # Miquel van Smoorenburg <[EMAIL PROTECTED]> # Bruce Perens <[EMAIL PROTECTED]> + # Edited for bootsplash by Pablo Chinea <[EMAIL PROTECTED]>, 2006 + # PATH=/sbin:/bin:/usr/sbin:/usr/bin export PATH *************** *** 39,51 **** # Set onlcr to avoid staircase effect. stty onlcr 0>&1 ! # Decide if usplash progress bar should be activated or not. Override ! # in /etc/default/rcS if required. ! if type usplash_write >/dev/null 2>&1; then ! SPLASH=true ! else ! SPLASH=false ! fi # Now find out what the current and what the previous runlevel are. --- 41,56 ---- # Set onlcr to avoid staircase effect. stty onlcr 0>&1 ! # source the bootsplash config file ! test -f /etc/default/bootsplash && . /etc/default/bootsplash ! ! # ! # Update bootsplash stuff. (progress bar, animations...) ! # ! rc_splash() { ! export progress ! test "$SPLASH" != "no" && /sbin/splash.sh "$1" ! } # Now find out what the current and what the previous runlevel are. *************** *** 72,77 **** --- 77,83 ---- then /sbin/unconfigured.sh fi + rc_splash "splash start" # let bootsplash know we are ready fi . /etc/default/rcS *************** *** 82,92 **** # startup_progress() { $@ ! if [ "$SPLASH" = true ] ; then ! step=$(($step + $step_change)) ! progress=$(($step * $progress_size / $num_steps + $first_step)) ! usplash_write "PROGRESS $progress" || true ! fi } # --- 88,98 ---- # startup_progress() { $@ ! step=$(($step + $step_change)) ! progress=$(($step * $progress_size / $num_steps + $first_step)) ! if type usplash_write >/dev/null 2>&1; then ! usplash_write "PROGRESS $progress" || true ! fi } # *************** *** 192,197 **** --- 198,212 ---- ;; esac + # + # let bootsplash know if we are shutting down + # + if [ "$runlevel" = "0" -o "$runlevel" = "6" ] + then + rc_splash "splash start" + rc_splash "shutdown" + fi + # Is there an rc directory for this new runlevel? if [ -d /etc/rc$runlevel.d ] then *************** *** 229,235 **** ;; esac - if [ "$SPLASH" = true ] ; then # Count the number of scripts we need to run (for usplash # progress bar) num_steps=0 --- 244,249 ---- *************** *** 242,248 **** num_steps=$(($num_steps + 1)) done step=0 - fi # First, run the KILL scripts. if [ "$previous" != N ] --- 256,261 ---- *************** *** 281,286 **** --- 294,300 ---- SCRIPTS="$SCRIPTS $i" done startup stop $SCRIPTS + rc_splash "$i stop" # update bootsplash progress bar done fi *************** *** 320,325 **** --- 334,340 ---- SCRIPTS="$SCRIPTS $i" done startup $ACTION $SCRIPTS + rc_splash "$i $ACTION" # update bootsplash progress bar done fi *************** *** 340,345 **** --- 355,362 ---- fi fi + rc_splash "master" # stop playing animations + trap - EXIT # Disable emergency handler exit 0
splash.sh
Description: application/shellscript
pgpaVAVl5EdHq.pgp
Description: PGP signature