diff --git a/SOURCES/rear-bz1631183.patch b/SOURCES/rear-bz1631183.patch new file mode 100644 index 0000000..7c0ad0f --- /dev/null +++ b/SOURCES/rear-bz1631183.patch @@ -0,0 +1,275 @@ +diff --git a/usr/share/rear/backup/NETFS/default/500_make_backup.sh b/usr/share/rear/backup/NETFS/default/500_make_backup.sh +index 47266910..7170cda6 100644 +--- a/usr/share/rear/backup/NETFS/default/500_make_backup.sh ++++ b/usr/share/rear/backup/NETFS/default/500_make_backup.sh +@@ -67,49 +67,99 @@ else + SPLIT_COMMAND="dd of=$backuparchive" + fi + ++# Used by "tar" method to record which pipe command failed ++FAILING_BACKUP_PROG_FILE="$TMP_DIR/failing_backup_prog" ++FAILING_BACKUP_PROG_RC_FILE="$TMP_DIR/failing_backup_prog_rc" ++ + LogPrint "Creating $BACKUP_PROG archive '$backuparchive'" + ProgressStart "Preparing archive operation" + ( + case "$(basename ${BACKUP_PROG})" in +- # tar compatible programs here +- (tar) +- set_tar_features +- Log $BACKUP_PROG $TAR_OPTIONS --sparse --block-number --totals --verbose \ +- --no-wildcards-match-slash --one-file-system \ +- --ignore-failed-read "${BACKUP_PROG_OPTIONS[@]}" \ +- $BACKUP_PROG_CREATE_NEWER_OPTIONS \ +- ${BACKUP_PROG_BLOCKS:+-b $BACKUP_PROG_BLOCKS} "${BACKUP_PROG_COMPRESS_OPTIONS[@]}" \ +- -X $TMP_DIR/backup-exclude.txt -C / -c -f - \ +- $(cat $TMP_DIR/backup-include.txt) $RUNTIME_LOGFILE \| $BACKUP_PROG_CRYPT_OPTIONS BACKUP_PROG_CRYPT_KEY \| $SPLIT_COMMAND +- $BACKUP_PROG $TAR_OPTIONS --sparse --block-number --totals --verbose \ +- --no-wildcards-match-slash --one-file-system \ +- --ignore-failed-read "${BACKUP_PROG_OPTIONS[@]}" \ +- $BACKUP_PROG_CREATE_NEWER_OPTIONS \ +- ${BACKUP_PROG_BLOCKS:+-b $BACKUP_PROG_BLOCKS} "${BACKUP_PROG_COMPRESS_OPTIONS[@]}" \ +- -X $TMP_DIR/backup-exclude.txt -C / -c -f - \ +- $(cat $TMP_DIR/backup-include.txt) $RUNTIME_LOGFILE | $BACKUP_PROG_CRYPT_OPTIONS $BACKUP_PROG_CRYPT_KEY | $SPLIT_COMMAND +- ;; +- (rsync) +- # make sure that the target is a directory +- mkdir -p $v "$backuparchive" >&2 +- Log $BACKUP_PROG --verbose "${BACKUP_RSYNC_OPTIONS[@]}" --one-file-system --delete \ +- --exclude-from=$TMP_DIR/backup-exclude.txt --delete-excluded \ +- $(cat $TMP_DIR/backup-include.txt) "$backuparchive" +- $BACKUP_PROG --verbose "${BACKUP_RSYNC_OPTIONS[@]}" --one-file-system --delete \ +- --exclude-from=$TMP_DIR/backup-exclude.txt --delete-excluded \ +- $(cat $TMP_DIR/backup-include.txt) "$backuparchive" >&2 +- ;; +- (*) +- Log "Using unsupported backup program '$BACKUP_PROG'" +- Log $BACKUP_PROG "${BACKUP_PROG_COMPRESS_OPTIONS[@]}" \ +- $BACKUP_PROG_OPTIONS_CREATE_ARCHIVE $TMP_DIR/backup-exclude.txt \ +- "${BACKUP_PROG_OPTIONS[@]}" $backuparchive \ +- $(cat $TMP_DIR/backup-include.txt) $RUNTIME_LOGFILE > $backuparchive +- $BACKUP_PROG "${BACKUP_PROG_COMPRESS_OPTIONS[@]}" \ +- $BACKUP_PROG_OPTIONS_CREATE_ARCHIVE $TMP_DIR/backup-exclude.txt \ +- "${BACKUP_PROG_OPTIONS[@]}" $backuparchive \ +- $(cat $TMP_DIR/backup-include.txt) $RUNTIME_LOGFILE > $backuparchive +- ;; ++ # tar compatible programs here ++ (tar) ++ set_tar_features ++ Log $BACKUP_PROG $TAR_OPTIONS --sparse --block-number --totals --verbose \ ++ --no-wildcards-match-slash --one-file-system \ ++ --ignore-failed-read "${BACKUP_PROG_OPTIONS[@]}" \ ++ $BACKUP_PROG_CREATE_NEWER_OPTIONS \ ++ ${BACKUP_PROG_BLOCKS:+-b $BACKUP_PROG_BLOCKS} "${BACKUP_PROG_COMPRESS_OPTIONS[@]}" \ ++ -X $TMP_DIR/backup-exclude.txt -C / -c -f - \ ++ $(cat $TMP_DIR/backup-include.txt) $RUNTIME_LOGFILE \| $BACKUP_PROG_CRYPT_OPTIONS BACKUP_PROG_CRYPT_KEY \| $SPLIT_COMMAND ++ ++ # Variable used to record the short name of piped commands in case of ++ # error, e.g. ( "tar" "cat" "dd" ) in case of unencrypted and unsplit backup. ++ backup_prog_shortnames=( ++ "$(basename $(echo "$BACKUP_PROG" | awk '{ print $1 }'))" ++ "$(basename $(echo "$BACKUP_PROG_CRYPT_OPTIONS" | awk '{ print $1 }'))" ++ "$(basename $(echo "$SPLIT_COMMAND" | awk '{ print $1 }'))" ++ ) ++ for index in ${!backup_prog_shortnames[@]} ; do ++ [ -n "${backup_prog_shortnames[$index]}" ] || BugError "No computed shortname for pipe component $index" ++ done ++ ++ $BACKUP_PROG $TAR_OPTIONS --sparse --block-number --totals --verbose \ ++ --no-wildcards-match-slash --one-file-system \ ++ --ignore-failed-read "${BACKUP_PROG_OPTIONS[@]}" \ ++ $BACKUP_PROG_CREATE_NEWER_OPTIONS \ ++ ${BACKUP_PROG_BLOCKS:+-b $BACKUP_PROG_BLOCKS} \ ++ "${BACKUP_PROG_COMPRESS_OPTIONS[@]}" \ ++ -X $TMP_DIR/backup-exclude.txt -C / -c -f - \ ++ $(cat $TMP_DIR/backup-include.txt) $RUNTIME_LOGFILE | \ ++ \ ++ $BACKUP_PROG_CRYPT_OPTIONS $BACKUP_PROG_CRYPT_KEY | \ ++ \ ++ $SPLIT_COMMAND ++ pipes_rc=( ${PIPESTATUS[@]} ) ++ ++ # Exit code logic: ++ # - never return rc=1 (this is reserved for "tar" warning about modified files) ++ # - process exit code in pipe's reverse order ++ # - if last command failed (e.g. "dd"), return an error ++ # - otherwise if previous command failed (e.g. "encrypt"), return an error ++ # ... ++ # - otherwise return "tar" exit code ++ # ++ # When an error occurs, record the program name in $FAILING_BACKUP_PROG_FILE ++ # and real exit code in $FAILING_BACKUP_PROG_RC_FILE. ++ ++ let index=${#pipes_rc[@]}-1 ++ while [ $index -ge 0 ] ; do ++ rc=${pipes_rc[$index]} ++ if [ $rc -ne 0 ] ; then ++ echo "${backup_prog_shortnames[$index]}" > $FAILING_BACKUP_PROG_FILE ++ echo "$rc" > $FAILING_BACKUP_PROG_RC_FILE ++ if [ $rc -eq 1 ] && [ "${backup_prog_shortnames[$index]}" != "tar" ] ; then ++ rc=2 ++ fi ++ exit $rc ++ fi ++ # This pipe command succeeded, check the previous one ++ let index-- ++ done ++ # This was a success ++ exit 0 ++ ;; ++ (rsync) ++ # make sure that the target is a directory ++ mkdir -p $v "$backuparchive" >&2 ++ Log $BACKUP_PROG --verbose "${BACKUP_RSYNC_OPTIONS[@]}" --one-file-system --delete \ ++ --exclude-from=$TMP_DIR/backup-exclude.txt --delete-excluded \ ++ $(cat $TMP_DIR/backup-include.txt) "$backuparchive" ++ $BACKUP_PROG --verbose "${BACKUP_RSYNC_OPTIONS[@]}" --one-file-system --delete \ ++ --exclude-from=$TMP_DIR/backup-exclude.txt --delete-excluded \ ++ $(cat $TMP_DIR/backup-include.txt) "$backuparchive" >&2 ++ ;; ++ (*) ++ Log "Using unsupported backup program '$BACKUP_PROG'" ++ Log $BACKUP_PROG "${BACKUP_PROG_COMPRESS_OPTIONS[@]}" \ ++ $BACKUP_PROG_OPTIONS_CREATE_ARCHIVE $TMP_DIR/backup-exclude.txt \ ++ "${BACKUP_PROG_OPTIONS[@]}" $backuparchive \ ++ $(cat $TMP_DIR/backup-include.txt) $RUNTIME_LOGFILE > $backuparchive ++ $BACKUP_PROG "${BACKUP_PROG_COMPRESS_OPTIONS[@]}" \ ++ $BACKUP_PROG_OPTIONS_CREATE_ARCHIVE $TMP_DIR/backup-exclude.txt \ ++ "${BACKUP_PROG_OPTIONS[@]}" $backuparchive \ ++ $(cat $TMP_DIR/backup-include.txt) $RUNTIME_LOGFILE > $backuparchive ++ ;; + esac 2> "${TMP_DIR}/${BACKUP_PROG_ARCHIVE}.log" + # important trick: the backup prog is the last in each case entry and the case .. esac is the last command + # in the (..) subshell. As a result the return code of the subshell is the return code of the backup prog! +@@ -121,44 +171,44 @@ sleep 1 # Give the backup software a good chance to start working + + # return disk usage in bytes + function get_disk_used() { +- let "$(stat -f -c 'used=(%b-%f)*%S' $1)" +- echo $used ++ let "$(stat -f -c 'used=(%b-%f)*%S' $1)" ++ echo $used + } + + # While the backup runs in a sub-process, display some progress information to the user. + # ProgressInfo texts have a space at the end to get the 'OK' from ProgressStop shown separated. + test "$PROGRESS_WAIT_SECONDS" || PROGRESS_WAIT_SECONDS=1 + case "$( basename $BACKUP_PROG )" in +- (tar) +- while sleep $PROGRESS_WAIT_SECONDS ; kill -0 $BackupPID 2>/dev/null; do +- #blocks="$(stat -c %b ${backuparchive})" +- #size="$((blocks*512))" +- size="$(stat -c %s ${backuparchive}* | awk '{s+=$1} END {print s}')" +- ProgressInfo "Archived $((size/1024/1024)) MiB [avg $((size/1024/(SECONDS-starttime))) KiB/sec] " +- done +- ;; +- (rsync) +- # since we do not want to do a $(du -s) run every second we count disk usage instead +- # this obviously leads to wrong results in case something else is writing to the same +- # disk at the same time as is very likely with a networked file system. For local disks +- # this should be good enough and in any case this is only some eye candy. +- # TODO: Find a fast way to count the actual transfer data, preferrable getting the info from rsync. +- let old_disk_used="$(get_disk_used "$backuparchive")" +- while sleep $PROGRESS_WAIT_SECONDS ; kill -0 $BackupPID 2>/dev/null; do +- let disk_used="$(get_disk_used "$backuparchive")" size=disk_used-old_disk_used +- ProgressInfo "Archived $((size/1024/1024)) MiB [avg $((size/1024/(SECONDS-starttime))) KiB/sec] " +- done +- ;; +- (*) +- while sleep $PROGRESS_WAIT_SECONDS ; kill -0 $BackupPID 2>/dev/null; do +- size="$(stat -c "%s" "$backuparchive")" || { +- kill -9 $BackupPID +- ProgressError +- Error "$(basename $BACKUP_PROG) failed to create the archive file" +- } +- ProgressInfo "Archived $((size/1024/1024)) MiB [avg $((size/1024/(SECONDS-starttime))) KiB/sec] " +- done +- ;; ++ (tar) ++ while sleep $PROGRESS_WAIT_SECONDS ; kill -0 $BackupPID 2>/dev/null; do ++ #blocks="$(stat -c %b ${backuparchive})" ++ #size="$((blocks*512))" ++ size="$(stat -c %s ${backuparchive}* | awk '{s+=$1} END {print s}')" ++ ProgressInfo "Archived $((size/1024/1024)) MiB [avg $((size/1024/(SECONDS-starttime))) KiB/sec] " ++ done ++ ;; ++ (rsync) ++ # since we do not want to do a $(du -s) run every second we count disk usage instead ++ # this obviously leads to wrong results in case something else is writing to the same ++ # disk at the same time as is very likely with a networked file system. For local disks ++ # this should be good enough and in any case this is only some eye candy. ++ # TODO: Find a fast way to count the actual transfer data, preferrable getting the info from rsync. ++ let old_disk_used="$(get_disk_used "$backuparchive")" ++ while sleep $PROGRESS_WAIT_SECONDS ; kill -0 $BackupPID 2>/dev/null; do ++ let disk_used="$(get_disk_used "$backuparchive")" size=disk_used-old_disk_used ++ ProgressInfo "Archived $((size/1024/1024)) MiB [avg $((size/1024/(SECONDS-starttime))) KiB/sec] " ++ done ++ ;; ++ (*) ++ while sleep $PROGRESS_WAIT_SECONDS ; kill -0 $BackupPID 2>/dev/null; do ++ size="$(stat -c "%s" "$backuparchive")" || { ++ kill -9 $BackupPID ++ ProgressError ++ Error "$(basename $BACKUP_PROG) failed to create the archive file" ++ } ++ ProgressInfo "Archived $((size/1024/1024)) MiB [avg $((size/1024/(SECONDS-starttime))) KiB/sec] " ++ done ++ ;; + esac + ProgressStop + transfertime="$((SECONDS-starttime))" +@@ -177,10 +227,12 @@ sleep 1 + # everyone should see this warning, even if not verbose + case "$(basename $BACKUP_PROG)" in + (tar) +- if (( $backup_prog_rc == 1 )); then +- LogPrint "WARNING: $(basename $BACKUP_PROG) ended with return code $backup_prog_rc and below output: ++ if (( $backup_prog_rc != 0 )); then ++ prog="$(cat $FAILING_BACKUP_PROG_FILE)" ++ if (( $backup_prog_rc == 1 )); then ++ LogUserOutput "WARNING: $prog ended with return code 1 and below output: + ---snip--- +-$(grep '^tar: ' $RUNTIME_LOGFILE | sed -e 's/^/ /' | tail -n3) ++$(grep '^tar: ' "${TMP_DIR}/${BACKUP_PROG_ARCHIVE}.log" | sed -e 's/^/ /' | tail -n3) + ---------- + This means that files have been modified during the archiving + process. As a result the backup may not be completely consistent +@@ -188,16 +240,19 @@ or may not be a perfect copy of the system. Relax-and-Recover + will continue, however it is highly advisable to verify the + backup in order to be sure to safely recover this system. + " +- elif (( $backup_prog_rc > 1 )); then +- Error "$(basename $BACKUP_PROG) failed with return code $backup_prog_rc and below output: ++ else ++ rc=$(cat $FAILING_BACKUP_PROG_RC_FILE) ++ Error "$prog failed with return code $rc and below output: + ---snip--- +-$(grep '^tar: ' $RUNTIME_LOGFILE | sed -e 's/^/ /' | tail -n3) ++$(grep "^$prog: " "${TMP_DIR}/${BACKUP_PROG_ARCHIVE}.log" | sed -e 's/^/ /' | tail -n3) + ---------- + This means that the archiving process ended prematurely, or did + not even start. As a result it is unlikely you can recover this + system properly. Relax-and-Recover is therefore aborting execution. + " +- fi;; ++ fi ++ fi ++ ;; + (*) + if (( $backup_prog_rc > 0 )) ; then + Error "$(basename $BACKUP_PROG) failed with return code $backup_prog_rc +@@ -212,10 +267,12 @@ esac + + tar_message="$(tac $RUNTIME_LOGFILE | grep -m1 '^Total bytes written: ')" + if [ $backup_prog_rc -eq 0 -a "$tar_message" ] ; then +- LogPrint "$tar_message in $transfertime seconds." ++ LogPrint "$tar_message in $transfertime seconds." + elif [ "$size" ]; then +- LogPrint "Archived $((size/1024/1024)) MiB in $((transfertime)) seconds [avg $((size/1024/transfertime)) KiB/sec]" ++ LogPrint "Archived $((size/1024/1024)) MiB in $((transfertime)) seconds [avg $((size/1024/transfertime)) KiB/sec]" + fi + + ### Copy progress log to backup media + cp $v "${TMP_DIR}/${BACKUP_PROG_ARCHIVE}.log" "${opath}/${BACKUP_PROG_ARCHIVE}.log" >&2 ++ ++# vim: set et ts=4 sw=4: diff --git a/SOURCES/rear-bz1655956.patch b/SOURCES/rear-bz1655956.patch new file mode 100644 index 0000000..ea9c039 --- /dev/null +++ b/SOURCES/rear-bz1655956.patch @@ -0,0 +1,35 @@ +diff --git a/usr/sbin/rear b/usr/sbin/rear +index a51f820c..e21156bf 100755 +--- a/usr/sbin/rear ++++ b/usr/sbin/rear +@@ -527,6 +527,10 @@ Build date: $( date -R ) + if test "$WORKFLOW" != "help" ; then + # Create temporary work area and register removal exit task: + BUILD_DIR="$( mktemp -d -t rear.XXXXXXXXXXXXXXX || Error "Could not create build area '$BUILD_DIR'" )" ++ # Since 'mktemp' doesn't always return a path under /tmp, the build ++ # directory has always to be excluded for safety ++ BACKUP_PROG_EXCLUDE+=( "$BUILD_DIR" ) ++ + QuietAddExitTask cleanup_build_area_and_end_program + Log "Using build area '$BUILD_DIR'" + ROOTFS_DIR=$BUILD_DIR/rootfs +@@ -582,3 +586,5 @@ if test "$WORKFLOW" != "help" ; then + fi + + exit $EXIT_CODE ++ ++# vim: set et ts=4 sw=4: +diff --git a/usr/share/rear/conf/default.conf b/usr/share/rear/conf/default.conf +index ef118998..52b05eea 100644 +--- a/usr/share/rear/conf/default.conf ++++ b/usr/share/rear/conf/default.conf +@@ -47,7 +47,9 @@ + # is set in the environment where /usr/sbin/rear is called. + # To have a specific working area directory prefix for Relax-and-Recover + # specify in /etc/rear/local.conf something like ++# + # export TMPDIR="/prefix/for/rear/working/directory" ++# + # where /prefix/for/rear/working/directory must already exist. + # This is useful for example when there is not sufficient free space + # in /tmp or $TMPDIR for the ISO image or even the backup archive. diff --git a/SOURCES/rear-bz1672938.patch b/SOURCES/rear-bz1672938.patch index 70f6471..dea54f2 100644 --- a/SOURCES/rear-bz1672938.patch +++ b/SOURCES/rear-bz1672938.patch @@ -2,7 +2,7 @@ diff --git a/usr/share/rear/lib/layout-functions.sh b/usr/share/rear/lib/layout- index aa6fc938..4bc59131 100644 --- a/usr/share/rear/lib/layout-functions.sh +++ b/usr/share/rear/lib/layout-functions.sh -@@ -476,6 +476,9 @@ get_sysfs_name() { +@@ -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 @@ -12,7 +12,7 @@ index aa6fc938..4bc59131 100644 get_device_name() { ### strip common prefixes local name=${1#/dev/} -@@ -483,47 +486,39 @@ get_device_name() { +@@ -485,47 +488,39 @@ get_device_name() { contains_visible_char "$name" || BugError "Empty string passed to get_device_name" diff --git a/SOURCES/rear-rhbz1610638.patch b/SOURCES/rear-rhbz1610638.patch new file mode 100644 index 0000000..7111c27 --- /dev/null +++ b/SOURCES/rear-rhbz1610638.patch @@ -0,0 +1,85 @@ +diff --git a/usr/share/rear/conf/GNU/Linux.conf b/usr/share/rear/conf/GNU/Linux.conf +index 5b9343b9..f0c44381 100644 +--- a/usr/share/rear/conf/GNU/Linux.conf ++++ b/usr/share/rear/conf/GNU/Linux.conf +@@ -184,6 +184,8 @@ env + w + dosfslabel + sysctl ++blockdev ++lsblk + ) + + # the lib* serves to cover both 32bit and 64bit libraries! +diff --git a/usr/share/rear/lib/layout-functions.sh b/usr/share/rear/lib/layout-functions.sh +index eb45115b..af1069ea 100644 +--- a/usr/share/rear/lib/layout-functions.sh ++++ b/usr/share/rear/lib/layout-functions.sh +@@ -365,7 +365,9 @@ get_partition_start() { + local disk_name=$1 + local start_block start + +- local block_size=$(get_block_size ${disk_name%/*}) ++ # When reading /sys/block/.../start or "dmsetup table", output is always in ++ # 512 bytes blocks ++ local block_size=512 + + if [[ -r /sys/block/$disk_name/start ]] ; then + start_block=$(< $path/start) +@@ -548,11 +550,32 @@ get_device_mapping() { + } + + # Get the size in bytes of a disk/partition. ++# For disks, use "sda" as argument. + # For partitions, use "sda/sda1" as argument. + get_disk_size() { + local disk_name=$1 ++ # When a partition is specified (e.g. sda/sda1) ++ # then it has to read /sys/block/sda/sda1/size in the old code below. ++ # In contrast the get_block_size() function below is different ++ # because it is non-sense asking for block size of a partition, ++ # so that the get_block_size() function below is stripping everything ++ # in front of the blockdev basename (e.g. /some/path/sda -> sda) ++ # cf. https://github.com/rear/rear/pull/1885#discussion_r207900308 ++ ++ # Preferably use blockdev, see https://github.com/rear/rear/issues/1884 ++ if has_binary blockdev; then ++ # ${disk_name##*/} translates 'sda/sda1' into 'sda1' and 'sda' into 'sda' ++ blockdev --getsize64 /dev/${disk_name##*/} && return ++ # If blockdev fails do not error out but fall through to the old code below ++ # because blockdev fails e.g. for a CDROM device when no DVD or ISO is attached to ++ # cf. https://github.com/rear/rear/pull/1885#issuecomment-410676283 ++ # and https://github.com/rear/rear/pull/1885#issuecomment-410697398 ++ fi + +- local block_size=$(get_block_size ${disk_name%/*}) ++ # Linux always considers sectors to be 512 bytes long. See the note in the ++ # kernel source, specifically, include/linux/types.h regarding the sector_t ++ # type for details. ++ local block_size=512 + + retry_command test -r /sys/block/$disk_name/size || Error "Could not determine size of disk $disk_name" + +@@ -565,9 +588,20 @@ get_disk_size() { + + # Get the block size of a disk. + get_block_size() { ++ local disk_name="${1##*/}" # /some/path/sda -> sda ++ ++ # Preferably use blockdev, see https://github.com/rear/rear/issues/1884 ++ if has_binary blockdev; then ++ blockdev --getss /dev/$disk_name && return ++ # If blockdev fails do not error out but fall through to the old code below ++ # because blockdev fails e.g. for a CDROM device when no DVD or ISO is attached to ++ # cf. https://github.com/rear/rear/pull/1885#issuecomment-410676283 ++ # and https://github.com/rear/rear/pull/1885#issuecomment-410697398 ++ fi ++ + # Only newer kernels have an interface to get the block size +- if [ -r /sys/block/$1/queue/logical_block_size ] ; then +- echo $( < /sys/block/$1/queue/logical_block_size) ++ if [ -r /sys/block/$disk_name/queue/logical_block_size ] ; then ++ echo $( < /sys/block/$disk_name/queue/logical_block_size) + else + echo "512" + fi diff --git a/SOURCES/rear-rhbz1610647.patch b/SOURCES/rear-rhbz1610647.patch new file mode 100644 index 0000000..5d7ac48 --- /dev/null +++ b/SOURCES/rear-rhbz1610647.patch @@ -0,0 +1,50 @@ +diff --git a/usr/share/rear/finalize/Linux-ppc64le/680_install_PPC_bootlist.sh b/usr/share/rear/finalize/Linux-ppc64le/680_install_PPC_bootlist.sh +index bf1db404..3a07580a 100644 +--- a/usr/share/rear/finalize/Linux-ppc64le/680_install_PPC_bootlist.sh ++++ b/usr/share/rear/finalize/Linux-ppc64le/680_install_PPC_bootlist.sh +@@ -9,9 +9,12 @@ if grep -q "PowerNV" /proc/cpuinfo || grep -q "emulated by qemu" /proc/cpuinfo ; + fi + + # Look for the PPC PReP Boot Partition. +-part=$( awk -F ' ' '/^part / {if ($6 ~ /prep/) {print $7}}' $LAYOUT_FILE ) ++part_list=$( awk -F ' ' '/^part / {if ($6 ~ /prep/) {print $7}}' $LAYOUT_FILE ) + +-if [ -n "$part" ]; then ++# All the possible boot devices ++boot_list=() ++ ++for part in $part_list ; do + LogPrint "PPC PReP Boot partition found: $part" + + # Using $LAYOUT_DEPS file to find the disk device containing the partition. +@@ -29,14 +32,23 @@ if [ -n "$part" ]; then + # If yes, get the list of path which are part of the multipath device. + # Limit to the first 5 PATH (see #876) + if dmsetup ls --target multipath | grep -w ${bootdev#/dev/mapper/} >/dev/null 2>&1; then +- LogPrint "Limiting bootlist to 5 entries..." +- bootlist_path=$(dmsetup deps $bootdev -o devname | awk -F: '{gsub (" ",""); gsub("\\(","/dev/",$2) ; gsub("\\)"," ",$2) ; print $2}' | cut -d" " -f-5) +- LogPrint "Set LPAR bootlist to $bootlist_path" +- bootlist -m normal $bootlist_path ++ LogPrint "Limiting bootlist to 5 entries as a maximum..." ++ boot_list+=( $(dmsetup deps $bootdev -o devname | awk -F: '{gsub (" ",""); gsub("\\(","/dev/",$2) ; gsub("\\)"," ",$2) ; print $2}' | cut -d" " -f-5) ) + else + # Single Path device found +- LogPrint "Set LPAR bootlist to $bootdev" +- bootlist -m normal $bootdev ++ boot_list+=( $bootdev ) + fi +- LogIfError "Unable to set bootlist. You will have to start in SMS to set it up manually." ++done ++ ++if [[ ${#boot_list[@]} -gt 5 ]]; then ++ LogPrint "Too many entries for bootlist command, limiting to first 5 entries..." ++ boot_list=( ${boot_list[@]:0:5} ) + fi ++ ++if [[ ${#boot_list[@]} -gt 0 ]]; then ++ LogPrint "Set LPAR bootlist to '${boot_list[*]}'" ++ bootlist -m normal "${boot_list[@]}" ++ LogPrintIfError "Unable to set bootlist. You will have to start in SMS to set it up manually." ++fi ++ ++# vim: set et ts=4 sw=4: diff --git a/SPECS/rear.spec b/SPECS/rear.spec index 2234461..7ff0b6d 100644 --- a/SPECS/rear.spec +++ b/SPECS/rear.spec @@ -2,19 +2,23 @@ Summary: Relax-and-Recover is a Linux disaster recovery and system migration tool Name: rear Version: 2.4 -Release: 5%{?dist} +Release: 7%{?dist} License: GPLv3 Group: Applications/File URL: http://relax-and-recover.org/ Source0: https://github.com/rear/rear/archive/%{version}.tar.gz#/rear-%{version}.tar.gz Patch4: rear-bz1492177-warning.patch +Patch6: rear-rhbz1610638.patch +Patch7: rear-rhbz1610647.patch Patch8: rear-bz1652828-bz1652853.patch +Patch9: rear-bz1631183.patch Patch10: rear-bz1639705.patch Patch11: rear-bz1653214.patch Patch12: rear-bz1659137.patch Patch14: rear-bz1672938.patch Patch15: rear-bz1685166.patch +Patch16: rear-bz1655956.patch ExcludeArch: s390x ExcludeArch: s390 @@ -57,7 +61,7 @@ Requires: yaboot Requires: crontabs Requires: iproute -Requires: mkisofs +Requires: xorriso # mingetty is not available anymore with RHEL 7 (use agetty instead via systemd) # Note that CentOS also has %rhel defined so there is no need to use %centos @@ -100,12 +104,16 @@ fi %prep %setup %patch4 -p1 +%patch6 -p1 +%patch7 -p1 %patch8 -p1 +%patch9 -p1 %patch10 -p1 %patch11 -p1 %patch12 -p1 %patch14 -p1 %patch15 -p1 +%patch16 -p1 echo "30 1 * * * root /usr/sbin/rear checklayout || /usr/sbin/rear mkrescue" >rear.cron @@ -140,6 +148,22 @@ TZ=UTC %{__make} -C doc %{_sbindir}/rear %changelog +* Tue Mar 26 2019 Pavel Cahyna - 2.4-7 +- Backport fix for upstream bug 1913 (backup succeeds in case of tar error) + Resolves: rhbz1631183 +- Apply upstream patch PR1885 + Partition information recorded is unexpected when disk has 4K block size + Resolves: rhbz1610638 +- Apply upstream patch PR1887 + LPAR/PPC64 bootlist is incorrectly set when having multiple 'prep' partitions + Resolves: rhbz1610647 +- Apply upstream patch PR1993 + Automatically exclude $BUILD_DIR from the backup + Resolves: rhbz1655956 +- Require xorriso instead of genisoimage, it is now the preferred method + and supports files over 4GB in size. + Resolves: rhbz1462189 + * Wed Mar 13 2019 Pavel Cahyna - 2.4-5 - Apply upstream PR2065 (record permanent MAC address for team members) Resolves: rhbz1685166