Bug 20436

Summary: Can't make only cd0 under 4.1-STABLE
Product: Base System Reporter: Andre Albsmeier <Andre.Albsmeier>
Component: confAssignee: iedowse
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.1-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Andre Albsmeier 2000-08-05 21:30:00 UTC
It is not possible to make only cd0.

How-To-Repeat: 
as root:

mkdir /tmp/x
cd /tmp/x
cp /dev/MAKEDEV .
./MAKEDEV cd
ls -l

./MAKEDEV cd0 produces the same result
Comment 1 Sheldon Hearn 2000-08-07 12:37:47 UTC
On Sat, 05 Aug 2000 22:21:42 +0200, Andre Albsmeier wrote:

> It is not possible to make only cd0.

Actually, I think that the correct fix is probably something more like
this.  However, I wouldn't want to commit this without seeing what
impact it has on a release.

Ciao,
Sheldon.

Index: MAKEDEV
===================================================================
RCS file: /home/ncvs/src/etc/MAKEDEV,v
retrieving revision 1.266
diff -u -d -r1.266 MAKEDEV
--- MAKEDEV	2000/07/30 16:18:48	1.266
+++ MAKEDEV	2000/08/07 11:37:09
@@ -803,7 +803,7 @@
 	fi
 	if [ "${units}" -le 31 ]; then
 		i=0
-		while [ $i -le $units ]; do
+		while [ $i -lt $units ]; do
 			dname=$name$i
 			rm -rf ${dname}* r${dname}*
 			mknod ${dname}a c $chr $(($i * 8)) root:operator
Comment 2 Andre Albsmeier 2000-08-07 12:41:40 UTC
On Mon, 07-Aug-2000 at 13:37:47 +0200, Sheldon Hearn wrote:
> 
> 
> On Sat, 05 Aug 2000 22:21:42 +0200, Andre Albsmeier wrote:
> 
> > It is not possible to make only cd0.
> 
> Actually, I think that the correct fix is probably something more like
> this.  However, I wouldn't want to commit this without seeing what
> impact it has on a release.

Should we bother Jordan with this?


> Ciao,
> Sheldon.
> 
> Index: MAKEDEV
> ===================================================================
> RCS file: /home/ncvs/src/etc/MAKEDEV,v
> retrieving revision 1.266
> diff -u -d -r1.266 MAKEDEV
> --- MAKEDEV	2000/07/30 16:18:48	1.266
> +++ MAKEDEV	2000/08/07 11:37:09
> @@ -803,7 +803,7 @@
>  	fi
>  	if [ "${units}" -le 31 ]; then
>  		i=0
> -		while [ $i -le $units ]; do
> +		while [ $i -lt $units ]; do
>  			dname=$name$i
>  			rm -rf ${dname}* r${dname}*
>  			mknod ${dname}a c $chr $(($i * 8)) root:operator


You are right. units are probably the number of cd devices wanted.
So if units=1 it should create one cd (cd0).

	-Andre
Comment 3 Sheldon Hearn freebsd_committer freebsd_triage 2000-08-07 12:46:23 UTC
Responsible Changed
From-To: freebsd-bugs->asmodai

Jeroen, could you look at this PR?  It seems odd that the 
comparison for CDROMs is different from the comparisons 
made for other device nodes.
Comment 4 Sheldon Hearn 2000-08-07 12:47:45 UTC
On Mon, 07 Aug 2000 13:41:40 +0200, Andre Albsmeier wrote:

> Should we bother Jordan with this?

Let's see what asmodai says -- we'd be reverting a change he made in
rev 1.249.

Ciao,
Sheldon.
Comment 5 Andre Albsmeier 2000-08-07 12:58:24 UTC
On Mon, 07-Aug-2000 at 13:47:45 +0200, Sheldon Hearn wrote:
> 
> 
> On Mon, 07 Aug 2000 13:41:40 +0200, Andre Albsmeier wrote:
> 
> > Should we bother Jordan with this?
> 
> Let's see what asmodai says -- we'd be reverting a change he made in
> rev 1.249.

Oops, I see. But the current behaviour can be considered wrong.

The whole thing was probably already discussed to death but I still don't
get it why "MAKEDEV cd3" should build cd0-cd2... What is so difficult to
type "MAKEDEV cd0 cd1 cd2" ? At least this would be the same behaviour
as we got with "MAKEDEV da...".

I think it should be possible to create individual devices. If there
is some extension, maybe in the form of "MAKEDEV cd0-4" or similar,
thats OK.

	-Andre
Comment 6 Sheldon Hearn 2000-08-07 13:00:42 UTC
On Mon, 07 Aug 2000 13:58:24 +0200, Andre Albsmeier wrote:

> The whole thing was probably already discussed to death but I still don't
> get it why "MAKEDEV cd3" should build cd0-cd2... What is so difficult to
> type "MAKEDEV cd0 cd1 cd2" ? At least this would be the same behaviour
> as we got with "MAKEDEV da...".

Don't lose your original issue in the face of religious war.  The point
folks are likely to agree on is that ``MAKEDEV cd0'' should create a
single device and that ``MAKEDEV cd1'' should create two devices.

This is pretty standard and well-accepted behaviour, and you're likely
to win that one.

Going further than that right now is just going to get your original
issue lost in the noise.

Ciao,
Sheldon.
Comment 7 Andre Albsmeier 2000-08-07 13:02:53 UTC
On Mon, 07-Aug-2000 at 14:00:42 +0200, Sheldon Hearn wrote:
> 
> 
> On Mon, 07 Aug 2000 13:58:24 +0200, Andre Albsmeier wrote:
> 
> > The whole thing was probably already discussed to death but I still don't
> > get it why "MAKEDEV cd3" should build cd0-cd2... What is so difficult to
> > type "MAKEDEV cd0 cd1 cd2" ? At least this would be the same behaviour
> > as we got with "MAKEDEV da...".
> 
> Don't lose your original issue in the face of religious war.  The point
> folks are likely to agree on is that ``MAKEDEV cd0'' should create a
> single device and that ``MAKEDEV cd1'' should create two devices.
> 
> This is pretty standard and well-accepted behaviour, and you're likely
> to win that one.
> 
> Going further than that right now is just going to get your original
> issue lost in the noise.

Agreed. Let's face on the "MAKEDEV cd0" thing :-)

	-Andre
Comment 8 Sheldon Hearn 2000-08-08 11:23:28 UTC
On Tue, 08 Aug 2000 03:25:33 +1000, Bruce Evans wrote:

> The bug in the PR is caused by a wrong fix for this in rev.1.249.

This was my impression too.  However, it seems to me that it's very
common (almost standard) for targets in MAKEDEV to take the unit number
supplied as a unit count, rather than a specific node name.

Therefore, I think that it's enough to revert rev 1.249.  However, I
also think that the MAKEDEV manual page could do with some serious
work.  I think thta the manual page should clearly describe that the
unit number argument can mean two different things.

Most of the reason I want to do this is because I don't think that I can
win the holy war issue that the unit number should mean only one thing
to all targets.

If you think I can win that war, perhaps I'll take a stab at converting
every MAKEDEV target to read the passed unit number target as a specific
device node name and update the manual page with an EXAMPLES section
that provides shell magic to produce a range of device node names.

What say you? :-)

Ciao,
Sheldon.
Comment 9 Jeroen Ruigrok van der Werven freebsd_committer freebsd_triage 2001-11-16 10:27:31 UTC
Responsible Changed
From-To: asmodai->freebsd-doc

Move back to the doc pool.
Comment 10 dd freebsd_committer freebsd_triage 2002-01-07 07:04:34 UTC
Responsible Changed
From-To: freebsd-doc->freebsd-bugs

This is not a doc PR.
Comment 11 Crist J. Clark freebsd_committer freebsd_triage 2002-01-10 08:48:28 UTC
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

-- 
"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
Comment 12 Sheldon Hearn 2002-01-10 12:55:37 UTC
On Thu, 10 Jan 2002 01:00:03 PST, "Crist J . Clark" wrote:

>  So... This make everyone happy?

Makes me happy.  Can't speak for everyone else.

Ciao,
Sheldon.
Comment 13 iedowse freebsd_committer freebsd_triage 2002-08-10 01:20:48 UTC
State Changed
From-To: open->patched


Fixed in -current, awaiting MFC. 


Comment 14 iedowse freebsd_committer freebsd_triage 2002-08-10 01:20:48 UTC
Responsible Changed
From-To: freebsd-bugs->iedowse

MFC reminder.
Comment 15 iedowse freebsd_committer freebsd_triage 2002-09-17 00:23:51 UTC
State Changed
From-To: patched->closed


Merged to stable now too. Thanks for the reminder!