Magellan Linux

Diff of /trunk/busybox/splash-functions.rc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1279 by niro, Sun Feb 6 22:32:23 2011 UTC revision 1839 by niro, Fri Jul 13 09:55:49 2012 UTC
# Line 9  splash() Line 9  splash()
9   local args   local args
10    
11   # check for a framebuffer console first!   # check for a framebuffer console first!
12   [[ ! -e /dev/fb0 ]] && return 0   [[ ! -e ${SPLASH_DEV} ]] && return 0
13   # proc must be mounted too   # proc must be mounted too
14   [[ ! -e /proc/cmdline ]] && return 0   [[ ! -e /proc/cmdline ]] && return 0
15   # only run fbsplash if theme was found   # only run fbsplash if theme was found
# Line 17  splash() Line 17  splash()
17   # and run only if a config for the current resolution exist   # and run only if a config for the current resolution exist
18   [[ ! -e ${SPLASH_THEMES}/${SPLASH_THEME}/$(splash_resolution).conf ]] && return   [[ ! -e ${SPLASH_THEMES}/${SPLASH_THEME}/$(splash_resolution).conf ]] && return
19    
20     # create fifo if not exist
21     if [[ ! -w ${SPLASH_FIFO} ]]
22     then
23     mkfifo ${SPLASH_FIFO}
24     fi
25    
26   # check cmdline for config_opts   # check cmdline for config_opts
27   #   splash=silent,theme:mcore   #   splash=silent,theme:mcore
28   for cmd in $(< /proc/cmdline)   for cmd in $(< /proc/cmdline)
# Line 36  splash() Line 42  splash()
42   case $1 in   case $1 in
43   rc_init) rc_init ;;   rc_init) rc_init ;;
44   rc_verbose|rc_exit) rc_exit ;;   rc_verbose|rc_exit) rc_exit ;;
45     # redraw splash image and text
46     svc_started)
47     if [[ ${runlevel} = boot ]] || [[ ${runlevel} = sysinit ]]
48     then
49     splash_control "image:"
50     splash_control "write:${SPLASH_BOOT_MESSAGE}"
51     fi
52     ;;
53     svc_stopped)
54     if [[ ${runlevel} = shutdown ]]
55     then
56     splash_control "image:"
57     splash_control "write:${SPLASH_SHUTDOWN_MESSAGE}"
58     fi
59     if [[ ${runlevel} = reboot ]]
60     then
61     splash_control "image:"
62     splash_control "write:${SPLASH_REBOOT_MESSAGE}"
63     fi
64     ;;
65   esac   esac
66  }  }
67    
# Line 45  rc_init() Line 71  rc_init()
71   then   then
72   local resolution="$(splash_resolution)"   local resolution="$(splash_resolution)"
73    
  splash_cursor disable  
74   chvt ${SPLASH_TTY}   chvt ${SPLASH_TTY}
75   sleep 0.5   sleep 0.5
76    
77   if [[ $runlevel = boot ]] || [[ ${runlevel} = sysinit ]]   if [[ ${runlevel} = boot ]] || [[ ${runlevel} = sysinit ]]
78   then   then
79   fbsplash -i ${SPLASH_THEMES}/${SPLASH_THEME}/${resolution}.conf \   fbsplash -i ${SPLASH_THEMES}/${SPLASH_THEME}/${resolution}.conf \
80   -s ${SPLASH_THEMES}/${SPLASH_THEME}/startup-${resolution}.ppm.gz \   -s ${SPLASH_THEMES}/${SPLASH_THEME}/startup-${resolution}.ppm.gz \
81   -m ${SPLASH_THEMES}/${SPLASH_THEME}/splash-font.gz \   -m ${SPLASH_THEMES}/${SPLASH_THEME}/splash-font.gz \
82   -f ${SPLASH_FIFO} \   -f ${SPLASH_FIFO} \
83     -d ${SPLASH_DEV} \
84   ${SPLASH_OPTS} &   ${SPLASH_OPTS} &
85    
86   wait_for_fbsplash   wait_for_fbsplash
# Line 67  rc_init() Line 93  rc_init()
93   -s ${SPLASH_THEMES}/${SPLASH_THEME}/shutdown-${resolution}.ppm.gz \   -s ${SPLASH_THEMES}/${SPLASH_THEME}/shutdown-${resolution}.ppm.gz \
94   -m ${SPLASH_THEMES}/${SPLASH_THEME}/splash-font.gz \   -m ${SPLASH_THEMES}/${SPLASH_THEME}/splash-font.gz \
95   -f ${SPLASH_FIFO} \   -f ${SPLASH_FIFO} \
96     -d ${SPLASH_DEV} \
97   ${SPLASH_OPTS} &   ${SPLASH_OPTS} &
98    
99   wait_for_fbsplash   wait_for_fbsplash
100   splash_control "write:${SPLASH_SHUTDOWN_MESSAGE}"   splash_control "write:${SPLASH_SHUTDOWN_MESSAGE}"
101   fi   fi
102    
103   if [[ $runlevel = reboot ]]   if [[ ${runlevel} = reboot ]]
104   then   then
105   fbsplash -i ${SPLASH_THEMES}/${SPLASH_THEME}/${resolution}.conf \   fbsplash -i ${SPLASH_THEMES}/${SPLASH_THEME}/${resolution}.conf \
106   -s ${SPLASH_THEMES}/${SPLASH_THEME}/reboot-${resolution}.ppm.gz \   -s ${SPLASH_THEMES}/${SPLASH_THEME}/reboot-${resolution}.ppm.gz \
107   -m ${SPLASH_THEMES}/${SPLASH_THEME}/splash-font.gz \   -m ${SPLASH_THEMES}/${SPLASH_THEME}/splash-font.gz \
108   -f ${SPLASH_FIFO} \   -f ${SPLASH_FIFO} \
109     -d ${SPLASH_DEV} \
110   ${SPLASH_OPTS} &   ${SPLASH_OPTS} &
111    
112   wait_for_fbsplash   wait_for_fbsplash
# Line 92  rc_exit() Line 120  rc_exit()
120   if [[ ${SPLASH_MODE} = silent ]]   if [[ ${SPLASH_MODE} = silent ]]
121   then   then
122   splash_control "exit"   splash_control "exit"
  splash_cursor enable  
123   if [[ -n ${SPLASH_X11_TTY} ]]   if [[ -n ${SPLASH_X11_TTY} ]]
124   then   then
125   chvt ${SPLASH_X11_TTY}   chvt ${SPLASH_X11_TTY}
# Line 122  splash_control() Line 149  splash_control()
149   if [[ -n $(pidof fbsplash) ]]   if [[ -n $(pidof fbsplash) ]]
150   then   then
151   echo "$@" > ${SPLASH_FIFO}   echo "$@" > ${SPLASH_FIFO}
  else  
  # exit here  
  splash_cursor enable  
  chvt 1  
152   fi   fi
153  }  }
   
 # disable|enable  
 splash_cursor()  
 {  
  case $1 in  
  enable) echo -e "\e[?0c";;  
  disable) echo -e "\e[?1c" ;;  
  esac  
 }  

Legend:
Removed from v.1279  
changed lines
  Added in v.1839