1#!/bin/sh - 2# 3# Copyright (c) 1980 Regents of the University of California. 4# All rights reserved. The Berkeley software License Agreement 5# specifies the terms and conditions for redistribution. 6# 7# @(#)MAKEDEV 4.23 (Berkeley) 10/18/85 8# 9# Device "make" file. Valid arguments: 10# std standard devices 11# local configuration specific devices 12# Tapes: 13# ct* HP300 HP-IB cartridge tape 14# Disks: 15# cd* "concatenated" pseudo-disks 16# fd* "file" pseudo-disks 17# rd* HP300 HP-IB disks 18# sd* HP300 SCSI disks 19# Terminal multiplexors: 20# dca* HP200/300 single port serial interface 21# dcm* HP200/300 4 port serial mux interface 22# Pseudo terminals: 23# pty* set of 16 master and slave pseudo terminals 24# Printers: 25# Call units: 26# Special purpose devices: 27# flog* kernel logging device 28# grf* raw interface to HP300 graphics devices 29# ite* terminal emulator interface to HP300 graphics devices 30# hil HP300 HIL input devices 31# Devices specific to UTAH machines: 32# 33umask 77 34for i 35do 36case $i in 37 38std) 39 /etc/mknod console c 0 0 40 /etc/mknod drum c 3 0 ; chmod 640 drum ; chgrp kmem drum 41 /etc/mknod kmem c 2 1 ; chmod 640 kmem ; chgrp kmem kmem 42 /etc/mknod mem c 2 0 ; chmod 640 mem ; chgrp kmem mem 43 /etc/mknod null c 2 2 ; chmod 666 null 44 /etc/mknod tty c 1 0 ; chmod 666 tty 45 /etc/mknod klog c 6 0 ; chmod 600 klog 46 ;; 47 48ct*) 49 umask 0 ; unit=`expr $i : '..\(.*\)'` 50 case $i in 51 ct*) blk=0; chr=7;; 52 esac 53 case $unit in 54 0|1|2|3|4|5|6|7) 55 four=`expr $unit + 4` ; eight=`expr $unit + 8` 56 twelve=`expr $unit + 12`; twenty=`expr $unit + 20` 57 # 58 # block devices don't work so don't make them 59 #/etc/mknod ct$unit b $blk $unit 60 #/etc/mknod ct$four b $blk $four 61 #/etc/mknod ct$eight b $blk $eight 62 #/etc/mknod ct$twelve b $blk $twelve 63 #/etc/mknod nct$unit b $blk $four ;: sanity w/pdp11 v7 64 #/etc/mknod nct$eight b $blk $twelve ;: ditto 65 # 66 /etc/mknod rct$unit c $chr $unit 67 /etc/mknod rct$four c $chr $four 68 /etc/mknod rct$eight c $chr $eight 69 /etc/mknod rct$twelve c $chr $twelve 70 ln rct$four nrct$unit ;: sanity w/pdp11 v7 71 ln rct$twelve nrct$eight ;: ditto 72 ;; 73 *) 74 echo bad unit for tape in: $1 75 ;; 76 esac 77 umask 77 78 ;; 79 80cd*|fd*|rd*|sd*) 81 umask 2 ; unit=`expr $i : '..\(.*\)'` 82 case $i in 83 rd*) name=rd; blk=2; chr=9;; 84 sd*) name=sd; blk=4; chr=8;; 85 cd*) name=cd; blk=5; chr=17;; 86 fd*) name=fd; blk=6; chr=19;; 87 esac 88 case $unit in 89 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|\ 90 17|18|19|20|21|22|23|24|25|26|27|28|29|30|31) 91 /etc/mknod ${name}${unit}c b $blk `expr $unit '*' 8 + 2` 92 /etc/mknod r${name}${unit}c c $chr `expr $unit '*' 8 + 2` 93 if [ $name != cd -a $name != fd ] 94 then 95 /etc/mknod ${name}${unit}a b $blk `expr $unit '*' 8 + 0` 96 /etc/mknod ${name}${unit}b b $blk `expr $unit '*' 8 + 1` 97 /etc/mknod ${name}${unit}d b $blk `expr $unit '*' 8 + 3` 98 /etc/mknod ${name}${unit}e b $blk `expr $unit '*' 8 + 4` 99 /etc/mknod ${name}${unit}f b $blk `expr $unit '*' 8 + 5` 100 /etc/mknod ${name}${unit}g b $blk `expr $unit '*' 8 + 6` 101 /etc/mknod ${name}${unit}h b $blk `expr $unit '*' 8 + 7` 102 /etc/mknod r${name}${unit}a c $chr `expr $unit '*' 8 + 0` 103 /etc/mknod r${name}${unit}b c $chr `expr $unit '*' 8 + 1` 104 /etc/mknod r${name}${unit}d c $chr `expr $unit '*' 8 + 3` 105 /etc/mknod r${name}${unit}e c $chr `expr $unit '*' 8 + 4` 106 /etc/mknod r${name}${unit}f c $chr `expr $unit '*' 8 + 5` 107 /etc/mknod r${name}${unit}g c $chr `expr $unit '*' 8 + 6` 108 /etc/mknod r${name}${unit}h c $chr `expr $unit '*' 8 + 7` 109 fi 110 chgrp operator ${name}${unit}[a-h] r${name}${unit}[a-h] 111 chmod 640 ${name}${unit}[a-h] r${name}${unit}[a-h] 112 ;; 113 *) 114 echo bad unit for disk in: $i 115 ;; 116 esac 117 umask 77 118 ;; 119 120dca*) 121 unit=`expr $i : 'dca\(.*\)'` 122 case $unit in 123 0) 124 /etc/mknod tty0 c 12 0 125 ;; 126 *) 127 echo bad unit for dca in: $i 128 ;; 129 esac 130 ;; 131 132dcm*) 133 unit=`expr $i : 'dcm\(.*\)'` 134 case $unit in 135 0|1|2|3) 136 eval `echo $unit | awk ' { unit = $1; u = 4 * $1 } END { 137 for (i = 0; i < 4; i++) 138 printf("/etc/mknod tty0%x c 15 %d; ",u+i,u+i); }'` 139 ;; 140 *) 141 echo bad unit for dcm in: $i 142 ;; 143 esac 144 ;; 145 146ite*) 147 unit=`expr $i : 'ite\(.*\)'` 148 case $unit in 149 0|1|2|3) 150 /etc/mknod ttye${unit} c 13 ${unit} 151 ;; 152 *) 153 echo bad unit for ite in: $i 154 ;; 155 esac 156 ;; 157 158grf*) 159 unit=`expr $i : 'grf\(.*\)'` 160 case $unit in 161 0|1|2|3) 162 /etc/mknod grf${unit} c 10 ${unit}; chmod 666 grf${unit} 163 echo "grf${unit}: use MAKEDEV.hpux to make HP-UX names for device" 164 ;; 165 *) 166 echo bad unit for grf in: $i 167 ;; 168 esac 169 ;; 170 171hil) 172 for unit in 0 1 2 3 4 5 6 7 173 do 174 /etc/mknod hil${unit} c 14 ${unit} 175 if [ -f /usr/local/hilinfo ] 176 then 177 case `/usr/local/hilinfo -t hil${unit}` in 178 mouse) 179 if [ ! -f locator ] 180 then 181 ln hil${unit} locator 182 fi 183 ;; 184 keyboard) 185 if [ ! -f keyboard ] 186 then 187 ln hil${unit} keyboard 188 fi 189 ;; 190 *) 191 ;; 192 esac 193 fi 194 done 195 if [ ! -f /usr/local/hilinfo ] 196 then 197 ln hil1 keyboard 198 ln hil3 locator 199 fi 200 chmod 666 hil* 201 echo "hil: use MAKEDEV.hpux to make HP-UX names for devices" 202 ;; 203 204pty*) 205 class=`expr $i : 'pty\(.*\)'` 206 case $class in 207 0) offset=0 name=p;; 208 1) offset=16 name=q;; 209 2) offset=32 name=r;; 210 3) offset=48 name=s;; 211# Note that telnetd, rlogind, and xterm (at least) only look at p-s. 212 4) offset=64 name=t;; 213 *) echo bad unit for pty in: $i;; 214 esac 215 case $class in 216 0|1|2|3|4) 217 umask 0 218 eval `echo $offset $name | awk ' { b=$1; n=$2 } END { 219 for (i = 0; i < 16; i++) 220 printf("/etc/mknod tty%s%x c 4 %d; \ 221 /etc/mknod pty%s%x c 5 %d; ", \ 222 n, i, b+i, n, i, b+i); }'` 223 umask 77 224 if [ $class = 1 ]; then 225 mv ttyqf ttyv0; mv ptyqf ptyv0 226 fi 227 ;; 228 esac 229 ;; 230 231local) 232 umask 0 233 sh MAKEDEV.local 234 ;; 235 236esac 237done 238