From 674cffb516eaa918126c6abbb824a30c4cc2f656 Mon Sep 17 00:00:00 2001 From: HikariKnight <2557889+HikariKnight@users.noreply.github.com> Date: Thu, 16 Mar 2023 21:13:52 +0100 Subject: [PATCH] More updates to work with the go version of ls-iommu --- lib/get_GPU.sh | 2 +- lib/get_GPU_GROUP.sh | 4 ++-- lib/get_USB_CTL.sh | 2 +- lib/get_USB_CTL_GROUP.sh | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/get_GPU.sh b/lib/get_GPU.sh index c46e012..e806f4e 100755 --- a/lib/get_GPU.sh +++ b/lib/get_GPU.sh @@ -8,7 +8,7 @@ does not belong to itself. Both cards must also have unique hardware ids [xxxx:y " echo "#------------------------------------------#" - exec "$SCRIPTDIR/utils/ls-iommu" -g | cut -d " " -f 1-5,10- + "$SCRIPTDIR/utils/ls-iommu" -g -F name,device_id,optional_revision echo "#------------------------------------------#" printf " diff --git a/lib/get_GPU_GROUP.sh b/lib/get_GPU_GROUP.sh index dbbd586..5e3bb3c 100755 --- a/lib/get_GPU_GROUP.sh +++ b/lib/get_GPU_GROUP.sh @@ -18,11 +18,11 @@ Optionally it may also include: " echo "#------------------------------------------#" - exec "$SCRIPTDIR/utils/ls-iommu" -i "$1" -r | cut -d " " -f 1-5,6- | perl -pe "s/\[[0-9a-f]{4}\]: //" + "$SCRIPTDIR/utils/ls-iommu" -i "$1" -r -F subclass_name:,name,device_id,optional_revision # | cut -d " " -f 1-5,6- | perl -pe "s/\[[0-9a-f]{4}\]: //" echo "#------------------------------------------#" printf " -To use any of these devices for passthrough ALL of them has to be passed through to the VMs\ +To use any of these devices for passthrough ALL of them (except PCI bridges in their own IOMMU groups) has to be passed through to the VMs\ To return to the previous page just press ENTER without typing in anything. " diff --git a/lib/get_USB_CTL.sh b/lib/get_USB_CTL.sh index e4acff3..01567fe 100755 --- a/lib/get_USB_CTL.sh +++ b/lib/get_USB_CTL.sh @@ -9,7 +9,7 @@ is only needed if you intend to use other devices than just mouse and keyboard w " echo "#------------------------------------------#" - exec "$SCRIPTDIR/utils/ls-iommu" | grep -i "usb controller" | cut -d " " -f 1-5,9- + "$SCRIPTDIR/utils/ls-iommu" -u -F name,device_id,optional_revision echo "#------------------------------------------#" printf " Press q to quit diff --git a/lib/get_USB_CTL_GROUP.sh b/lib/get_USB_CTL_GROUP.sh index 70edbca..e2988cf 100755 --- a/lib/get_USB_CTL_GROUP.sh +++ b/lib/get_USB_CTL_GROUP.sh @@ -13,7 +13,7 @@ if you do not know what you are doing. " echo "#------------------------------------------#" - exec "$SCRIPTDIR/utils/ls-iommu" -i "$1" | cut -d " " -f 1-5,6- | perl -pe "s/ \[[0-9a-f]{4}\]: /: /" + "$SCRIPTDIR/utils/ls-iommu" -i "$1" -F subclass_name:,name,device_id,optional_revision echo "#------------------------------------------#" printf " @@ -27,7 +27,7 @@ To return to the previous page just press ENTER. [Yy]*) # Get the PCI ids local PCI_ID - PCI_ID=$("$SCRIPTDIR/utils/ls-iommu" -i "$1" | cut -d " " -f 5 | perl -pe "s/([0-9a-f]{4}:[0-9a-f]{2}:[0-9a-f]{2}.[0-9a-f]{1})\n/\"\1\" /" | perl -pe "s/\s$//") + PCI_ID=$("$SCRIPTDIR/utils/ls-iommu" -i "$1" --pciaddr | perl -pe "s/([0-9a-f]{4}:[0-9a-f]{2}:[0-9a-f]{2}.[0-9a-f]{1})\n/\"\1\" /" | perl -pe "s/\s$//") # Replace the blank USB_CTL_ID with the PCI_ID for the usb controller the user wants to pass through perl -pi -e "s/USB_CTL_ID=\(\)/USB_CTL_ID=\($PCI_ID\)/" "$SCRIPTDIR/$QUICKEMU/qemu-vfio_vars.conf"