USB console hangs right after SSH keys are shown before login promt

Started by kursu, February 25, 2019, 07:47:59 PM

Previous topic - Next topic
Setting "-S115200 -h" into boot.conf seems to be a workaround, however it gets replaced every reboot. Wrong uart flags or how to
make -h persistant?

dmesg:

root@bifrost:/boot # dmesg | grep uart
uart0: <16550 or compatible> at port 0x3f8 irq 4 on isa0
uart1: <16550 or compatible> at port 0x2f8 irq 3 flags 0x10 on isa0
uart1: console (115200,n,8,1)


/etc/ttys:

# If console is marked "insecure", then init will ask for the root password
# when going to single-user mode.
console none                            unknown off secure
#
ttyv0   "/usr/libexec/getty Pc"         xterm   off secure
# Virtual terminals
ttyv1   "/usr/libexec/getty Pc"         xterm   off secure
ttyv2   "/usr/libexec/getty Pc"         xterm   off secure
ttyv3   "/usr/libexec/getty Pc"         xterm   off secure
ttyv4   "/usr/libexec/getty Pc"         xterm   off secure
ttyv5   "/usr/libexec/getty Pc"         xterm   off secure
ttyv6   "/usr/libexec/getty Pc"         xterm   off secure
ttyv7   "/usr/libexec/getty Pc"         xterm   off secure
ttyv8   "/usr/local/bin/xdm -nodaemon"  xterm   off secure
# Serial terminals
# The 'dialup' keyword identifies dialin lines to login, fingerd etc.
ttyU0   "/usr/libexec/getty std.115200" vt100   onifconsole secure
ttyU1   "/usr/libexec/getty std.115200" vt100   onifconsole secure
ttyU2   "/usr/libexec/getty std.115200" vt100   onifconsole secure
ttyU3   "/usr/libexec/getty std.115200" vt100   onifconsole secure
# Dumb console
dcons   "/usr/libexec/getty std.9600"   vt100   off secure



root@bifrost:/boot # cat loader.conf.local
comconsole_port="0x2F8"
comconsole_speed="115200"
hint.uart.0.flags=0x0
hint.uart.1.flags=0x10



In System / Settings / Administration there's a "USB-based serial" option - did you try that? (not sure what it does exactly at the system level but sounds related)

I have a physical serial here so I can't test the USB right now. You could use ssh access to check if getty is actually being spawned on the correct USB tty - seems like it's not.

Yes, USB Serial box is checked, it added the following to /etc/ttys :


ttyU0   "/usr/libexec/getty std.115200" vt100   onifconsole secure
ttyU1   "/usr/libexec/getty std.115200" vt100   onifconsole secure
ttyU2   "/usr/libexec/getty std.115200" vt100   onifconsole secure
ttyU3   "/usr/libexec/getty std.115200" vt100   onifconsole secure


root@bifrost:/ # ls /dev | grep ttyu
ttyu0
ttyu0.init
ttyu0.lock
ttyu1
ttyu1.init
ttyu1.lock


There you said something....  devices is named lower-case in /dev (ttyu0,ttyu1) and in /etc/ttys (ttyU0 ttyU1).

system.inc

   /* serial terminals */
        foreach (array('tty%s0', 'tty%s1', 'tty%s2', 'tty%s3') as $serialport) {
            $serialport = sprintf($serialport, isset($config['system']['serialusb']) ? 'U' : 'u');
            if (stripos($tty, $serialport) === 0) {
                fwrite($fd, "{$serialport}\t\"/usr/libexec/getty {$serial_type}\"\tvt100\t{$on_off_secure_u}\n");
                continue 2;
            }
        }

I wasnt able to try out my code change due to my netgate hardware decided to die  :-\, a 12core proliant have jumpen in as temporary replacement  8)

ttyu0 and ttyu1 (lower case 'u') look like actual physical serial ports to me, not USB - could it be? (see uart(4) vs. ucom(4) for the naming)

This too doesn't look like USB...

uart0: <16550 or compatible> at port 0x3f8 irq 4 on isa0
uart1: <16550 or compatible> at port 0x2f8 irq 3 flags 0x10 on isa0

With serial port enabled (secondary or primary) and USB unchecked it should work in conjunction with the loader.conf.local trickery.


Cheers,
Franco
"AI has absolutely reduced the cost of creating technical debt." -- ChatGPT