rear/rear.spec
2026-08-18 15:58:07 +02:00

485 lines
20 KiB
RPMSpec

# this is purely a shell script, so no debug packages
%global debug_package %{nil}
Name: rear
Version: 2.9
Release: 5%{?dist}
Summary: Relax-and-Recover is a Linux disaster recovery and system migration tool
URL: https://relax-and-recover.org
License: GPL-3.0-or-later AND LGPL-2.1-or-later
Source0: https://github.com/rear/rear/archive/%{version}/rear-%{version}.tar.gz
# Add cronjob and systemd timer as documentation
Source1: rear.cron
Source2: rear.service
Source3: rear.timer
# Required for HTML user guide
BuildRequires: asciidoctor
BuildRequires: efi-srpm-macros
# Needed for %%autosetup -S git
BuildRequires: git-core
BuildRequires: make
######################
# upstream backports #
######################
# Patch101 - Patch121 Reserved
# skip longhorn iscsi devices in disklayout.conf
# https://github.com/rear/rear/commit/d765abff976a8346ce6afa432c9a09d67ed63482
Patch122: rear-skip-longhorn-iscsi-RHEL-83551.patch
# fix PPC PReP Boot detection on GPT layouts
# https://github.com/rear/rear/commit/1ca518c2a0e675ace956ef71bc79d67e4990562b
Patch123: rear-detect-prep-boot-on-gpt-RHEL-82098.patch
# fix recovery of LUKS encrypted systems with multiple keyslots
# https://github.com/rear/rear/commit/e9ce93f096e505968cc728a7eb5a06e25dc8d88b
Patch124: rear-support-multi-keyslot-luks-RHEL-83776.patch
# support generation of ed25519 SSH host keys in the rescue image
# https://github.com/rear/rear/commit/62d9a744ff710de34035ce15bd1b1bf810b6934a
Patch125: rear-rescue-ed25519-hostkey-support-RHEL-83479.patch
# enhance the 300_map_disks.sh script to also print the disk sizes
# https://github.com/rear/rear/commit/43d62fdfcac50b35be4f99d45bac3b5340525a7a
Patch126: rear-print-disk-mapping-with-sizes-RHEL-83241.patch
# add initial support for arm/aarch64 machines with UEFI
# https://github.com/rear/rear/commit/9b28f14fad26ff00a6f90b13c3e4906d85f3ae3c
Patch127: rear-support-aarch64-uefi-RHEL-56045.patch
# Copy a sshd helper to the rescue ramdisk, necessary on EL10
# https://github.com/rear/rear/commit/8497de2d8a029460b0e47119b0664f0d254c97ac
Patch128: rear-sshd-el10-RHEL-109270.patch
# fix support for PowerNV machines without PPC PReP partitions
# https://github.com/rear/rear/commit/79a3b50a0effcf4c1a43e9dfe1b8d0427ee0bf02
Patch129: rear-fix-powerNV-support-RHEL-134218.patch
# fix duplicate execution of automated recovery
# https://github.com/rear/rear/commit/8a122cb5cfc28ce8c83baa963ad12f1c42e1c908
# https://github.com/rear/rear/commit/fe5397d9da7ab95abfa93533c2cb3efd61f6ca05
Patch130: rear-fix-duplicate-auto-recovery-RHEL-110659.patch
# fix sorting of stage scripts
# https://github.com/rear/rear/commit/95ecb7e024aa187ea6babd49eac1b4c9c3aba106
Patch131: rear-fix-script-sorting-RHEL-132181.patch
# add support for dbus broker
# https://github.com/rear/rear/commit/61d294b9635b3c71bd58409e810bccb705b1220c
Patch132: rear-dbus-broker-RHEL-134213.patch
# EL9-only
# Patch133:
# Patch134:
# Patch135:
# Patch136:
# fix EXCLUDE_COMPONENTS being ignored for partition tables unsupported by ReaR
# https://github.com/rear/rear/commit/626701843a32070080856c960b9e4202102b81d1
Patch137: rear-respect-EXCLUDE_COMPONENTS-in-extract_partitions-RHEL-235767.patch
# mark ISO filesystem labels as write protected
# https://github.com/rear/rear/commit/014a7653b56f9ab8471af591ddf3698d08f0f290
Patch138: rear-mark-ISO-labels-write-protected-RHEL-143987.patch
# fix lftp command to pass options prior to opening the URL
# https://github.com/rear/rear/commit/da9200db491c37662f0c6dc734dcb31e1efc0275
# https://github.com/rear/rear/commit/958231f8a4fdba028ba396e1147f8ad7ee654307
Patch139: rear-fix-lftp-options-pass-RHEL-178087.patch
# add REAR_INITRD_OVERLAY to split initramfs into core + SquashFS overlay
# https://github.com/rear/rear/commit/e95afd1c8580454451fb791991b30839be3141b7
Patch140: rear-add-squashfs-overlay-split-support-RHEL-192030.patch
# fix unsuccessful unmout of rescue ESP that might result in a corrupted rescue USB
# https://github.com/rear/rear/commit/aadf9b40a48f4bbdc9f1ac22165bb2ecfed92207
Patch141: rear-add-lazy-unmounting-with-retry-RHEL-146134.patch
######################
# downstream patches #
######################
# No-longer applicable
# Patch201: rear-bz1492177-warning.patch
# avoid vgcfgrestore on unsupported volume types
# https://github.com/pcahyna/rear/commit/5d5d1db3ca621eb80b9481924d1fc470571cfc09
Patch202: rear-bz1747468.patch
# No-longer applicable
# Patch203: rear-bz2119501.patch
# additional fixes for NBU support
Patch204: rear-bz2120736.patch
Patch205: rear-bz2188593-nbu-systemd.patch
Patch206: rear-nbu-RHEL-17390-RHEL-17393.patch
# restore the pre-2.8 OUTPUT=IPL behaviour
Patch207: rear-restore-output-IPL-RHEL-102563.patch
# rear contains only bash scripts plus documentation so that on first glance it could be "BuildArch: noarch"
# but actually it is not "noarch" because it only works on those architectures that are explicitly supported.
# Of course the rear bash scripts can be installed on any architecture just as any binaries can be installed on any architecture.
# But the meaning of architecture dependent packages should be on what architectures they will work.
# Therefore only those architectures that are actually supported are explicitly listed.
# This avoids that rear can be "just installed" on architectures that are actually not supported:
ExclusiveArch: %ix86 x86_64 ppc ppc64 ppc64le ia64 s390x %arm aarch64
# Furthermore for some architectures it requires architecture dependent packages (like syslinux for x86 and x86_64)
# so that rear must be architecture dependent because ifarch conditions never match in case of "BuildArch: noarch"
# see the GitHub issue https://github.com/rear/rear/issues/629
%ifarch %ix86 x86_64
Requires: syslinux-extlinux
%endif
%ifarch ppc ppc64 ppc64le
# Called by grub2-install (except on PowerNV)
Requires: /usr/sbin/ofpathname
# Needed to make PowerVM LPARs bootable
Requires: /usr/sbin/bootlist
%endif
%ifarch s390x
# Contain many utilities for working with DASDs
Requires: s390utils-base
Requires: s390utils-core
%endif
# See https://github.com/rhboot/efi-rpm-macros/blob/main/README
%ifarch %{efi}
# We need mkfs.vfat for recreating EFI System Partition
Requires: dosfstools
# Needed for ISO image creation
Requires: grub2-efi-%{efi_arch}-modules
Requires: grub2-tools-extra
%endif
### Mandatory dependencies:
Requires: attr
Requires: bc
Requires: binutils
Requires: dhcpcd
Requires: ethtool
Requires: file
Requires: gawk
Requires: gzip
Requires: iproute
Requires: iputils
Requires: lftp
Requires: openssl
Requires: parted
# For REAR_INITRD_OVERLAY
Requires: squashfs-tools
Requires: tar
# No ISO image support on s390x (may change when we add support for LPARs)
%ifnarch s390x
Requires: xorriso
%endif
%if 0%{?rhel}
Requires: util-linux
%endif
%description
Relax-and-Recover is the leading Open Source disaster recovery and system
migration solution. It comprises of a modular
frame-work and ready-to-go workflows for many common situations to produce
a bootable image and restore from backup using this image. As a benefit,
it allows to restore to different hardware and can therefore be used as
a migration tool as well.
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, MircroFocus Data Protector, Symantec NetBackup, EMC NetWorker,
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
removes any excuse for not having a disaster recovery solution implemented.
Professional services and support are available.
#-- PREP, BUILD & INSTALL -----------------------------------------------------#
%prep
%autosetup -p1 -S git
# Change /lib to /usr/lib for COPY_AS_IS
sed -E -e "s:([\"' ])/lib:\1/usr/lib:g" \
-i usr/share/rear/prep/GNU/Linux/*include*.sh
# Same for Linux.conf
sed -e 's:/lib/:/usr/lib/:g' \
-e 's:/lib\*/:/usr/lib\*/:g' \
-e 's:/usr/usr/lib:/usr/lib:g' \
-i 'usr/share/rear/conf/GNU/Linux.conf'
%build
# build HTML user guide
# asciidoc writes a timestamp to files it produces, based on the last
# modified date of the source file, but is sensitive 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_build doc
%install
%make_install sbindir=%{_sbindir}
install -p -d %{buildroot}%{_docdir}/%{name}/
install -m 0644 %{SOURCE1} %{buildroot}%{_docdir}/%{name}/
install -m 0644 %{SOURCE2} %{buildroot}%{_docdir}/%{name}/
install -m 0644 %{SOURCE3} %{buildroot}%{_docdir}/%{name}/
#-- FILES ---------------------------------------------------------------------#
%files
%license COPYING
%doc MAINTAINERS README.md doc/user-guide doc/*.txt
%dir %{_sysconfdir}/rear/
%config(noreplace) %{_sysconfdir}/rear/local.conf
%{_datadir}/rear/
%{_docdir}/%{name}/rear.*
%{_mandir}/man8/rear.8*
%{_sbindir}/rear
%{_sharedstatedir}/rear/
#-- CHANGELOG -----------------------------------------------------------------#
%changelog
* Mon Jan 12 2026 Lukáš Zaoral <lzaoral@redhat.com> - 2.9-5
- fix support for PowerNV machines without PPC PReP partitions (RHEL-134218)
- fix duplicate execution of automated recovery (RHEL-110659)
- fix sorting of stage scripts (RHEL-132181)
- add support for dbus-broker (RHEL-134213)
* Mon Aug 18 2025 Pavel Cahyna <pcahyna@redhat.com> - 2.9-4
- Add a sshd helper to rescue, otherwise sshd does not start, PR 3510
* Mon Aug 04 2025 Lukáš Zaoral <lzaoral@redhat.com> - 2.9-3
- add dependency on grub2-tools-extra on EFI machines (RHEL-85421)
- add initial support for aarch64 machines with UEFI (RHEL-84286)
- enhance the 300_map_disks.sh script to also print the disk sizes (RHEL-106771)
- support generation of ed25519 SSH host keys in the rescue image (RHEL-106770)
- fix recovery of LUKS encrypted systems with multiple keyslots (RHEL-106762)
- fix PPC PReP Boot detection on GPT layouts (RHEL-82098)
- skip longhorn iscsi devices in disklayout.conf (RHEL-106561)
- restore the pre-2.8 OUTPUT=IPL behaviour (RHEL-102563)
* Wed Feb 05 2025 Lukáš Zaoral <lzaoral@redhat.com> - 2.9-2
- require syslinux-extlinux which is necessary for USB devices bootable on
legacy BIOS
* Tue Feb 04 2025 Lukáš Zaoral <lzaoral@redhat.com> - 2.9-1
- rebase to version 2.9 (rhbz#2343296)
- drop upstreamed patches
- remove obsolete patch for rhbz2119501
- ReaR 2.7 and newer do not copy dangling symlinks in /lib/modules/*/
- remove broken patch for rhbz1492177 (VERBOSE is a read-only var, so the script silently failed)
- install correct packages using proper RPM dependencies instead
- rebase remaining patches
* Tue Jan 21 2025 Lukáš Zaoral <lzaoral@redhat.com> - 2.7-14
- fix FTBFS after F42 bin/sbin merge
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 2.7-13
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Thu Aug 8 2024 Pavel Cahyna <pcahyna@redhat.com> - 2.7-12
- Remove doc/rear-release-notes.txt, it is CC-BY-ND-3.0, which is not an allowed
license for documentation, and use a cleaned tarball (with the file removed)
for build
* Wed Aug 7 2024 Pavel Cahyna <pcahyna@redhat.com> - 2.7-11
- Generate /etc/rear/os.conf during build again, it is better than generating it
in %%post, but do not mark it as config file to allow it to be updated during
package upgrade and avoid containing an old OS version information
* Mon Aug 05 2024 Lukáš Zaoral <lzaoral@redhat.com> - 2.7-10
- skip btrfs subvolumes when detecting ESP partitions
- fix booting on UEFI systems with multiple CDROM devices
- fix copying of console kernel cmdline parameters
- Use git to apply patches in %%prep
- Sync with patches in CentOS Stream 9 (kudos to @pcahyna!):
- Backport PR 3250 to fix useless warning that libsystemd-core requires
additional libraries and ReaR recovery system needs additional libraries
- Backport PR 3242 to fix IPv6 address in nfs:// and sshfs://
BACKUP/OUTPUT_URL
- fix backup of btrfs subvolumes
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 2.7-9
- Bump release for June 2024 mass rebuild
* Fri Feb 09 2024 Lukáš Zaoral <lzaoral@redhat.com> - 2.7-8
- Sync with patches in CentOS Stream 9 (kudos to @pcahyna!) chronologically
from the latest:
- Resolve libs for executable links in COPY_AS_IS, PR 3073
- Skip invalid disk drives when saving layout PR 3047
- Do not delete NetBackup logs in case of errors and save
/usr/openv/netbackup/logs to the restored system after a successful recovery
- Add /usr/openv/var to COPY_AS_IS_NBU, fixes an issue seen
with NetBackup 10.2.0.1
- Support saving and restoring hybrid BIOS/UEFI bootloader, PRs 3145 3136
* Thu Feb 08 2024 Lukáš Zaoral <lzaoral@redhat.com> - 2.7-7
- do not generate /etc/rear/os.conf during build
* Wed Feb 07 2024 Lukáš Zaoral <lzaoral@redhat.com> - 2.7-6
- copy the console= kernel arguments from the original system
* Tue Feb 06 2024 Lukáš Zaoral <lzaoral@redhat.com> - 2.7-5
- replace dhcp-client with dhcpcd (rhbz#2247060)
* Tue Feb 06 2024 Lukáš Zaoral <lzaoral@redhat.com> - 2.7-4
- make initrd accessible only by root (CVE-2024-23301)
* Tue Feb 06 2024 Lukáš Zaoral <lzaoral@redhat.com> - 2.7-3
- fix unusable recovery with newer systemd (rbhz#2254871)
* Mon Feb 05 2024 Lukáš Zaoral <lzaoral@redhat.com> - 2.7-2
- migrate to SPDX license format
- properly use %%license and %%doc macros
- use https in URLs
* Fri Feb 02 2024 Lukáš Zaoral <lzaoral@redhat.com> - 2.7-1
- rebase to version 2.7 (rhbz#2215778)
- drop obsolete patches
- rebase remaining patches
* Fri Feb 2 2024 Lukáš Zaoral <lzaoral@redhat.com> - 2.6-14
- Sync with patches in CentOS Stream 9 (kudos to @pcahyna!) chronologically
from the latest:
- Backport PR 3061 to save LVM pool metadata volume size in disk layout
and restore it
- Backport PR 3058 to skip useless xfs mount options when mounting
during recovery, prevents mount errors like "logbuf size must be greater
than or equal to log stripe size"
- Add patch to force removal of lvmdevices, prevents LVM problems after
restoring to different disks/cloning. Upstream PR 3043
- Add patch to start rsyslog and include NBU systemd units
- Apply PR 3027 to ensure correct creation of the rescue environment
when a file is shrinking while being read
- Backport PR 2774 to increase USB_UEFI_PART_SIZE to 1024 MiB
- Apply upstream patch for temp dir usage with LUKS to ensure
that during recovery an encrypted disk can be unlocked using a keyfile
- Backport upstream PR 3031: Secure Boot support for OUTPUT=USB
- Correct a mistake done when backporting PR 2691
- Backport PR2943 to fix s390x dasd formatting
- Require s390utils-{core,base} on s390x
- Apply PR2903 to protect against colons in pvdisplay output
- Apply PR2873 to fix initrd regeneration on s390x
- Apply PR2431 to migrate XFS configuration files
- Exclude /etc/lvm/devices from the rescue system to work around a segfault
in lvm pvcreate
- Avoid stderr message about irrelevant broken links
- Changes for NetBackup (NBU) 9.x support
- Backport PR2831 - rsync URL refactoring
fixes rsync OUTPUT_URL when different from BACKUP_URL
- Apply PR2795 to detect changes in system files between backup
and rescue image
- Apply PR2808 to exclude dev/watchdog* from recovery system
- Backport upstream PRs 2827 and 2839 to pass -y to lvcreate instead of one "y"
on stdin
- Apply PR2811 to add the PRE/POST_RECOVERY_COMMANDS directives
- Recommend dosfstools on x86_64, needed for EFI System Partition
- Backport PR2825 to replace defunct mkinitrd with dracut
- Apply PR2580 to load the nvram module in the rescue environment in order
to be able to set the boot order on ppc64le LPARs
- Backport PR2822 to include the true vi executable in rescue ramdisk
- Apply PR2675 to fix leftover temp dir bug (introduced in backported PR2625)
- Apply PR2603 to ignore unused PV devices
- Apply upstream PR2750 to avoid exclusion of wanted multipath devices
- Remove unneeded xorriso dep on s390x (no ISO image support there)
- Apply upstream PR2736 to add the EXCLUDE_{IP_ADDRESSES,NETWORK_INTERFACES}
options
- Add patch for better handling of thin pools and other LV types not supported
by vgcfgrestore
- Sync spec changes and downstream patches from RHEL 8 rear-2.6-2
- Fix multipath performance regression in 2.6, introduced by upstream PR #2299.
Resolves: rhbz1993296
- On POWER add bootlist & ofpathname to the list of required programs
conditionally (bootlist only if running under PowerVM, ofpathname
always except on PowerNV) - upstream PR2665, add them to package
dependencies
Resolves: rhbz1983013
- Backport PR2608:
Fix setting boot path in case of UEFI partition (ESP) on MD RAID
Resolves: rhbz1945869
- Backport PR2625
Prevents accidental backup removal in case of errors
Resolves: rhbz1958247
- Fix rsync error and option handling
Resolves: rhbz1930662
- Put TMPDIR on /var/tmp by default, otherwise it may lack space
RHBZ #1988420, upstream PR2664
- Sync spec changes and downstream patches from RHEL 8
- Require xorriso instead of genisoimage
- Add S/390 support and forgotten dependency on the file utility
- Backport upstream code related to LUKS2 support
- Modify the cron command to avoid an e-mail with error message after
ReaR is installed but not properly configured when the cron command
is triggered for the first time
- Changes for NetBackup (NBU) support, upstream PR2544
- Add dependency on dhcp-client, RHBZ #1926451
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.6-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.6-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.6-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Fri Jun 23 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 2.6-10
- Switch to xorriso for iso image creation
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.6-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.6-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.6-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.6-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Fri Feb 26 2021 Christopher Engelhard <ce@lcts.de> - 2.6-5
- Change /lib to /usr/lib in scripts to fix RHBZ #1931112
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.6-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Sep 23 2020 Christopher Engelhard <ce@lcts.de> - 2.6-3
- Stop auto-creating a cronjob, but ship example cronjob/
systemd timer units in docdir instead (upstream issue #1829)
- Build & ship HTML user guide
- Remove %pre scriptlet, as it was introduced only to fix a
specific upgrade issue with v1.15 in 2014
* Tue Sep 22 2020 Christopher Engelhard <ce@lcts.de> - 2.6-2
- Backport upstream PR#2469 to fix RHBZ #1831311
* Tue Sep 22 2020 Christopher Engelhard <ce@lcts.de> - 2.6-1
- Update to 2.6
- Streamline & clean up spec file
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.4-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.4-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Thu Jul 30 2015 Johannes Meixner <jsmeix@suse.de>
- For a changelog see the rear-release-notes.txt file.