Contents of /trunk/splashutils-magellan/init-splash
Parent Directory | Revision Log
Revision 8 -
(show annotations)
(download)
Fri Mar 4 18:32:33 2005 UTC (19 years, 6 months ago) by niro
File size: 2224 byte(s)
Fri Mar 4 18:32:33 2005 UTC (19 years, 6 months ago) by niro
File size: 2224 byte(s)
updated to gentoo ver-0.1.4
1 | #!/bin/bash |
2 | # $Header: /root/magellan-cvs/src/splashutils-magellan/init-splash,v 1.3 2005-03-04 18:32:33 niro Exp $ |
3 | |
4 | #%rlevels: 1:s 2:s 3:s 4:s 5:s |
5 | #%start: 99 |
6 | #%stop: |
7 | |
8 | #deps |
9 | #%needs: |
10 | #%before: |
11 | #%after: |
12 | |
13 | source /etc/sysconfig/rc |
14 | source $rc_functions |
15 | source /etc/conf.d/splash |
16 | |
17 | # default settings |
18 | test -z "${SPLASH_THEME}" && SPLASH_THEME="default" |
19 | if [ -z "${SPLASH_TTYS}" ]; then |
20 | if [ -n "${RC_TTY_NUMBER}" ]; then |
21 | SPLASH_TTYS=$(seq 0 "${RC_TTY_NUMBER}") |
22 | else |
23 | SPLASH_TTYS="0 1 2 3 4 5 6" |
24 | fi |
25 | fi |
26 | |
27 | # dummy function to handle sourcing of fbconfig file |
28 | box () { return; } |
29 | |
30 | parse_cmdline () |
31 | { |
32 | line=`egrep -o 'splash=[^ ]+' /proc/cmdline` |
33 | line="${line#splash=}" |
34 | t="${IFS}" |
35 | IFS="," |
36 | |
37 | for param in ${line} |
38 | do |
39 | if [ "${param%:*}" = "theme" ]; then |
40 | SPLASH_THEME="${param#*:}" |
41 | else |
42 | SPLASH_MODE="${param}" |
43 | fi |
44 | done |
45 | |
46 | IFS="${t}" |
47 | } |
48 | |
49 | case "$1" in |
50 | start) |
51 | # only do this if the kernel supports fbsplash |
52 | if [ -e /dev/fbsplash ] && [ -e /proc/fbsplash ] |
53 | then |
54 | echo -e ${COLOREDSTAR}"Setting framebuffer console images" |
55 | parse_cmdline |
56 | |
57 | for TTY in ${SPLASH_TTYS} |
58 | do |
59 | theme="${SPLASH_THEME}" |
60 | |
61 | if [ "${TTY}" -eq 0 -a -z "$(splash_util -c getstate --vc=0 | grep off)" ] |
62 | then |
63 | continue |
64 | fi |
65 | |
66 | if [ -n "${SPLASH_TTY_MAP}" ] |
67 | then |
68 | for i in ${SPLASH_TTY_MAP} |
69 | do |
70 | if [ "${i%:*}" = "${TTY}" ] |
71 | then |
72 | theme="${i#*:}" |
73 | fi |
74 | done |
75 | fi |
76 | |
77 | /sbin/splash_util --vc="${TTY}" -m v -t "${theme}" -c setcfg 2>/dev/null |
78 | /sbin/splash_util --vc="${TTY}" -m v -t "${theme}" -c setpic 2>/dev/null |
79 | /sbin/splash_util --vc="${TTY}" -c on 2>/dev/null |
80 | done |
81 | |
82 | evaluate_retval |
83 | fi |
84 | splash svc_started splash 0 |
85 | ;; |
86 | |
87 | stop) |
88 | if [ -e /dev/fbsplash ] && [ -e /proc/fbsplash ] |
89 | then |
90 | echo -e ${COLOREDSTAR}"Removing splash-screens ..." |
91 | for TTY in ${SPLASH_TTYS} |
92 | do |
93 | /sbin/splash_util --vc="${TTY}" --cmd=off |
94 | done |
95 | fi |
96 | |
97 | #to prevent the flow effect |
98 | source /etc/sysconfig/rc |
99 | source $rc_functions |
100 | |
101 | evaluate_retval |
102 | splash svc_stopped splash 0 |
103 | ;; |
104 | |
105 | restart) |
106 | $0 stop |
107 | sleep 1 |
108 | $0 start |
109 | ;; |
110 | |
111 | *) |
112 | echo "Usage: $0 {start|stop|restart}" |
113 | exit 1 |
114 | ;; |
115 | esac |
Properties
Name | Value |
---|---|
svn:executable | * |