Last active
          October 29, 2025 18:27 
        
      - 
      
 - 
        
Save r15ch13/ba2d738985fce8990a4e9f32d07c6ada to your computer and use it in GitHub Desktop.  
Revisions
- 
        
r15ch13 revised this gist
Jul 25, 2021 . No changes.There are no files selected for viewing
 - 
        
r15ch13 revised this gist
Jul 25, 2021 . No changes.There are no files selected for viewing
 - 
        
r15ch13 revised this gist
Jul 25, 2021 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,12 +4,12 @@ shopt -s nullglob lastgroup="" for g in `find /sys/kernel/iommu_groups/* -maxdepth 0 -type d | sort -V`; do for d in $g/devices/*; do if [ "${g##*/}" != "$lastgroup" ]; then echo -en "Group ${g##*/}:\t" else echo -en "\t\t" fi lastgroup=${g##*/} lspci -nms ${d##*/} | awk -F'"' '{printf "[%s:%s]", $4, $6}' if [[ -e "$d"/reset ]]; then echo -en " [R] "; else echo -en " "; fi  - 
        
r15ch13 revised this gist
Jul 24, 2021 . 1 changed file with 14 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,14 +1,24 @@ #!/usr/bin/env bash shopt -s nullglob lastgroup="" for g in `find /sys/kernel/iommu_groups/* -maxdepth 0 -type d | sort -V`; do for d in $g/devices/*; do if [ "${g##*/}" != "$lastgroup" ]; then echo -en "Group ${g##*/}:\t" else echo -en "\t\t" fi lastgroup=${g##*/} lspci -nms ${d##*/} | awk -F'"' '{printf "[%s:%s]", $4, $6}' if [[ -e "$d"/reset ]]; then echo -en " [R] "; else echo -en " "; fi lspci -mms ${d##*/} | awk -F'"' '{printf "%s %-40s %s\n", $1, $2, $6}' for u in ${d}/usb*/; do bus=$(cat "${u}/busnum") lsusb -s $bus: | \ awk '{gsub(/:/,"",$4); printf "%s|%s %s %s %s|", $6, $1, $2, $3, $4; for(i=7;i<=NF;i++){printf "%s ", $i}; printf "\n"}' | \ awk -F'|' '{printf "USB:\t\t[%s]\t\t %-40s %s\n", $1, $2, $3}' done done done  - 
        
r15ch13 revised this gist
Jul 24, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ for g in `find /sys/kernel/iommu_groups/* -maxdepth 0 -type d | sort -V`; do if [[ -e "$d"/reset ]]; then echo -en "[RESET]"; fi echo -e "\t$(lspci -nns ${d##*/})" for u in ${d}/usb*/; do lsusb -s $(cat "${u}/busnum"): | awk '{printf "\t\t\t\t%s\n", $0}' echo done done  - 
        
r15ch13 revised this gist
Jul 24, 2021 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,9 @@ shopt -s nullglob for g in `find /sys/kernel/iommu_groups/* -maxdepth 0 -type d | sort -V`; do for d in $g/devices/*; do echo -en "Group ${g##*/}:\t" if [[ -e "$d"/reset ]]; then echo -en "[RESET]"; fi echo -e "\t$(lspci -nns ${d##*/})" for u in ${d}/usb*/; do lsusb -s $(cat "${u}/busnum"): | awk '{printf "\t\t\t%s\n", $0}' echo  - 
        
r15ch13 created this gist
Jul 24, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ #!/usr/bin/env bash shopt -s nullglob for g in `find /sys/kernel/iommu_groups/* -maxdepth 0 -type d | sort -V`; do for d in $g/devices/*; do echo -e "Group ${g##*/}:\t$(lspci -nns ${d##*/})" for u in ${d}/usb*/; do lsusb -s $(cat "${u}/busnum"): | awk '{printf "\t\t\t%s\n", $0}' echo done done done