-
Notifications
You must be signed in to change notification settings - Fork 335
go: improve serial console #292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This allows a native `go build` and `go test`. Signed-off-by: David Scott <dave@recoil.org>
The previous API didn't allow us to disable the PTY but keep the ring buffer, for example. These should be orthogonal, so add a new API and deprecate the old one. Signed-off-by: David Scott <dave@recoil.org>
Signed-off-by: David Scott <dave@recoil.org>
|
User observed a problem here: docker/roadmap#12 (comment) -- it looks like I've forgotten to modify the |
It's useful to be able to log the serial console output to a ring buffer (or even ASL) without necessarily having a real host console attached to it (i.e. no TTY or `stdio`). The code requires an open file descriptor so add a new type `null` which opens `/dev/null`. Signed-off-by: David Scott <dave@recoil.org>
18bafa1 to
04d209c
Compare
mat007
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
| } else { | ||
| if err := h.checkSerials(); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: } else if { works as well
|
Thanks! |
The current Go API for setting up the serial console has limitations, including:
stdioor atty, and will trigger anassertif you don't provide one of themttywith the request to log the output to a ring-buffer or to Apple System Log.This PR adds a new Go API while keeping (but deprecating) the old one. It's now possible to have multiple serial ports, each of which is connected to one of:
/dev/nullstdioand of which can be separately logged to any combination of:
/dev/nullThis PR also adds a
go.modand some unit tests for the console-related command-line building functions.