Blame SOURCES/rear-bz1685166.patch

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