diff options
author | Cecil Hugh Watson <knoppmyth@gmail.com> | 2009-02-12 08:22:14 (GMT) |
---|---|---|
committer | Cecil Hugh Watson <knoppmyth@gmail.com> | 2009-02-12 08:22:14 (GMT) |
commit | 40727c47f4a6319dc101ca97cddd72732db03889 (patch) | |
tree | c469bd876c58981ef4abd517af7af7f6c8f8868a /abs/core-testing/fbsplash/fbsplash.inithooks | |
parent | d39d6198243375c7cc8e72aa926d24fc6b625982 (diff) | |
download | linhes_pkgbuild-40727c47f4a6319dc101ca97cddd72732db03889.zip linhes_pkgbuild-40727c47f4a6319dc101ca97cddd72732db03889.tar.gz linhes_pkgbuild-40727c47f4a6319dc101ca97cddd72732db03889.tar.bz2 |
Initial inclusion of fbsplash and deps.
Diffstat (limited to 'abs/core-testing/fbsplash/fbsplash.inithooks')
-rw-r--r-- | abs/core-testing/fbsplash/fbsplash.inithooks | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/abs/core-testing/fbsplash/fbsplash.inithooks b/abs/core-testing/fbsplash/fbsplash.inithooks new file mode 100644 index 0000000..dbf7b13 --- /dev/null +++ b/abs/core-testing/fbsplash/fbsplash.inithooks @@ -0,0 +1,91 @@ +# fbsplash function.d script # +# Author: Greg Helton <gt@fallendusk.org> # + +# Who is calling? # +CALLER=$0 + +# splash stuff # +. /etc/conf.d/fbsplash.conf +. /sbin/splash-functions.sh + +# Redefine the stat functions # +stat_bkgd() { + printf "${C_OTHER}${PREFIX_REG} ${C_MAIN}${1}${C_CLEAR} " + deltext + printf " ${C_OTHER}[${C_BKGD}BKGD${C_OTHER}]${C_CLEAR} " +} + +stat_busy() { + printf "${C_OTHER}${PREFIX_REG} ${C_MAIN}${1}${C_CLEAR} " + printf "${SAVE_POSITION}" + deltext + printf " ${C_OTHER}[${C_BUSY}BUSY${C_OTHER}]${C_CLEAR} " + # This checks to see if we just brought up the lo interface in rc.sysinit # + # if so, start the progress bar # + if [ "${1}" == 'Bringing up loopback interface' ]; then + splash rc_init + fi + # Load variables # + var_load STEP_NR MAX_STEPS RC_MULTI RC_SYSINIT RC_SHUTDOWN + # Only update the splash progress if we're in sysinit, multi, or shutdown. # + if [[ ${SPLASH_RC_MULTI} == 1 || ${SPLASH_RC_SYSINIT} == 1 || ${SPLASH_RC_SHUTDOWN} == 1 ]]; then + ((SPLASH_STEP_NR++)) + SPLASH_PROGRESS=$((100*${SPLASH_STEP_NR}/${SPLASH_MAX_STEPS})) + SPLASH_CURRENT_PROGRESS=${SPLASH_PROGRESS} + splash_update_progress ${SPLASH_PROGRESS} + var_save STEP_NR CURRENT_PROGRESS + fi + if [ ${SPLASH_RC_SHUTDOWN} == 1 ]; then + save_shutdown_steps + fi + +} + +stat_done() { + deltext + printf " ${C_OTHER}[${C_DONE}DONE${C_OTHER}]${C_CLEAR} \n" +} + +stat_fail() { + deltext + printf " ${C_OTHER}[${C_FAIL}FAIL${C_OTHER}]${C_CLEAR} \n" + splash_verbose +} + +start_daemon() { + /etc/rc.d/$1 start +} + +# rc.sysinit # +if [ $CALLER == '/etc/rc.sysinit' ]; then + echo "fbsplash: Setting up splash..." + splash_cache_prep + SPLASH_MAX_STEPS=$(load_boot_steps) + SPLASH_STEP_NR=0 + SPLASH_RC_MULTI=0 + SPLASH_RC_SYSINIT=1 + SPLASH_RC_SHUTDOWN=0 + var_save MAX_STEPS STEP_NR RC_MULTI RC_SYSINIT RC_SHUTDOWN +fi + +# rc.multi # +if [ $CALLER == '/etc/rc.multi' ]; then + SPLASH_RC_MULTI=1 + SPLASH_RC_SYSINIT=0 + var_save RC_MULTI RC_SYSINIT +fi + +# rc.shutdown # +if [ $CALLER == '/etc/rc.shutdown' ]; then + echo "fbsplash: Setting up splash..." + splash_cache_prep + SPLASH_MAX_STEPS=$(load_shutdown_steps) + SPLASH_SHUTDOWN_STEPS=1 + SPLASH_STEP_NR=0 + SPLASH_RC_MULTI=0 + SPLASH_RC_SYSINIT=0 + SPLASH_RC_SHUTDOWN=1 + var_save MAX_STEPS STEP_NR RC_MULTI RC_SYSINIT RC_SHUTDOWN DAEMON_STEPS + splash rc_init +fi + |