From b650a9764d0bf98f344a08af0f6e44a2f079042e Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mar 31 2020 09:40:41 +0000 Subject: import rear-2.4-11.el7 --- diff --git a/SOURCES/rear-bz1692575.patch b/SOURCES/rear-bz1692575.patch new file mode 100644 index 0000000..a5abadd --- /dev/null +++ b/SOURCES/rear-bz1692575.patch @@ -0,0 +1,33 @@ +diff -up rear-2.4/usr/share/rear/conf/GNU/Linux.conf.empty rear-2.4/usr/share/rear/conf/GNU/Linux.conf +--- rear-2.4/usr/share/rear/conf/GNU/Linux.conf.empty 2019-09-10 09:45:50.381285069 +0200 ++++ rear-2.4/usr/share/rear/conf/GNU/Linux.conf 2019-09-10 09:45:50.421284309 +0200 +@@ -276,6 +276,6 @@ COPY_AS_IS_EXCLUDE=( "${COPY_AS_IS_EXCLU + # some stuff for the Linux command line + KERNEL_CMDLINE="$KERNEL_CMDLINE selinux=0" + # common users and groups +-CLONE_USERS=( "${CLONE_USERS[@]:-}" daemon rpc usbmuxd usbmux vcsa nobody dbus ) +-CLONE_GROUPS=( "${CLONE_GROUPS[@]:-}" tty usbmuxd usbmux fuse kvm oinstall dbus ) ++CLONE_USERS+=( daemon rpc usbmuxd usbmux vcsa nobody dbus ) ++CLONE_GROUPS+=( tty usbmuxd usbmux fuse kvm oinstall dbus ) + +diff -up rear-2.4/usr/share/rear/rescue/default/900_clone_users_and_groups.sh.empty rear-2.4/usr/share/rear/rescue/default/900_clone_users_and_groups.sh +--- rear-2.4/usr/share/rear/rescue/default/900_clone_users_and_groups.sh.empty 2018-06-21 10:40:53.000000000 +0200 ++++ rear-2.4/usr/share/rear/rescue/default/900_clone_users_and_groups.sh 2019-09-10 09:45:50.421284309 +0200 +@@ -40,6 +40,8 @@ local group="" + # because it should succeed when there is any non-empty array member, not necessarily the first one: + test "${CLONE_USERS[*]}" && Log "Cloning users: ${CLONE_USERS[@]}" + for user in "${CLONE_USERS[@]}" ; do ++ # Skip empty user values, cf. https://github.com/rear/rear/issues/2220 ++ test $user || continue + # Skip if the user exists already in the ReaR recovery system: + grep -q "^$user:" $ROOTFS_DIR/etc/passwd && continue + # Skip if the user does not exist in the current system: +@@ -78,6 +80,8 @@ done + # because it should succeed when there is any non-empty array member, not necessarily the first one: + test "${CLONE_GROUPS[*]}" && Log "Cloning groups: ${CLONE_GROUPS[@]}" + for group in "${CLONE_GROUPS[@]}" ; do ++ # Skip empty group values, cf. https://github.com/rear/rear/issues/2220 ++ test $group || continue + # Skip if the group exists already in the ReaR recovery system: + grep -q "^$group:" $ROOTFS_DIR/etc/group && continue + # Skip if the group does not exist in the current system: diff --git a/SOURCES/rear-bz1693608.patch b/SOURCES/rear-bz1693608.patch new file mode 100644 index 0000000..9d8aae2 --- /dev/null +++ b/SOURCES/rear-bz1693608.patch @@ -0,0 +1,113 @@ +diff -up rear-2.4/usr/share/rear/build/default/980_verify_rootfs.sh.build rear-2.4/usr/share/rear/build/default/980_verify_rootfs.sh +--- rear-2.4/usr/share/rear/build/default/980_verify_rootfs.sh.build 2019-09-10 09:31:05.971102125 +0200 ++++ rear-2.4/usr/share/rear/build/default/980_verify_rootfs.sh 2019-09-10 09:31:06.002101535 +0200 +@@ -3,6 +3,33 @@ + # i.e. test that the ReaR recovery system will be usable + # to avoid issues like https://github.com/rear/rear/issues/1494 + ++if test "$KEEP_BUILD_DIR" = "errors"; then ++ local keep_build_dir_on_errors=1 ++else ++ # KEEP_BUILD_DIR does not say to keep it on errors ++ # - effective value depends on whether we are running interactively ++ if tty -s ; then ++ local keep_build_dir_on_errors=1 ++ else ++ local keep_build_dir_on_errors=0 ++ fi ++fi ++ ++function keep_build_dir() { ++ if ! is_true "$KEEP_BUILD_DIR" && ! is_false "$KEEP_BUILD_DIR"; then ++ # is either empty or equal to "errors" ... or some garbage value ++ local orig_keep_build_dir="$KEEP_BUILD_DIR" ++ KEEP_BUILD_DIR="${keep_build_dir_on_errors}" ++ fi ++ if is_true "$KEEP_BUILD_DIR" ; then ++ LogPrintError "Build area kept for investigation in $BUILD_DIR, remove it when not needed" ++ elif ! is_false "$orig_keep_build_dir" ; then ++ # if users disabled preserving the build dir explicitly, let's not bother them with messages ++ LogPrintError "Build area $BUILD_DIR will be removed" ++ LogPrintError "To preserve it for investigation set KEEP_BUILD_DIR=errors or run ReaR with -d" ++ fi ++} ++ + # In case the filesystem that contains the ROOTFS_DIR is mounted 'noexec' we cannot do the 'chroot' tests. + # The filesystem_name function in linux-functions.sh returns the mountpoint (not a filesystem name like 'ext4'): + local rootfs_dir_fs_mountpoint=$( filesystem_name $ROOTFS_DIR ) +@@ -16,7 +43,7 @@ Log "Testing that $ROOTFS_DIR contains a + + # The bash test ensures that we have a working bash in the ReaR recovery system: + if ! chroot $ROOTFS_DIR /bin/bash -c true ; then +- KEEP_BUILD_DIR=1 ++ keep_build_dir + BugError "ReaR recovery system in '$ROOTFS_DIR' is broken: 'bash -c true' failed" + fi + +@@ -25,7 +52,7 @@ fi + # First test is 'ldd /bin/bash' to ensure 'ldd' works: + Log "Testing 'ldd /bin/bash' to ensure 'ldd' works for the subsequent 'ldd' tests" + if ! chroot $ROOTFS_DIR /bin/ldd /bin/bash 1>&2 ; then +- KEEP_BUILD_DIR=1 ++ keep_build_dir + BugError "ReaR recovery system in '$ROOTFS_DIR' is broken: 'ldd /bin/bash' failed" + fi + # Now test each binary (except links) with ldd and look for 'not found' libraries. +@@ -83,7 +110,7 @@ test $old_LD_LIBRARY_PATH && export LD_L + # Report binaries with 'not found' shared object dependencies: + if contains_visible_char "$broken_binaries" ; then + LogPrintError "There are binaries or libraries in the ReaR recovery system that need additional libraries" +- KEEP_BUILD_DIR=1 ++ keep_build_dir + local fatal_missing_library="" + local ldd_output="" + for binary in $broken_binaries ; do +@@ -113,9 +140,10 @@ if contains_visible_char "$broken_binari + # Show only the missing libraries to the user to not flood his screen with tons of other ldd output lines: + PrintError "$( grep 'not found' <<<"$ldd_output" )" + done ++ LogPrintError "ReaR recovery system in '$ROOTFS_DIR' needs additional libraries, check $RUNTIME_LOGFILE for details" ++ is_true "$fatal_missing_library" && keep_build_dir + # Usually it should be no BugError when there are libraries missing for particular binaries because probably + # the reason is that the user added only the plain binaries with COPY_AS_IS (instead of using REQUIRED_PROGS): + is_true "$fatal_missing_library" && Error "ReaR recovery system in '$ROOTFS_DIR' not usable" +- LogPrintError "ReaR recovery system in '$ROOTFS_DIR' needs additional libraries, check $RUNTIME_LOGFILE for details" + fi + +diff -up rear-2.4/usr/share/rear/conf/default.conf.build rear-2.4/usr/share/rear/conf/default.conf +--- rear-2.4/usr/share/rear/conf/default.conf.build 2019-09-10 09:31:05.996101649 +0200 ++++ rear-2.4/usr/share/rear/conf/default.conf 2019-09-10 09:31:06.002101535 +0200 +@@ -125,9 +125,19 @@ OS_VERSION=none + # supported values that could make it work even for your system. + # See the SetOSVendorAndVersion function in the config-functions.sh script. + +-# Keep the build area after we are done (BOOL). ++# Keep the build area after we are done (ternary). + # Useful to inspect the ReaR recovery system content in $TMPDIR/rear.XXXXXXXXXXXXXXX/rootfs/ +-# directly without the need to extract it from the initramfs/initrd in the ISO image: ++# directly without the need to extract it from the initramfs/initrd in the ISO image. ++# Set to "y", "Yes", etc. to always keep the build area, to "n", "No", etc. to never keep it. ++# KEEP_BUILD_DIR is automatically set to true in debug mode (-d) and in debugscript mode (-D). ++# In addition to true (any value that is recognized as 'yes' by the is_true function) ++# and false (any value that is recognized as 'no' by the is_false function) it can be set ++# to several special values: ++# - "errors" to obtain the old behaviour where KEEP_BUILD_DIR was always set ++# to true to keep the build area when errors in the ReaR recovery system were detected. ++# - empty (KEEP_BUILD_DIR="") which means that the build area will be kept on errors ++# if running interactively (in a terminal) and not otherwise (to avoid cluttering ++# /tmp by cron or other automated jobs in case of errors). + KEEP_BUILD_DIR="" + + # No default workflows. This variable is filled in where the workflows are defined +diff -up rear-2.4/usr/share/rear/lib/framework-functions.sh.build rear-2.4/usr/share/rear/lib/framework-functions.sh +--- rear-2.4/usr/share/rear/lib/framework-functions.sh.build 2018-06-21 10:40:53.000000000 +0200 ++++ rear-2.4/usr/share/rear/lib/framework-functions.sh 2019-09-10 09:31:06.002101535 +0200 +@@ -106,7 +106,7 @@ function SourceStage () { + function cleanup_build_area_and_end_program () { + # Cleanup build area + Log "Finished in $((SECONDS-STARTTIME)) seconds" +- if test "$KEEP_BUILD_DIR" ; then ++ if is_true "$KEEP_BUILD_DIR" ; then + LogPrint "You should also rm -Rf $BUILD_DIR" + else + Log "Removing build area $BUILD_DIR" diff --git a/SOURCES/rear-bz1700807.patch b/SOURCES/rear-bz1700807.patch index e957de2..50c43ae 100644 --- a/SOURCES/rear-bz1700807.patch +++ b/SOURCES/rear-bz1700807.patch @@ -1,7 +1,7 @@ diff -up rear-2.4/usr/share/rear/conf/default.conf.nbu rear-2.4/usr/share/rear/conf/default.conf ---- rear-2.4/usr/share/rear/conf/default.conf.nbu 2019-09-17 08:35:47.461915240 +0200 -+++ rear-2.4/usr/share/rear/conf/default.conf 2019-09-17 08:35:47.467915240 +0200 -@@ -1470,7 +1470,7 @@ OBDR_BLOCKSIZE=2048 +--- rear-2.4/usr/share/rear/conf/default.conf.nbu 2019-09-10 09:37:56.619290929 +0200 ++++ rear-2.4/usr/share/rear/conf/default.conf 2019-09-10 09:37:56.621290891 +0200 +@@ -1480,7 +1480,7 @@ OBDR_BLOCKSIZE=2048 # COPY_AS_IS_NBU=( /usr/openv/bin/vnetd /usr/openv/bin/vopied /usr/openv/lib /usr/openv/netbackup /usr/openv/var/auth/[mn]*.txt ) COPY_AS_IS_EXCLUDE_NBU=( "/usr/openv/netbackup/logs/*" "/usr/openv/netbackup/bin/bpjava*" /usr/openv/netbackup/bin/xbp /usr/openv/netbackup/bin/private /usr/openv/lib/java /usr/openv/lib/shared/vddk /usr/openv/netbackup/baremetal ) diff --git a/SOURCES/rear-bz1711123.patch b/SOURCES/rear-bz1711123.patch new file mode 100644 index 0000000..70f3a8b --- /dev/null +++ b/SOURCES/rear-bz1711123.patch @@ -0,0 +1,87 @@ +diff --git a/usr/share/rear/layout/save/GNU/Linux/230_filesystem_layout.sh b/usr/share/rear/layout/save/GNU/Linux/230_filesystem_layout.sh +index 2fc8ccd3..60306718 100644 +--- a/usr/share/rear/layout/save/GNU/Linux/230_filesystem_layout.sh ++++ b/usr/share/rear/layout/save/GNU/Linux/230_filesystem_layout.sh +@@ -50,13 +50,28 @@ fi + # so that in particular what is mounted at '/' is output before other stuff. + read_filesystems_command="$read_filesystems_command | sort -t ' ' -k 1,1 -u" + +-# docker daemon mounts file systems for its docker containers +-# see also https://docs.docker.com/storage/storagedriver/device-mapper-driver/#configure-direct-lvm-mode-for-production +-# As it is for container usage only we do not to backup these up or recreate as this disk device is completely under +-# control by docker itself (even the recreation of it incl, the creation of the volume group). Usually this is +-# done via a kind of cookbook (Chef, puppet or ansible) ++# The Docker daemon mounts file systems for its Docker containers, see also ++# https://docs.docker.com/storage/storagedriver/device-mapper-driver/#configure-direct-lvm-mode-for-production ++# As it is for container usage only we do not to backup these up or recreate as this disk device is completely ++# under control by Docker itself (even the recreation of it incl, the creation of the volume group). ++# Usually this is done via a kind of cookbook (Chef, puppet or ansible). + docker_is_running="" +-service docker status >/dev/null 2>&1 && docker_is_running="yes" ++docker_root_dir="" ++if service docker status &>/dev/null ; then ++ docker_is_running="yes" ++ # When the Docker daemon/service is running, try to get its 'Docker Root Dir': ++ # Kill 'docker info' with SIGTERM after 5 seconds and with SIGKILL after additional 2 seconds ++ # because there are too many crippled Docker installations, cf. https://github.com/rear/rear/pull/2021 ++ docker_root_dir=$( timeout -k 2s 5s docker info | grep 'Docker Root Dir' | awk '{print $4}' ) ++ # Things may go wrong in the 'Docker specific exclude part' below ++ # when Docker is used but its 'Docker Root Dir' cannot be determined ++ # cf. https://github.com/rear/rear/issues/1989 ++ if test "$docker_root_dir" ; then ++ LogPrint "Docker is running, skipping filesystems mounted below Docker Root Dir $docker_root_dir" ++ else ++ LogPrintError "Cannot determine Docker Root Dir - things may go wrong - check $DISKLAYOUT_FILE" ++ fi ++fi + + # Begin writing output to DISKLAYOUT_FILE: + ( +@@ -64,9 +79,10 @@ service docker status >/dev/null 2>&1 && docker_is_running="yes" + echo "# Format: fs [uuid=] [label=