sbin/*hammer: Use typedef'd for struct zone_stat*
[dragonfly.git] / etc / rc.d / syscons
blob3d58eb3b3b48714eaab71d41542c2f2aabe3e898
1 #!/bin/sh -
3 # Copyright (c) 2000 The FreeBSD Project
4 # All rights reserved.
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
8 # are met:
9 # 1. Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 # 2. Redistributions in binary form must reproduce the above copyright
12 # notice, this list of conditions and the following disclaimer in the
13 # documentation and/or other materials provided with the distribution.
15 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 # SUCH DAMAGE.
27 # $FreeBSD: src/etc/rc.d/syscons,v 1.9 2002/09/09 22:40:34 gordon Exp $
30 # PROVIDE: syscons
31 # REQUIRE: LOGIN
33 . /etc/rc.subr
35 name="syscons"
36 start_cmd="syscons_start"
38 # stdin must be redirected because it might be for a serial console
40 kbddev=/dev/ttyv0
41 viddev=/dev/ttyv0
43 syscons_start()
45 echo -n 'Configuring syscons:'
47 # keymap
49 case ${keymap} in
50 [Nn][Oo] | '')
53 echo -n ' keymap'; kbdcontrol < ${kbddev} -l ${keymap}
55 esac
57 # keyrate
59 case ${keyrate} in
60 [Nn][Oo] | '')
63 echo -n ' keyrate'; kbdcontrol < ${kbddev} -r ${keyrate}
65 esac
67 # keybell
69 case ${keybell} in
70 [Nn][Oo] | '')
73 echo -n ' keybell'; kbdcontrol < ${kbddev} -b ${keybell}
75 esac
77 # change function keys
79 case ${keychange} in
80 [Nn][Oo] | '')
83 echo -n ' keychange'
84 set - ${keychange}
85 while [ $# -gt 0 ]; do
86 kbdcontrol <${kbddev} -f "$1" "$2"
87 shift; shift
88 done
90 esac
92 # cursor type
94 case ${cursor} in
95 [Nn][Oo] | '')
98 echo -n ' cursor'; vidcontrol < ${viddev} -c ${cursor}
100 esac
102 # screen mapping
104 case ${scrnmap} in
105 [Nn][Oo] | '')
108 echo -n ' scrnmap'; vidcontrol < ${viddev} -l ${scrnmap}
110 esac
112 # font 8x16
114 case ${font8x16} in
115 [Nn][Oo] | '')
118 echo -n ' font8x16'; vidcontrol < ${viddev} -f 8x16 ${font8x16}
120 esac
122 # font 8x14
124 case ${font8x14} in
125 [Nn][Oo] | '')
128 echo -n ' font8x14'; vidcontrol < ${viddev} -f 8x14 ${font8x14}
130 esac
132 # font 8x8
134 case ${font8x8} in
135 [Nn][Oo] | '')
138 echo -n ' font8x8'; vidcontrol < ${viddev} -f 8x8 ${font8x8}
140 esac
142 # blank time
144 case ${blanktime} in
145 [Nn][Oo] | '')
148 echo -n ' blanktime'; vidcontrol < ${viddev} -t ${blanktime}
150 esac
152 # screen saver
154 case ${saver} in
155 [Nn][Oo] | '')
158 echo -n ' screensaver'
159 for i in `kldstat | awk '$5 ~ "^splash_.*$" { print $5 }'`; do
160 kldunload ${i}
161 done
162 kldstat -m ${saver}_saver || kldload -n ${saver}_saver
164 esac
166 # video history buffer
168 case ${vidhistory} in
169 [Nn][Oo] | '')
172 echo -n ' vidhistory'; vidcontrol < ${viddev} -h ${vidhistory}
174 esac
176 # set this mode for all virtual screens
178 if [ -n "${allscreens_flags}" ]; then
179 echo -n ' allscreens'
180 for ttyv in /dev/ttyv*; do
181 vidcontrol ${allscreens_flags} < ${ttyv} > ${ttyv} 2>&1
182 done
185 # set this keyboard mode for all virtual terminals
187 if [ -n "${allscreens_kbdflags}" ]; then
188 echo -n ' allscreens_kbd'
189 for ttyv in /dev/ttyv*; do
190 kbdcontrol ${allscreens_kbdflags} < ${ttyv} > ${ttyv} 2>&1
191 done
194 echo '.'
197 load_rc_config $name
198 run_rc_command "$1"