From f5179b5f46bbe3d0c951beda48a9a023258b4d74 Mon Sep 17 00:00:00 2001 From: LiaoU3 <58060146+LiaoU3@users.noreply.github.com> Date: Wed, 10 Jan 2024 09:18:52 +0800 Subject: [PATCH] Modify detection method for usb-dwc3 and provide more info when it fails (Bugfix) (#903) --- providers/iiotg/units/usb-dwc3/jobs.pxu | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/providers/iiotg/units/usb-dwc3/jobs.pxu b/providers/iiotg/units/usb-dwc3/jobs.pxu index 001050e99e..272cb18576 100644 --- a/providers/iiotg/units/usb-dwc3/jobs.pxu +++ b/providers/iiotg/units/usb-dwc3/jobs.pxu @@ -3,10 +3,15 @@ _summary: Detect if the USB DWC3 drivers are loaded category_id: usb-dwc3 imports: from com.canonical.plainbox import manifest requires: - device.driver == 'dwc3-pci' manifest.has_usb_dwc3_controller == 'True' -flags: simple fail-on-resource +plugin: shell +flags: simple command: + if ! lspci -v | grep dwc3-pci; then + echo "Cannot find the 'dwc3-pci' driver be used!" + echo "Please make sure this feature is supported on this platform and check the value of xDCI in BIOS setting." + exit 1 + fi echo "dwc3-pci driver loaded" id: usb-dwc3/module-detect @@ -14,11 +19,15 @@ _summary: Detect if the USB DWC3 module is loaded category_id: usb-dwc3 imports: from com.canonical.plainbox import manifest requires: - module.name == 'dwc3_pci' manifest.has_usb_dwc3_controller == 'True' -flags: simple fail-on-resource +plugin: shell +flags: simple command: - echo "dwc3_pci module loaded" + if ! lsmod | grep dwc3_pci; then + echo "Cannot find the 'dwc3_pci' module be loaded!" + echo "Please make sure this feature is supported on this platform and check the value of xDCI in BIOS setting." + exit 1 + fi id: usb-dwc3/mass-storage _summary: Check DUT can be detected as mass storage device @@ -63,4 +72,3 @@ command: fi user: root estimated_duration: 1s -