From leres@fun.ee.lbl.gov  Tue Sep 19 01:31:49 2000
Return-Path: <leres@fun.ee.lbl.gov>
Received: from fun.ee.lbl.gov (fun.ee.lbl.gov [131.243.1.81])
	by hub.freebsd.org (Postfix) with ESMTP id ACF8237B423
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 19 Sep 2000 01:31:49 -0700 (PDT)
Received: (from leres@localhost)
	by fun.ee.lbl.gov (8.11.0/8.11.0) id e8J8Vn824409;
	Tue, 19 Sep 2000 01:31:49 -0700 (PDT)
Message-Id: <200009190831.e8J8Vn824409@fun.ee.lbl.gov>
Date: Tue, 19 Sep 2000 01:31:49 PDT
From: Craig Leres <leres@ee.lbl.gov>
Sender: leres@fun.ee.lbl.gov
To: FreeBSD-gnats-submit@freebsd.org
Cc: leres@ee.lbl.gov (Craig Leres)
Subject: [PATCH] MAKEDEV creates rocketport specials in /dev (instead of cwd)
X-Send-Pr-Version: 3.2

>Number:         21394
>Category:       bin
>Synopsis:       [PATCH] MAKEDEV creates rocketport specials in /dev (instead of cwd)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dd
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 19 01:40:01 PDT 2000
>Closed-Date:    Mon Jul 23 03:11:37 PDT 2001
>Last-Modified:  Mon Jul 23 03:11:45 PDT 2001
>Originator:     Craig Leres
>Release:        FreeBSD 4.1-RELEASE i386
>Organization:
Lawrence Berkeley National Laboratory
>Environment:
>Description:

The rocketport devices (ttyR and cuaR) are the only MAKEDEV targets
that don't create the specials in the current working directory.

(Also, it's kind of lame to read the number of rocketport ports
from dmesg. If the system has been up very long, the autoconf
messages are long gone; using /var/run/dmesg.boot would be slightly
better. But it would probably be best to just create N specials,
thus allowing one to configure a filesystem in advance.)

>How-To-Repeat:

    # cd /mnt/dev
    # ./MAKEDEV ttyR0 cuaR0

Then notice that the new specials end up in /dev, not /mnt/dev.
(Or especially how the specials that were in /dev now have default
permissions!)

>Fix:

Appended is a context diff to etc/MAKEDEV. It remove the /dev
prefixes. (My patch does not address the dmesg issue.)

===================================================================
RCS file: RCS/MAKEDEV,v
retrieving revision 1.1
diff -c -r1.1 MAKEDEV
*** MAKEDEV	2000/09/18 22:03:18	1.1
--- MAKEDEV	2000/09/18 22:03:51
***************
*** 1196,1202 ****
  			esac
  		done
  	)
! 	rm -f /dev/ttyR* /dev/ttyiR* /dev/ttylR*
  	for i in $controllers; do
  	   ndevices=$(
  		dmesg | while read first bar ports rest; do
--- 1196,1202 ----
  			esac
  		done
  	)
! 	rm -f ttyR* ttyiR* ttylR*
  	for i in $controllers; do
  	   ndevices=$(
  		dmesg | while read first bar ports rest; do
***************
*** 1210,1218 ****
  	   echo -n "Creating $ndevices devices for $i: "
  	   dev=0
  	   while [ $dev -lt $ndevices ]; do
! 		   mknod /dev/ttyR$Rnum c $major $MINOR
! 		   mknod /dev/ttyiR$Rnum c $major $(($MINOR + 32))
! 		   mknod /dev/ttylR$Rnum c $major $(($MINOR + 64))
  		   Rnum=$(($Rnum + 1))
  		   MINOR=$(($MINOR + 1))
  		   dev=$(($dev + 1))
--- 1210,1218 ----
  	   echo -n "Creating $ndevices devices for $i: "
  	   dev=0
  	   while [ $dev -lt $ndevices ]; do
! 		   mknod ttyR$Rnum c $major $MINOR
! 		   mknod ttyiR$Rnum c $major $(($MINOR + 32))
! 		   mknod ttylR$Rnum c $major $(($MINOR + 64))
  		   Rnum=$(($Rnum + 1))
  		   MINOR=$(($MINOR + 1))
  		   dev=$(($dev + 1))
***************
*** 1236,1242 ****
  			esac
  		done
  	)
! 	rm -f /dev/cuaR* /dev/cuaiR* /dev/cualR*
  	for i in $controllers; do
  	   ndevices=$(
  		dmesg | while read first bar ports rest; do
--- 1236,1242 ----
  			esac
  		done
  	)
! 	rm -f cuaR* cuaiR* cualR*
  	for i in $controllers; do
  	   ndevices=$(
  		dmesg | while read first bar ports rest; do
***************
*** 1250,1259 ****
  	   echo -n "Creating $ndevices devices for $i: "
  	   dev=0
  	   while [ $dev -lt $ndevices ]; do
! 		   mknod /dev/cuaR$Rnum c  $major $(($MINOR + 128)) uucp:dialer
! 		   mknod /dev/cuaiR$Rnum c $major $(($MINOR + 128 + 32)) \
  		       uucp:dialer
! 		   mknod /dev/cualR$Rnum c $major $(($MINOR + 128 + 64)) \
  		       uucp:dialer
  		   Rnum=$(($Rnum + 1))
  		   MINOR=$(($MINOR + 1))
--- 1250,1259 ----
  	   echo -n "Creating $ndevices devices for $i: "
  	   dev=0
  	   while [ $dev -lt $ndevices ]; do
! 		   mknod cuaR$Rnum c  $major $(($MINOR + 128)) uucp:dialer
! 		   mknod cuaiR$Rnum c $major $(($MINOR + 128 + 32)) \
  		       uucp:dialer
! 		   mknod cualR$Rnum c $major $(($MINOR + 128 + 64)) \
  		       uucp:dialer
  		   Rnum=$(($Rnum + 1))
  		   MINOR=$(($MINOR + 1))

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: dd 
State-Changed-When: Thu Jun 28 00:07:22 PDT 2001 
State-Changed-Why:  
Committed, thanks! 


Responsible-Changed-From-To: freebsd-bugs->dd 
Responsible-Changed-By: dd 
Responsible-Changed-When: Thu Jun 28 00:07:22 PDT 2001 
Responsible-Changed-Why:  
my MFC reminder. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=21394 
State-Changed-From-To: analyzed->closed 
State-Changed-By: dd 
State-Changed-When: Mon Jul 23 03:11:37 PDT 2001 
State-Changed-Why:  
MFC'd, thanks 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=21394 
>Unformatted:
