6bc5671491
Apply: git diff --full-index --binary anaconda-23.19.10-1..anaconda-25.20.9-1 And resolve conflicts. QubesOS/qubes-issues#2574
24 lines
530 B
Bash
Executable File
24 lines
530 B
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Find all devices which depend on input kernel driver.
|
|
#
|
|
# Author: Jiri Konecny
|
|
#
|
|
|
|
driver="$1"
|
|
|
|
# List all interfaces in system
|
|
for i in /sys/class/net/*/device/modalias; do
|
|
if [ -z $i ]; then
|
|
exit 0
|
|
fi
|
|
# Get kernel mods on which the interface is dependent
|
|
d=$(modprobe -R $(cat "$i"))
|
|
|
|
# Test if this is the mod we are looking for. If so return name of the interface.
|
|
if [[ " $d " == *\ $driver\ * ]]; then
|
|
intf=${i%%/device/modalias}
|
|
echo "${intf##*/}"
|
|
fi
|
|
done
|