Blame SOURCES/rear-bz1685166.patch

29e449
diff --git a/usr/share/rear/rescue/GNU/Linux/310_network_devices.sh b/usr/share/rear/rescue/GNU/Linux/310_network_devices.sh
29e449
index 6b3194bd..57e8777a 100644
29e449
--- a/usr/share/rear/rescue/GNU/Linux/310_network_devices.sh
29e449
+++ b/usr/share/rear/rescue/GNU/Linux/310_network_devices.sh
29e449
@@ -562,7 +562,12 @@ function handle_team () {
29e449
     local network_interface=$1
29e449
     local sysfspath=/sys/class/net/$network_interface
29e449
 
29e449
-    if [ "$( ethtool -i $network_interface | awk '$1 == "driver:" { print $2 }' )" != "team" ] ; then
29e449
+    if has_binary ethtool ; then
29e449
+        if [ "$( ethtool -i $network_interface | awk '$1 == "driver:" { print $2 }' )" != "team" ] ; then
29e449
+            return $rc_error
29e449
+        fi
29e449
+    else
29e449
+        LogPrintError "Couldn't determine if network interface '$network_interface' is a Team, skipping."
29e449
         return $rc_error
29e449
     fi
29e449
 
29e449
@@ -854,10 +859,17 @@ function handle_physdev () {
29e449
 
29e449
     DebugPrint "$network_interface is a physical device"
29e449
 
29e449
-    if [ -e $sysfspath/bonding_slave/perm_hwaddr ] ; then
29e449
-        mac="$( cat $sysfspath/bonding_slave/perm_hwaddr )"
29e449
-    else
29e449
-        mac="$( cat $sysfspath/address )" || BugError "Could not read a MAC address for '$network_interface'."
29e449
+    local mac=""
29e449
+
29e449
+    if has_binary ethtool ; then
29e449
+        mac="$( ethtool -P $network_interface 2>/dev/null | awk '{ print $NF }' )"
29e449
+    fi
29e449
+    if [ -z "$mac" ] ; then
29e449
+        if [ -e $sysfspath/bonding_slave/perm_hwaddr ] ; then
29e449
+            mac="$( cat $sysfspath/bonding_slave/perm_hwaddr )"
29e449
+        else
29e449
+            mac="$( cat $sysfspath/address )" || BugError "Could not read a MAC address for '$network_interface'."
29e449
+        fi
29e449
     fi
29e449
     # Skip fake interfaces without MAC address
29e449
     [ "$mac" != "00:00:00:00:00:00" ] || return $rc_error