Skip to content

Commit

Permalink
FMO-92: fmo-tool, add ability to passthrough with vendorid and regex-…
Browse files Browse the repository at this point in the history
…productid

Signed-off-by: Anh Huy Bui <[email protected]>
  • Loading branch information
buianhhuy96 committed Dec 17, 2024
1 parent 3686159 commit d98cfa2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions modules/custom-packages/vhotplug/vendorid.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/vhotplug/config.py b/vhotplug/config.py
index 689d243..c1e7300 100644
--- a/vhotplug/config.py
+++ b/vhotplug/config.py
@@ -32,7 +32,7 @@ class Config:
logger.debug(f"Rule {usb_description}")
logger.debug(f"Checking {vid}:{pid} against {usb_vid}:{usb_pid}")
vidMatch = usb_vid and vid.casefold() == usb_vid.casefold()
- pidMatch = usb_pid and pid.casefold() == usb_pid.casefold()
+ pidMatch = (usb_pid and pid.casefold() == usb_pid.casefold()) or re.match(usb_pid, pid, re.IGNORECASE)
if vidMatch and pidMatch:
logger.info(f"Found VM {vm_name} by vendor id / product id, description: {usb_description}")
matches = True
2 changes: 2 additions & 0 deletions modules/custom-packages/vhotplug/vhotplug.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ in

doCheck = false;

patches = [ ./vendorid.patch ];

src = fetchFromGitHub {
owner = "tiiuae";
repo = "vhotplug";
Expand Down

0 comments on commit d98cfa2

Please sign in to comment.