From caea3132c96fb371d35dc5392fe4093372b8a649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= Date: Mon, 19 Feb 2024 08:36:30 +0100 Subject: [PATCH] probe: Change to return the sysfs path for authorized and authorized_default Leave it to confd to check if the file exist. --- board/netconf/rootfs/libexec/infix/probe | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/board/netconf/rootfs/libexec/infix/probe b/board/netconf/rootfs/libexec/infix/probe index bcb8ea13..13020324 100755 --- a/board/netconf/rootfs/libexec/infix/probe +++ b/board/netconf/rootfs/libexec/infix/probe @@ -89,13 +89,11 @@ class DTSystem: if data != {}: out["usb-ports"] = [] for name,ph in data.items(): - [out["usb-ports"].append({"name": name, "path": dev.attrpath("authorized")}) for dev in self.devices_from_ph(ph)] + [out["usb-ports"].extend([{"name": name, "path": dev.attrpath("authorized")}, {"name": name, "path": dev.attrpath("authorized_default")}]) for dev in self.devices_from_ph(ph)] def infix_devices(self, kind): phs = self.__get_phandle_array(kind) - #for ph in phs: - # for dev in self.devices_from_ph(ph): return [[d for d in self.devices_from_ph(ph)] for ph in phs] def infix_vpds(self): @@ -126,14 +124,24 @@ class QEMUSystem: return [self.product_vpd()] def usb_ports(self): - ports = [{ + ports = [ + { "name": "USB", - "path": "/sys/bus/usb/devices/1-0:1.0/" + "path": "/sys/bus/usb/devices/usb1/authorized" }, { "name": "USB", - "path": "/sys/bus/usb/devices/usb1/" + "path": "/sys/bus/usb/devices/usb1/authorized_default" + + }, + { + "name": "USB2", + "path": "/sys/bus/usb/devices/usb2/authorized" + }, + { + "name": "USB2", + "path": "/sys/bus/usb/devices/usb2/authorized_default" }] return ports