qubes-installer-qubes-os/anaconda/dracut/find-net-intfs-by-driver
Marek Marczykowski-Górecki 6bc5671491
anaconda: update to 25.20.9-1
Apply:
  git diff --full-index --binary anaconda-23.19.10-1..anaconda-25.20.9-1

And resolve conflicts.

QubesOS/qubes-issues#2574
2017-02-14 02:36:20 +01:00

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