Skip to content

Commit

Permalink
Remove conmux
Browse files Browse the repository at this point in the history
  • Loading branch information
montjoie committed Sep 12, 2023
1 parent 6ccad32 commit 152e7c1
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 42 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ boards:
baud: (optional) Change the baud rate of the this uart (default is 115200)
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_conmux: True/False (Use conmux-console instead of ser2net)
use_ser2net: True/False (Deprecated, ser2net is the default uart handler)
ser2net_keepopen: True/False (optional) Use the recent ser2net keepopen
ser2net_options: (optional) A list of ser2net options to add
Expand Down Expand Up @@ -385,7 +384,6 @@ this script will generate all necessary files in the following locations:
```
output/host/lava-master/tokens/ This is where the callback tokens will be generated
output/host/lava-master/users/ This is where the users will be generated
output/host/lab-slave-XX/conmux/ All files needed by conmux
output/host/lab-slave-XX/devices/ All LAVA devices files
output/host/udev/99-lavaworker-udev.rules udev rules for host
output/host/docker-compose.yml Generated from docker-compose.template
Expand Down
4 changes: 1 addition & 3 deletions lava-slave/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@ FROM lavasoftware/lava-dispatcher:2023.01

RUN apt-get update

# cu conmux is for console via conmux
# telnet is for using ser2net
# git is necessary for checkout tests
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install cu conmux telnet git ser2net patch lavacli
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install telnet git ser2net patch lavacli

COPY configs/lava-slave /etc/lava-dispatcher/lava-slave

COPY configs/tftpd-hpa /etc/default/tftpd-hpa

COPY scripts/ /usr/local/bin/
RUN chmod a+x /usr/local/bin/*
COPY conmux/ /etc/conmux/

# Caution to not use any port between the Linux dynamic port range: 32768-60999
RUN find /usr/lib/python3/dist-packages/ -iname constants.py | xargs sed -i 's,XNBD_PORT_RANGE_MIN.*,XNBD_PORT_RANGE_MIN=61950,'
Expand Down
11 changes: 0 additions & 11 deletions lava-slave/scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,6 @@ if [ -s /etc/ser2net.yaml ];then
service ser2net start || exit 7
fi

touch /var/run/conmux-registry
/usr/sbin/conmux-registry 63000 /var/run/conmux-registry&
sleep 2
for item in $(ls /etc/conmux/*cf)
do
echo "Add $item"
# On some OS, the rights/user from host are not duplicated on guest
grep -o '/dev/[a-zA-Z0-9_-]*' $item | xargs chown uucp
/usr/sbin/conmux $item &
done

# start an http file server for boot/transfer_overlay support
(cd /var/lib/lava/dispatcher; python3 -m http.server 80) &

Expand Down
27 changes: 1 addition & 26 deletions lavalab-gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,10 @@
ser2net_ports = {}
allowed_hosts_list = [ '"127.0.0.1","localhost"' ]

template_conmux = string.Template("""#
# auto-generated by lavalab-gen.py for ${board}
#
listener ${board}
application console '${board} console' 'exec sg dialout "cu-loop /dev/${board} ${baud}"'
""")

#no comment it is volontary
template_device = string.Template("""{% extends '${devicetype}.jinja2' %}
""")

template_device_conmux = string.Template("""
{% set connection_command = 'conmux-console ${board}' %}
""")
template_device_connection_command = string.Template("""#
{% set connection_command = '${connection_command}' %}
""")
Expand Down Expand Up @@ -471,9 +461,6 @@ def main():
fp = open("%s/phyhostname" % workerdir, "w")
fp.write(host)
fp.close()
conmuxpath = "%s/conmux" % workerdir
if not os.path.isdir(conmuxpath):
os.mkdir(conmuxpath)

worker = slave
worker_name = name
Expand Down Expand Up @@ -740,26 +727,14 @@ def main():
fp.close()
if not "bind_dev" in slave or not slave["bind_dev"]:
dockcomp_add_device(dockcomp, worker_name, "/dev/%s:/dev/%s" % (board_name, board_name))
use_conmux = False
use_ser2net = False
ser2net_keepopen = False
if "use_conmux" in uart:
use_conmux = uart["use_conmux"]
if "use_ser2net" in uart:
use_ser2net = uart["use_ser2net"]
if "ser2net_keepopen" in uart:
ser2net_keepopen = uart["ser2net_keepopen"]
if (use_conmux and use_ser2net):
print("ERROR: Only one uart handler must be configured")
sys.exit(1)
if not use_conmux and not use_ser2net and not "connection_command" in board:
if not use_ser2net and not "connection_command" in board:
use_ser2net = 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()
if use_ser2net:
if not worker_name in ser2net_ports:
ser2net_ports[worker_name] = ser2net_port_start
Expand Down

0 comments on commit 152e7c1

Please sign in to comment.