From 31cab7b4957a41187ce5629fab89b67e1e04a98d Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Sep 03 2019 13:22:20 +0000 Subject: import rear-2.4-9.el7_7 --- diff --git a/SOURCES/rear-bz1726982.patch b/SOURCES/rear-bz1726982.patch new file mode 100644 index 0000000..ce9d8fb --- /dev/null +++ b/SOURCES/rear-bz1726982.patch @@ -0,0 +1,17 @@ +diff --git a/usr/share/rear/restore/BACULA/default/400_restore_backup.sh b/usr/share/rear/restore/BACULA/default/400_restore_backup.sh +index eac4d275..d21af71c 100644 +--- a/usr/share/rear/restore/BACULA/default/400_restore_backup.sh ++++ b/usr/share/rear/restore/BACULA/default/400_restore_backup.sh +@@ -110,7 +110,11 @@ WARNING: The new root is mounted under '$TARGET_FS_ROOT'. + Press ENTER to start bconsole" + read + +- bconsole ++ if bconsole 0<&6 1>&7 2>&8 ; then ++ Log "bconsole finished with zero exit code" ++ else ++ Log "bconsole finished with non-zero exit code $?" ++ fi + + LogPrint " + Please verify that the backup has been restored correctly to '$TARGET_FS_ROOT' diff --git a/SOURCES/rear-bz1732328.patch b/SOURCES/rear-bz1732328.patch new file mode 100644 index 0000000..b5813f6 --- /dev/null +++ b/SOURCES/rear-bz1732328.patch @@ -0,0 +1,119 @@ +diff --git a/usr/share/rear/layout/save/GNU/Linux/220_lvm_layout.sh b/usr/share/rear/layout/save/GNU/Linux/220_lvm_layout.sh +index e43ff896..a9730435 100644 +--- a/usr/share/rear/layout/save/GNU/Linux/220_lvm_layout.sh ++++ b/usr/share/rear/layout/save/GNU/Linux/220_lvm_layout.sh +@@ -53,6 +53,7 @@ Log "Saving LVM layout." + done + + header_printed=0 ++ already_processed_lvs="" + + ## Get all logical volumes + # format: lvmvol [key:value ...] +@@ -61,7 +62,7 @@ Log "Saving LVM layout." + + if lvm lvs -o lv_layout >/dev/null 2>&1; then + +- lvm 8>&- 7>&- lvs --separator=":" --noheadings --units b --nosuffix -o origin,lv_name,vg_name,lv_size,lv_layout,pool_lv,chunk_size,stripes,stripe_size | while read line ; do ++ lvm 8>&- 7>&- lvs --separator=":" --noheadings --units b --nosuffix -o origin,lv_name,vg_name,lv_size,lv_layout,pool_lv,chunk_size,stripes,stripe_size,seg_size | while read line ; do + + if [ $header_printed -eq 0 ] ; then + echo "# Format for LVM LVs" +@@ -72,7 +73,7 @@ Log "Saving LVM layout." + origin="$(echo "$line" | awk -F ':' '{ print $1 }')" + # Skip snapshots (useless) or caches (dont know how to handle that) + if [ -n "$origin" ] ; then +- echo "# Skipped snapshot of cache information '$line'" ++ echo "# Skipped snapshot or cache information '$line'" + continue + fi + +@@ -84,25 +85,45 @@ Log "Saving LVM layout." + chunksize="$(echo "$line" | awk -F ':' '{ print $7 }')" + stripes="$(echo "$line" | awk -F ':' '{ print $8 }')" + stripesize="$(echo "$line" | awk -F ':' '{ print $9 }')" ++ segmentsize="$(echo "$line" | awk -F ':' '{ print $10 }')" + + kval="" ++ infokval="" + [ -z "$thinpool" ] || kval="${kval:+$kval }thinpool:$thinpool" + [ $chunksize -eq 0 ] || kval="${kval:+$kval }chunksize:${chunksize}b" + [ $stripesize -eq 0 ] || kval="${kval:+$kval }stripesize:${stripesize}b" ++ [ $segmentsize -eq $size ] || infokval="${infokval:+$infokval }segmentsize:${segmentsize}b" + if [[ ,$layout, == *,mirror,* ]] ; then + kval="${kval:+$kval }mirrors:$(($stripes - 1))" + elif [[ ,$layout, == *,striped,* ]] ; then + kval="${kval:+$kval }stripes:$stripes" + fi + +- echo "lvmvol /dev/$vg $lv ${size}b $layout $kval" ++ if [[ " $already_processed_lvs " == *\ $vg/$lv\ * ]] ; then ++ # The LV has multiple segments; the create_lvmvol() function in ++ # 110_include_lvm_code.sh is not able to recreate this, but ++ # keep the information for the administrator anyway. ++ echo "#lvmvol /dev/$vg $lv ${size}b $layout $kval" ++ if [ -n "$infokval" ] ; then ++ echo "# extra parameters for the line above not taken into account when restoring using 'lvcreate': $infokval" ++ fi ++ else ++ if [ $segmentsize -ne $size ] ; then ++ echo "# WARNING: Volume $vg/$lv has multiple segments. Restoring it in Migration Mode using 'lvcreate' won't preserve segments and properties of the other segments as well!" ++ fi ++ echo "lvmvol /dev/$vg $lv ${size}b $layout $kval" ++ if [ -n "$infokval" ] ; then ++ echo "# extra parameters for the line above not taken into account when restoring using 'lvcreate': $infokval" ++ fi ++ already_processed_lvs="${already_processed_lvs:+$already_processed_lvs }$vg/$lv" ++ fi + done + + else + # Compatibility with older LVM versions (e.g. <= 2.02.98) + # No support for 'lv_layout', too bad, do our best! + +- lvm 8>&- 7>&- lvs --separator=":" --noheadings --units b --nosuffix -o origin,lv_name,vg_name,lv_size,modules,pool_lv,chunk_size,stripes,stripe_size | while read line ; do ++ lvm 8>&- 7>&- lvs --separator=":" --noheadings --units b --nosuffix -o origin,lv_name,vg_name,lv_size,modules,pool_lv,chunk_size,stripes,stripe_size,seg_size | while read line ; do + + if [ $header_printed -eq 0 ] ; then + echo "# Format for LVM LVs" +@@ -125,11 +146,14 @@ Log "Saving LVM layout." + chunksize="$(echo "$line" | awk -F ':' '{ print $7 }')" + stripes="$(echo "$line" | awk -F ':' '{ print $8 }')" + stripesize="$(echo "$line" | awk -F ':' '{ print $9 }')" ++ segmentsize="$(echo "$line" | awk -F ':' '{ print $10 }')" + + kval="" ++ infokval="" + [ -z "$thinpool" ] || kval="${kval:+$kval }thinpool:$thinpool" + [ $chunksize -eq 0 ] || kval="${kval:+$kval }chunksize:${chunksize}b" + [ $stripesize -eq 0 ] || kval="${kval:+$kval }stripesize:${stripesize}b" ++ [ $segmentsize -eq $size ] || infokval="${infokval:+$infokval }segmentsize:${segmentsize}b" + if [[ "$modules" == "" ]] ; then + layout="linear" + [ $stripes -eq 0 ] || kval="${kval:+$kval }stripes:$stripes" +@@ -148,7 +172,24 @@ Log "Saving LVM layout." + kval="${kval:+$kval }stripes:$stripes" + fi + +- echo "lvmvol /dev/$vg $lv ${size}b $layout $kval" ++ if [[ " $already_processed_lvs " == *\ $vg/$lv\ * ]]; then ++ # The LV has multiple segments; the create_lvmvol() function in ++ # 110_include_lvm_code.sh is not able to recreate this, but ++ # keep the information for the administrator anyway. ++ echo "#lvmvol /dev/$vg $lv ${size}b $layout $kval" ++ if [ -n "$infokval" ] ; then ++ echo "# extra parameters for the line above not taken into account when restoring using 'lvcreate': $infokval" ++ fi ++ else ++ if [ $segmentsize -ne $size ] ; then ++ echo "# WARNING: Volume $vg/$lv has multiple segments. Restoring it in Migration Mode using 'lvcreate' won't preserve segments and properties of the other segments as well!" ++ fi ++ echo "lvmvol /dev/$vg $lv ${size}b $layout $kval" ++ if [ -n "$infokval" ] ; then ++ echo "# extra parameters for the line above not taken into account when restoring using 'lvcreate': $infokval" ++ fi ++ already_processed_lvs="${already_processed_lvs:+$already_processed_lvs }$vg/$lv" ++ fi + done + + fi diff --git a/SPECS/rear.spec b/SPECS/rear.spec index 7ff0b6d..d7e8634 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: 7%{?dist} +Release: 9%{?dist} License: GPLv3 Group: Applications/File URL: http://relax-and-recover.org/ @@ -19,6 +19,8 @@ Patch12: rear-bz1659137.patch Patch14: rear-bz1672938.patch Patch15: rear-bz1685166.patch Patch16: rear-bz1655956.patch +Patch17: rear-bz1732328.patch +Patch18: rear-bz1726982.patch ExcludeArch: s390x ExcludeArch: s390 @@ -114,6 +116,8 @@ fi %patch14 -p1 %patch15 -p1 %patch16 -p1 +%patch17 -p1 +%patch18 -p1 echo "30 1 * * * root /usr/sbin/rear checklayout || /usr/sbin/rear mkrescue" >rear.cron @@ -148,6 +152,17 @@ TZ=UTC %{__make} -C doc %{_sbindir}/rear %changelog +* Wed Jul 31 2019 Pavel Cahyna - 2.4-9 +- Apply upstream PR2173 - Cannot restore using Bacula method + due to "bconsole" not showing its prompt + Resolves: rhbz1726982 + +* Tue Jul 30 2019 Pavel Cahyna - 2.4-8 +- Backport fix for upstream issue 2187 (disklayout.conf file contains + duplicate lines, breaking recovery in migration mode or when + thin pools are used). PR2194, 2196. + Resolves: rhbz1732328 + * Tue Mar 26 2019 Pavel Cahyna - 2.4-7 - Backport fix for upstream bug 1913 (backup succeeds in case of tar error) Resolves: rhbz1631183