mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: Add barebox remote control
Date: Thu, 11 Jun 2015 08:54:06 +0200	[thread overview]
Message-ID: <1434005650-28131-1-git-send-email-s.hauer@pengutronix.de> (raw)

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

             reply	other threads:[~2015-06-11  6:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-11  6:54 Sascha Hauer [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1434005650-28131-1-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox