From b9f687dd0b754ecb061340379bb20254497e512b Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Fri, 22 Dec 2023 13:09:25 +0000 Subject: [PATCH] Add ls-iommu utility --- ls-iommu.sh | 6 ++++++ utilities/utilities.plugin.zsh | 4 ++++ 2 files changed, 10 insertions(+) create mode 100755 ls-iommu.sh diff --git a/ls-iommu.sh b/ls-iommu.sh new file mode 100755 index 0000000..326de2a --- /dev/null +++ b/ls-iommu.sh @@ -0,0 +1,6 @@ +#!/bin/bash +for d in /sys/kernel/iommu_groups/*/devices/*; do + n=${d#*/iommu_groups/*}; n=${n%%/*} + printf '%s ' "$n" + lspci -nns "${d##*/}" +done diff --git a/utilities/utilities.plugin.zsh b/utilities/utilities.plugin.zsh index 9b7f254..0332b57 100644 --- a/utilities/utilities.plugin.zsh +++ b/utilities/utilities.plugin.zsh @@ -102,3 +102,7 @@ if which docker-machine &> /dev/null; then fi } fi + +ls-iommu() { + ${0:a:h}/ls-iommu.sh | sort -n +}