Page MenuHomeFreeBSD

loader: Respect loader_color=YES for serial consoles
ClosedPublic

Authored by ryan_freqlabs.com on Sep 20 2019, 7:06 PM.

Details

Summary

It's not uncommon these days for the terminals attached to serial consoles to support ANSI escape sequences. However, we assume escape sequences may break some serial consoles and default to not using them when boot_serial or boot_multicons (or if console contains "comconsole" in the forth loader) for broader compatibility. We also have loader_color which can be explicitly set to "NO" to disable the use of ANSI escape sequences.

The problem is that loader_color=YES gets ignored when boot_serial=YES or boot_multicons=YES (or when console contains "comconsole" in the forth loader).

To fix, the existing default behavior remains unchanged when loader_color is unset, loader_color=NO explicitly disables the use of ANSI escape sequences still, and the change is that loader_color=YES can now be used to explicitly allow ANSI escapes when a serial console is enabled.

Sponsored by: iXsystems, Inc.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

kevans accepted this revision.Sep 20 2019, 7:12 PM

Looks good for lualoader side.

This revision is now accepted and ready to land.Sep 20 2019, 7:12 PM
tsoome added inline comments.Sep 20 2019, 7:20 PM
stand/forth/color.4th
33 ↗(On Diff #62356)

this is not your code, but could you swap N to t there, since we leave true or false on stack, it is traditionally denoted by char 't''. (N is for signed int).

53 ↗(On Diff #62356)

you can use:
boot_serial? 0= -- this will leave proper value on stack and you can save 4 words:)

Fixed up nearby code as requested

This revision now requires review to proceed.Sep 20 2019, 7:29 PM
ryan_freqlabs.com marked 2 inline comments as done.Sep 20 2019, 7:29 PM
tsoome accepted this revision.Sep 20 2019, 7:30 PM
This revision is now accepted and ready to land.Sep 20 2019, 7:30 PM
kevans accepted this revision.Sep 20 2019, 7:31 PM

Still OK from lua side -- please commit at will.

Thanks! Can I ask someone with a commit bit to please put this in for me?

This revision was automatically updated to reflect the committed changes.