A prettier LS-IOMMU.sh

#!/bin/bash
shopt -s nullglob
for d in /sys/kernel/iommu_groups/*/devices/*; do
  n=${d#*/iommu_groups/*}; n=${n%%/*}
  printf 'IOMMU Group %s \n' "$n"
  lspci -vmms "${d##*/}" |grep -E "^Slot|^Class|^Vendor|^Device"
  printf 'IDs:    '
  lspci -ns "${d##*/}" | awk {print\ \$3}
  lspci -vmms "${d##*/}" |grep -E "^Rev"
  printf '\n'
done

Just something I did in my spare time to prettify LS-IOMMU for machine readable output. Feel free to do further filtering as necessary. You could even take this and pipe it to a GUI. The extra line break is for better human legibility, like the verbose lspci options, and possibly for filtering help.

3 Likes

This topic was automatically closed 273 days after the last reply. New replies are no longer allowed.