ethtool may cause the auto-loading of a kernel module for non-existing
interface-names. Avoid that by checking whether such an interface exists.
This is inherently racy.
# Determine ID_NET_DRIVER if there's no ID_NET_DRIVER or DRIVERS (old udev?)
ENV{ID_NET_DRIVER}=="?*", GOTO="nm_unmanaged_driver"
DRIVERS=="?*", GOTO="nm_unmanaged_driver"
-PROGRAM="/bin/sh -c '/usr/sbin/ethtool -i $env{INTERFACE} |/bin/sed -n s/^driver:\ //p'", RESULT=="?*", ENV{ID_NET_DRIVER}="%c"
+PROGRAM="/bin/sh -c 'test -e "/sys/class/net/$env{INTERFACE}" && /usr/sbin/ethtool -i "$env{INTERFACE}" | /bin/sed -n s/^driver:\ //p'", RESULT=="?*", ENV{ID_NET_DRIVER}="%c"
LABEL="nm_unmanaged_driver"
# VirtualBox host networking. Out-of-tree driver that looks like an ordinary