Blame SOURCES/rear-bz1685166.patch

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