Prevent umounting of theme directories.
[fbsplash.git] / gentoo / init-fbcondecor
blob400b249e2d5b25acc2a445eebca9621765f90ed5
1 #!/sbin/runscript
2 # Copyright 1999-2007 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
5 depend() {
6         before xdm
7         use localmount
10 start() {
11         . /sbin/splash-functions.sh
12         splash_setup
14         if [ -z "${FBCONDECOR_TTYS}" ]; then
15                 if [ -n "${RC_TTY_NUMBER}" ]; then
16                         FBCONDECOR_TTYS=$(seq 1 "${RC_TTY_NUMBER}")
17                 else
18                         FBCONDECOR_TTYS="1 2 3 4 5 6"
19                 fi
20         fi
22         local err=0
24         # Only do this if the kernel supports fbcondecor.
25         if fbcondecor_supported && [ "${SPLASH_MODE_REQ}" != "off" ]; then
26                 ebegin "Setting framebuffer console images"
28                 for TTY in ${FBCONDECOR_TTYS} ; do
29                         theme="${SPLASH_THEME}"
31                         [ ${TTY} = "1" -a -z "$(/usr/sbin/fbcondecor_ctl -c getstate --tty=${TTY}| grep 'off')" ] && continue
32                         [ ${TTY} = "0" ] && continue
34                         if [ -n "${FBCONDECOR_TTY_MAP}" ]; then
35                                 for i in ${FBCONDECOR_TTY_MAP} ; do
36                                         if [ "${i%:*}" = "${TTY}" ]; then
37                                                 theme="${i#*:}"
38                                         fi
39                                 done
40                         fi
42                         if [ -x /usr/bin/openvt ]; then
43                                 /usr/bin/openvt -c "${TTY}" -- printf "" 2>/dev/null
44                         fi
46                         if ! fbcondecor_set_theme "${theme}" "${TTY}"; then
47                                 err=1
48                                 eerror "Failed to set background image on tty${TTY}"
49                                 if [ -z "${FBCONDECOR_TTY_MAP}" ]; then
50                                         break
51                                 fi
52                         fi
53                 done
54                 eend "${err}"
55         fi