From sheldonh@axl.training.iafrica.com  Thu Aug 20 10:56:46 1998
Received: from axl.training.iafrica.com (axl.training.iafrica.com [196.31.1.175])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA22800
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 20 Aug 1998 10:56:38 -0700 (PDT)
          (envelope-from sheldonh@axl.training.iafrica.com)
Received: from sheldonh by axl.training.iafrica.com with local (Exim 1.92 #1)
	for FreeBSD-gnats-submit@freebsd.org
	id 0z9YwF-0001sg-00; Thu, 20 Aug 1998 19:55:55 +0200
Message-Id: <E0z9YwF-0001sg-00@axl.training.iafrica.com>
Date: Thu, 20 Aug 1998 19:55:55 +0200
From: axl@iafrica.com
Sender: Sheldon Hearn <sheldonh@axl.training.iafrica.com>
Reply-To: axl@iafrica.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: rc.i386 only enables mouse support for ttyv0
X-Send-Pr-Version: 3.2

>Number:         7695
>Category:       i386
>Synopsis:       [PATCH] rc.i386 only enables mouse support for ttyv0
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 20 11:00:02 PDT 1998
>Closed-Date:    Fri Oct 23 03:10:36 PDT 1998
>Last-Modified:  Fri Oct 23 03:10:44 PDT 1998
>Originator:     Sheldon Hearn
>Release:        FreeBSD 2.2.7-STABLE i386
>Organization:
UUNET Internet Africa
>Environment:

	Any -STABLE i386 machine with moused enabled in rc.conf

>Description:

	When moused is enabled in rc.conf, rc.i386 uses vidcontrol
	to enable mouse support on console. Unfortunately, this
	operation is only performed for ttyv0. 

	There is no reason for leaving mouse support disabled for
	other virtual terminals when said terminals are offering
	a console login.

	It would make sense to enable mouse support on all virtual
	terminals for which getty is offering a console login.

>How-To-Repeat:

	N/A

>Fix:
	
	The following patch teaches rc.i386 to enable mouse support
	on any virtual terminal where getty is offering console
	login.

--- src/etc/etc.i386/rc.i386.ORIG	Thu Aug 20 19:26:28 1998
+++ src/etc/etc.i386/rc.i386	Thu Aug 20 19:26:44 1998
@@ -102,7 +102,9 @@
 if [ "X${moused_enable}" = X"YES" ] ; then
 	echo -n ' moused'
 	moused ${moused_flags} -p ${moused_port} -t ${moused_type}
-	vidcontrol <${viddev} -m on
+        for i in `grep "^ttyv.* getty Pc.*\bon\b" /etc/ttys|cut -f 1` ; do
+                vidcontrol </dev/$i -m on
+        done
 fi
 echo '.'
 
>Release-Note:
>Audit-Trail:

From: Sheldon Hearn <axl@iafrica.com>
To: freebsd-gnats-submit@freebsd.org
Cc:  Subject: Re: i386/7695: rc.i386 only enables mouse support for ttyv0
Date: Fri, 21 Aug 1998 12:24:38 +0200

 What a pity. The patch is buggered by an unwanted space in the regular
 expression. Please ignore previous patch and apply this one instead.
 
 --- src/etc/etc.i386/rc.i386.ORIG	Thu Aug 20 19:26:28 1998
 +++ src/etc/etc.i386/rc.i386	Thu Aug 20 19:26:44 1998
 @@ -102,7 +102,9 @@
  if [ "X${moused_enable}" = X"YES" ] ; then
  	echo -n ' moused'
  	moused ${moused_flags} -p ${moused_port} -t ${moused_type}
 -	vidcontrol <${viddev} -m on
 +        for i in `grep "^ttyv.*getty Pc.*\bon\b" /etc/ttys|cut -f 1` ; do
 +                vidcontrol </dev/$i -m on
 +        done
  fi
  echo '.'
  

From: axl@iafrica.com
To: freebsd-gnats-submit@freebsd.org, axl@iafrica.com
Cc:  Subject: Re: i386/7695: rc.i386 only enables mouse support for ttyv0
Date: Fri, 25 Sep 1998 14:09:10 +0200

 > +        for i in `grep "^ttyv.*getty Pc.*\bon\b" /etc/ttys|cut -f 1` ; do
 > +                vidcontrol </dev/$i -m on
 > +        done
 
 The following patch is functionally the same, but is more efficient in
 that it uses sed instead of grep&cut.
 
 Sheldon.
 
 Index: rc.i386
 ===================================================================
 RCS file: /home/ncvs/src/etc/etc.i386/rc.i386,v
 retrieving revision 1.18.2.10
 diff -u -d -r1.18.2.10 rc.i386
 --- rc.i386	1998/03/07 09:06:19	1.18.2.10
 +++ rc.i386	1998/09/25 12:05:26
 @@ -102,7 +102,9 @@
  if [ "X${moused_enable}" = X"YES" ] ; then
  	echo -n ' moused'
  	moused ${moused_flags} -p ${moused_port} -t ${moused_type}
 -	vidcontrol <${viddev} -m on
 +	for i in `sed -ne 's/^\(ttyv[0-9ab]\).*getty[\t ]*Pc[^\t ]*[\t ]*on[\t ]*.*$/\1/p' < /etc/ttys ` ; do
 +		vidcontrol -m on </dev/$i
 +	done
  fi
  echo '.'
  

From: Sheldon Hearn <axl@iafrica.com>
To: freebsd-gnats-submit@freebsd.org
Cc:  Subject: Re: i386/7695: rc.i386 only enables mouse support for ttyv0
Date: Tue, 29 Sep 1998 11:32:51 +0200

 Having done a little more research, I now know that -CURRENT already has
 a knob in rc.conf and some magic in rc.i386 to do vidcontrol stuff to
 all virtual terminals.
 
 The appropriate code has had 8 months to mature in -CURRENT, I think
 it's ready for an MFC. :-)
 
 I've tested the patches that were to the -CURRENT branch, and they apply
 perfectly to the -STABLE sources now. I've tested them on my 2.2-STABLE
 box with no ill effects.
 
 The diffs are attached below, for your convenience.
 
 Ciao,
 Sheldon.
 
 Index: rc.conf
 ===================================================================
 RCS file: /home/ncvs/src/etc/rc.conf,v
 retrieving revision 1.41
 retrieving revision 1.43
 diff -u -d -r1.41 -r1.43
 --- rc.conf	1998/03/09 08:50:27	1.41
 +++ rc.conf	1998/04/02 15:33:36	1.43
 @@ -124,6 +124,7 @@
  moused_type="auto"	# See man page for rc.conf(5) for available settings.
  moused_port="/dev/cuaa0" # Set to your mouse port.
  moused_flags=""		# Any additional flags to moused.
 +allscreens_flags=""	# Set this vidcontrol mode for all virtual screens
  
  
  ##############################################################
 Index: etc.i386/rc.i386
 ===================================================================
 RCS file: /home/ncvs/src/etc/etc.i386/rc.i386,v
 retrieving revision 1.32
 retrieving revision 1.34
 diff -u -d -r1.32 -r1.34
 --- rc.i386	1998/03/07 09:02:08	1.32
 +++ rc.i386	1998/04/02 15:33:49	1.34
 @@ -103,6 +103,15 @@
  	echo -n ' moused'
  	moused ${moused_flags} -p ${moused_port} -t ${moused_type}
  	vidcontrol <${viddev} -m on
 +fi
 +
 +# set this mode for all virtual screens
 +if [ "X${allscreens_flags}" != X"" ] ; then
 +	echo -n ' allscreens'
 +	for ttyv in /dev/ttyv*
 +	do
 +		vidcontrol <$ttyv ${allscreens_flags}
 +	done
  fi
  echo '.'
  
State-Changed-From-To: open->closed 
State-Changed-By: jkh 
State-Changed-When: Fri Oct 23 03:10:36 PDT 1998 
State-Changed-Why:  
fixed 
>Unformatted:
