mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* Add barebox remote control
@ 2015-06-11  6:54 Sascha Hauer
  2015-06-11  6:54 ` [PATCH 1/4] Add Reliable Asynchronous Transfer Protocol Sascha Hauer
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Sascha Hauer @ 2015-06-11  6:54 UTC (permalink / raw)
  To: Barebox List

There's often the desire to control barebox from scripts on a remote
host. Currently this means matching the console output for something
that looks like a prompt, then sending commands to the shell and parsing
the output again. This is quite error prone and fragile, so here is
another approach:

Back in the eighties RFC916 was posted which describes a reliable packet
based communication over serial lines: The reliable asynchronous transfer
protocol (RATP). This series implements this protocol and uses it to transfer
command messages to barebox and the result back to the host. A sample
invocation of the host tool looks like:

# ./scripts/bbremote --port rfc2217://rl3:4006 run ls
console: '.      '
console: '..     '
console: 'dev    '
console: 'env    '
console: 'mnt    '
console: '\n'
Result: BBPacketCommandReturn(exit_code=0)

This is all in an early stadium, we'll probably do some iterations before
we merge this, but to some extend it's already useful and maybe someone
else is also interested, so we decided to post it now.

Sascha

----------------------------------------------------------------
Jan Luebbe (2):
      include pyserial trunk
      host side for barebox remote control

Sascha Hauer (2):
      Add Reliable Asynchronous Transfer Protocol
      barebox remote control

 .gitignore                                    |    1 +
 common/Kconfig                                |   10 +
 common/Makefile                               |    2 +
 common/console.c                              |   54 +-
 common/hush.c                                 |    5 +
 common/ratp.c                                 |  257 ++++
 common/startup.c                              |    6 +
 crypto/Kconfig                                |    1 +
 include/console.h                             |    3 +
 include/ratp.h                                |   80 ++
 lib/Kconfig                                   |    8 +
 lib/Makefile                                  |    1 +
 lib/ratp.c                                    | 1612 +++++++++++++++++++++++++
 lib/readline.c                                |    3 +
 scripts/bbremote                              |    3 +
 scripts/remote/__init__.py                    |    0
 scripts/remote/main.py                        |   57 +
 scripts/remote/messages.py                    |  182 +++
 scripts/remote/missing.py                     |   28 +
 scripts/remote/ratp.py                        |  747 ++++++++++++
 scripts/serial/__init__.py                    |   79 ++
 scripts/serial/rfc2217.py                     | 1327 ++++++++++++++++++++
 scripts/serial/serialcli.py                   |  284 +++++
 scripts/serial/serialposix.py                 |  730 +++++++++++
 scripts/serial/serialutil.py                  |  572 +++++++++
 scripts/serial/tools/__init__.py              |    0
 scripts/serial/tools/list_ports.py            |  103 ++
 scripts/serial/tools/list_ports_linux.py      |  152 +++
 scripts/serial/urlhandler/__init__.py         |    0
 scripts/serial/urlhandler/protocol_hwgrep.py  |   45 +
 scripts/serial/urlhandler/protocol_loop.py    |  279 +++++
 scripts/serial/urlhandler/protocol_rfc2217.py |   11 +
 scripts/serial/urlhandler/protocol_socket.py  |  291 +++++
 33 files changed, 6931 insertions(+), 2 deletions(-)
 create mode 100644 common/ratp.c
 create mode 100644 include/ratp.h
 create mode 100644 lib/ratp.c
 create mode 100755 scripts/bbremote
 create mode 100644 scripts/remote/__init__.py
 create mode 100644 scripts/remote/main.py
 create mode 100644 scripts/remote/messages.py
 create mode 100644 scripts/remote/missing.py
 create mode 100644 scripts/remote/ratp.py
 create mode 100644 scripts/serial/__init__.py
 create mode 100644 scripts/serial/rfc2217.py
 create mode 100644 scripts/serial/serialcli.py
 create mode 100644 scripts/serial/serialposix.py
 create mode 100644 scripts/serial/serialutil.py
 create mode 100644 scripts/serial/tools/__init__.py
 create mode 100644 scripts/serial/tools/list_ports.py
 create mode 100644 scripts/serial/tools/list_ports_linux.py
 create mode 100644 scripts/serial/urlhandler/__init__.py
 create mode 100644 scripts/serial/urlhandler/protocol_hwgrep.py
 create mode 100644 scripts/serial/urlhandler/protocol_loop.py
 create mode 100644 scripts/serial/urlhandler/protocol_rfc2217.py
 create mode 100644 scripts/serial/urlhandler/protocol_socket.py

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-06-17  5:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-11  6:54 Add barebox remote control Sascha Hauer
2015-06-11  6:54 ` [PATCH 1/4] Add Reliable Asynchronous Transfer Protocol Sascha Hauer
2015-06-12 12:05   ` Peter Korsgaard
2015-06-15  5:12     ` Sascha Hauer
2015-06-15  7:19       ` Peter Korsgaard
2015-06-17  5:45         ` Sascha Hauer
2015-06-11  6:54 ` [PATCH 2/4] barebox remote control Sascha Hauer
2015-06-12 10:36   ` Peter Korsgaard
2015-06-15  4:51     ` Sascha Hauer
2015-06-11  6:54 ` [PATCH 3/4] include pyserial trunk Sascha Hauer
2015-06-11 15:48   ` Uwe Kleine-König
2015-06-11  6:54 ` [PATCH 4/4] host side for barebox remote control Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox