Magellan Linux

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

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

revision 1273 by niro, Fri Jan 28 19:39:02 2011 UTC revision 1279 by niro, Sun Feb 6 22:32:23 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     # check cmdline for config_opts
21     #   splash=silent,theme:mcore
22     for cmd in $(< /proc/cmdline)
23     do
24     case "${cmd}" in
25     splash=*)
26     # split the cmd and put everything into an array
27     args=( $(echo "${cmd}" | sed 's:[,\:=]:\ :g') )
28     # mode is always args[1]
29     SPLASH_MODE="${args[1]}"
30     # theme is always args[3]
31     SPLASH_THEME="${args[3]}"
32     ;;
33     esac
34     done
35    
36   case $1 in   case $1 in
37   rc_init) rc_init ;;   rc_init) rc_init ;;
38   rc_verbose|rc_exit) rc_exit ;;   rc_verbose|rc_exit) rc_exit ;;
# Line 19  rc_init() Line 47  rc_init()
47    
48   splash_cursor disable   splash_cursor disable
49   chvt ${SPLASH_TTY}   chvt ${SPLASH_TTY}
50     sleep 0.5
51    
52   if [[ $runlevel = boot ]] || [[ ${runlevel} = sysinit ]]   if [[ $runlevel = boot ]] || [[ ${runlevel} = sysinit ]]
53   then   then
# Line 28  rc_init() Line 57  rc_init()
57   -f ${SPLASH_FIFO} \   -f ${SPLASH_FIFO} \
58   ${SPLASH_OPTS} &   ${SPLASH_OPTS} &
59    
60     wait_for_fbsplash
61   splash_control "write:${SPLASH_BOOT_MESSAGE}"   splash_control "write:${SPLASH_BOOT_MESSAGE}"
62   fi   fi
63    
# Line 39  rc_init() Line 69  rc_init()
69   -f ${SPLASH_FIFO} \   -f ${SPLASH_FIFO} \
70   ${SPLASH_OPTS} &   ${SPLASH_OPTS} &
71    
72     wait_for_fbsplash
73   splash_control "write:${SPLASH_SHUTDOWN_MESSAGE}"   splash_control "write:${SPLASH_SHUTDOWN_MESSAGE}"
74   fi   fi
75    
# Line 50  rc_init() Line 81  rc_init()
81   -f ${SPLASH_FIFO} \   -f ${SPLASH_FIFO} \
82   ${SPLASH_OPTS} &   ${SPLASH_OPTS} &
83    
84     wait_for_fbsplash
85   splash_control "write:${SPLASH_REBOOT_MESSAGE}"   splash_control "write:${SPLASH_REBOOT_MESSAGE}"
86   fi   fi
87   fi   fi
# Line 61  rc_exit() Line 93  rc_exit()
93   then   then
94   splash_control "exit"   splash_control "exit"
95   splash_cursor enable   splash_cursor enable
96   chvt 1   if [[ -n ${SPLASH_X11_TTY} ]]
97     then
98     chvt ${SPLASH_X11_TTY}
99     else
100     chvt 1
101     fi
102   fi   fi
103  }  }
104    
# Line 70  splash_resolution() Line 107  splash_resolution()
107   fbres   fbres
108  }  }
109    
110    wait_for_fbsplash()
111    {
112     while [[ -z $(pidof fbsplash) ]]
113     do
114     sleep 0.1
115     done
116    }
117    
118  splash_control()  splash_control()
119  {  {
120   # 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 122  splash_control()
122   if [[ -n $(pidof fbsplash) ]]   if [[ -n $(pidof fbsplash) ]]
123   then   then
124   echo "$@" > ${SPLASH_FIFO}   echo "$@" > ${SPLASH_FIFO}
125     else
126     # exit here
127     splash_cursor enable
128     chvt 1
129   fi   fi
130  }  }
131    

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