summaryrefslogtreecommitdiffstats
path: root/etc/MAKEDEV
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2002-03-31 09:15:43 +0000
committerbde <bde@FreeBSD.org>2002-03-31 09:15:43 +0000
commitdf30d6374fe92f59350770d63cd31f77979006da (patch)
treef8c2f5ed93e3f204296bb031ae818b3c8d00238f /etc/MAKEDEV
parentcf12629bdcf1d3d01898f867636181c50222eca8 (diff)
downloadFreeBSD-src-df30d6374fe92f59350770d63cd31f77979006da.zip
FreeBSD-src-df30d6374fe92f59350770d63cd31f77979006da.tar.gz
Support more than 32 sio unit numbers. The maximum unit number is now
(65536 * 32 - 1), but MAKEDEV only supports up to (32 * 32 -1). Device names use the unit number in base 32 for all "digits". This required fixing an old bug in MAKEDEV:ttyminor(). Its arg was the global $unit instead of $1. Reminded by: Valentin K. Ponomarenko <valka@krog.ukrtel.net> MFC-after: 1 week
Diffstat (limited to 'etc/MAKEDEV')
-rw-r--r--etc/MAKEDEV48
1 files changed, 35 insertions, 13 deletions
diff --git a/etc/MAKEDEV b/etc/MAKEDEV
index cc8a1a8..7f13367 100644
--- a/etc/MAKEDEV
+++ b/etc/MAKEDEV
@@ -256,8 +256,8 @@ saminor()
# Convert the last character of a tty name to a minor number.
ttyminor()
{
- case $unit in
- [0-9]) m=$unit;;
+ case $1 in
+ [0-9]) m=$1;;
a) m=10;; b) m=11;; c) m=12;; d) m=13;; e) m=14;; f) m=15;; g) m=16;;
h) m=17;; i) m=18;; j) m=19;; k) m=20;; l) m=21;; m) m=22;; n) m=23;;
o) m=24;; p) m=25;; q) m=26;; r) m=27;; s) m=28;; t) m=29;; u) m=30;;
@@ -1068,22 +1068,44 @@ speaker)
mknod speaker c 26 0
;;
-cuaa?|cua?)
+cua?|cuaa?|cuaa??)
umask 7
- unit=`expr $i : 'cua.*\(.\)$'`
- m=`ttyminor $unit`
- mknod cuaa$unit c 28 $(($m + 128)) uucp:dialer
- mknod cuaia$unit c 28 $(($m + 32 + 128)) uucp:dialer
- mknod cuala$unit c 28 $(($m + 64 + 128)) uucp:dialer
+ unit_low=`expr $i : 'cua.*\(.\)$'`
+ case $i in
+ cua?|cuaa?)
+ unit_high=""
+ m_high=0
+ ;;
+ cuaa??)
+ unit_high=`expr $i : 'cuaa\(.\).$'`
+ m_high=`ttyminor $unit_high`
+ ;;
+ esac
+ unit=$unit_high$unit_low
+ m=$(($m_high << 16 | `ttyminor $unit_low`))
+ mknod cuaa$unit c 28 $(($m | 128)) uucp:dialer
+ mknod cuaia$unit c 28 $(($m | 32 | 128)) uucp:dialer
+ mknod cuala$unit c 28 $(($m | 64 | 128)) uucp:dialer
umask 77
;;
-tty0?|ttyd?|tty?)
- unit=`expr $i : 'tty.*\(.\)$'`
- m=`ttyminor $unit`
+tty?|tty0?|ttyd?|ttyd??)
+ unit_low=`expr $i : 'tty.*\(.\)$'`
+ case $i in
+ tty?|tty0?|ttyd?)
+ unit_high=""
+ m_high=0
+ ;;
+ ttyd??)
+ unit_high=`expr $i : 'ttyd\(.\).$'`
+ m_high=`ttyminor $unit_high`
+ ;;
+ esac
+ unit=$unit_high$unit_low
+ m=$(($m_high << 16 | `ttyminor $unit_low`))
mknod ttyd$unit c 28 $m
- mknod ttyid$unit c 28 $(($m + 32))
- mknod ttyld$unit c 28 $(($m + 64))
+ mknod ttyid$unit c 28 $(($m | 32))
+ mknod ttyld$unit c 28 $(($m | 64))
;;
cuac?)
OpenPOWER on IntegriCloud