Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Sep 2000 01:31:49 PDT
From:      Craig Leres <leres@ee.lbl.gov>
To:        FreeBSD-gnats-submit@freebsd.org
Cc:        leres@ee.lbl.gov (Craig Leres)
Subject:   bin/21394: [PATCH] MAKEDEV creates rocketport specials in /dev (instead of cwd)
Message-ID:  <200009190831.e8J8Vn824409@fun.ee.lbl.gov>

next in thread | raw e-mail | index | archive | help

>Number:         21394
>Category:       bin
>Synopsis:       [PATCH] MAKEDEV creates rocketport specials in /dev (instead of cwd)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 19 01:40:01 PDT 2000
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200009190831.e8J8Vn824409>