From 72fce7856928dbae032eee15a1cd5a8b8c9ce384 Mon Sep 17 00:00:00 2001 From: Corentin LABBE Date: Fri, 8 Jun 2018 11:14:55 +0200 Subject: 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) --- lavalab-gen.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'lavalab-gen.py') 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) -- cgit 1.2.3-korg