From nobody@www.freebsd.org  Sun Jun 16 15:00:25 2002
Return-Path: <nobody@www.freebsd.org>
Received: from nwww.freebsd.org (www.FreeBSD.org [216.136.204.117])
	by hub.freebsd.org (Postfix) with ESMTP id 584E937B419
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 16 Jun 2002 15:00:22 -0700 (PDT)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by nwww.freebsd.org (8.12.2/8.12.2) with ESMTP id g5GM0MhG011347
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 16 Jun 2002 15:00:22 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.2/8.12.2/Submit) id g5GM0Mtv011346;
	Sun, 16 Jun 2002 15:00:22 -0700 (PDT)
Message-Id: <200206162200.g5GM0Mtv011346@www.freebsd.org>
Date: Sun, 16 Jun 2002 15:00:22 -0700 (PDT)
From: Dirk-Willem van Gulik <dirkx@covalent.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: /dev/vga is created by rc.devfs - even when there is no ttyv0/vga
X-Send-Pr-Version: www-1.0

>Number:         39381
>Category:       misc
>Synopsis:       /dev/vga is created by rc.devfs - even when there is no ttyv0/vga
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dougb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          wish
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jun 16 15:10:01 PDT 2002
>Closed-Date:    Tue Jun 18 00:36:38 PDT 2002
>Last-Modified:  Tue Jun 18 00:36:38 PDT 2002
>Originator:     Dirk-Willem van Gulik
>Release:        5-CURRENT
>Organization:
Foem
>Environment:
FreeBSD dubbeldrank.leiden.webweaving.org 5.0-CURRENT FreeBSD 5.0-CURRENT #7: Sun Jun 16 00:55:56 CEST 2002     dirkx@foem.leiden.webweaving.org:/usr/src/sys/i386/compile/SJOESJOE  i386
>Description:
At the end of rc.devfs:

	# Setup DEVFS, ie permissions, links etc.
	#
	ln -fs /dev/ttyv0 /dev/vga

regardless of the presense of a vga/ttyv.

>How-To-Repeat:
install according to diskless on a headless machine (e.g. net4501).
>Fix:
Add something along the lines of

	if [ -e /dev/ttyv0 ]; then
		ln -fs /dev/ttyv0 /dev/vga
	fi

>Release-Note:
>Audit-Trail:

From: Bruce Evans <bde@zeta.org.au>
To: Dirk-Willem van Gulik <dirkx@covalent.net>
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: misc/39381: /dev/vga is created by rc.devfs - even when there
 is no ttyv0/vga
Date: Mon, 17 Jun 2002 15:00:57 +1000 (EST)

 On Sun, 16 Jun 2002, Dirk-Willem van Gulik wrote:
 
 > >Description:
 > At the end of rc.devfs:
 >
 > 	# Setup DEVFS, ie permissions, links etc.
 > 	#
 > 	ln -fs /dev/ttyv0 /dev/vga
 >
 > regardless of the presense of a vga/ttyv.
 >
 > >How-To-Repeat:
 > install according to diskless on a headless machine (e.g. net4501).
 > >Fix:
 > Add something along the lines of
 >
 > 	if [ -e /dev/ttyv0 ]; then
 > 		ln -fs /dev/ttyv0 /dev/vga
 > 	fi
 
 This leaves about 10 bugs in the 2 (now 4) devfs-specific lines in
 this file:
 
 - rc files should not create anything unless configured to do so.  They
   especially shouldn't delete correct links unconditionally.  (The
   correct link is created by MAKEDEV; it is vga -> ttyv0, not vga ->
   /dev/ttyv0.)
 - /dev/vga is compatibilty cruft for a 1993ish version of X (but I think
   current X's still use it because of their own compatibility cruft).  It
   is an especially bad example to put in a file with only 1 example.
 - [... comments about style bugs deleted]
 
 Bruce
 

From: dirkx@covalent.net
To: bde@zeta.org.au
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: misc/39381: /dev/vga is created by rc.devfs - even when there
 is no ttyv0/vga
Date: Mon, 17 Jun 2002 09:16:00 +0200 (CEST)

 On Mon, 17 Jun 2002, Bruce Evans wrote:
 
 > > Add something along the lines of
 > >
 > > 	if [ -e /dev/ttyv0 ]; then
 > > 		ln -fs /dev/ttyv0 /dev/vga
 > > 	fi
 
 > This leaves about 10 bugs in the 2 (now 4) devfs-specific lines in
 > this file:
 
 I am confused. Today (i.e. in 5-CURRENT) it says:
 
 	# Setup DEVFS, ie permissions, links etc.
 	#
 	ln -fs /dev/ttyv0 /dev/vga
 
 > - rc files should not create anything unless configured to do so.  They
 >   especially shouldn't delete correct links unconditionally.  (The
 >   correct link is created by MAKEDEV; it is vga -> ttyv0, not vga ->
 >   /dev/ttyv0.)
 
 So you argue that the existing rc.devfs should not create the above at all
 but leave it to MAKEDEV ?
 
 > - /dev/vga is compatibilty cruft for a 1993ish version of X (but I think
 >   current X's still use it because of their own compatibility cruft).  It
 >   is an especially bad example to put in a file with only 1 example.
 > - [... comments about style bugs deleted]
 
 
 Or do you argue that the existing rc.devfs should be empty ?
 
 Dw.
 

From: Bruce Evans <bde@zeta.org.au>
To: dirkx@covalent.net
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: misc/39381: /dev/vga is created by rc.devfs - even when there
 is no ttyv0/vga
Date: Mon, 17 Jun 2002 17:55:25 +1000 (EST)

 On Mon, 17 Jun 2002 dirkx@covalent.net wrote:
 
 > On Mon, 17 Jun 2002, Bruce Evans wrote:
 > > This leaves about 10 bugs in the 2 (now 4) devfs-specific lines in
 > > this file:
 >
 > I am confused. Today (i.e. in 5-CURRENT) it says:
 >
 > 	# Setup DEVFS, ie permissions, links etc.
 > 	#
 > 	ln -fs /dev/ttyv0 /dev/vga
 >
 > > - rc files should not create anything unless configured to do so.  They
 > >   especially shouldn't delete correct links unconditionally.  (The
 > >   correct link is created by MAKEDEV; it is vga -> ttyv0, not vga ->
 > >   /dev/ttyv0.)
 >
 > So you argue that the existing rc.devfs should not create the above at all
 > but leave it to MAKEDEV ?
 
 MAKEDEV just provides a template for the correct devices.  (One reason
 I don't believe in devfs is that it doesn't even create devices with
 the same names and attributes after N years of development, starting
 with /dev itself not having the permissions specified in
 /etc/mtree/BSD.root.dist.)
 
 > > - /dev/vga is compatibilty cruft for a 1993ish version of X (but I think
 > >   current X's still use it because of their own compatibility cruft).  It
 > >   is an especially bad example to put in a file with only 1 example.
 > > - [... comments about style bugs deleted]
 >
 >
 > Or do you argue that the existing rc.devfs should be empty ?
 
 It should have commented out examples like most other rc files that don't
 have knobs in rc.conf, and it should have more than 1 example.  If /dev/vga
 is actually non-optional, then it should be created by the driver and not
 by rc.devfs.  Symlinks for devices should always be optional but this may
 be impractical for very old compatibility cruft like /dev/vga.
 
 Bruce
 
State-Changed-From-To: open->closed 
State-Changed-By: dougb 
State-Changed-When: Tue Jun 18 00:34:23 PDT 2002 
State-Changed-Why:  

I improved the vga example slightly, and committed some more 
examples, ala Bruce's suggestions. Still not perfect, 
but better. 


Responsible-Changed-From-To: freebsd-bugs->dougb 
Responsible-Changed-By: dougb 
Responsible-Changed-When: Tue Jun 18 00:34:23 PDT 2002 
Responsible-Changed-Why:  

I did the deed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=39381 
>Unformatted:
