Autodetect and enable serial tty
We currently only enable serial console on the -virt iso image. It would be nice if we could automatically enable a serial tty when something is connected.
We can do this by looking for CTS
and/or DSR
in /proc/tty/drivers/serial
.
For example (here a getty is configured for ttyS1 but not for ttyS0. A cable is connected to ttyS0 and minicom is running on the other end):
0: uart:16550A port:000003F8 irq:4 tx:0 rx:0 CTS|DSR
1: uart:16550A port:000002F8 irq:3 tx:103 rx:0 RTS|DTR
2: uart:unknown port:000003E8 irq:4
3: uart:unknown port:000002E8 irq:3
When those are there we can add the serial console entry in $sysroot/etc/inittab
.
This seems to also work with qemu's -serial stdio
/-nographic
which is the primary use case.
We can verify that serial console is readable with stty -a -F /dev/ttyS0
.
ref: aports#11599 (closed) ref: aports#12418 (closed)