home *** CD-ROM | disk | FTP | other *** search
/ chilidog.highland.cc.ks.us / chilidog.highland.cc.ks.us.zip / chilidog.highland.cc.ks.us / backup / bradford.20110725.etc.tar.gz / bradford.20110725.etc.tar / etc / rc.splash < prev    next >
Text File  |  2004-10-20  |  3KB  |  107 lines

  1. # /etc/rc.splash
  2. #
  3. # Initialize bootsplash progressbar variables and
  4. # define the bootsplash boot script functions.
  5. #
  6.  
  7. SPLASHCFG=
  8.    SPLASH=yes
  9. SPLASHNUM=0
  10.     THEME=
  11. export SPLASHCFG SPLASH
  12.  
  13. test -s /etc/sysconfig/bootsplash && . /etc/sysconfig/bootsplash
  14. test -x /sbin/splash -a -w /proc/splash            || SPLASH=no
  15. test -n "$THEME" -a -d "/etc/bootsplash/themes/$THEME"    || SPLASH=no
  16. case "$PREVLEVEL-$RUNLEVEL" in
  17.     [2-5]-[2-5]) SPLASH=no
  18. esac
  19.  
  20. if test "$SPLASH" = yes -a -r /proc/splash ; then
  21.     read -t 1 splashstatus < /proc/splash
  22.     splashstatus="${splashstatus#*:}"
  23.     splashstatus="${splashstatus## }"
  24.     test "$splashstatus" = on    || SPLASH=no
  25.     unset splashstatus
  26. else
  27.     SPLASH=no
  28. fi
  29.  
  30. if test "$SPLASH" = yes -a -x /sbin/fbresolution ; then
  31.     fbresolution="$(/sbin/fbresolution 2> /dev/null)"
  32.     SPLASHCFG="/etc/bootsplash/themes/$THEME/config/bootsplash-${fbresolution}.cfg"
  33.     unset fbresolution
  34.     test -f "$SPLASHCFG"    || SPLASH=no
  35. fi
  36.  
  37. if test "$SPLASH" = "yes" ; then
  38.     if test "$1" = "B" ; then
  39.     SPLASHSTART=100
  40.     SPLASHEND=20000
  41.     for i in /etc/init.d/boot.d/S[0-9][0-9]*; do
  42.         test -x "$i" || continue
  43.         : $((SPLASHNUM++))
  44.     done
  45.     unset i
  46.     else
  47.     SPLASHSTART=0
  48.     SPLASHEND=65535
  49.     case "$PREVLEVEL-$RUNLEVEL" in
  50.         N-[3-5]) SPLASHSTART=20000 ;;
  51.     esac
  52.     for i in /etc/init.d/rc${RUNLEVEL}.d/S[0-9][0-9]*; do
  53.         test -x "$i" || continue
  54.         : $((SPLASHNUM++))
  55.     done
  56.     for i in /etc/init.d/rc${PREVLEVEL}.d/K[0-9][0-9]*; do
  57.         test -x "$i" || continue
  58.         : $((SPLASHNUM++))
  59.     done
  60.     unset i
  61.     fi
  62.     function splashtrigger  ()
  63.     {
  64.     case "$1" in
  65.     rlreached*) SPLASHSTART=$SPLASHEND
  66.     esac
  67.     case "$RUNLEVEL" in
  68.     [06]) /sbin/splash -S -p $SPLASHSTART -t "$1" "$SPLASHCFG" ;;
  69.     *)    /sbin/splash    -p $SPLASHSTART -t "$1" "$SPLASHCFG"
  70.     esac
  71.     }
  72.     function splashprogress ()
  73.     {
  74.     local SPLASHDIFF
  75.     test "$SPLASHNUM" -ge 1 || SPLASHNUM=1
  76.     SPLASHDIFF=$(((SPLASHEND - SPLASHSTART)/SPLASHNUM))
  77.     /sbin/splash -p "$SPLASHSTART:$SPLASHDIFF" -t "$1" "$SPLASHCFG"
  78.     SPLASHSTART=$((SPLASHSTART+SPLASHDIFF))
  79.     : $((SPLASHNUM--))
  80.     }
  81.     function splashparallel ()
  82.     {
  83.     local SPLASHDIFF
  84.     local SPLASHOLDSTART=$SPLASHSTART
  85.     for i; do
  86.         test "$SPLASHNUM" -ge 1 || SPLASHNUM=1
  87.         SPLASHDIFF=$(((SPLASHEND-SPLASHSTART)/SPLASHNUM))
  88.         SPLASHSTART=$((SPLASHSTART+SPLASHDIFF))
  89.         : $((SPLASHNUM--))
  90.     done
  91.     SPLASHDIFF=$((SPLASHSTART-SPLASHOLDSTART))
  92.     echo "-S $SPLASHOLDSTART:$SPLASHDIFF"
  93.     }
  94.     function splashmake ()
  95.     {
  96.     local SPLASHDIFF=$((SPLASHEND-SPLASHSTART))
  97.     echo "-S $SPLASHSTART:$SPLASHDIFF"
  98.     SPLASHSTART=$SPLASHEND
  99.     SPLASHNUM=0
  100.     }
  101. else
  102.     function splashtrigger  () { :; }
  103.     function splashprogress () { :; }
  104.     function splashparallel () { echo ""; }
  105.     function splashmake     () { echo ""; }
  106. fi
  107.