summaryrefslogtreecommitdiff
path: root/devio/MAKEDEV
blob: 213d087d218e3250cd2dfbd0d90a32dbddc07b71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh
#
# Make standard devices
#

PATH=/bin

for I; do
  case "$I" in
    std)
      $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*)
      settrans -cf r$I /hurd/devio $I
      settrans -cf $I /hurd/devio -b $I
      ;;

    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
	;;
      *)
	echo 1>&2 $0: $I: Must supply a device number and partition
	exit 1
	;;
      esac
      ;;

    *)
      echo >&2 $0: $I: Unknown device
      exit 1
      ;;
  esac
done