summaryrefslogtreecommitdiff
path: root/devio
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-04-21 18:17:11 +0000
committerRoland McGrath <roland@gnu.org>1995-04-21 18:17:11 +0000
commitce443e072e340a9fe6956560ca2287449ce49e8c (patch)
tree6badcc652fd8d28f9e2517afd563d73d4a556cfa /devio
parentc7995fdc6a19a6f97911ded05ce628c0c98137f1 (diff)
Split out `std' into individual device-makers it calls.
Rewrote /dev/fd stuff (still commented out). Use case built-in instead of expr program.
Diffstat (limited to 'devio')
-rw-r--r--devio/MAKEDEV44
1 files changed, 27 insertions, 17 deletions
diff --git a/devio/MAKEDEV b/devio/MAKEDEV
index 356a5b02..213d087d 100644
--- a/devio/MAKEDEV
+++ b/devio/MAKEDEV
@@ -8,34 +8,44 @@ PATH=/bin
for I; do
case "$I" in
std)
- settrans -cf console /hurd/term console
-
- settrans -cf tty /hurd/magic tty
-
- settrans -cf null /hurd/null
- settrans -cf zero /hurd/null -z
-
- #settrans -cf stdin /hurd/magic fd/0
- #settrans -cf stdout /hurd/magic fd/1
- #settrans -cf stderr /hurd/magic fd/2
+ $0 console tty null zero # fd
+ ;;
+ console)
+ settrans -cf console /hurd/term console ;;
+ tty)
+ settrans -cf tty /hurd/magic tty ;;
+ null)
+ settrans -cf null /hurd/null ;;
+ zero)
+ settrans -cf zero /hurd/null -z ;;
+ fd)
+ settrans -cf stdin /hurd/magic fd
+ ln -f -s fd/0 stdin
+ ln -f -s fd/1 stdout
+ ln -f -s fd/2 stderr
;;
- fd*|mt*)
+ fd*|mt*)
settrans -cf r$I /hurd/devio $I
settrans -cf $I /hurd/devio -b $I
;;
- rd*|sd*|hd*)
- if expr $I : '[a-z]*[0-9][0-9]*\([a-z]*\)' > /dev/null; then
+ rd*|sd*|hd*)
+ case "$I" in
+ [a-z]*[0-9][0-9]*[a-z]*)
settrans -cf r$I /hurd/devio $I
settrans -cf $I /hurd/devio -b $I
- else
+ ;;
+ *)
echo 1>&2 $0: $I: Must supply a device number and partition
exit 1
- fi
+ ;;
+ esac
;;
*)
- echo $0: $I: Unknown device
- esac
+ echo >&2 $0: $I: Unknown device
+ exit 1
+ ;;
+ esac
done