diff --git a/SOURCES/rear-bz1685166.patch b/SOURCES/rear-bz1685166.patch new file mode 100644 index 0000000..365310e --- /dev/null +++ b/SOURCES/rear-bz1685166.patch @@ -0,0 +1,40 @@ +diff --git a/usr/share/rear/rescue/GNU/Linux/310_network_devices.sh b/usr/share/rear/rescue/GNU/Linux/310_network_devices.sh +index 6b3194bd..57e8777a 100644 +--- a/usr/share/rear/rescue/GNU/Linux/310_network_devices.sh ++++ b/usr/share/rear/rescue/GNU/Linux/310_network_devices.sh +@@ -562,7 +562,12 @@ function handle_team () { + local network_interface=$1 + local sysfspath=/sys/class/net/$network_interface + +- if [ "$( ethtool -i $network_interface | awk '$1 == "driver:" { print $2 }' )" != "team" ] ; then ++ if has_binary ethtool ; then ++ if [ "$( ethtool -i $network_interface | awk '$1 == "driver:" { print $2 }' )" != "team" ] ; then ++ return $rc_error ++ fi ++ else ++ LogPrintError "Couldn't determine if network interface '$network_interface' is a Team, skipping." + return $rc_error + fi + +@@ -854,10 +859,17 @@ function handle_physdev () { + + DebugPrint "$network_interface is a physical device" + +- if [ -e $sysfspath/bonding_slave/perm_hwaddr ] ; then +- mac="$( cat $sysfspath/bonding_slave/perm_hwaddr )" +- else +- mac="$( cat $sysfspath/address )" || BugError "Could not read a MAC address for '$network_interface'." ++ local mac="" ++ ++ if has_binary ethtool ; then ++ mac="$( ethtool -P $network_interface 2>/dev/null | awk '{ print $NF }' )" ++ fi ++ if [ -z "$mac" ] ; then ++ if [ -e $sysfspath/bonding_slave/perm_hwaddr ] ; then ++ mac="$( cat $sysfspath/bonding_slave/perm_hwaddr )" ++ else ++ mac="$( cat $sysfspath/address )" || BugError "Could not read a MAC address for '$network_interface'." ++ fi + fi + # Skip fake interfaces without MAC address + [ "$mac" != "00:00:00:00:00:00" ] || return $rc_error diff --git a/SPECS/rear.spec b/SPECS/rear.spec index 4ebd3f3..2234461 100644 --- a/SPECS/rear.spec +++ b/SPECS/rear.spec @@ -2,7 +2,7 @@ Summary: Relax-and-Recover is a Linux disaster recovery and system migration tool Name: rear Version: 2.4 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv3 Group: Applications/File URL: http://relax-and-recover.org/ @@ -14,6 +14,7 @@ Patch10: rear-bz1639705.patch Patch11: rear-bz1653214.patch Patch12: rear-bz1659137.patch Patch14: rear-bz1672938.patch +Patch15: rear-bz1685166.patch ExcludeArch: s390x ExcludeArch: s390 @@ -104,6 +105,7 @@ fi %patch11 -p1 %patch12 -p1 %patch14 -p1 +%patch15 -p1 echo "30 1 * * * root /usr/sbin/rear checklayout || /usr/sbin/rear mkrescue" >rear.cron @@ -138,6 +140,10 @@ TZ=UTC %{__make} -C doc %{_sbindir}/rear %changelog +* Wed Mar 13 2019 Pavel Cahyna - 2.4-5 +- Apply upstream PR2065 (record permanent MAC address for team members) + Resolves: rhbz1685166 + * Tue Feb 26 2019 Pavel Cahyna - 2.4-4 - Apply upstream PR2034 (multipath optimizations for lots of devices)