diff --git a/.gitignore b/.gitignore index bd49bec..38668b3 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/rear-2.00.tar.gz +SOURCES/rear-2.4.tar.gz diff --git a/.rear.metadata b/.rear.metadata index b57604f..68e7cba 100644 --- a/.rear.metadata +++ b/.rear.metadata @@ -1 +1 @@ -6d78cd78e4c6679fba4bb224dde56ac9da0485ae SOURCES/rear-2.00.tar.gz +9f6037ea582635ed78f1dffaa8a7cc5cdc7db37a SOURCES/rear-2.4.tar.gz diff --git a/SOURCES/bz1506231.patch b/SOURCES/bz1506231.patch deleted file mode 100644 index f94f66b..0000000 --- a/SOURCES/bz1506231.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -up rear-2.00/usr/share/rear/rescue/NBU/default/450_prepare_netbackup.sh.bz1506231 rear-2.00/usr/share/rear/rescue/NBU/default/450_prepare_netbackup.sh ---- rear-2.00/usr/share/rear/rescue/NBU/default/450_prepare_netbackup.sh.bz1506231 2017-11-02 10:29:57.000000000 +0100 -+++ rear-2.00/usr/share/rear/rescue/NBU/default/450_prepare_netbackup.sh 2017-11-27 11:58:54.000000000 +0100 -@@ -7,6 +7,9 @@ - - [[ $NBU_version -lt 7 ]] && return # NBU is using xinetd when version <7.x - --cp $v /etc/init.d/netbackup $ROOTFS_DIR/etc/scripts/system-setup.d/90-netbackup.sh --[ -f $ROOTFS_DIR/etc/scripts/system-setup.d/90-netbackup.sh ] && \ -+if [ -e "/etc/init.d/netbackup" ]; then -+ cp $v /etc/init.d/netbackup $ROOTFS_DIR/etc/scripts/system-setup.d/netbackup.real -+ chmod $v +x $ROOTFS_DIR/etc/scripts/system-setup.d/netbackup.real -+ echo "( /etc/scripts/system-setup.d/netbackup.real )" > $ROOTFS_DIR/etc/scripts/system-setup.d/90-netbackup.sh - chmod $v +x $ROOTFS_DIR/etc/scripts/system-setup.d/90-netbackup.sh -+fi -diff -up rear-2.00/usr/share/rear/skel/default/usr/lib/systemd/system/sysinit.service.bz1506231 rear-2.00/usr/share/rear/skel/default/usr/lib/systemd/system/sysinit.service ---- rear-2.00/usr/share/rear/skel/default/usr/lib/systemd/system/sysinit.service.bz1506231 2017-11-27 11:57:54.000000000 +0100 -+++ rear-2.00/usr/share/rear/skel/default/usr/lib/systemd/system/sysinit.service 2017-11-27 11:58:09.000000000 +0100 -@@ -6,3 +6,4 @@ After=systemd-udevd.service - Type=oneshot - ExecStart=/etc/scripts/system-setup - StandardInput=tty -+RemainAfterExit=yes diff --git a/SOURCES/pr-1481.patch b/SOURCES/pr-1481.patch deleted file mode 100644 index 1438ff5..0000000 --- a/SOURCES/pr-1481.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/usr/share/rear/prep/default/310_include_uefi_tools.sh b/usr/share/rear/prep/default/330_include_uefi_tools.sh -similarity index 58% -rename from usr/share/rear/prep/default/310_include_uefi_tools.sh -rename to usr/share/rear/prep/default/330_include_uefi_tools.sh -index 61f973a..c910d36 100644 ---- a/usr/share/rear/prep/default/310_include_uefi_tools.sh -+++ b/usr/share/rear/prep/default/330_include_uefi_tools.sh -@@ -1,14 +1,9 @@ --# When /boot/efi is mounted we copy the UEFI binaries we might need -+# -+# Copy UEFI binaries we might need into the ReaR recovery system. -+# - --# If noefi is set, we can ignore UEFI altogether --if grep -qw 'noefi' /proc/cmdline; then -- return --fi -- --# next step, is checking /boot/efi directory (we need it) --if [[ ! -d /boot/efi ]]; then -- return # must be mounted --fi -+# Include UEFI tools on demand only -+is_true $USING_UEFI_BOOTLOADER || return - - REQUIRED_PROGS=( "${REQUIRED_PROGS[@]}" - dosfsck diff --git a/SOURCES/rear-bz1388653-pr1418.patch b/SOURCES/rear-bz1388653-pr1418.patch deleted file mode 100644 index 1461655..0000000 --- a/SOURCES/rear-bz1388653-pr1418.patch +++ /dev/null @@ -1,61 +0,0 @@ -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-bz1532676-pr1685.patch b/SOURCES/rear-bz1532676-pr1685.patch deleted file mode 100644 index f252f5a..0000000 --- a/SOURCES/rear-bz1532676-pr1685.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/usr/share/rear/verify/NETFS/default/550_check_backup_archive.sh b/usr/share/rear/verify/NETFS/default/550_check_backup_archive.sh -index a7bb31f..57f7537 100644 ---- a/usr/share/rear/verify/NETFS/default/550_check_backup_archive.sh -+++ b/usr/share/rear/verify/NETFS/default/550_check_backup_archive.sh -@@ -26,7 +26,9 @@ for restoreinput in "${RESTORE_ARCHIVES[@]}" ; do - if is_true "$BACKUP_INTEGRITY_CHECK" && test -f $restoreinput.md5 ; then - if ! test -f "$backup_splitted_file" ; then - LogPrint "Checking integrity of $restoreinput_filename" -+ pushd ${restoreinput%/*} - md5sum -c $restoreinput.md5 || Error "Integrity check failed. Restore aborted because BACKUP_INTEGRITY_CHECK is enabled." -+ popd - fi - fi - done diff --git a/SOURCES/rear-bz1571266-pr1383.patch b/SOURCES/rear-bz1571266-pr1383.patch deleted file mode 100644 index 1ed6ddf..0000000 --- a/SOURCES/rear-bz1571266-pr1383.patch +++ /dev/null @@ -1,125 +0,0 @@ -diff --git a/usr/share/rear/output/ISO/Linux-ppc64/800_create_isofs.sh b/usr/share/rear/output/ISO/Linux-ppc64/800_create_isofs.sh -deleted file mode 100644 -index 005de330..00000000 ---- a/usr/share/rear/output/ISO/Linux-ppc64/800_create_isofs.sh -+++ /dev/null -@@ -1,34 +0,0 @@ --# 800_create_isofs.sh --# --# create initramfs for Relax-and-Recover --# --# This file is part of Relax-and-Recover, licensed under the GNU General --# Public License. Refer to the included COPYING for full text of license. -- --# check that we have mkisofs --[ -x "$ISO_MKISOFS_BIN" ] --StopIfError "ISO_MKISOFS_BIN [$ISO_MKISOFS_BIN] not an executable !" -- --Log "Copying kernel" --cp -pL $v $KERNEL_FILE $TMP_DIR/kernel >&2 -- --if [[ "$SUSE_STYLE" ]]; then -- ISO_FILES=( ${ISO_FILES[@]} $TMP_DIR/kernel initrd.cgz yaboot) --else -- ISO_FILES=( ${ISO_FILES[@]} $TMP_DIR/kernel initrd.cgz) --fi --Log "Starting '$ISO_MKISOFS_BIN'" --LogPrint "Making ISO image" -- --mkdir -p $v "$ISO_DIR" >&2 --StopIfError "Could not create ISO ouput directory ($ISO_DIR)" -- --pushd $TMP_DIR >&8 # so that relative paths will work --$ISO_MKISOFS_BIN $v -o "$ISO_DIR/$ISO_PREFIX.iso" -U -chrp-boot \ -- -R -J -volid "$ISO_VOLID" -v -graft-points "${ISO_FILES[@]}" >&8 --StopIfError "Could not create ISO image" --popd >&8 --Print "Wrote ISO Image $ISO_DIR/$ISO_PREFIX.iso ($(du -h "$ISO_DIR/$ISO_PREFIX.iso"| tr -s " \t" " " | cut -d " " -f 1))" -- --# Add ISO image to result files --RESULT_FILES=( "${RESULT_FILES[@]}" "$ISO_DIR/$ISO_PREFIX.iso" ) -diff --git a/usr/share/rear/output/ISO/Linux-ppc64/800_create_isofs.sh b/usr/share/rear/output/ISO/Linux-ppc64/800_create_isofs.sh -new file mode 120000 -index 00000000..b2cd4893 ---- /dev/null -+++ b/usr/share/rear/output/ISO/Linux-ppc64/800_create_isofs.sh -@@ -0,0 +1 @@ -+../Linux-ppc64le/800_create_isofs.sh -\ No newline at end of file -diff --git a/usr/share/rear/output/ISO/Linux-ppc64/810_prepare_multiple_iso.sh b/usr/share/rear/output/ISO/Linux-ppc64/810_prepare_multiple_iso.sh -new file mode 120000 -index 00000000..04f8a495 ---- /dev/null -+++ b/usr/share/rear/output/ISO/Linux-ppc64/810_prepare_multiple_iso.sh -@@ -0,0 +1 @@ -+../Linux-i386/810_prepare_multiple_iso.sh -\ No newline at end of file -diff --git a/usr/share/rear/output/ISO/Linux-ppc64/820_create_iso_image.sh b/usr/share/rear/output/ISO/Linux-ppc64/820_create_iso_image.sh -new file mode 120000 -index 00000000..981cfd2e ---- /dev/null -+++ b/usr/share/rear/output/ISO/Linux-ppc64/820_create_iso_image.sh -@@ -0,0 +1 @@ -+../Linux-ppc64le/820_create_iso_image.sh -\ No newline at end of file -diff --git a/usr/share/rear/output/ISO/Linux-ppc64le/800_create_isofs.sh b/usr/share/rear/output/ISO/Linux-ppc64le/800_create_isofs.sh -index f0c023cd..d9ce61de 100644 ---- a/usr/share/rear/output/ISO/Linux-ppc64le/800_create_isofs.sh -+++ b/usr/share/rear/output/ISO/Linux-ppc64le/800_create_isofs.sh -@@ -18,13 +18,3 @@ LogPrint "Making ISO image" - - mkdir -p $v "$ISO_DIR" >&2 - StopIfError "Could not create ISO ouput directory ($ISO_DIR)" -- --pushd $TMP_DIR >&8 # so that relative paths will work --$ISO_MKISOFS_BIN $v -o "$ISO_DIR/$ISO_PREFIX.iso" -U -chrp-boot \ -- -R -J -volid "$ISO_VOLID" -v -graft-points "${ISO_FILES[@]}" >&8 --StopIfError "Could not create ISO image" --popd >&8 --Print "Wrote ISO Image $ISO_DIR/$ISO_PREFIX.iso ($(du -h "$ISO_DIR/$ISO_PREFIX.iso"| tr -s " \t" " " | cut -d " " -f 1))" -- --# Add ISO image to result files --RESULT_FILES=( "${RESULT_FILES[@]}" "$ISO_DIR/$ISO_PREFIX.iso" ) -diff --git a/usr/share/rear/output/ISO/Linux-ppc64le/810_prepare_multiple_iso.sh b/usr/share/rear/output/ISO/Linux-ppc64le/810_prepare_multiple_iso.sh -new file mode 120000 -index 00000000..04f8a495 ---- /dev/null -+++ b/usr/share/rear/output/ISO/Linux-ppc64le/810_prepare_multiple_iso.sh -@@ -0,0 +1 @@ -+../Linux-i386/810_prepare_multiple_iso.sh -\ No newline at end of file -diff --git a/usr/share/rear/output/ISO/Linux-ppc64le/820_create_iso_image.sh b/usr/share/rear/output/ISO/Linux-ppc64le/820_create_iso_image.sh -new file mode 100644 -index 00000000..28b6464f ---- /dev/null -+++ b/usr/share/rear/output/ISO/Linux-ppc64le/820_create_iso_image.sh -@@ -0,0 +1,29 @@ -+ -+Log "Starting '$ISO_MKISOFS_BIN'" -+LogPrint "Making ISO image" -+ -+pushd $TMP_DIR >&2 -+ -+# If isofs directory exists, add its content to ISO_FILES (when backup must be part of the ISO images) -+if [ -d isofs ] ; then -+ ISO_FILES=( ${ISO_FILES[@]} isofs ) -+fi -+ -+# mkisofs command for ppc64/ppc64le arch -+# Adapt the chrp-boot option if xorrisofs is used. -+if [[ "$(basename $ISO_MKISOFS_BIN)" == "xorrisofs" ]]; then -+ chrp_boot_option="-chrp-boot-part" -+else -+ chrp_boot_option="-chrp-boot" -+fi -+ -+$ISO_MKISOFS_BIN $v -o "$ISO_DIR/$ISO_PREFIX.iso" -U $chrp_boot_option -R -J -volid "$ISO_VOLID" -v -graft-points "${ISO_FILES[@]}" >&2 -+ -+StopIfError "Could not create ISO image (with $ISO_MKISOFS_BIN)" -+popd >&2 -+ -+iso_image_size=( $(du -h "$ISO_DIR/$ISO_PREFIX.iso") ) -+LogPrint "Wrote ISO image: $ISO_DIR/$ISO_PREFIX.iso ($iso_image_size)" -+ -+# Add ISO image to result files -+RESULT_FILES=( "${RESULT_FILES[@]}" "$ISO_DIR/$ISO_PREFIX.iso" ) diff --git a/SPECS/rear.spec b/SPECS/rear.spec index 9a00ebb..77fea64 100644 --- a/SPECS/rear.spec +++ b/SPECS/rear.spec @@ -1,29 +1,20 @@ Summary: Relax-and-Recover is a Linux disaster recovery and system migration tool Name: rear -Version: 2.00 -Release: 7%{?dist} +Version: 2.4 +Release: 2%{?dist} License: GPLv3 Group: Applications/File 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 +Source0: https://github.com/rear/rear/archive/%{version}.tar.gz#/rear-%{version}.tar.gz Patch4: rear-bz1492177-warning.patch -Patch5: rear-bz1571266-pr1383.patch -BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) ExcludeArch: s390x ExcludeArch: s390 ### Dependencies on all distributions +BuildRequires: asciidoc Requires: binutils Requires: ethtool Requires: gzip @@ -33,6 +24,7 @@ Requires: tar Requires: openssl Requires: gawk Requires: attr +Requires: bc ### If you require NFS, you may need the below packages #Requires: nfsclient portmap rpcbind @@ -85,7 +77,7 @@ Currently Relax-and-Recover supports various boot media (incl. ISO, PXE, OBDR tape, USB or eSATA storage), a variety of network protocols (incl. sftp, ftp, http, nfs, cifs) as well as a multitude of backup strategies (incl. IBM TSM, HP DataProtector, Symantec NetBackup, EMC NetWorker, -Bacula, Bareos, rsync). +Bacula, Bareos, BORG, Duplicity, rsync). Relax-and-Recover was designed to be easy to set up, requires no maintenance and is there to assist when disaster strikes. Its setup-and-forget nature @@ -101,12 +93,7 @@ fi %prep %setup -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 %patch4 -p1 -%patch5 -p1 echo "30 1 * * * root /usr/sbin/rear checklayout || /usr/sbin/rear mkrescue" >rear.cron @@ -115,18 +102,23 @@ echo "30 1 * * * root /usr/sbin/rear checklayout || /usr/sbin/rear mkrescue" >re %{?rhel:echo -e "OS_VENDOR=RedHatEnterpriseServer\nOS_VERSION=%{?rhel}" >etc/rear/os.conf} %build +# asciidoc writes a timestamp to files it produces, based on the last +# modified date of the source file, but is sensible to the timezone. +# This makes the results differ according to the timezone of the build machine +# and spurious changes will be seen. +# Set the timezone to UTC as a workaround. +# https://wiki.debian.org/ReproducibleBuilds/TimestampsInDocumentationGeneratedByAsciidoc +TZ=UTC %{__make} -C doc %install %{__rm} -rf %{buildroot} %{__make} install DESTDIR="%{buildroot}" %{__install} -Dp -m0644 rear.cron %{buildroot}%{_sysconfdir}/cron.d/rear #%{__install} -Dp -m0644 etc/udev/rules.d/62-rear-usb.rules %{buildroot}%{_sysconfdir}/udev/rules.d/62-rear-usb.rules -%clean -%{__rm} -rf %{buildroot} %files %defattr(-, root, root, 0755) -%doc AUTHORS COPYING README.adoc doc/*.txt +%doc MAINTAINERS COPYING README.adoc doc/*.txt doc/user-guide/relax-and-recover-user-guide.html %doc %{_mandir}/man8/rear.8* %config(noreplace) %{_sysconfdir}/cron.d/rear %config(noreplace) %{_sysconfdir}/rear/ @@ -136,10 +128,12 @@ echo "30 1 * * * root /usr/sbin/rear checklayout || /usr/sbin/rear mkrescue" >re %{_sbindir}/rear %changelog -* Fri Jul 13 2018 Pavel Cahyna - 2.00-7 -- Backport upstream PR1383: Allow backup to be stored in ISO for ppc64/ppc64le - Includes also commit 30099a98fdc1eab6373bc3682929bc4b9c09b54b. - Resolves: #1596182 +* Wed Jul 18 2018 Pavel Cahyna - 2.4-2 +- Build and install the HTML user guide. #1418459 + +* Wed Jun 27 2018 Pavel Cahyna - 2.4-1 +- Rebase to version 2.4, drop patches integrated upstream + Resolves #1534646 #1484051 #1498828 #1571266 #1496518 * Wed Feb 14 2018 Pavel Cahyna - 2.00-6 - Ensure that NetBackup is started automatically upon recovery (PR#1544)