diff options
-rw-r--r-- | README.md | 4 | ||||
-rwxr-xr-x | lavalab-gen.py | 12 |
2 files changed, 10 insertions, 6 deletions
@@ -287,6 +287,9 @@ boards: devpath: the UDEV devpath to this uart for UART without serial number interfacenum: (optional) The interfacenumber of the serial. (Used with two serial in one device) use_ser2net: True/false (Use ser2net instead of conmux-console) + ser2net_options (optional) A list of ser2net options to add + - option1 + - option2 use_screen: True/false (Use screen via ssh instead of conmux-console) connection_command: A command to be ran for getting a serial console pdu_generic: @@ -296,6 +299,7 @@ boards: ``` Notes on UART: * Only one of devpath/serial is necessary. +* screen usage is discouraged and should not be used, it was added as a workaround for some boards, but ser2net now can handle them. * For finding the right devpath, you could use ``` udevadm info -a -n /dev/ttyUSBx |grep devpath | head -n1 diff --git a/lavalab-gen.py b/lavalab-gen.py index 9eae28e..4287efc 100755 --- a/lavalab-gen.py +++ b/lavalab-gen.py @@ -38,9 +38,6 @@ template_device_pdu_generic = string.Template(""" {% set power_on_command = '${power_on_command}' %} """) -template_ser2net = string.Template(""" -${port}:telnet:600:/dev/${board}:${baud} 8DATABITS NONE 1STOPBIT banner -""") template_device_ser2net = string.Template(""" {% set connection_command = 'telnet 127.0.0.1 ${port}' %} """) @@ -482,13 +479,16 @@ def main(): if not worker_name in ser2net_ports: ser2net_ports[worker_name] = ser2net_port_start fp = open("%s/ser2net.conf" % workerdir, "a") - fp.write("DEFAULT:max-connections:10") + fp.write("DEFAULT:max-connections:10\n") fp.close() - ser2net_line = template_ser2net.substitute(port=ser2net_ports[worker_name],baud=baud,board=board_name) + ser2net_line = "%d:telnet:600:/dev/%s:%d 8DATABITS NONE 1STOPBIT" % (ser2net_ports[worker_name], board_name, baud) + if "ser2net_options" in uart: + for ser2net_option in uart["ser2net_options"]: + ser2net_line += " %s" % ser2net_option device_line += template_device_ser2net.substitute(port=ser2net_ports[worker_name]) ser2net_ports[worker_name] += 1 fp = open("%s/ser2net.conf" % workerdir, "a") - fp.write(ser2net_line) + fp.write(ser2net_line + " banner\n") fp.close() if use_screen: device_line += template_device_screen.substitute(board=board_name) |