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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
|
#!/bin/sh -
# $NetBSD: MAKEDEV.tmpl,v 1.16 2003/12/22 22:26:32 lukem Exp $
#
# Copyright (c) 2003 The NetBSD Foundation, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
# must display the following acknowledgement:
# This product includes software developed by the NetBSD
# Foundation, Inc. and its contributors.
# 4. Neither the name of The NetBSD Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
#
###########################################################################
#
# PLEASE RUN "cd ../share/man/man8 ; make makedevs"
# AFTER CHANGING THIS FILE, AND COMMIT THE UPDATED MANPAGE!
#
###########################################################################
#
# Device "make" file. Valid arguments:
# all makes all known devices, including local devices.
# Tries to make the 'standard' number of each type.
# init A set of devices that is used for MFS /dev by init.
# May be equal to "all".
# floppy devices to be put on install floppies
# ramdisk devices to be put into INSTALL kernel ramdisks.
# std standard devices
# local configuration specific devices
# usbs make USB devices
# isdns make ISDN devices
#
# Tapes:
# st* SCSI tapes
# wt* QIC-interfaced (e.g. not SCSI) 3M cartridge tape
# ht* MASSBUS TM03 and TU??
# mt* MSCP tapes (e.g. TU81, TK50)
# tm* UNIBUS TM11 and TE10 emulations (e.g. Emulex TC-11)
# ts* UNIBUS TS11
# ut* UNIBUS TU45 emulations (e.g. si 9700)
# uu* TU58 cassettes on DL11 controller
#
# Disks:
# ccd* concatenated disk devices
# cd* SCSI or ATAPI CD-ROM
# cgd* cryptographic disk devices
# raid* RAIDframe disk devices
# sd* SCSI disks
# wd* "winchester" disk drives (ST506,IDE,ESDI,RLL,...)
# bmd* Nereid bank memory disks
# ed* IBM PS/2 ESDI disk devices
# fd* "floppy" disk drives (3 1/2", 5 1/4")
# fss* Files system snapshot devices
# gdrom* Dreamcast "gigadisc" CD-ROM drive
# hk* UNIBUS RK06 and RK07
# hp* MASSBUS RM??
# ld* Logical disk devices (e.g., hardware RAID)
# mcd* Mitsumi CD-ROM
# md* memory pseudo-disk devices
# ofdisk* OpenFirmware disk devices
# ra* MSCP disks (RA??, RD??)
# rb* 730 IDC w/ RB80 and/or RB02
# rd* HDC9224 RD disks on VS2000
# rl* UNIBUS RL02
# rx* MSCP floppy disk (RX33/50/...)
# up* other UNIBUS devices (e.g. on Emulex SC-21V controller)
# vnd* "file" pseudo-disks
# xd* Xylogic 753/7053 disks
# xy* Xylogic 450/451 disks
#
# Pointing devices:
# wsmouse* wscons mouse events
# lms* Logitech bus mouse
# mms* Microsoft bus mouse
# qms* "quadrature mouse"
# pms* PS/2 mouse
# mouse mouse (provides events, for X11)
#
# Keyboard devices:
# wskbd* wscons keyboard events
# kbd raw keyboard (provides events, for X11)
# kbdctl keyboard control
#
# Terminals/Console ports:
# tty[01]* standard serial ports
# tty0* SB1250 ("sbscn") serial ports (sbmips)
# ttyE* wscons - Workstation console ("wscons") glass-tty emulators
# ttyCZ? Cyclades-Z multiport serial boards. Each "unit"
# makes 64 ports.
# ttyCY? Cyclom-Y multiport serial boards. Each "unit" makes
# 32 ports.
# ttye* ITE bitmapped consoles
# ttyv0 pccons
# ttyC? NS16550 ("com") serial ports
# ttyS* SA1110 serial port (hpcarm)
# ttyTX? TX39 internal serial ports (hpcmips)
# ttyB? DEC 3000 ZS8530 ("scc") serial ports (alpha)
# ttyA* mfc serial ports (amiga)
# ttyB* msc serial ports (amiga)
# ttyC* com style serial ports (DraCo, HyperCom) (amiga)
# On the DraCo, units 0 and 1 are the built-in "modem" and
# "mouse" ports, if configured.
# ttyA0 8530 Channel A (formerly ser02) (atari)
# ttyA1 8530 Channel B (formerly mdm02) (atari)
# ttyB0 UART on first 68901 (formerly mdm01) (atari)
# ixpcom IXP12x0 COM ports
# ttyM? HP200/300 4 port serial mux interface (hp300)
# ttya "ttya" system console (luna68k)
# ttyb second system serial port (luna68k)
# tty* Onboard serial ports (mvme68k)
# On the mvme147 these are: ttyZ1, ttyZ2 and ttyZ3.
# On the mvme167, and '177: ttyC1, ttyC2 and ttyC3.
# Note that tty[CZ]0 is grabbed by the console device
# so is not created by default
# dc* PMAX 4 channel serial interface (kbd, mouse, modem, printer)
# scc* 82530 serial interface (pmax)
# ttyZ* Zilog 8530 ("zstty") serial ports
# tty[abcd] Built-in serial ports (sparc)
# tty* Z88530 serial controllers (sparc64)
# ttyh* SAB82532 serial controllers (sparc64)
# tty[a-j] Built-in serial ports (sun2, sun3)
# ttyC? pccons (arc)
# dz* UNIBUS DZ11 and DZ32 (vax)
# dh* UNIBUS DH11 and emulations (e.g. Able DMAX, Emulex CS-11) (vax)
# dmf* UNIBUS DMF32 (vax)
# dhu* UNIBUS DHU11 (vax)
# dmz* UNIBUS DMZ32 (vax)
# dl* UNIBUS DL11 (vax)
#
# Terminal multiplexors:
# dc* 4 channel serial interface (keyboard, mouse, modem, printer)
# dh* UNIBUS DH11 and emulations (e.g. Able DMAX, Emulex CS-11)
# dhu* UNIBUS DHU11
# dl* UNIBUS DL11
# dmf* UNIBUS DMF32
# dmz* UNIBUS DMZ32
# dz* UNIBUS DZ11 and DZ32
# scc* 82530 serial interface
#
# Call units:
# dn* UNIBUS DN11 and emulations (e.g. Able Quadracall)
#
# Pseudo terminals:
# pty* set of 62 master and slave pseudo terminals
# opty first 16 ptys, to save inodes on install media
# ipty first 2 ptys, for install media use only
#
# Printers:
# arcpp* Archimedes parallel port
# lpt* stock lp
# lpa* interruptless lp
# par* Amiga motherboard parallel port
#
# USB devices:
# usb* USB control devices
# uhid* USB generic HID devices
# ulpt* USB printer devices
# ugen* USB generic devices
# urio* USB Diamond Rio 500 devices
# uscanner* USB scanners
# ttyU* USB modems
#
# ISDN devices:
# isdn communication between userland isdnd and kernel
# isdnctl control device
# isdnbchan* raw b-channel access
# isdntel* telephony device
# isdnteld* telephony dialout device
# isdntrc* trace device
#
# Video devices:
# bwtwo* monochromatic frame buffer
# cgtwo* 8-bit color frame buffer
# cgthree* 8-bit color frame buffer
# cgfour* 8-bit color frame buffer
# cgsix* accelerated 8-bit color frame buffer
# cgeight* 24-bit color frame buffer
# etvme Tseng et-compatible cards on VME (atari)
# ik* UNIBUS interface to Ikonas frame buffer
# leo Circad Leonardo VME-bus true color (atari)
# ps* UNIBUS interface to Picture System 2
# qv* QVSS (MicroVAX) display
# tcx* accelerated 8/24-bit color frame buffer
#
# Maple bus devices:
# maple Maple bus control devices
# mlcd* Maple bus LCD devices
# mmem* Maple bus storage devices
#
# Special purpose devices:
# ad* UNIBUS interface to Data Translation A/D converter
# agp* AGP GART devices
# altq ALTQ control interface
# apm power management device
# audio* audio devices
# beep PC speaker
# bell* OPM bell device (x68k)
# bktr Brooktree 848/849/878/879 based TV cards
# bpf* packet filter
# cfs* Coda file system device
# ch* SCSI media changer
# cir* Consumer IR
# clockctl clock control for non root users
# crypto hardware crypto access driver
# dmoverio hardware-assisted data movers
# dpt* DPT/Adaptec EATA RAID management interface
# dpti* DPT/Adaptec I2O RAID management interface
# fb* PMAX generic framebuffer pseudo-device
# fd file descriptors
# grf* graphics frame buffer device
# hil HP300 HIL input devices
# icp ICP-Vortex/Intel RAID control interface
# iic* IIC bus device
# iop* I2O IOP control interface
# ipl IP Filter
# irframe* IrDA physical frame
# ite* terminal emulator interface to HP300 graphics devices
# joy* joystick device
# kttcp kernel ttcp helper device
# lkm loadable kernel modules interface
# magma* Magma multiport serial/parallel cards
# midi* MIDI
# mlx* Mylex DAC960 control interface
# mly* Mylex AcceleRAID/eXtremeRAID control interface
# np* UNIBUS Ethernet co-processor interface, for downloading.
# nsmb* SMB requester
# openfirm OpenFirmware accessor
# pci* PCI bus access devices
# pf PF packet filter (not in tree)
# pow* power management device (x68k)
# px* PixelStamp Xserver access
# radio* radio devices
# random Random number generator
# rtc* RealTimeClock
# satlink* PlanetConnect satellite receiver driver
# scsibus* SCSI busses
# se* SCSI Ethernet
# ses* SES/SAF-TE SCSI Devices
# speaker PC speaker (XXX - installed)
# sram battery backuped memory (x68k)
# ss* SCSI scanner
# stic* PixelStamp interface chip
# sysmon System Monitoring hardware
# systrace syscall tracer
# tun* network tunnel driver
# twe 3ware Escalade control interface
# uk* unknown SCSI device
# veriexec verified executable fingerprint loader
# vmegen* generic VME access
# view* generic interface to graphic displays (Amiga)
# wsfont* console font control
# wsmux* wscons event multiplexor
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/rescue
usage()
{
cat 1>&2 << _USAGE_
Usage: ${0##*/} [-f] [-m mknod] [-s] special [...]
Create listed special devices. Options:
-f Force permissions to be updated on existing devices.
-m mknod Name of mknod(8) program. [\$TOOL_MKNOD or mknod]
-s Generate mtree(8) specfile instead of creating devices.
_USAGE_
exit 1
}
do_force=false
do_specfile=false
while getopts fm:s ch; do
case ${ch} in
f) do_force=true ;;
m) TOOL_MKNOD=${OPTARG} ;;
s) do_specfile=true ;;
*) usage ;;
esac
done
shift $((${OPTIND} - 1))
[ $# -gt 0 ] || usage
MKNOD="${TOOL_MKNOD:-mknod} -F netbsd"
if ! $do_force; then
MKNOD="${MKNOD} -r"
fi
u_root="%uid_root%"
u_uucp="%uid_uucp%"
g_kmem="%gid_kmem%"
g_ntpd="%gid_ntpd%"
g_operator="%gid_operator%"
g_wheel="%gid_wheel%"
dialin=0
dialout=524288
callunit=262144
# only allow read&write for owner by default
umask 077
# Check if we have fdesc mounted
if [ -d fd ]; then
case "`df fd`" in
*fdesc*) nofdesc=false;;
*) nofdesc=true;;
esac
else
nofdesc=true
fi
if $do_specfile; then
echo ". type=dir"
fi
#
# functions available to create nodes:
#
# mkdev name [b|c] major minor [mode{=600} [gid{=0} [uid{=0}]]]
# create device node `name' with the appropriate permissions
#
# lndev src target
# create a symlink from src to target
#
# makedir dir mode
# create directory with appropriate mode
#
mkdev()
{
if $do_specfile; then
case $2 in
b) type=block ;;
c) type=char ;;
esac
echo "./$1 type=${type} device=netbsd,$3,$4 mode=${5:-600} gid=${6:-$g_wheel} uid=${7:-$u_root}"
else
${MKNOD} -m ${5:-600} -g \#${6:-$g_wheel} -u \#${7:-$u_root} $1 $2 $3 $4
fi
}
lndev()
{
if $do_specfile; then
echo "./$2 type=link link=$1 mode=0700 gid=$g_wheel uid=$u_root"
else
ln -f -s $1 $2
fi
}
makedir()
{
if $do_specfile; then
echo "./$1 type=dir mode=$2 gid=$g_wheel uid=$u_root"
else
mkdir $1 2>/dev/null
chmod $2 $1
fi
}
warn()
{
echo 1>&2 "$0: $*"
}
# makedev special [...]
# the main loop
#
makedev()
{
for i
do
case $i in
%MD_DEVICES%
all)
makedev all_md
makedev std fd pty0
makedev ccd0 ccd1 ccd2 ccd3
makedev cgd0 cgd1 cgd2 cgd3
makedev fss0 fss1 fss2 fss3
makedev md0 md1
makedev raid0 raid1 raid2 raid3 raid4 raid5 raid6 raid7
makedev vnd0 vnd1 vnd2 vnd3
makedev bpf0 bpf1 bpf2 bpf3 bpf4 bpf5 bpf6 bpf7
makedev tun0 tun1 tun2 tun3
makedev ipl crypto random systrace
makedev lkm clockctl
makedev local
;;
init)
# unless overridden by MD entry, this is equal to 'all'
makedev all
;;
%MI_DEVICES_BEGIN%
audio)
makedev audio0 audio1 audio2 audio3
lndev sound0 sound
lndev audio0 audio
lndev mixer0 mixer
lndev audioctl0 audioctl
;;
radio)
makedev radio0 radio1
lndev radio0 radio
;;
ramdisk)
makedev floppy md0
;;
usbs)
makedev usb usb0 usb1 usb2 usb3 usb4 usb5 usb6 usb7
makedev uhid0 uhid1 uhid2 uhid3
makedev ulpt0 ulpt1
makedev ttyU0 ttyU1
makedev urio0
makedev uscanner0 uscanner1
makedev ugen0
;;
isdns)
makedev isdn isdnctl isdnbchan0 isdnbchan1 isdntel0 isdntel1 isdnteld0 isdnteld1 isdntrc0 isdntrc1
;;
std)
mkdev console c %cons_chr% 0 600
mkdev constty c %cons_chr% 1 600
mkdev drum c %swap_chr% 0 640 $g_kmem
mkdev kmem c %mem_chr% 1 640 $g_kmem
mkdev mem c %mem_chr% 0 640 $g_kmem
mkdev null c %mem_chr% 2 666
mkdev zero c %mem_chr% 12 666
mkdev klog c %log_chr% 0 600
mkdev ksyms c %ksyms_chr% 0 444
if $nofdesc; then
mkdev tty c %ctty_chr% 0 666
mkdev stdin c %filedesc_chr% 0 666
mkdev stdout c %filedesc_chr% 1 666
mkdev stderr c %filedesc_chr% 2 666
fi
;;
usb*)
unit=${i#usb}
if [ "$unit" = "" ]; then
unit=255
usb=usb
else
usb=usb$unit
fi
mkdev $usb c %usb_chr% $unit
;;
uhid*)
unit=${i#uhid}
mkdev uhid$unit c %uhid_chr% $unit 666
;;
ulpt*)
unit=${i#ulpt}
mkdev ulpt$unit c %ulpt_chr% $unit
mkdev ulpn$unit c %ulpt_chr% $(($unit + 64))
;;
urio*)
unit=${i#urio}
mkdev urio$unit c %urio_chr% $unit 666
;;
uscanner*)
unit=${i#uscanner}
mkdev uscanner$unit c %uscanner_chr% $unit
;;
ttyU*)
unit=${i#ttyU}
mkdev ttyU$unit c %ucom_chr% $(($unit + $dialin )) "" "" $u_uucp
mkdev dtyU$unit c %ucom_chr% $(($unit + $dialout )) "" "" $u_uucp
mkdev ctyU$unit c %ucom_chr% $(($unit + $callunit)) "" "" $u_uucp
;;
ugen*)
unit=${i#ugen}
for j in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
do
mkdev ugen$unit.$j c %ugen_chr% $(($unit * 16 + ${j#0}))
done
;;
wscons)
makedev ttyE0 ttyE1 ttyE2 ttyE3 ttyE4 ttyE5 ttyE6 ttyE7
makedev wsmouse0 wsmouse1 wsmouse2 wsmouse3
makedev wskbd0 wskbd1 wskbd2 wskbd3
makedev wsmux0 wsmux1 wsmux2 wsmux3
makedev wsmouse wskbd
makedev ttyEcfg ttyEstat
makedev wsfont
;;
wsmouse)
mkdev wsmouse c %wsmux_chr% 0
;;
wskbd)
mkdev wskbd c %wsmux_chr% 1
;;
wsmux*)
unit=${i#wsmux}
mkdev wsmux$unit c %wsmux_chr% $unit
mkdev wsmuxctl$unit c %wsmux_chr% $(($unit + 128)) 200
;;
ttyEstat)
mkdev ttyEstat c %wsdisplay_chr% 254
;;
ttyEcfg)
mkdev ttyEcfg c %wsdisplay_chr% 255
;;
ttyE*)
unit=${i#ttyE}
mkdev ttyE$unit c %wsdisplay_chr% $unit
;;
wsmouse*)
unit=${i#wsmouse}
mkdev wsmouse$unit c %wsmouse_chr% $unit
;;
wskbd*)
unit=${i#wskbd}
mkdev wskbd$unit c %wskbd_chr% $unit
;;
fd)
if $nofdesc; then
makedir fd 755
n=0
while [ $n -lt 64 ]
do
mkdev fd/$n c %filedesc_chr% $n 666
n=$(($n + 1))
done
fi
;;
wt*)
case $i in
wt*) name=wt; unit=${i#wt}; chr=%wt_chr%; blk=%wt_blk%;;
esac
for sub in $unit $(($unit+8)) $(($unit+16))
do
mkdev $name$sub b $blk $(($sub + 0)) 660 $g_operator
mkdev n$name$sub b $blk $(($sub + 4)) 660 $g_operator
mkdev r$name$sub c $chr $(($sub + 0)) 660 $g_operator
mkdev nr$name$sub c $chr $(($sub + 4)) 660 $g_operator
done
;;
md*)
makedisk_minimal md ${i#md} %md_blk% %md_chr%
;;
fss*)
case $i in
fss*) name=fss; unit=${i#fss}; blk=%fss_blk%; chr=%fss_chr%
esac
mkdev $name$unit b $blk $unit 660 $g_operator
mkdev r$name$unit c $chr $unit 660 $g_operator
;;
ss*)
case $i in
ss*) name=ss; unit=${i#ss}; chr=%ss_chr%;;
esac
mkdev $name$unit c $chr $(($unit * 16 + 0)) 640 $g_operator
mkdev n$name$unit c $chr $(($unit * 16 + 1)) 640 $g_operator
mkdev en$name$unit c $chr $(($unit * 16 + 3)) 640 $g_operator
;;
ccd*|cgd*|raid*|vnd*)
case $i in
ccd*) name=ccd; unit=${i#ccd}; blk=%ccd_blk%; chr=%ccd_chr%;;
cgd*) name=cgd; unit=${i#cgd}; blk=%cgd_blk%; chr=%cgd_chr%;;
raid*) name=raid; unit=${i#raid}; blk=%raid_blk%; chr=%raid_chr%;;
vnd*) name=vnd; unit=${i#vnd}; blk=%vnd_blk%; chr=%vnd_chr%;;
esac
%MKDISK% $name $unit $blk $chr
;;
sd*)
name=sd; unit=${i#sd}; blk=%sd_blk%; chr=%sd_chr%
%MKDISK% $name $unit $blk $chr
;;
wd*)
name=wd; unit=${i#wd}; blk=%wd_blk%; chr=%wd_chr%
%MKDISK% $name $unit $blk $chr
;;
fd*)
name=fd; unit=${i#fd}; blk=%fd_blk%; chr=%fd_chr%
%MKDISK% $name $unit $blk $chr
;;
ld*)
name=ld; unit=${i#ld}; blk=%ld_blk%; chr=%ld_chr%
%MKDISK% $name $unit $blk $chr
;;
ed*)
name=ed; unit=${i#ed}; blk=%ed_blk%; chr=%ed_chr%
%MKDISK% $name $unit $blk $chr
;;
ofdisk*)
name=ofdisk; unit=${i#ofdisk}; blk=%ofdisk_blk%; chr=%ofdisk_chr%
%MKDISK% $name $unit $blk $chr
;;
ttyCY*)
name=tyCY; chr=%cy_chr%; off=32; fmt="%03d"
unit=${i#t${name}}
minor=$(($unit * $off))
eminor=$(($minor + $off))
while [ $minor -lt $eminor ]
do
nminor=$(printf $fmt $minor)
mkdev t$name$nminor c $chr $(($minor + $dialin )) "" "" $u_uucp
mkdev d$name$nminor c $chr $(($minor + $dialout)) "" "" $u_uucp
minor=$(($minor + 1))
done
;;
ttyCZ*)
name=tyCZ; chr=%cz_chr%; off=64; fmt="%04d"
unit=${i#t${name}}
minor=$(($unit * $off))
eminor=$(($minor + $off))
while [ $minor -lt $eminor ]
do
nminor=$(printf $fmt $minor)
mkdev t$name$nminor c $chr $(($minor + $dialin )) "" "" $u_uucp
mkdev d$name$nminor c $chr $(($minor + $dialout)) "" "" $u_uucp
minor=$(($minor + 1))
done
;;
tty[0-9]|tty0[0-9])
# some archs have built-in zstty (major %zstty_chr%) instead
# of NS16550; create ttyZ* and hardlink as [dt]ty0*; this
# needs to be before com entry, for archs which have both
unit=${i#tty}
unit=$(($unit + 0))
makedev ttyZ${unit}
lndev ttyZ$unit tty0${unit}
lndev dtyZ$unit dty0${unit}
;;
tty0*|tty1*|tty[0-9])
unit=${i#tty}
ounit=$(printf "%02d" $unit)
mkdev tty$ounit c %com_chr% $(($unit + $dialin )) "" "" $u_uucp
mkdev dty$ounit c %com_chr% $(($unit + $dialout)) "" "" $u_uucp
;;
ttyC*)
# some archs call com_chr ttyC traditionally
unit=${i#ttyC}; name=ttyC; dname=dtyC; chr=%com_chr%
mkdev $name$unit c $chr $(($unit + $dialin )) "" "" $u_uucp
mkdev $dname$unit c $chr $(($unit + $dialout)) "" "" $u_uucp
;;
ttyh*)
unit=${i#ttyh}; name=ttyh; dname=dtyh; chr=%sabtty_chr%
mkdev $name$unit c $chr $(($unit + $dialin )) "" "" $u_uucp
mkdev $dname$unit c $chr $(($unit + $dialout)) "" "" $u_uucp
;;
ttyTX*)
unit=${i#ttyTX}; name=ttyTX0; dname=dtyTX0; chr=%txcom_chr%
mkdev $name$unit c $chr $(($unit + $dialin )) "" "" $u_uucp
mkdev $dname$unit c $chr $(($unit + $dialout)) "" "" $u_uucp
;;
ttyZ*)
unit=${i#ttyZ}; name=ttyZ; dname=dtyZ; chr=%zstty_chr%
mkdev $name$unit c $chr $(($unit + $dialin )) "" "" $u_uucp
mkdev $dname$unit c $chr $(($unit + $dialout)) "" "" $u_uucp
;;
opty)
for j in 0 1 2 3 4 5 6 7 8 9 a b c d e f
do
case $j in
[0-9]) jn=$j ;;
a) jn=10 ;;
b) jn=11 ;;
c) jn=12 ;;
d) jn=13 ;;
e) jn=14 ;;
f) jn=15 ;;
esac
mkdev ttyp$j c %pts_chr% $jn 666
mkdev ptyp$j c %ptc_chr% $jn 666
done
;;
pty*)
class=${i#pty}
set -- p q r s t u v w x y z P Q R S T
if [ "$class" -ge $# ]; then
warn "$i: pty unit must be between 0 and 15"
continue
fi
shift $class
name=$1
if [ "$name" = v ]; then
warn "$i: pty unit conflicts with console ttyv0 device"
continue
fi
jn=0
unit=$(($class * 16))
set -- - 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
while
shift
j=$1
[ -n "$j" ]
do
if [ $j = g ]; then
unit=$(($unit + $class * 30 + 256 - 16))
fi
mkdev tty$name$j c %pts_chr% $unit 666
mkdev pty$name$j c %ptc_chr% $unit 666
unit=$(($unit + 1))
done
;;
stic*)
unit=${i#stic}
mkdev stic$unit c %stic_chr% $unit
;;
st*)
case $i in
st*) name=st; unit=${i#st}; chr=%st_chr%; blk=%st_blk%;;
esac
mkdev $name$unit b $blk $(($unit * 16 + 0)) 660 $g_operator
mkdev n$name$unit b $blk $(($unit * 16 + 1)) 660 $g_operator
mkdev e$name$unit b $blk $(($unit * 16 + 2)) 660 $g_operator
mkdev en$name$unit b $blk $(($unit * 16 + 3)) 660 $g_operator
mkdev r$name$unit c $chr $(($unit * 16 + 0)) 660 $g_operator
mkdev nr$name$unit c $chr $(($unit * 16 + 1)) 660 $g_operator
mkdev er$name$unit c $chr $(($unit * 16 + 2)) 660 $g_operator
mkdev enr$name$unit c $chr $(($unit * 16 + 3)) 660 $g_operator
;;
ses*|ch*|uk*)
case $i in
ch*) name=ch; unit=${i#ch}; chr=%ch_chr%;;
uk*) name=uk; unit=${i#uk}; chr=%uk_chr%;;
ses*) name=ses; unit=${i#ses}; chr=%ses_chr%;;
esac
mkdev $name$unit c $chr $unit 640 $g_operator
;;
cd*)
makedisk_minimal cd ${i#cd} %cd_blk% %cd_chr% %
;;
mcd*)
makedisk_minimal mcd ${i#mcd} %mcd_blk% %mcd_chr%
;;
gdrom*)
makedisk_minimal gdrom ${i#gdrom} %gdrom_blk% %gdrom_chr%
;;
lpt*|lpa*)
case $i in
lpt*) name=lpt; unit=${i#lpt}; chr=%lpt_chr%; flags=0;;
lpa*) name=lpa; unit=${i#lpa}; chr=%lpt_chr%; flags=128;;
esac
mkdev $name$unit c $chr $(($unit + $flags))
;;
bpf*|tun*)
case $i in
bpf*) name=bpf; unit=${i#bpf}; chr=%bpf_chr%;;
tun*) name=tun; unit=${i#tun}; chr=%tun_chr%;;
esac
mkdev $name$unit c $chr $unit
;;
joy*)
case $i in
joy*) name=joy; unit=${i#joy}; chr=%joy_chr%;;
esac
mkdev $name$unit c $chr $unit
;;
ipl)
mkdev ipl c %ipl_chr% 0
mkdev ipnat c %ipl_chr% 1
mkdev ipstate c %ipl_chr% 2
mkdev ipauth c %ipl_chr% 3
;;
pf)
mkdev pf c %pf_chr% 0
;;
crypto)
mkdev crypto c %crypto_chr% 0 666
;;
speaker)
mkdev speaker c %spkr_chr% 0
;;
lkm)
mkdev lkm c %lkm_chr% 0 640 $g_kmem
;;
audio*)
unit=${i#audio}
audio=audio$unit
sound=sound$unit
mixer=mixer$unit
audioctl=audioctl$unit
: ${unit:-0}
mkdev $sound c %audio_chr% $(($unit + 0)) 666
mkdev $audio c %audio_chr% $(($unit + 128)) 666
mkdev $mixer c %audio_chr% $(($unit + 16)) 666
mkdev $audioctl c %audio_chr% $(($unit + 192)) 666
;;
rmidi*)
unit=${i#rmidi}
mkdev rmidi$unit c %midi_chr% $unit 666
;;
music*)
unit=${i#music}
: ${unit:-0}
mkdev music$unit c %sequencer_chr% $(($unit + 0)) 666
mkdev sequencer$unit c %sequencer_chr% $(($unit + 128)) 666
;;
radio*)
unit=${i#radio}
: ${unit:-0}
mkdev radio$unit c %radio_chr% $unit 666
;;
apm)
mkdev apm c %apm_chr% 0 644
mkdev apmctl c %apm_chr% 8 644
;;
apm)
# hpcmips uses `apmdev_chr' instead of `apm_chr'
mkdev apm c %apmdev_chr% 0 644
mkdev apmctl c %apmdev_chr% 8 644
;;
satlink*)
unit=${i#satlink}
mkdev satlink$unit c %satlink_chr% $unit 444
;;
random)
mkdev random c %rnd_chr% 0 444
mkdev urandom c %rnd_chr% 1 644
;;
cfs*)
unit=${i#cfs}
mkdev cfs$unit c %vcoda_chr% $unit
;;
sysmon)
mkdev sysmon c %sysmon_chr% 0 644
mkdev watchdog c %sysmon_chr% 1 644
mkdev power c %sysmon_chr% 2 640
;;
scsibus*)
unit=${i#scsibus}
mkdev scsibus$unit c %scsibus_chr% $unit 644
;;
bktr)
makedev bktr0 bktr1
lndev bktr0 bktr
lndev tuner0 tuner
lndev vbi0 vbi
;;
bktr*)
unit=${i#bktr}
mkdev bktr$unit c %bktr_chr% $(($unit + 0)) 444
mkdev tuner$unit c %bktr_chr% $(($unit + 16)) 444
mkdev vbi$unit c %bktr_chr% $(($unit + 32)) 444
;;
iop*)
unit=${i#iop}
mkdev iop$unit c %iop_chr% $unit
;;
mlx*)
unit=${i#mlx}
mkdev mlx$unit c %mlx_chr% $unit
;;
mly*)
unit=${i#mly}
mkdev mly$unit c %mly_chr% $unit
;;
twe*)
unit=${i#twe}
mkdev twe$unit c %twe_chr% $unit
;;
icp*)
unit=${i#icp}
mkdev icp$unit c %icp_chr% $unit
;;
agp*)
unit=${i#agp}
mkdev agp$unit c %agp_chr% $unit 644
if [ "$unit" = "0" ]; then
lndev agp$unit agpgart
fi
;;
pci*)
unit=${i#pci}
mkdev pci$unit c %pci_chr% $unit 644
;;
dpti*)
unit=${i#dpti}
mkdev dpti$unit c %dpti_chr% $unit
;;
dpt*)
unit=${i#dpt}
mkdev dpt$unit c %dpt_chr% $unit
;;
altq)
makedir altq 755
unit=0
for dev in altq cbq wfq afm fifoq red rio localq hfsc cdnr blue priq
do
mkdev altq/$dev c %altq_chr% $unit 644
unit=$(($unit + 1))
done
;;
isdn)
mkdev isdn c %isdn_chr% 0
;;
isdnctl)
mkdev isdnctl c %isdnctl_chr% 0
;;
isdnbchan*)
unit=${i#isdnbchan}
mkdev isdnbchan$unit c %isdnbchan_chr% $unit
;;
isdnteld*)
unit=${i#isdnteld}
mkdev isdnteld$unit c %isdntel_chr% $(($unit + 64))
;;
isdntel*)
unit=${i#isdntel}
mkdev isdntel$unit c %isdntel_chr% $unit
;;
isdntrc*)
unit=${i#isdntrc}
mkdev isdntrc$unit c %isdntrc_chr% $unit
;;
vmegen)
makedev vmegen0 vmegen1 vmegen2 vmegen3
;;
vmegen*)
unit=${i#vmegen}
mkdev vmegen$unit c %vmegeneric_chr% $(($unit * 16 + 0))
;;
wsfont)
mkdev wsfont c %wsfont_chr% 0
;;
cir*)
unit=${i#cir}
mkdev cir$unit c %cir_chr% $unit 666
;;
irframe*)
unit=${i#irframe}
mkdev irframe$unit c %irframe_chr% $unit
;;
fcom*)
unit=${i#fcom}
mkdev fcom$unit c %fcom_chr% $unit "" "" $u_uucp
;;
beep)
mkdev beep c %beep_chr% 0
;;
openfirm)
mkdev openfirm c %openfirm_chr% 0 444
;;
nvram)
mkdev nvram c %nvram_chr% 0 644
;;
rtc)
mkdev rtc c %rtc_chr% 0 644
;;
clockctl)
mkdev clockctl c %clockctl_chr% 0 660 $g_ntpd
;;
nsmb)
makedev nsmb0 nsmb1 nsmb2 nsmb3
;;
nsmb*)
unit=${i#nsmb}
mkdev nsmb$unit c %nsmb_chr% $unit 644
;;
systrace)
mkdev systrace c %systrace_chr% 0 644
;;
kttcp)
mkdev kttcp c %kttcp_chr% 0
;;
dmoverio)
mkdev dmoverio c %dmoverio_chr% 0 644
;;
veriexec)
mkdev veriexec c %veriexec_chr% 0 644
;;
ttyv*)
unit=${i#ttyv}
mkdev ttyv$unit c %pc_chr% $unit
;;
# arm, acorn32
ttyv*)
unit=${i#ttyv}
mkdev ttyv$unit c %physcon_chr% $unit
;;
arcpp*)
unit=${i#arcpp}
mkdev arcpp$unit c %arcpp_chr% $unit
;;
par*)
unit=${i#par}
case $unit in
0)
mkdev par$unit c %par_chr% $unit
;;
*)
warn "bad unit for par in: $i"
;;
esac
;;
ite*|ttye*)
case $i in
ite*) unit=${i#ite};;
ttye*) unit=${i#ttye};;
esac
mkdev ttye$unit c %ite_chr% $unit
;;
pms*)
unit=${i#pms}
mkdev pms$unit c %opms_chr% $unit
;;
qms*)
unit=${i#qms}
mkdev qms$unit c %qms_chr% $unit
;;
lms*)
unit=${i#lms}
mkdev lms$unit c %lms_chr% $unit
;;
mms*)
unit=${i#mms}
mkdev mms$unit c %mms_chr% $unit
;;
mouse-*)
case $i in
mouse-pms*) name=pms ;;
mouse-qms*) name=qms ;;
esac
unit=${i#mouse-${name}}
lndev $name$unit mouse
;;
kbd)
mkdev kbd c %kbd_chr% 0
;;
kbdctl)
mkdev kbdctl c %kbd_chr% 1
;;
vidcconsole0)
mkdev vidcconsole0 c %vidcconsole_chr% 0 640
;;
view*)
unit=${i#view}
mkdev view$unit c %view_chr% $unit 666
;;
mouse*)
unit=${i#mouse}
case $unit in
0|1)
mkdev mouse$unit c %ms_chr% $unit 666
if [ $unit = 0 ]; then
lndev mouse$unit mouse
fi
;;
*)
warn "bad unit for mouse in: $i"
;;
esac
;;
panel)
mkdev panel0 c %panel_chr% 0 660
;;
ipty)
mkdev ttyp0 c %pts_chr% 0 666
mkdev ttyp1 c %pts_chr% 1 666
mkdev ptyp0 c %ptc_chr% 0 666
mkdev ptyp1 c %ptc_chr% 1 666
;;
grf*)
unit=${i#grf}
mkdev grf$unit c %grf_chr% $unit 666
;;
etvme)
mkdev etvme c %et_chr% 0
;;
leo*)
unit=${i#leo}
mkdev leo$unit c %leo_chr% $unit
;;
scif*)
unit=${i#scif}
mkdev scif$unit c %scif_chr% $unit "" "" $u_uucp
;;
sci*)
unit=${i#sci}
mkdev sci$unit c %sci_chr% $unit "" "" $u_uucp
;;
maple*)
case $i in
mapleA*) name="mapleA"; unit=0;;
mapleB*) name="mapleB"; unit=1;;
mapleC*) name="mapleC"; unit=2;;
mapleD*) name="mapleD"; unit=3;;
esac
subunit=${i#$name}
mkdev $name$subunit c %maple_chr% $(($unit * 8 + 0$subunit))
;;
mmem*)
unit=${i#mmem}
for pt in 0 # 1 2 3 4 ... 255
do
# mkdev mmem${unit}.${pt}a b %mmem_blk% $(($unit * 4096 + $pt * 16 + 0)) 640 $g_operator
mkdev mmem${unit}.${pt}c b %mmem_blk% $(($unit * 4096 + $pt * 16 + 2)) 640 $g_operator
# mkdev rmmem${unit}.${pt}a c %mmem_chr% $(($unit * 4096 + $pt * 16 + 0)) 640 $g_operator
mkdev rmmem${unit}.${pt}c c %mmem_chr% $(($unit * 4096 + $pt * 16 + 2)) 640 $g_operator
done
;;
mlcd*)
unit=${i#mlcd}
for pt in 0 # 1 2 3 4 ... 255
do
mkdev mlcd${unit}.${pt} c %mlcd_chr% $(($unit * 256 + $pt)) 640 $g_operator
done
;;
ixpcom*)
unit=${i#ixpcom}
mkdev ixpcom$unit c %ixpcom_chr% $unit "" "" $u_uucp
;;
ucbsnd)
mkdev ucbsnd c %ucbsnd_chr% 0 666
;;
adb)
mkdev adb c %aed_chr% 0 666
;;
asc*)
unit=${i#asc}
mkdev asc$unit c %asc_chr% $unit 666
;;
bwtwo*)
unit=${i#bwtwo}
mkdev bwtwo$unit c %bwtwo_chr% $unit 666
;;
cgtwo*)
unit=${i#cgtwo}
mkdev cgtwo$unit c %cgtwo_chr% $unit 666
;;
cgthree*)
unit=${i#cgthree}
mkdev cgthree$unit c %cgthree_chr% $unit 666
;;
cgfour*)
unit=${i#cgfour}
mkdev cgfour$unit c %cgfour_chr% $unit 666
;;
cgsix*)
unit=${i#cgsix}
mkdev cgsix$unit c %cgsix_chr% $unit 666
;;
cgeight*)
unit=${i#cgeight}
mkdev cgeight$unit c %cgeight_chr% $unit 666
;;
tcx*)
unit=${i#tcx}
mkdev tcx$unit c %tcx_chr% $unit 666
;;
xd*|xy*)
case $i in
xd*) name=xd; unit=${i#xd}; blk=%xd_blk%; chr=%xd_chr%;;
xy*) name=xy; unit=${i#xy}; blk=%xy_blk%; chr=%xy_chr%;;
esac
%MKDISK% $name $unit $blk $chr
;;
magma*)
unit=${i#magma}
if [ 0$unit -gt 3 ]; then
warn "bad unit for $i: $unit"
break
fi
for j in 0 1 2 3 4 5 6 7 8 9 a b c d e f
do
case $j in
[0-9]) jn=$j ;;
a) jn=10 ;;
b) jn=11 ;;
c) jn=12 ;;
d) jn=13 ;;
e) jn=14 ;;
f) jn=15 ;;
esac
mkdev tty$unit$j c %mtty_chr% $(($unit * 64 + $jn))
done
mkdev bpp${unit}0 c %mbpp_chr% $(($unit * 64 + 0))
mkdev bpp${unit}1 c %mbpp_chr% $(($unit * 64 + 1))
;;
clcd*)
unit=${i#clcd}
if [ 0$unit -gt 7 ]; then
warn "bad unit for $i: $unit"
break
fi
for j in 0 1 2 3 4 5 6 7
do
mkdev ttyA$unit$j c %clcd_chr% $(($unit * 8 + $j + $dialin)) "" "" $u_uucp
mkdev dtyA$unit$j c %clcd_chr% $(($unit * 8 + $j + $dialout)) "" "" $u_uucp
done
;;
bpp*)
unit=${i#bpp}
mkdev bpp$unit c %bpp_chr% $(($unit + 0))
;;
tctrl*)
unit=${i#tctrl}
mkdev tctrl$unit c %tctrl_chr% $unit 666
;;
bmd*)
unit=${i#bmd}
mkdev bmd${unit}a b %bmd_blk% $(($unit * 8 + 0)) 640 $g_operator
mkdev bmd${unit}c b %bmd_blk% $(($unit * 8 + 2)) 640 $g_operator
mkdev rbmd${unit}a c %bmd_chr% $(($unit * 8 + 0)) 640 $g_operator
mkdev rbmd${unit}c c %bmd_chr% $(($unit * 8 + 2)) 640 $g_operator
;;
sram)
mkdev sram c %sram_chr% 0 644
;;
pow*)
unit=${i#pow}
case $unit in
0|1)
mkdev pow${unit} c %pow_chr% ${unit} 644
if [ $unit = 0 ]; then
lndev pow${unit} pow
fi
;;
*)
warn "bad unit for pow in: $i"
;;
esac
;;
ttyS*)
unit=${i#ttyS}
mkdev ttyS$unit c %sacom_chr% $(($unit + $dialin )) "" "" $u_uucp
mkdev dtyS$unit c %sacom_chr% $(($unit + $dialout)) "" "" $u_uucp
;;
midevend)
%MI_DEVICES_END%
local)
if [ -f "$0.local" ]; then
umask 0
sh $0.local all
umask 077
fi
;;
*)
warn "$i: unknown device"
;;
esac
done
}
# three variants of disk partitions - max 8, max 16, max 16 with highpartoffset
# hack; only the one used by port is retained in final MAKEDEV script
# routine is called as:
# makedisk name unit blk chr
makedisk_p8()
{
name="$1"; unit="$2"; blk="$3"; chr="$4"
mkdev ${name}${unit}a b $blk $(($unit * 8 + 0)) 640 $g_operator
mkdev ${name}${unit}b b $blk $(($unit * 8 + 1)) 640 $g_operator
mkdev ${name}${unit}c b $blk $(($unit * 8 + 2)) 640 $g_operator
mkdev ${name}${unit}d b $blk $(($unit * 8 + 3)) 640 $g_operator
mkdev ${name}${unit}e b $blk $(($unit * 8 + 4)) 640 $g_operator
mkdev ${name}${unit}f b $blk $(($unit * 8 + 5)) 640 $g_operator
mkdev ${name}${unit}g b $blk $(($unit * 8 + 6)) 640 $g_operator
mkdev ${name}${unit}h b $blk $(($unit * 8 + 7)) 640 $g_operator
mkdev r${name}${unit}a c $chr $(($unit * 8 + 0)) 640 $g_operator
mkdev r${name}${unit}b c $chr $(($unit * 8 + 1)) 640 $g_operator
mkdev r${name}${unit}c c $chr $(($unit * 8 + 2)) 640 $g_operator
mkdev r${name}${unit}d c $chr $(($unit * 8 + 3)) 640 $g_operator
mkdev r${name}${unit}e c $chr $(($unit * 8 + 4)) 640 $g_operator
mkdev r${name}${unit}f c $chr $(($unit * 8 + 5)) 640 $g_operator
mkdev r${name}${unit}g c $chr $(($unit * 8 + 6)) 640 $g_operator
mkdev r${name}${unit}h c $chr $(($unit * 8 + 7)) 640 $g_operator
}
makedisk_p16()
{
name="$1"; unit="$2"; blk="$3"; chr="$4"
mkdev ${name}${unit}a b $blk $(($unit * 16 + 0)) 640 $g_operator
mkdev ${name}${unit}b b $blk $(($unit * 16 + 1)) 640 $g_operator
mkdev ${name}${unit}c b $blk $(($unit * 16 + 2)) 640 $g_operator
mkdev ${name}${unit}d b $blk $(($unit * 16 + 3)) 640 $g_operator
mkdev ${name}${unit}e b $blk $(($unit * 16 + 4)) 640 $g_operator
mkdev ${name}${unit}f b $blk $(($unit * 16 + 5)) 640 $g_operator
mkdev ${name}${unit}g b $blk $(($unit * 16 + 6)) 640 $g_operator
mkdev ${name}${unit}h b $blk $(($unit * 16 + 7)) 640 $g_operator
mkdev ${name}${unit}i b $blk $(($unit * 16 + 8)) 640 $g_operator
mkdev ${name}${unit}j b $blk $(($unit * 16 + 9)) 640 $g_operator
mkdev ${name}${unit}k b $blk $(($unit * 16 + 10)) 640 $g_operator
mkdev ${name}${unit}l b $blk $(($unit * 16 + 11)) 640 $g_operator
mkdev ${name}${unit}m b $blk $(($unit * 16 + 12)) 640 $g_operator
mkdev ${name}${unit}n b $blk $(($unit * 16 + 13)) 640 $g_operator
mkdev ${name}${unit}o b $blk $(($unit * 16 + 14)) 640 $g_operator
mkdev ${name}${unit}p b $blk $(($unit * 16 + 15)) 640 $g_operator
mkdev r${name}${unit}a c $chr $(($unit * 16 + 0)) 640 $g_operator
mkdev r${name}${unit}b c $chr $(($unit * 16 + 1)) 640 $g_operator
mkdev r${name}${unit}c c $chr $(($unit * 16 + 2)) 640 $g_operator
mkdev r${name}${unit}d c $chr $(($unit * 16 + 3)) 640 $g_operator
mkdev r${name}${unit}e c $chr $(($unit * 16 + 4)) 640 $g_operator
mkdev r${name}${unit}f c $chr $(($unit * 16 + 5)) 640 $g_operator
mkdev r${name}${unit}g c $chr $(($unit * 16 + 6)) 640 $g_operator
mkdev r${name}${unit}h c $chr $(($unit * 16 + 7)) 640 $g_operator
mkdev r${name}${unit}i c $chr $(($unit * 16 + 8)) 640 $g_operator
mkdev r${name}${unit}j c $chr $(($unit * 16 + 9)) 640 $g_operator
mkdev r${name}${unit}k c $chr $(($unit * 16 + 10)) 640 $g_operator
mkdev r${name}${unit}l c $chr $(($unit * 16 + 11)) 640 $g_operator
mkdev r${name}${unit}m c $chr $(($unit * 16 + 12)) 640 $g_operator
mkdev r${name}${unit}n c $chr $(($unit * 16 + 13)) 640 $g_operator
mkdev r${name}${unit}o c $chr $(($unit * 16 + 14)) 640 $g_operator
mkdev r${name}${unit}p c $chr $(($unit * 16 + 15)) 640 $g_operator
}
makedisk_p16high()
{
ho=524280 # offset for partition 9 to 16
name="$1"; unit="$2"; blk="$3"; chr="$4"
mkdev ${name}${unit}a b $blk $(($unit * 8 + 0)) 640 $g_operator
mkdev ${name}${unit}b b $blk $(($unit * 8 + 1)) 640 $g_operator
mkdev ${name}${unit}c b $blk $(($unit * 8 + 2)) 640 $g_operator
mkdev ${name}${unit}d b $blk $(($unit * 8 + 3)) 640 $g_operator
mkdev ${name}${unit}e b $blk $(($unit * 8 + 4)) 640 $g_operator
mkdev ${name}${unit}f b $blk $(($unit * 8 + 5)) 640 $g_operator
mkdev ${name}${unit}g b $blk $(($unit * 8 + 6)) 640 $g_operator
mkdev ${name}${unit}h b $blk $(($unit * 8 + 7)) 640 $g_operator
mkdev ${name}${unit}i b $blk $(($unit * 8 + $ho + 8)) 640 $g_operator
mkdev ${name}${unit}j b $blk $(($unit * 8 + $ho + 9)) 640 $g_operator
mkdev ${name}${unit}k b $blk $(($unit * 8 + $ho + 10)) 640 $g_operator
mkdev ${name}${unit}l b $blk $(($unit * 8 + $ho + 11)) 640 $g_operator
mkdev ${name}${unit}m b $blk $(($unit * 8 + $ho + 12)) 640 $g_operator
mkdev ${name}${unit}n b $blk $(($unit * 8 + $ho + 13)) 640 $g_operator
mkdev ${name}${unit}o b $blk $(($unit * 8 + $ho + 14)) 640 $g_operator
mkdev ${name}${unit}p b $blk $(($unit * 8 + $ho + 15)) 640 $g_operator
mkdev r${name}${unit}a c $chr $(($unit * 8 + 0)) 640 $g_operator
mkdev r${name}${unit}b c $chr $(($unit * 8 + 1)) 640 $g_operator
mkdev r${name}${unit}c c $chr $(($unit * 8 + 2)) 640 $g_operator
mkdev r${name}${unit}d c $chr $(($unit * 8 + 3)) 640 $g_operator
mkdev r${name}${unit}e c $chr $(($unit * 8 + 4)) 640 $g_operator
mkdev r${name}${unit}f c $chr $(($unit * 8 + 5)) 640 $g_operator
mkdev r${name}${unit}g c $chr $(($unit * 8 + 6)) 640 $g_operator
mkdev r${name}${unit}h c $chr $(($unit * 8 + 7)) 640 $g_operator
mkdev r${name}${unit}i c $chr $(($unit * 8 + $ho + 8)) 640 $g_operator
mkdev r${name}${unit}j c $chr $(($unit * 8 + $ho + 9)) 640 $g_operator
mkdev r${name}${unit}k c $chr $(($unit * 8 + $ho + 10)) 640 $g_operator
mkdev r${name}${unit}l c $chr $(($unit * 8 + $ho + 11)) 640 $g_operator
mkdev r${name}${unit}m c $chr $(($unit * 8 + $ho + 12)) 640 $g_operator
mkdev r${name}${unit}n c $chr $(($unit * 8 + $ho + 13)) 640 $g_operator
mkdev r${name}${unit}o c $chr $(($unit * 8 + $ho + 14)) 640 $g_operator
mkdev r${name}${unit}p c $chr $(($unit * 8 + $ho + 15)) 640 $g_operator
}
# make only the very few basic disk device nodes - 'a' partition
# and raw partition
makedisk_minimal()
{
name=$1; unit=$2; blk=$3; chr=$4
doff=%DISKMINOROFFSET%
ro=%RAWDISK_OFF%
rn=%RAWDISK_NAME%
mkdev ${name}${unit}a b $blk $(($unit * $doff + 0)) 640 $g_operator
mkdev ${name}${unit}$rn b $blk $(($unit * $doff + $ro)) 640 $g_operator
mkdev r${name}${unit}a c $chr $(($unit * $doff + 0)) 640 $g_operator
mkdev r${name}${unit}$rn c $chr $(($unit * $doff + $ro)) 640 $g_operator
}
makedev $*
|