3 # Copyright (c) 2002 The FreeBSD Project
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
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
27 # $FreeBSD: src/etc/rc.d/pcvt,v 1.3 2002/10/12 10:31:31 schweikh Exp $
28 # $DragonFly: src/etc/rc.d/Attic/pcvt,v 1.2 2004/01/27 00:42:45 rob Exp $
38 start_precmd="pcvt_precmd"
39 start_cmd="pcvt_start"
43 if [ -x /usr/sbin/ispcvt ]; then
44 /usr/sbin/ispcvt -d /dev/ttyv0 && return 0
51 if checkyesno pcvt_verbose; then
58 # path for pcvt's EGA/VGA download fonts
59 FONTP=/usr/share/misc/pcvtfonts
61 if checkyesno pcvt_verbose; then
62 echo "Configuring pcvt console driver:"
64 echo "-n" "Configuring pcvt"
69 adapter=`/usr/sbin/scon -d /dev/ttyv0 -a`
71 pcvt_echo "-n" " video adapter type is $adapter, "
73 # monitor type (mono/color)
75 monitor=`/usr/sbin/scon -d /dev/ttyv0 -m`
77 pcvt_echo "" "monitor type is $monitor"
81 if [ $adapter = VGA ]; then
82 pcvt_echo "-n" " loading fonts: 8x16:0,"
83 loadfont -d /dev/ttyv0 -c0 -f $FONTP/vt220l.816
86 loadfont -d /dev/ttyv0 -c1 -f $FONTP/vt220h.816
88 pcvt_echo "-n" " 8x14:0,"
89 loadfont -d /dev/ttyv0 -c2 -f $FONTP/vt220l.814
92 loadfont -d /dev/ttyv0 -c3 -f $FONTP/vt220h.814
94 pcvt_echo "-n" " 8x10:0,"
95 loadfont -d /dev/ttyv0 -c4 -f $FONTP/vt220l.810
98 loadfont -d /dev/ttyv0 -c5 -f $FONTP/vt220h.810
100 pcvt_echo "-n" " 8x8:0,"
101 loadfont -d /dev/ttyv0 -c6 -f $FONTP/vt220l.808
104 loadfont -d /dev/ttyv0 -c7 -f $FONTP/vt220h.808
106 # setting screen sizes
108 case ${pcvt_lines} in
111 pcvt_echo "" " switching to 28 lines"
115 pcvt_echo "" " switching to 40 lines"
119 pcvt_echo "" " switching to 50 lines"
123 pcvt_echo "" " switching to 25 lines"
128 # use HP extensions to VT220 or plain VT220 ?
130 if checkyesno pcvt_hpext; then
132 pcvt_echo "" " setting emulation to VT220 with HP extensions"
135 pcvt_echo "" " setting emulation to VT220"
140 for device in /dev/ttyv*
144 /usr/sbin/scon -d$device $size $emulation >/dev/null 2>&1
151 case ${pcvt_cursorh} in
155 case ${pcvt_cursorl} in
159 /usr/sbin/cursor -d$device -s$pcvt_cursorh -e$pcvt_cursorl
165 # on monochrome monitor, set color palette to use a higher intensity
167 if checkyesno pcvt_monohigh && \
168 [ $monitor = MONO -a $adapter = VGA ]
170 /usr/sbin/scon -d$device -p8,60,60,60
176 pcvt_echo "" " switching to screen 0"
178 /usr/sbin/scon -d /dev/ttyv0
180 # screensaver timeout
182 case ${pcvt_blanktime} in
186 pcvt_echo "" " setting screensaver timeout to $pcvt_blanktime seconds"
187 /usr/sbin/scon -d /dev/ttyv0 -t$pcvt_blanktime
191 # national keyboard layout
193 case ${pcvt_keymap} in
197 pcvt_echo "" " switching national keyboard layout to $pcvt_keymap"
198 /usr/sbin/kcon -m $pcvt_keymap
202 # keyboard repeat delay value
204 case ${pcvt_keydel} in
208 pcvt_echo "" " setting keyboard delay to $pcvt_keydel"
209 /usr/sbin/kcon -d$pcvt_keydel
213 # keyboard repeat rate value
215 case ${pcvt_keyrate} in
219 pcvt_echo "" " setting keyboard repeat rate to $pcvt_keyrate"
220 /usr/sbin/kcon -r$pcvt_keyrate
226 if checkyesno pcvt_verbose; then
227 echo "Finished configuring pcvt console driver."