core icon indicating copy to clipboard operation
core copied to clipboard

21->22 upgrade - loss of serial port at 115200

Open dirkx opened this issue 3 years ago • 3 comments

Important notices

Before you add a new report, we ask you kindly to acknowledge the following:

  • [ X] I have read the contributing guide lines at https://github.com/opnsense/core/blob/master/CONTRIBUTING.md
  • [ X] I am convinced that my issue is new after having checked both open and closed issues at https://github.com/opnsense/core/issues?q=is%3Aissue

Describe the bug

After a routine 21->22 upgrade; the com console on the serial port (uart0) was lost & 'stty -f' and set to 9600.

To Reproduce

Steps to reproduce the behavior:

install 21.x -- serial port functional and on 115200

upgrade to 22.x -- serial port no longer working

Expected behavior

Expected this to continue working.

Describe alternatives you considered

Adding the line:

 hw.uart.console="io:0x3f8,br:115200"

to loader.conf.local does not work. Also adding the lines

 hw.uart.console="io:0x3f8,br:115200"
 set comconsole_speed=115200
 set comconsole_port=0x3f8
 set console=comconsole

works perfectly.

dirkx avatar Aug 23 '22 11:08 dirkx

Well what hardware is this? And 22.x is a little inconvenient as fixes went in an the OS was upgraded from FreeBSD 12 to 13...

fichtner avatar Aug 23 '22 11:08 fichtner

  1. OPNSense appliance, DEC3850 (not sure of revision; about 2 years old)

  2. Protectli Vault FW2B, 4port, rev.7-2020

  3. non branded Fanless Mini PC Router Core I3 7167U, no revision/date known

All set in the bios to be COM1 console/fully serial; VGA/etc disabled.

dirkx avatar Aug 23 '22 12:08 dirkx

For 1) there was a bug in FreeBSD 13 that didn't handle EFI serial consoles anymore. It was added in 22.1.2, but in general FreeBSD 13 requires the BIOS to disable legacy UART emulation: https://docs.opnsense.org/hardware/serial_connectivity.html

For 2) It should continue to work regardless.

For 3) I can't say, not very specific.

fichtner avatar Aug 23 '22 12:08 fichtner

For 1 - that workaround works - with as caveat that on any existing OPNSense applicances coming from21 it seems that the loader.conf.local needs to be manaully removed/emptied post upgrade. Perhaps nice for release notes or as part of the update.

For 2 and 3 - no such BIOS setting - but above loader.conf.local settings make it work reliably.

dirkx avatar Oct 11 '22 08:10 dirkx

that workaround works

It's not a workaround. It's a requirement in FreeBSD 13, which broke the EFI serial console in the first place.

loader.conf.local needs to be manually removed/emptied

What's done to loader.conf.local is local to the installation and of no concern to the core system.

hw.uart.console et al.

You can set that from the System: Settings: Tunables GUI if needed.

As for FreeBSD requirements regading serial console across multiple hardware that will be of further subject to change outside of our control through upstream driver changes and hardware adoption.

Cheers, Franco

fichtner avatar Oct 11 '22 09:10 fichtner

Just as a note - we have experienced issues when booting systems without an attached monitor. We have written a wiki article on that and we have added links to this issue here on GitHub:

  • https://www.thomas-krenn.com/en/wiki/OPNsense_does_not_boot_without_monitor (Englisch version)
  • https://www.thomas-krenn.com/de/wiki/OPNsense_bootet_nicht_ohne_Monitor (German version)

tk-wfischer avatar Jan 09 '23 12:01 tk-wfischer

Happy new year @tk-wfischer! :)

Thanks for the article. Although the bug was addressed it's still pending for FreeBSD. I'm not sure at which point it'll be officially accepted. I'll try to poke them again this year to see how much work a "proper" integration actually is.

https://reviews.freebsd.org/D34329

Cheers, Franco

fichtner avatar Jan 09 '23 12:01 fichtner