Skip to content

Instantly share code, notes, and snippets.

@bskjon
Created September 1, 2023 23:50
Show Gist options
  • Save bskjon/012e43e5451489c8654228fcdc6591cc to your computer and use it in GitHub Desktop.
Save bskjon/012e43e5451489c8654228fcdc6591cc to your computer and use it in GitHub Desktop.
IOMMU USB
#! /bin/sh
for usb_ctrl in $(find /sys/bus/usb/devices/usb* -maxdepth 0 -type l); do
pci_path="$(dirname "$(realpath "${usb_ctrl}")")";
echo "Bus $(cat "${usb_ctrl}/busnum") --> $(basename $pci_path) (IOMMU group $(basename $(realpath $pci_path/iommu_group)))";
lsusb -s "$(cat "${usb_ctrl}/busnum"):";
echo; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment