summaryrefslogtreecommitdiff
path: root/devio/MAKEDEV
blob: 933914608e7fe10e1d741c3b43e6e7c78d8a5484 (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 `pwd`/console ;;
    tty)
      settrans -cf tty /hurd/magic tty ;;
    null)
      settrans -cf null /hurd/null ;;
    zero)
      settrans -cf zero /hurd/null -z ;;
    fd)
      settrans -cf fd /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