Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1264 - (hide annotations) (download)
Fri Jan 28 19:08:48 2011 UTC (13 years, 9 months ago) by niro
Original Path: trunk/busybox/splash-funtions.rc
File size: 1882 byte(s)
-added splash-functions and config
1 niro 1264 # /etc/rc.d/init.d/splash-functions - splashfunctions for busybox' fbsplash with tykef patch
2     # $Id$
3    
4     [[ -f /etc/splash/splash.conf ]] && . /etc/splash/splash.conf
5    
6     splash()
7     {
8     case $1 in
9     rc_init) rc_init ;;
10     rc_verbose|rc_exit) rc_exit ;;
11     esac
12     }
13    
14     rc_init()
15     {
16     if [[ ${SPLASH_MODE} = silent ]]
17     then
18     local resolution="$(splash_resolution)"
19    
20     splash_cursor disable
21     chvt ${SPLASH_TTY}
22    
23     if [[ $runlevel = boot ]] || [[ ${runlevel} = sysinit ]]
24     then
25     fbsplash -i ${SPLASH_THEMES}/${SPLASH_THEME}/${resolution}.conf \
26     -s ${SPLASH_THEMES}/${SPLASH_THEME}/startup-${resolution}.ppm.gz \
27     -m ${SPLASH_THEMES}/${SPLASH_THEME}/splash-font.gz \
28     -f ${SPLASH_FIFO} \
29     ${SPLASH_OPTS} &
30    
31     splash_control "write:${SPLASH_BOOT_MESSAGE}"
32     fi
33    
34     if [[ ${runlevel} = shutdown ]]
35     then
36     fbsplash -i ${SPLASH_THEMES}/${SPLASH_THEME}/${resolution}.conf \
37     -s ${SPLASH_THEMES}/${SPLASH_THEME}/shutdown-${resolution}.ppm.gz \
38     -m ${SPLASH_THEMES}/${SPLASH_THEME}/splash-font.gz \
39     -f ${SPLASH_FIFO} \
40     ${SPLASH_OPTS} &
41    
42     splash_control "write:${SPLASH_SHUTDOWN_MESSAGE}"
43     fi
44    
45     if [[ $runlevel = reboot ]]
46     then
47     fbsplash -i ${SPLASH_THEMES}/${SPLASH_THEME}/${resolution}.conf \
48     -s ${SPLASH_THEMES}/${SPLASH_THEME}/reboot-${resolution}.ppm.gz \
49     -m ${SPLASH_THEMES}/${SPLASH_THEME}/splash-font.gz \
50     -f ${SPLASH_FIFO} \
51     ${SPLASH_OPTS} &
52    
53     splash_control "write:${SPLASH_REBOOT_MESSAGE}"
54     fi
55     fi
56     }
57    
58     rc_exit()
59     {
60     if [[ ${SPLASH_MODE} = silent ]]
61     then
62     splash_control "exit"
63     splash_cursor enable
64     chvt 1
65     fi
66     }
67    
68     splash_resolution()
69     {
70     fbres
71     }
72    
73     splash_control()
74     {
75     # only write to fifo if the fbsplash process is runnning
76     # or the console will hang
77     if [[ -n $(pidof fbsplash) ]]
78     then
79     echo "$@" > ${SPLASH_FIFO}
80     fi
81     }
82    
83     # disable|enable
84     splash_cursor()
85     {
86     case $1 in
87     enable) echo -e "\e[?0c";;
88     disable) echo -e "\e[?1c" ;;
89     esac
90     }