From bddadec60582c3eacc8928a178ea24dc9fd71243 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Apr 10 2018 05:48:34 +0000 Subject: import rear-2.00-6.el7 --- diff --git a/SOURCES/rear-bz1388653-pr1418.patch b/SOURCES/rear-bz1388653-pr1418.patch new file mode 100644 index 0000000..1461655 --- /dev/null +++ b/SOURCES/rear-bz1388653-pr1418.patch @@ -0,0 +1,61 @@ +diff --git a/usr/share/rear/conf/default.conf b/usr/share/rear/conf/default.conf +index 3be1552..b392d6d 100644 +--- a/usr/share/rear/conf/default.conf ++++ b/usr/share/rear/conf/default.conf +@@ -409,6 +409,16 @@ PXE_REMOVE_OLD_LINKS= + # Default is empty which means prompting what to do next and after a timeout boot next option defined by BIOS + PXE_RECOVER_MODE= + ++# Certain operation might need longer time to kick in and more retries might be desirable. ++# REAR_SLEEP_DELAY (in sec.) is general delay for operation. ++REAR_SLEEP_DELAY=1 ++# REAR_MAX_RETRIES is maximum number of attempts that should be executed before operation is aborted. ++# Maximum timeout for operation calculates as REAR_SLEEP_DELAY * REAR_MAX_RETRIES ++# This retries / timeout operation is currently implemented only in get_disk_size (), ++# so if you have trouble with error messages like: ++# 'Could not determine size of disk ...' tweaking of REAR_SLEEP_DELAY and REAR_MAX_RETRIES might help. ++REAR_MAX_RETRIES=5 ++ + ## + # internal BACKUP stuff + ## +diff --git a/usr/share/rear/lib/layout-functions.sh b/usr/share/rear/lib/layout-functions.sh +index 75a59bb..052a752 100644 +--- a/usr/share/rear/lib/layout-functions.sh ++++ b/usr/share/rear/lib/layout-functions.sh +@@ -530,8 +530,7 @@ get_disk_size() { + + local block_size=$(get_block_size ${disk_name%/*}) + +- [ -r /sys/block/$disk_name/size ] +- BugIfError "Could not determine size of disk $disk_name, please file a bug." ++ retry_command test -r /sys/block/$disk_name/size || Error "Could not determine size of disk $disk_name" + + local nr_blocks=$( < /sys/block/$disk_name/size) + local disk_size=$(( nr_blocks * block_size )) +@@ -586,3 +585,25 @@ is_disk_a_pv() { + return 1 + fi + } ++ ++# retry_command () is binded with REAR_SLEEP_DELAY and REAR_MAX_RETRIES. ++# This function will do maximum of REAR_MAX_RETRIES command execution ++# and will sleep REAR_SLEEP_DELAY after each unsuccessful command execution. ++# It outputs command stdout if succeeded or returns 1 on failure. ++retry_command () ++{ ++ local retry=0 ++ ++ until command_stdout=$(eval "$@"); do ++ sleep $REAR_SLEEP_DELAY ++ ++ let retry++ ++ ++ if (( retry >= REAR_MAX_RETRIES )) ; then ++ Log "retry_command '$*' failed" ++ return 1 ++ fi ++ done ++ # Have no additional trailing newline for the command stdout: ++ echo -n "$command_stdout" ++} diff --git a/SOURCES/rear-bz1492177-warning.patch b/SOURCES/rear-bz1492177-warning.patch new file mode 100644 index 0000000..1f5556f --- /dev/null +++ b/SOURCES/rear-bz1492177-warning.patch @@ -0,0 +1,15 @@ +diff --git a/usr/share/rear/output/ISO/Linux-i386/249_check_rhel_grub2_efi_package.sh b/usr/share/rear/output/ISO/Linux-i386/249_check_rhel_grub2_efi_package.sh +new file mode 100644 +index 00000000..4c4ded08 +--- /dev/null ++++ b/usr/share/rear/output/ISO/Linux-i386/249_check_rhel_grub2_efi_package.sh +@@ -0,0 +1,9 @@ ++# 249_check_rhel_grub2_efi_package.sh ++ ++is_true $USING_UEFI_BOOTLOADER || return # empty or 0 means NO UEFI ++ ++( ++ VERBOSE=1 ++ test -r /usr/lib/grub/x86_64-efi/moddep.lst ++ PrintIfError "WARNING: /usr/lib/grub/x86_64-efi/moddep.lst not found, grub2-mkimage will likely fail. Please install the grub2-efi-x64-modules package to fix this." ++) diff --git a/SPECS/rear.spec b/SPECS/rear.spec index eb9e15c..0dbadf8 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.00 -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv3 Group: Applications/File URL: http://relax-and-recover.org/ @@ -10,11 +10,13 @@ URL: http://relax-and-recover.org/ # as GitHub stopped with download section we need to go back to Sourceforge for downloads Source0: https://sourceforge.net/projects/rear/files/rear/2.00/%{version}/rear-%{version}.tar.gz Patch0: pr-1481.patch +Patch1: rear-bz1388653-pr1418.patch Patch2: rear-bz1532676-pr1685.patch #Patch0: 0001-Added-PRE-POST-backup-scripts-in-order-to-be-able-to.patch #Patch1: 0002-Solved-error-with-exit-tasks-on-PRE-POST-backup-scri.patch #Patch2: 0003-Added-some-explanation-of-PRE-POST-backup-scripts-in.patch Patch3: bz1506231.patch +Patch4: rear-bz1492177-warning.patch BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) ExcludeArch: s390x @@ -99,9 +101,10 @@ fi %prep %setup %patch0 -p1 -#%patch1 -p1 +%patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 echo "30 1 * * * root /usr/sbin/rear checklayout || /usr/sbin/rear mkrescue" >rear.cron @@ -131,16 +134,22 @@ echo "30 1 * * * root /usr/sbin/rear checklayout || /usr/sbin/rear mkrescue" >re %{_sbindir}/rear %changelog -* Fri Feb 16 2018 Pavel Cahyna - 2.00-5 +* Wed Feb 14 2018 Pavel Cahyna - 2.00-6 - Ensure that NetBackup is started automatically upon recovery (PR#1544) Also do not kill daemons spawned by sysinit.service at the service's end (PR#1610, applies to NetBackup and also to dhclient) Resolves #1506231 +- Print a warning if grub2-mkimage is about to fail and suggest what to do. + bz#1492177 +- Update the patch for #1388653 to the one actually merged upstream (PR1418) -* Fri Jan 12 2018 Pavel Cahyna - 2.00-4 +* Fri Jan 12 2018 Pavel Cahyna - 2.00-5 - cd to the correct directory before md5sum to fix BACKUP_INTEGRITY_CHECK. Upstream PR#1685, bz1532676 +* Mon Oct 23 2017 Pavel Cahyna - 2.00-4 +- Retry get_disk_size to fix upstream #1370, bz1388653 + * Wed Sep 13 2017 Pavel Cahyna - 2.00-3 - Fix rear mkrescue on systems w/o UEFI. Upstream PR#1481 issue#1478 - Resolves: #1479002