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