From 8a9e66db32a082f0109a586a5e0ffb3f0e6b8af5 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..3a13aaf 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() { + $HOME/.config/zsh/ls-iommu.sh | sort -n +}