head	1.6;
access;
symbols
	RELENG_6_4_0_RELEASE:1.5.12.1
	RELENG_6_4:1.5.0.12
	RELENG_6_4_BP:1.5
	RELENG_6_3_0_RELEASE:1.5
	RELENG_6_3:1.5.0.10
	RELENG_6_3_BP:1.5
	RELENG_6_2_0_RELEASE:1.5
	RELENG_6_2:1.5.0.8
	RELENG_6_2_BP:1.5
	RELENG_5_5_0_RELEASE:1.4.2.1
	RELENG_5_5:1.4.2.1.0.6
	RELENG_5_5_BP:1.4.2.1
	RELENG_6_1_0_RELEASE:1.5
	RELENG_6_1:1.5.0.6
	RELENG_6_1_BP:1.5
	RELENG_6_0_0_RELEASE:1.5
	RELENG_6_0:1.5.0.4
	RELENG_6_0_BP:1.5
	RELENG_6:1.5.0.2
	RELENG_6_BP:1.5
	RELENG_5_4_0_RELEASE:1.4.2.1
	RELENG_5_4:1.4.2.1.0.4
	RELENG_5_4_BP:1.4.2.1
	RELENG_5_3_0_RELEASE:1.4.2.1
	RELENG_5_3:1.4.2.1.0.2
	RELENG_5_3_BP:1.4.2.1
	RELENG_5:1.4.0.2
	RELENG_5_BP:1.4
	RELENG_5_2_1_RELEASE:1.3
	RELENG_5_2_0_RELEASE:1.3
	RELENG_5_2:1.3.0.6
	RELENG_5_2_BP:1.3
	RELENG_5_1_0_RELEASE:1.3
	RELENG_5_1:1.3.0.4
	RELENG_5_1_BP:1.3
	RELENG_5_0_0_RELEASE:1.3
	RELENG_5_0:1.3.0.2
	RELENG_5_0_BP:1.3;
locks; strict;
comment	@# @;


1.6
date	2006.05.17.09.33.06;	author phk;	state dead;
branches;
next	1.5;

1.5
date	2004.10.07.13.55.26;	author mtm;	state Exp;
branches
	1.5.2.1
	1.5.12.1;
next	1.4;

1.4
date	2004.03.08.12.25.05;	author pjd;	state Exp;
branches
	1.4.2.1;
next	1.3;

1.3
date	2002.10.12.10.31.31;	author schweikh;	state Exp;
branches;
next	1.2;

1.2
date	2002.09.05.23.50.34;	author fenner;	state Exp;
branches;
next	1.1;

1.1
date	2002.08.30.12.43.23;	author hm;	state Exp;
branches;
next	;

1.5.2.1
date	2012.11.17.07.39.08;	author svnexp;	state Exp;
branches;
next	;

1.5.12.1
date	2008.10.02.02.57.24;	author kensmith;	state Exp;
branches;
next	;

1.4.2.1
date	2004.10.10.09.50.54;	author mtm;	state Exp;
branches;
next	;


desc
@@


1.6
log
@Send the pcvt(4) driver off to retirement.
@
text
@#!/bin/sh -
#
# Copyright (c) 2002  The FreeBSD Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $FreeBSD: src/etc/rc.d/pcvt,v 1.5 2004/10/07 13:55:26 mtm Exp $
#

# PROVIDE: pcvt
# REQUIRE: LOGIN
# KEYWORD: nojail

. /etc/rc.subr

name="pcvt"
start_precmd="pcvt_precmd"
start_cmd="pcvt_start"

pcvt_precmd()
{
	if [ -x /usr/sbin/ispcvt ]; then
		/usr/sbin/ispcvt -d /dev/ttyv0 && return 0
	fi
	return 1
}

pcvt_echo()
{
	if checkyesno pcvt_verbose; then
		echo $1 "$2"
	fi
}

pcvt_start()
{
	# path for pcvt's EGA/VGA download fonts
	FONTP=/usr/share/misc/pcvtfonts

	if checkyesno pcvt_verbose; then
		echo "Configuring pcvt console driver:"
	else
		echo "-n" "Configuring pcvt"
	fi

	# video adapter type

	adapter=`/usr/sbin/scon -d /dev/ttyv0 -a`

	pcvt_echo "-n" "  video adapter type is $adapter, "

	# monitor type (mono/color)

	monitor=`/usr/sbin/scon -d /dev/ttyv0 -m`

	pcvt_echo "" "monitor type is $monitor"

	# load fonts into VGA

	if [ $adapter = VGA ]; then
		pcvt_echo "-n" "  loading fonts: 8x16:0,"
		loadfont -d /dev/ttyv0 -c0 -f $FONTP/vt220l.816

		pcvt_echo "-n" "1 "
		loadfont -d /dev/ttyv0 -c1 -f $FONTP/vt220h.816

		pcvt_echo "-n" " 8x14:0,"
		loadfont -d /dev/ttyv0 -c2 -f $FONTP/vt220l.814

		pcvt_echo "-n" "1 "
		loadfont -d /dev/ttyv0 -c3 -f $FONTP/vt220h.814

		pcvt_echo "-n" " 8x10:0,"
		loadfont -d /dev/ttyv0 -c4 -f $FONTP/vt220l.810

		pcvt_echo "-n" "1 "
		loadfont -d /dev/ttyv0 -c5 -f $FONTP/vt220h.810

		pcvt_echo "-n" " 8x8:0,"
		loadfont -d /dev/ttyv0 -c6 -f $FONTP/vt220l.808

		pcvt_echo "" "1 "
		loadfont -d /dev/ttyv0 -c7 -f $FONTP/vt220h.808

	# setting screen sizes

		case ${pcvt_lines} in
		28)
			size=-s28
			pcvt_echo "" "  switching to 28 lines"
			;;
		40)
			size=-s40
			pcvt_echo "" "  switching to 40 lines"
			;;
		50)
			size=-s50
			pcvt_echo "" "  switching to 50 lines"
			;;
		*)
			size=-s25
			pcvt_echo "" "  switching to 25 lines"
			;;
		esac
	fi

	# use HP extensions to VT220 or plain VT220 ?

	if checkyesno pcvt_hpext; then
		emulation=-H
		pcvt_echo "" "  setting emulation to VT220 with HP extensions"
	else
		emulation=-V
		pcvt_echo "" "  setting emulation to VT220"
	fi

	# for all screens do

	for device in /dev/ttyv*
	do
		# set emulation

		/usr/sbin/scon -d$device $size $emulation >/dev/null 2>&1
		if [ $? != 0 ]; then
			break 1
		fi

		# set cursor shape

		case ${pcvt_cursorh} in
		[Nn][Oo] | '')
			;;
		*)
			case ${pcvt_cursorl} in
			[Nn][Oo] | '')
				;;
			*)
				/usr/sbin/cursor -d$device -s$pcvt_cursorh -e$pcvt_cursorl
				;;
			esac
			;;
		esac

		# on monochrome monitor, set color palette to use a higher intensity

		if checkyesno pcvt_monohigh && \
			[ $monitor = MONO -a $adapter = VGA ]
		then
			/usr/sbin/scon -d$device -p8,60,60,60
		fi
	done

	# switch to screen 0

	pcvt_echo "" "  switching to screen 0"

	/usr/sbin/scon -d /dev/ttyv0

	# screensaver timeout

	case ${pcvt_blanktime} in
	[Nn][Oo] | '')
		;;
	*)
		pcvt_echo "" "  setting screensaver timeout to $pcvt_blanktime seconds"
		/usr/sbin/scon -d /dev/ttyv0 -t$pcvt_blanktime
		;;
	esac

	# national keyboard layout

	case ${pcvt_keymap} in
	[Nn][Oo] | '')
		;;
	*)
		pcvt_echo "" "  switching national keyboard layout to $pcvt_keymap"
		/usr/sbin/kcon -m $pcvt_keymap
		;;
	esac

	# keyboard repeat delay value

	case ${pcvt_keydel} in
	[Nn][Oo] | '')
		;;
	*)
		pcvt_echo "" "  setting keyboard delay to $pcvt_keydel"
		/usr/sbin/kcon -d$pcvt_keydel
		;;
	esac

	# keyboard repeat rate value

	case ${pcvt_keyrate} in
	[Nn][Oo] | '')
		;;
	*)
		pcvt_echo "" "  setting keyboard repeat rate to $pcvt_keyrate"
		/usr/sbin/kcon -r$pcvt_keyrate
		;;
	esac

	# done

	if checkyesno pcvt_verbose; then
		echo "Finished configuring pcvt console driver."
	else
		echo "."
	fi
}

load_rc_config $name
run_rc_command "$1"
@


1.5
log
@Remove the requirement for the FreeBSD keyword as it no longer
makes any sense.

Discussed with: dougb, brooks
MFC after: 3 days
@
text
@d27 1
a27 1
# $FreeBSD$
@


1.5.2.1
log
@Switch importer
@
text
@d27 1
a27 1
# $FreeBSD: stable/6/etc/rc.d/pcvt 136224 2004-10-07 13:55:26Z mtm $
@


1.5.12.1
log
@SVN rev 183531 on 2008-10-02 02:57:24Z by kensmith

Create releng/6.4 from stable/6 in preparation for 6.4-RC1.

Approved by:	re (implicit)
@
text
@@


1.4
log
@Mark scripts as not usable inside a jail by adding keyword 'nojail'.

Some suggestions from:	rwatson, Ruben de Groot <mail25@@bzerk.org>
@
text
@d32 1
a32 1
# KEYWORD: FreeBSD nojail
@


1.4.2.1
log
@RCS file: /home/ncvs/src/etc/rc,v
----------------------------
revision 1.335
date: 2004/10/08 14:23:49;  author: mtm;  state: Exp;  lines: +0 -1
Remove an unused variable.

Submitted by: Pawel Worach <pawel.worach@@telia.com>
----------------------------
revision 1.334
date: 2004/10/07 13:55:25;  author: mtm;  state: Exp;  lines: +1 -1
Remove the requirement for the FreeBSD keyword as it no longer
makes any sense.

Discussed with: dougb, brooks
MFC after: 3 days
=============================================================================
RCS file: /home/ncvs/src/etc/rc.d/nsswitch,v
----------------------------
revision 1.4
date: 2004/09/16 17:03:12;  author: keramida;  state: Exp;  lines: +1 -1
Fix requirement of `network' to `NETWORK' because the former isn't
provided by any rc.d script.

Approved by:	mtm
=============================================================================
RCS file: /home/ncvs/src/etc/rc.d/pflog,v
----------------------------
revision 1.3
date: 2004/09/16 17:04:20;  author: keramida;  state: Exp;  lines: +1 -1
We don't have any providers of `beforenetlkm' in FreeBSD.  Remove the
dependency to it from our rc.d scripts.

Approved by:	mtm
=============================================================================

Approved by: re/scottl
@
text
@d32 1
a32 1
# KEYWORD: nojail
@


1.3
log
@Fix style bugs:
* Space -> tabs conversion.
* Removed blanks before semicolon in "if ... ; then".
* Proper indentation of misindented lines.
* Put a full stop after some comments.
* Removed whitespace at end of line.

Approved by:	silence from gordon
@
text
@d32 1
a32 1
# KEYWORD: FreeBSD
@


1.2
log
@Only try to run /usr/sbin/ispcvt if it exists and is executable.
@
text
@d66 1
a66 1
	# video adapter type 
d80 1
a80 1
	if [ $adapter = VGA ] ; then
d144 1
a144 1
		if [ $? != 0 ] ; then
a162 1
		
@


1.1
log
@integrate pcvt configuration into the new /etc/rc.d startup system

PR:           i386/7100
Reviewed by:  Gordon Tetlow <gordon@@FreeBSD.org>
@
text
@d37 1
a37 1
start_precmd="/usr/sbin/ispcvt -d /dev/ttyv0"
d39 8
@

