diff options
author | Corentin LABBE <clabbe@baylibre.com> | 2018-06-08 11:14:55 +0200 |
---|---|---|
committer | Corentin LABBE <clabbe@baylibre.com> | 2018-07-12 14:07:37 +0200 |
commit | 72fce7856928dbae032eee15a1cd5a8b8c9ce384 (patch) | |
tree | 0601538174edd4529c47dff5c23d6d1c0b601167 /lavalab-gen.py | |
parent | 615e0d597510736dab68e41bd9dc002da6b2514f (diff) |
Support screen for uart
This patch add support for using screen instead of conmux-console.
screen can be used by adding "use_screen: True" to uart.
screen is necessary for some board with internal uart which have a micro
cut when switching power (like DRA7-EVM and M3ULCB)
Diffstat (limited to 'lavalab-gen.py')
-rwxr-xr-x | lavalab-gen.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/lavalab-gen.py b/lavalab-gen.py index bb7809c..83a8a2d 100755 --- a/lavalab-gen.py +++ b/lavalab-gen.py @@ -43,6 +43,10 @@ template_device_ser2net = string.Template(""" {% set connection_command = 'telnet 127.0.0.1 ${port}' %} """) +template_device_screen = string.Template(""" +{% set connection_command = 'ssh -o StrictHostKeyChecking=no -t root@127.0.0.1 "TERM=xterm screen -x ${board}"' %} +""") + template_udev_serial = string.Template("""# SUBSYSTEM=="tty", ATTRS{idVendor}=="${idvendor}", ATTRS{idProduct}=="${idproduct}", ATTRS{serial}=="${serial}", MODE="0664", OWNER="uucp", SYMLINK+="${board}" """) @@ -336,21 +340,32 @@ def main(): dc_devices = dockcomp["services"][worker_name]["devices"] dc_devices.append("/dev/%s:/dev/%s" % (board_name, board_name)) use_conmux = True + use_ser2net = False + use_screen = False if "use_ser2net" in uart: use_conmux = False + use_ser2net = True + if "use_screen" in uart: + use_conmux = False + use_screen = True if use_conmux: conmuxline = template_conmux.substitute(board=board_name, baud=baud) device_line += template_device_conmux.substitute(board=board_name) fp = open("%s/conmux/%s.cf" % (workerdir, board_name), "w") fp.write(conmuxline) fp.close() - else: + if use_ser2net: ser2net_line = template_ser2net.substitute(port=ser2net_port,baud=baud,board=board_name) device_line += template_device_ser2net.substitute(port=ser2net_port) ser2net_port += 1 fp = open("%s/ser2net.conf" % workerdir, "a") fp.write(ser2net_line) fp.close() + if use_screen: + device_line += template_device_screen.substitute(board=board_name) + fp = open("%s/lava-screen.conf" % workerdir, "a") + fp.write("%s\n" % board_name) + fp.close() elif "connection_command" in board: connection_command = board["connection_command"] device_line += template_device_connection_command.substitute(connection_command=connection_command) |