From owner-freebsd-bugs Thu Jan 10 13: 6:46 2002 Delivered-To: freebsd-bugs@freebsd.org Received: from scaup.prod.itd.earthlink.net (scaup.mail.pas.earthlink.net [207.217.120.49]) by hub.freebsd.org (Postfix) with ESMTP id 9C6DF37B402 for ; Thu, 10 Jan 2002 13:05:50 -0800 (PST) Received: from dialup-209.244.106.239.dial1.sanjose1.level3.net ([209.244.106.239] helo=blossom.cjclark.org) by scaup.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16OmOS-0004Gf-00; Thu, 10 Jan 2002 13:05:49 -0800 Received: (from cjc@localhost) by blossom.cjclark.org (8.11.6/8.11.3) id g0AL5hI13375; Thu, 10 Jan 2002 13:05:43 -0800 (PST) (envelope-from cjc) Date: Thu, 10 Jan 2002 13:05:43 -0800 From: "Crist J . Clark" To: Bruce Evans Cc: freebsd-bugs@FreeBSD.ORG Subject: Re: conf/20436: Can't make only cd0 under 4.1-STABLE Message-ID: <20020110130543.A11553@blossom.cjclark.org> Reply-To: cjclark@alum.mit.edu References: <200201100900.g0A903H39165@freefall.freebsd.org> <20020110235151.U12236-100000@gamplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020110235151.U12236-100000@gamplex.bde.org>; from bde@zeta.org.au on Fri, Jan 11, 2002 at 12:07:56AM +1100 X-URL: http://people.freebsd.org/~cjc/ Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Fri, Jan 11, 2002 at 12:07:56AM +1100, Bruce Evans wrote: > On Thu, 10 Jan 2002, Crist J . Clark wrote: > > > So... This make everyone happy? > > > > Index: src/etc/MAKEDEV > > =================================================================== > > RCS file: /export/ncvs/src/etc/MAKEDEV,v > > retrieving revision 1.320 > > diff -u -r1.320 MAKEDEV > > --- src/etc/MAKEDEV 27 Dec 2001 22:41:35 -0000 1.320 > > +++ src/etc/MAKEDEV 10 Jan 2002 08:42:46 -0000 > > @@ -831,7 +831,7 @@ > > scd*) units=`expr $i : '...\(.*\)'`; name=scd; chr=45;; > > esac > > if [ -z "${units}" -o "${units}" -le 0 ]; then > > - units=1 > > + units=0 > > fi > > if [ "${units}" -le 31 ]; then > > i=0 > > No :). > > (1) "sh MAKEDEV cdN" still makes N units numbered 0 to N-1 instead of unit > N like one would expect. Actually, it makes devices 0 to N. > (2) The bug is also in acd*t*. Several other devices are made this way like the vty's. Then there are some really weird unit numbers, like the pty's. However, I could see going to only creating node 'N' since this is what the HDD devices (da, ad) and even wcd and matcd do. So if we are actually going to go an change this behavior, Index: src/etc/MAKEDEV =================================================================== RCS file: /export/ncvs/src/etc/MAKEDEV,v retrieving revision 1.320 diff -u -r1.320 MAKEDEV --- src/etc/MAKEDEV 27 Dec 2001 22:41:35 -0000 1.320 +++ src/etc/MAKEDEV 10 Jan 2002 21:02:38 -0000 @@ -792,32 +792,25 @@ acd*t*) umask $disk_umask - units=`expr $i : '...\(.*\)t'`; + unit=`expr $i : '...\(.*\)t'`; tracks=`expr $i : '.*t\(.*\)'`; name=acd; chr=117; - if [ -z "${units}" -o "${units}" -le 0 ]; then - units=1 - fi if [ -z "${tracks}" -o "${tracks}" -le 0 ]; then tracks=100 fi - if [ "${units}" -le 31 -a "${tracks}" -le 169 ]; then - i=0 - while [ $i -le $units ]; do - dname=$name$i - rm -rf ${dname}t* - j=1 - while [ $j -le ${tracks} ]; do - mknod ${dname}t$j c $chr \ - $((($i * 8) + (65536 * $j))) \ - root:operator - j=$(($j + 1)) - done - i=$(($i + 1)) + if [ "${unit}" -ge 0 -a "${unit}" -le 31 -a "${tracks}" -le 169 ]; then + dname=$name$unit + rm -rf ${dname}t* + j=1 + while [ $j -le ${tracks} ]; do + mknod ${dname}t$j c $chr \ + $((($unit * 8) + (65536 * $j))) \ + root:operator + j=$(($j + 1)) done else - echo "$i is invalid -- can't have more than 32 cd devices or 169 tracks" + echo "$unit is invalid -- can't have more than 32 cd devices or 169 tracks" fi umask 77 ;; @@ -825,27 +818,20 @@ acd*|cd*|mcd*|scd*) umask $disk_umask case $i in - acd*) units=`expr $i : '...\(.*\)'`; name=acd; chr=117;; - cd*) units=`expr $i : '..\(.*\)'`; name=cd; chr=15;; - mcd*) units=`expr $i : '...\(.*\)'`; name=mcd; chr=29;; - scd*) units=`expr $i : '...\(.*\)'`; name=scd; chr=45;; + acd*) unit=`expr $i : '...\(.*\)'`; name=acd; chr=117;; + cd*) unit=`expr $i : '..\(.*\)'`; name=cd; chr=15;; + mcd*) unit=`expr $i : '...\(.*\)'`; name=mcd; chr=29;; + scd*) unit=`expr $i : '...\(.*\)'`; name=scd; chr=45;; esac - if [ -z "${units}" -o "${units}" -le 0 ]; then - units=1 - fi - if [ "${units}" -le 31 ]; then - i=0 - while [ $i -le $units ]; do - dname=$name$i - rm -rf ${dname}[!t]* r${dname}* - mknod ${dname}a c $chr $(($i * 8)) root:operator - mknod ${dname}c c $chr $(($i * 8 + 2)) root:operator - ln -f ${dname}a r${dname}a - ln -f ${dname}c r${dname}c - i=$(($i + 1)) - done + if [ "${unit}" -ge 0 -a "${unit}" -le 31 ]; then + dname=$name$unit + rm -rf ${dname}[!t]* r${dname}* + mknod ${dname}a c $chr $(($unit * 8)) root:operator + mknod ${dname}c c $chr $(($unit * 8 + 2)) root:operator + ln -f ${dname}a r${dname}a + ln -f ${dname}c r${dname}c else - echo "$i is invalid -- can't have more than 32 cd devices" + echo "$unit is invalid -- can't have more than 32 cd devices" fi umask 77 ;; -- "It's always funny until someone gets hurt. Then it's hilarious." Crist J. Clark | cjclark@alum.mit.edu | cjclark@jhu.edu http://people.freebsd.org/~cjc/ | cjc@freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message