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 ;; |
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 |
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 |
|
|
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 |
|
|
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 |
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 |
|
|
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 |
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 |
|
|