From 29e449c2593664cb1c4d1c8a3b4fef16e66cab73 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jul 30 2019 09:17:42 +0000 Subject: import rear-2.4-8.el8_0 --- diff --git a/SOURCES/rear-bz1672938.patch b/SOURCES/rear-bz1672938.patch new file mode 100644 index 0000000..dea54f2 --- /dev/null +++ b/SOURCES/rear-bz1672938.patch @@ -0,0 +1,94 @@ +diff --git a/usr/share/rear/lib/layout-functions.sh b/usr/share/rear/lib/layout-functions.sh +index aa6fc938..4bc59131 100644 +--- a/usr/share/rear/lib/layout-functions.sh ++++ b/usr/share/rear/lib/layout-functions.sh +@@ -478,6 +478,9 @@ get_sysfs_name() { + ### /dev/dm-3 -> /dev/mapper/system-tmp + ### /dev/dm-4 -> /dev/mapper/oralun + ### /dev/dm-5 -> /dev/mapper/oralunp1 ++### /dev/sda -> /dev/sda ++### ++### Returns 0 on success, 1 if device is not existing + get_device_name() { + ### strip common prefixes + local name=${1#/dev/} +@@ -485,47 +488,39 @@ get_device_name() { + + contains_visible_char "$name" || BugError "Empty string passed to get_device_name" + +- ### Translate dm-8 -> mapper/test +- local device dev_number mapper_number +- if [[ -d /sys/block/$name ]] ; then ++ if [[ "$name" =~ ^mapper/ ]]; then ++ echo "/dev/$name" ++ return 0 ++ fi ++ ++ if [[ -L "/dev/$name" ]] ; then ++ # Map vg/lv into dm-X, which will then be resolved later ++ name="$( basename $(readlink -f /dev/$name) )" ++ fi ++ ++ if [[ "$name" =~ ^dm- ]] ; then ++ local device + if [[ -r /sys/block/$name/dm/name ]] ; then + ### recent kernels have a dm subfolder +- echo "/dev/mapper/$( < /sys/block/$name/dm/name)"; +- return 0 ++ device="$( < /sys/block/$name/dm/name )" + else +- ### loop over all block devices +- dev_number=$( < /sys/block/$name/dev) +- for device in /dev/mapper/* ; do +- mapper_number=$(dmsetup info -c --noheadings -o major,minor ${device#/dev/mapper/} 2>/dev/null ) +- if [ "$dev_number" = "$mapper_number" ] ; then +- echo "$device" +- return 0 +- fi +- done ++ local dev_number=$( < /sys/block/$name/dev) ++ if [[ ! -r "$TMP_DIR/dmsetup_info.txt" ]] ; then ++ dmsetup info --noheadings -c -o name,major,minor > "$TMP_DIR/dmsetup_info.txt" ++ fi ++ device="$( awk -F ':' "/$dev_number\$/ { print \$1 }" < "$TMP_DIR/dmsetup_info.txt" )" ++ [[ -n "$device" ]] || BugError "No device returned for major/minor $dev_number" + fi +- fi +- +- ### Translate device name to mapper name. ex: vg/lv -> mapper/vg-lv +- if [[ "$name" =~ ^mapper/ ]]; then +- echo "/dev/$name" ++ echo "/dev/mapper/$device" + return 0 + fi +- if my_dm=`readlink /dev/$name`; then +- for mapper_dev in /dev/mapper/*; do +- if mapper_dm=`readlink $mapper_dev`; then +- if [ "$my_dm" = "$mapper_dm" ]; then +- echo $mapper_dev +- return 0 +- fi +- fi +- done +- fi + + ### handle cciss sysfs naming + name=${name//!//} + + ### just return the possibly nonexisting name + echo "/dev/$name" ++ [[ -r "/dev/$name" ]] && return 0 + return 1 + } + +diff --git a/usr/share/rear/rescue/GNU/Linux/270_fc_transport_info.sh b/usr/share/rear/rescue/GNU/Linux/270_fc_transport_info.sh +index 0de4f60b..64276dfe 100644 +--- a/usr/share/rear/rescue/GNU/Linux/270_fc_transport_info.sh ++++ b/usr/share/rear/rescue/GNU/Linux/270_fc_transport_info.sh +@@ -1,3 +1,6 @@ ++# don't collect this anymore, this can be very slow ++return 0 ++ + # collect output from production SAN disks + + find /sys/class/fc_transport -follow -maxdepth 6 \( -name model -o -name vendor -o -name rev -name state -o -name model_name -o -name size -o -name node_name \) 2>/dev/null| egrep -v 'driver|rport|power|drivers|devices' | xargs grep '.' > $VAR_DIR/recovery/fc_transport.info >&2 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 8c476c3..e32f096 100644 --- a/SPECS/rear.spec +++ b/SPECS/rear.spec @@ -3,7 +3,7 @@ Summary: Relax-and-Recover is a Linux disaster recovery and system migration tool Name: rear Version: 2.4 -Release: 6%{?dist} +Release: 8%{?dist} License: GPLv3 Group: Applications/File URL: http://relax-and-recover.org/ @@ -18,6 +18,8 @@ Patch10: rear-bz1639705.patch Patch11: rear-bz1653214.patch Patch12: rear-bz1659137.patch patch13: rear-bz1663515.patch +Patch14: rear-bz1672938.patch +Patch15: rear-bz1685166.patch ExcludeArch: s390x ExcludeArch: s390 @@ -112,6 +114,8 @@ fi %patch11 -p1 %patch12 -p1 %patch13 -p1 +%patch14 -p1 +%patch15 -p1 echo "30 1 * * * root /usr/sbin/rear checklayout || /usr/sbin/rear mkrescue" >rear.cron @@ -145,6 +149,13 @@ TZ=UTC %{__make} -C doc %{_sbindir}/rear %changelog +* Tue May 28 2019 Pavel Cahyna - 2.4-8 +- Apply upstream PR2065 (record permanent MAC address for team members) + Resolves: rhbz1685178 + +* Tue May 28 2019 Pavel Cahyna - 2.4-7 +- Apply upstream PR2034 (multipath optimizations for lots of devices) + * Mon Jan 14 2019 Pavel Cahyna - 2.4-6 - Require xorriso instead of genisoimage, it is now the preferred method and supports files over 4GB in size.