This patch changes the names for emulated ttys from tty[C-J][0-9a-f] to
tty[C-J]{0..254}. 255 is reserved for the cfg device and thus cannot
currently be used.

This enables consistent addressing for all emulated ttys, and is
not unexpected to hit bits here and there; it is also a visible change,
as the getty(8) greeting displays the terminal name. 

If more than 10 emulated ttys are in use (at least on the same display),
ttys(5) must be modified to reflect the new scheme.

Index: src/etc/MAKEDEV.common
===================================================================
RCS file: /cvs/src/etc/MAKEDEV.common,v
retrieving revision 1.101
diff -u -p -r1.101 MAKEDEV.common
--- src/etc/MAKEDEV.common      31 Aug 2018 02:32:29 -0000      1.101
+++ src/etc/MAKEDEV.common      24 Dec 2018 06:17:25 -0000
@@ -277,7 +277,7 @@ __mkdev({-disks-}){--}dnl
 dnl
 __devtitle(cons, Console ports)dnl
 __devitem(wscons, wscons, Minimal wscons devices)dnl
-twrget(wscons, wscons, ttyC, cfg, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b)dnl
+twrget(wscons, wscons, ttyC, cfg, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)dnl
 target(wscons, wsmux)dnl
 target(wscons, wskbd, 0, 1, 2, 3)dnl
 target(wscons, wsmouse, 0, 1, 2, 3)dnl
@@ -297,9 +297,11 @@ _mkdev({-wsdisp-}, tty[C-J]*, {-U=${i##t
        ttyJ*) n=J m=expr(7*256);;
        esac
        case $U in
-       [0-9a-f]) M tty$n$U c major_wsdisp_c Add(16#$U, $m) 600;;
        cfg) M tty${n}cfg c major_wsdisp_c Add(255,$m) 600;;
-       *) echo bad unit $U for $i; exit 1;;
+       *) if [ -z "$U" ] || [ $U -gt 254 ]; then
+           echo bad unit $U for $i; exit 1;
+          fi;
+          M tty${n}${U} c major_wsdisp_c Add($U,$m) 600;;
        esac-})dnl
 __devitem(wskbd, wskbd*, wscons keyboards)dnl
 dnl XXX wskbd[0-9]* instead of wskbd* in case this appears before

Reply via email to