From b18c3454b16a4b01155daaaa54c6663cf9498121 Mon Sep 17 00:00:00 2001 From: Corentin LABBE Date: Tue, 7 Nov 2017 15:06:49 +0100 Subject: Place board under boardlist We need to add some information to lab node, so we need to move all boards under a list("boardlist") --- README.md | 19 +++++----- boards.yaml | 109 +++++++++++++++++++++++++++++---------------------------- lavalab-gen.py | 4 +-- 3 files changed, 67 insertions(+), 65 deletions(-) diff --git a/README.md b/README.md index b8bb503..c92febe 100644 --- a/README.md +++ b/README.md @@ -23,15 +23,16 @@ A sample dhcpd config file is available in the dhcpd directory This file describe how are setuped your boards, and how they are connected and powered. ``` lab-slave-name: - devicename: - type: the devicetype of this device - pdu: - daemon: The hostname running the PDU daemon (always localhost) - host: The host name of the PDU as named in lavapdu.conf - port: portnumber (The port number of the PDU where the device is connected) - uart: - type: - serial: The serial number in case of FTDI uart + boardlist: + devicename: + type: the devicetype of this device + pdu: + daemon: The hostname running the PDU daemon (always localhost) + host: The host name of the PDU as named in lavapdu.conf + port: portnumber (The port number of the PDU where the device is connected) + uart: + type: + serial: The serial number in case of FTDI uart ``` Notes: uart FTDI only need serial diff --git a/boards.yaml b/boards.yaml index 1f3788f..e4f072d 100644 --- a/boards.yaml +++ b/boards.yaml @@ -1,55 +1,56 @@ lab-slave-0: - bcm2837-rpi-3-b-01: - type: bcm2837-rpi-3-b - pdu: - daemon: localhost - host: acme-0 - port: 1 - uart: - type: FTDI - serial: FT9QQZTA - am335x-boneblack-01: - type: beaglebone-black - pdu: - daemon: localhost - host: acme-0 - port: 2 - uart: - type: FTDI - serial: FT9QR1A9 - meson-gxl-s905x-libretech-cc-01: - type: meson-gxl-s905x-libretech-cc - pdu: - daemon: localhost - host: acme-0 - port: 3 - uart: - type: FTDI - serial: FT9QQYCN - dragonboard-410c-01: - type: dragonboard-410c - pdu: - daemon: localhost - host: acme-0 - port: 4 - uart: - type: FTDI - serial: FT9R7VDB - r8a7796-m3ulcb-01: - type: r8a7796-m3ulcb - pdu: - daemon: localhost - host: acme-0 - port: 5 - uart: - type: FTDI - serial: AK04WW0Q - imx6q-sabrelite-01: - type: imx6q-sabrelite - pdu: - daemon: localhost - host: acme-0 - port: 6 - uart: - type: FTDI - serial: FTAJMM4V + boardlist: + bcm2837-rpi-3-b-01: + type: bcm2837-rpi-3-b + pdu: + daemon: localhost + host: acme-0 + port: 1 + uart: + type: FTDI + serial: FT9QQZTA + am335x-boneblack-01: + type: beaglebone-black + pdu: + daemon: localhost + host: acme-0 + port: 2 + uart: + type: FTDI + serial: FT9QR1A9 + meson-gxl-s905x-libretech-cc-01: + type: meson-gxl-s905x-libretech-cc + pdu: + daemon: localhost + host: acme-0 + port: 3 + uart: + type: FTDI + serial: FT9QQYCN + dragonboard-410c-01: + type: dragonboard-410c + pdu: + daemon: localhost + host: acme-0 + port: 4 + uart: + type: FTDI + serial: FT9R7VDB + r8a7796-m3ulcb-01: + type: r8a7796-m3ulcb + pdu: + daemon: localhost + host: acme-0 + port: 5 + uart: + type: FTDI + serial: AK04WW0Q + imx6q-sabrelite-01: + type: imx6q-sabrelite + pdu: + daemon: localhost + host: acme-0 + port: 6 + uart: + type: FTDI + serial: FTAJMM4V diff --git a/lavalab-gen.py b/lavalab-gen.py index 379f6b9..6c1cb0f 100755 --- a/lavalab-gen.py +++ b/lavalab-gen.py @@ -52,8 +52,8 @@ def main(args): for lab_name in labs: lab = labs[lab_name] - for board_name in lab: - b = lab[board_name] + for board_name in lab["boardlist"]: + b = lab["boardlist"][board_name] if b.get("disabled", None): continue -- cgit 1.2.3-korg From ffce31d5f3e13d9d3f952b14624883ca88538168 Mon Sep 17 00:00:00 2001 From: Corentin LABBE Date: Tue, 7 Nov 2017 15:12:43 +0100 Subject: Permit to customize dispatcher_ip dispatcher_ip is the IP used by boards for contacting/downloading images/dtb/etc... For the moment it was harcoded to 192.168.66.1. This patch permit to easily change it. --- README.md | 1 + lavalab-gen.py | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c92febe..c4a3cec 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ A sample dhcpd config file is available in the dhcpd directory This file describe how are setuped your boards, and how they are connected and powered. ``` lab-slave-name: + dispatcher_ip: the IP where the slave could be contacted. In lava-docker it is the host IP since docker proxify TFTP from host to the slave. boardlist: devicename: type: the devicetype of this device diff --git a/lavalab-gen.py b/lavalab-gen.py index 6c1cb0f..49203ec 100755 --- a/lavalab-gen.py +++ b/lavalab-gen.py @@ -97,11 +97,12 @@ def main(args): fp = open("lavalab-udev-%s.rules" % lab_name, "w") fp.write(udev_line) fp.close() - if not os.path.isdir("lava-master/slaves/"): - os.mkdir("lava-master/slaves/") - fp = open("lava-master/slaves/%s.yaml" % lab_name, "w") - fp.write("dispatcher_ip: 192.168.66.1") - fp.close() + if lab.has_key("dispatcher_ip"): + if not os.path.isdir("lava-master/slaves/"): + os.mkdir("lava-master/slaves/") + fp = open("lava-master/slaves/%s.yaml" % lab_name, "w") + fp.write("dispatcher_ip: %s" % lab["dispatcher_ip"]) + fp.close() #now proceed with tokens fp = open(tokens_yaml, "r") -- cgit 1.2.3-korg From d7b3ab2ca280c8ee1dafb4773bf979b805debf0a Mon Sep 17 00:00:00 2001 From: Corentin LABBE Date: Tue, 7 Nov 2017 15:54:59 +0100 Subject: Change misleading lab-slave-name example --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c4a3cec..e0fb466 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ A sample dhcpd config file is available in the dhcpd directory ### boards.yaml This file describe how are setuped your boards, and how they are connected and powered. ``` -lab-slave-name: +lab-slave-XX: dispatcher_ip: the IP where the slave could be contacted. In lava-docker it is the host IP since docker proxify TFTP from host to the slave. boardlist: devicename: -- cgit 1.2.3-korg From fa7d0cd24893694ff529a16386cfc7a27f833d59 Mon Sep 17 00:00:00 2001 From: Corentin LABBE Date: Tue, 9 Jan 2018 16:46:18 +0100 Subject: Move conmux and slaves directory creation Thoses two directory are necessary even with setup without conmux and slaves. (Due to Dockerfile COPY). This patch move the creation of thoses two directory at start of lavalav-gen.py --- lavalab-gen.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lavalab-gen.py b/lavalab-gen.py index 49203ec..6baa825 100755 --- a/lavalab-gen.py +++ b/lavalab-gen.py @@ -50,6 +50,16 @@ def main(args): dockcomp["services"]["lava-slave"]["devices"] = [] dc_devices = dockcomp["services"]["lava-slave"]["devices"] + # The slaves directory must exists + if not os.path.isdir("lava-master/slaves/"): + os.mkdir("lava-master/slaves/") + fp = open("lava-master/slaves/.empty", "w") + fp.close() + if not os.path.isdir("lava-slave/conmux/"): + os.mkdir("lava-slave/conmux/") + fp = open("lava-slave/conmux/.empty", "w") + fp.close() + for lab_name in labs: lab = labs[lab_name] for board_name in lab["boardlist"]: @@ -77,8 +87,6 @@ def main(args): fserial = b["fastboot_serial_number"] device_line += "{%% set fastboot_serial_number = '%s' %%}" % fserial - if not os.path.isdir("lava-slave/conmux/"): - os.mkdir("lava-slave/conmux/") # board specific hacks if devicetype == "qemu": device_line += "{% set no_kvm = True %}\n" @@ -98,8 +106,6 @@ def main(args): fp.write(udev_line) fp.close() if lab.has_key("dispatcher_ip"): - if not os.path.isdir("lava-master/slaves/"): - os.mkdir("lava-master/slaves/") fp = open("lava-master/slaves/%s.yaml" % lab_name, "w") fp.write("dispatcher_ip: %s" % lab["dispatcher_ip"]) fp.close() -- cgit 1.2.3-korg From f2e611a9528ec772a075e8f7fea5d70ca0465937 Mon Sep 17 00:00:00 2001 From: Corentin LABBE Date: Tue, 9 Jan 2018 16:55:00 +0100 Subject: Handle boards without uart Some boards could not have uart like qemu. This patch made having an uart optionnal. --- lavalab-gen.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/lavalab-gen.py b/lavalab-gen.py index 6baa825..6a5ea43 100755 --- a/lavalab-gen.py +++ b/lavalab-gen.py @@ -14,7 +14,7 @@ boards_yaml = "boards.yaml" tokens_yaml = "tokens.yaml" baud_default = 115200 -template = string.Template("""# +template_conmux = string.Template("""# # auto-generated by lavalab-gen.py for ${board} # listener ${board} @@ -27,7 +27,12 @@ command 'on' 'Power on ${board}' 'pduclient --daemon ${daemon} --host ${host} -- #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_pdu = string.Template(""" {% set hard_reset_command = 'pduclient --daemon localhost --hostname acme-0 --port ${port} --command=reboot' %} {% set power_off_command = 'pduclient --daemon localhost --hostname acme-0 --port ${port} --command=off' %} {% set power_on_command = 'pduclient --daemon localhost --hostname acme-0 --port ${port} --command=on' %} @@ -67,22 +72,24 @@ def main(args): if b.get("disabled", None): continue - if not b.has_key("uart"): - print("WARNING: %s missing uart property" % board_name) - continue - - baud = b["uart"].get("baud", baud_default) if b.has_key("pdu"): daemon = b["pdu"]["daemon"] host = b["pdu"]["host"] port = b["pdu"]["port"] devicetype = b["type"] delay_opt = "" - line = template.substitute(board=board_name, baud=baud, daemon=daemon, host=host, port=port, delay=delay_opt) device_line = template_device.substitute(board=board_name, port=port, devicetype=devicetype) + device_line += template_device_pdu.substitute(port=port) + if b.has_key("uart"): + baud = b["uart"].get("baud", baud_default) + line = template_conmux.substitute(board=board_name, baud=baud, daemon=daemon, host=host, port=port, delay=delay_opt) serial = b["uart"]["serial"] udev_line += template_udev.substitute(board=board_name, serial=serial) dc_devices.append("/dev/%s:/dev/%s" % (board_name, board_name)) + fp = open("lava-slave/conmux/%s.cf" % board_name, "w") + fp.write(line) + fp.close() + device_line += template_device_conmux.substitute(board=board_name) if b.has_key("fastboot_serial_number"): fserial = b["fastboot_serial_number"] device_line += "{%% set fastboot_serial_number = '%s' %%}" % fserial @@ -95,9 +102,6 @@ def main(args): device_path = "lava-master/devices/%s" % lab_name if not os.path.isdir(device_path): os.mkdir(device_path) - fp = open("lava-slave/conmux/%s.cf" % board_name, "w") - fp.write(line) - fp.close() board_device_file = "%s/%s.jinja2" % (device_path, board_name) fp = open(board_device_file, "w") fp.write(device_line) -- cgit 1.2.3-korg From 302e41d55759affe58d77e14c15d728625a03d19 Mon Sep 17 00:00:00 2001 From: Corentin LABBE Date: Thu, 11 Jan 2018 11:47:54 +0100 Subject: Create a working default boards.yaml The boards.yaml need to be more minimal and working for everybody. --- boards.yaml | 56 ++------------------------------------------------------ 1 file changed, 2 insertions(+), 54 deletions(-) diff --git a/boards.yaml b/boards.yaml index e4f072d..88f7e6d 100644 --- a/boards.yaml +++ b/boards.yaml @@ -1,56 +1,4 @@ lab-slave-0: boardlist: - bcm2837-rpi-3-b-01: - type: bcm2837-rpi-3-b - pdu: - daemon: localhost - host: acme-0 - port: 1 - uart: - type: FTDI - serial: FT9QQZTA - am335x-boneblack-01: - type: beaglebone-black - pdu: - daemon: localhost - host: acme-0 - port: 2 - uart: - type: FTDI - serial: FT9QR1A9 - meson-gxl-s905x-libretech-cc-01: - type: meson-gxl-s905x-libretech-cc - pdu: - daemon: localhost - host: acme-0 - port: 3 - uart: - type: FTDI - serial: FT9QQYCN - dragonboard-410c-01: - type: dragonboard-410c - pdu: - daemon: localhost - host: acme-0 - port: 4 - uart: - type: FTDI - serial: FT9R7VDB - r8a7796-m3ulcb-01: - type: r8a7796-m3ulcb - pdu: - daemon: localhost - host: acme-0 - port: 5 - uart: - type: FTDI - serial: AK04WW0Q - imx6q-sabrelite-01: - type: imx6q-sabrelite - pdu: - daemon: localhost - host: acme-0 - port: 6 - uart: - type: FTDI - serial: FTAJMM4V + qemu-01: + type: qemu -- cgit 1.2.3-korg