diff --git a/data/84-nm-drivers.rules b/data/84-nm-drivers.rules new file mode 100644 index 0000000000..d246ef6ce9 --- /dev/null +++ b/data/84-nm-drivers.rules @@ -0,0 +1,12 @@ +# Do not modify this file, it will get overwritten on updates. +# To override or extend the rules place a file in /etc/udev/rules.d + +SUBSYSTEM!="net", GOTO="nm_drivers_end" +ACTION!="add|change", GOTO="nm_drivers_end" + +# Determine ID_NET_DRIVER if there's no ID_NET_DRIVER or DRIVERS (old udev?) +ENV{ID_NET_DRIVER}=="?*", GOTO="nm_drivers_end" +DRIVERS=="?*", GOTO="nm_drivers_end" +PROGRAM="/bin/sh -c 'ethtool -i $1 | sed -n s/^driver:\ //p' -- $env{INTERFACE}", RESULT=="?*", ENV{ID_NET_DRIVER}="%c" + +LABEL="nm_drivers_end" diff --git a/data/85-nm-unmanaged.rules b/data/85-nm-unmanaged.rules index 9d2ad7737b..887ab84599 100644 --- a/data/85-nm-unmanaged.rules +++ b/data/85-nm-unmanaged.rules @@ -1,15 +1,9 @@ -# Do not modify this file, it will get overwriten on updates. +# Do not modify this file, it will get overwritten on updates. # To override or extend the rules place a file in /etc/udev/rules.d SUBSYSTEM!="net", GOTO="nm_unmanaged_end" ACTION!="add|change", GOTO="nm_unmanaged_end" -# 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 $1 | /bin/sed -n s/^driver:\ //p' -- $env{INTERFACE}", RESULT=="?*", ENV{ID_NET_DRIVER}="%c" -LABEL="nm_unmanaged_driver" - # VirtualBox host networking. Out-of-tree driver that looks like an ordinary # Ethernet. No parent device (lives in /virtual/), no support for ethtool # to identify the driver, MAC address defaults to 08:00:27:, but can be diff --git a/data/Makefile.am b/data/Makefile.am index 64ff337636..ce059fcb0f 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -37,6 +37,7 @@ examples_DATA = server.conf if WITH_UDEV_DIR udevrulesdir = $(UDEV_DIR)/rules.d udevrules_DATA = \ + 84-nm-drivers.rules \ 85-nm-unmanaged.rules endif @@ -57,6 +58,7 @@ EXTRA_DIST = \ NetworkManager-wait-online-systemd-pre200.service.in \ NetworkManager-dispatcher.service.in \ org.freedesktop.NetworkManager.service.in \ + 84-nm-drivers.rules \ 85-nm-unmanaged.rules \ server.conf.in