Skip to content
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

faux-mgs uart-attach: try to impersonate picocom #28

Merged
merged 3 commits into from
Dec 12, 2022

Conversation

jgallagher
Copy link
Collaborator

Added in this PR:

  • A top level faux-mgs --logfile <FILE> command to write slog output to a file instead of stderr
  • Three new options to faux-mgs uart-attach:
    • --imap <RULES>, --omap <RULES>: basically like picocom (but doesn't support the *hex remappings)
    • --uart-logfile <FILE>: record everything we read from MGS to FILE

Changed in this PR:

  • faux-mgs uart-attach's --raw flag is now --no-raw (i.e., raw is the default)
  • Exiting from raw mode is now Ctrl-A Ctrl-X instead of Ctrl-A Ctrl-C

This has some overlap / copy paste with oxidecomputer/humility#288 (picocom_map.rs in particular is a direct copy/paste). Might be worth trying to abstract a "serial console tty client" crate at some point?

Copy link
Collaborator

@andrewjstone andrewjstone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks correct based on tests, but I think adding a comment around the RemapIter regarding prev would be useful.

}

let drain = if let Some(path) = path {
// Special case /dev/null - don't even bother with slog_async, just
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

}

#[test]
fn remapping() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice test :)

faux-mgs/src/picocom_map.rs Show resolved Hide resolved
@jgallagher jgallagher merged commit 2e0b415 into main Dec 12, 2022
@jgallagher jgallagher deleted the faux-mgs-console-tweaks branch December 12, 2022 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants