Subject: misc/9524: SVR4_MAKEDEV example script is broken
To: None <gnats-bugs@gnats.netbsd.org>
From: None <jbernard@mines.edu>
List: netbsd-bugs
Date: 03/02/2000 19:57:36
>Number: 9524
>Category: misc
>Synopsis: SVR4_MAKEDEV example script is broken
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: misc-bug-people (Misc Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Mar 2 19:57:00 2000
>Last-Modified:
>Originator: Jim Bernard
>Organization:
Speaking for myself
>Release: Mar. 1, 2000
>Environment:
System: NetBSD nool 1.4R NetBSD 1.4R (NOOL-$Revision: 1.6 $) #0: Thu Feb 3 08:50:33 MST 2000 jbernard@nool:/home/tmp/compile/sys/arch/i386/compile/NOOL i386
>Description:
The script .../share/examples/emul/svr4/etc/SVR4_MAKEDEV contains
syntax errors and so cannot be used to create devices for svr4
emulation without being fixed. (Well, yes, it *is* an example,
but it would be nicer if it worked, and compat_svr4(8) claims that
it can and should be used as is.)
>How-To-Repeat:
Copy the script to /emul/svr4/dev (or wherever) and say
"sh SVR4_MAKEDEV". The error message is:
./SVR4_MAKEDEV: 156: Syntax error: ")" unexpected (expecting ";;")
>Fix:
The problem is a case statement in the "wabi" section--it was written
using c-style "fall-through" syntax instead of shell-style "alternative
patterns" syntax. The problem was introduced in revision 1.6, way
back in April (IIRC) of 1999; I guess nobody has used it since then.
Here's one way to fix it that, I believe, matches the intent of the
changes introduced in 1.6:
--- SVR4_MAKEDEV- Thu Mar 2 12:52:29 2000
+++ SVR4_MAKEDEV Thu Mar 2 16:16:19 2000
@@ -150,21 +150,21 @@
wabi)
rm -f $i
case $MACHINE in
- amiga)
- atari)
- hp300)
- i386)
- mac68k)
- mvme68k)
- next68k)
+ amiga|\
+ atari|\
+ hp300|\
+ i386|\
+ mac68k|\
+ mvme68k|\
+ next68k|\
x68k)
mknod $i c 2 2;; # /dev/null
- news68k)
- sparc)
+ news68k|\
+ sparc|\
sun3)
mknod $i c 3 2;; # /dev/null
esac
chown bin.bin $i
chmod 666 $i
>Audit-Trail:
>Unformatted: