Magellan Linux

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

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

trunk/busybox/splash-funtions.rc revision 1264 by niro, Fri Jan 28 19:08:48 2011 UTC trunk/busybox/splash-functions.rc revision 1398 by niro, Fri Jul 1 14:17:30 2011 UTC
# Line 5  Line 5 
5    
6  splash()  splash()
7  {  {
8     local cmd
9     local args
10    
11     # check for a framebuffer console first!
12     [[ ! -e /dev/fb0 ]] && return 0
13     # proc must be mounted too
14     [[ ! -e /proc/cmdline ]] && return 0
15     # only run fbsplash if theme was found
16     [[ ! -e ${SPLASH_THEMES}/${SPLASH_THEME} ]] && return
17     # and run only if a config for the current resolution exist
18     [[ ! -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
27     #   splash=silent,theme:mcore
28     for cmd in $(< /proc/cmdline)
29     do
30     case "${cmd}" in
31     splash=*)
32     # split the cmd and put everything into an array
33     args=( $(echo "${cmd}" | sed 's:[,\:=]:\ :g') )
34     # mode is always args[1]
35     SPLASH_MODE="${args[1]}"
36     # theme is always args[3]
37     SPLASH_THEME="${args[3]}"
38     ;;
39     esac
40     done
41    
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 ;;
# Line 19  rc_init() Line 53  rc_init()
53    
54   splash_cursor disable   splash_cursor disable
55   chvt ${SPLASH_TTY}   chvt ${SPLASH_TTY}
56     sleep 0.5
57    
58   if [[ $runlevel = boot ]] || [[ ${runlevel} = sysinit ]]   if [[ $runlevel = boot ]] || [[ ${runlevel} = sysinit ]]
59   then   then
# Line 28  rc_init() Line 63  rc_init()
63   -f ${SPLASH_FIFO} \   -f ${SPLASH_FIFO} \
64   ${SPLASH_OPTS} &   ${SPLASH_OPTS} &
65    
66     wait_for_fbsplash
67   splash_control "write:${SPLASH_BOOT_MESSAGE}"   splash_control "write:${SPLASH_BOOT_MESSAGE}"
68   fi   fi
69    
# Line 39  rc_init() Line 75  rc_init()
75   -f ${SPLASH_FIFO} \   -f ${SPLASH_FIFO} \
76   ${SPLASH_OPTS} &   ${SPLASH_OPTS} &
77    
78     wait_for_fbsplash
79   splash_control "write:${SPLASH_SHUTDOWN_MESSAGE}"   splash_control "write:${SPLASH_SHUTDOWN_MESSAGE}"
80   fi   fi
81    
# Line 50  rc_init() Line 87  rc_init()
87   -f ${SPLASH_FIFO} \   -f ${SPLASH_FIFO} \
88   ${SPLASH_OPTS} &   ${SPLASH_OPTS} &
89    
90     wait_for_fbsplash
91   splash_control "write:${SPLASH_REBOOT_MESSAGE}"   splash_control "write:${SPLASH_REBOOT_MESSAGE}"
92   fi   fi
93   fi   fi
# Line 61  rc_exit() Line 99  rc_exit()
99   then   then
100   splash_control "exit"   splash_control "exit"
101   splash_cursor enable   splash_cursor enable
102   chvt 1   if [[ -n ${SPLASH_X11_TTY} ]]
103     then
104     chvt ${SPLASH_X11_TTY}
105     else
106     chvt 1
107     fi
108   fi   fi
109  }  }
110    
# Line 70  splash_resolution() Line 113  splash_resolution()
113   fbres   fbres
114  }  }
115    
116    wait_for_fbsplash()
117    {
118     while [[ -z $(pidof fbsplash) ]]
119     do
120     sleep 0.1
121     done
122    }
123    
124  splash_control()  splash_control()
125  {  {
126   # only write to fifo if the fbsplash process is runnning   # only write to fifo if the fbsplash process is runnning
# Line 77  splash_control() Line 128  splash_control()
128   if [[ -n $(pidof fbsplash) ]]   if [[ -n $(pidof fbsplash) ]]
129   then   then
130   echo "$@" > ${SPLASH_FIFO}   echo "$@" > ${SPLASH_FIFO}
131     else
132     # exit here
133     splash_cursor enable
134     chvt 1
135   fi   fi
136  }  }
137    

Legend:
Removed from v.1264  
changed lines
  Added in v.1398