diff --git a/options/custom/scripts/default.nix b/options/custom/scripts/default.nix index 719d083..5924c4b 100644 --- a/options/custom/scripts/default.nix +++ b/options/custom/scripts/default.nix @@ -94,6 +94,11 @@ in { libnotify systemd ]) + (bash "iommu" [ + coreutils + findutils + pciutils + ]) (bash "launch" [ argc coreutils diff --git a/options/custom/scripts/iommu.sh b/options/custom/scripts/iommu.sh new file mode 100644 index 0000000..11cf9a3 --- /dev/null +++ b/options/custom/scripts/iommu.sh @@ -0,0 +1,12 @@ +#! /usr/bin/env bash + +# https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF#Ensuring_that_the_groups_are_valid + +shopt -s nullglob + +for g in $(find /sys/kernel/iommu_groups/* -maxdepth 0 -type d | sort -V); do + echo "IOMMU Group ${g##*/}:" + for d in "$g"/devices/*; do + echo -e "\t$(lspci -nns "${d##*/}")" + done +done