Apply PR 3027
Resolves: rhbz2223895
This commit is contained in:
parent
bc662c22a7
commit
0a26eb16ae
32
rear-device-shrinking-bz2223895.patch
Normal file
32
rear-device-shrinking-bz2223895.patch
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
commit 4f03a10d4866efc9b6920a3878e6397d170742f9
|
||||||
|
Author: Johannes Meixner <jsmeix@suse.com>
|
||||||
|
Date: Thu Jul 20 15:11:52 2023 +0200
|
||||||
|
|
||||||
|
Merge pull request #3027 from rmetrich/shrinking_file
|
||||||
|
|
||||||
|
In build/GNU/Linux/100_copy_as_is.sh
|
||||||
|
ensure to really get all COPY_AS_IS files copied by using
|
||||||
|
'tar ... -i' when extracting to avoid a false regular exit of 'tar'
|
||||||
|
in particular when padding zeroes get added when a file being read shrinks
|
||||||
|
because for 'tar' (without '-i') two consecutive 512-blocks of zeroes mean EOF,
|
||||||
|
cf. https://github.com/rear/rear/pull/3027
|
||||||
|
|
||||||
|
diff --git a/usr/share/rear/build/GNU/Linux/100_copy_as_is.sh b/usr/share/rear/build/GNU/Linux/100_copy_as_is.sh
|
||||||
|
index ec55f331..0e402b01 100644
|
||||||
|
--- a/usr/share/rear/build/GNU/Linux/100_copy_as_is.sh
|
||||||
|
+++ b/usr/share/rear/build/GNU/Linux/100_copy_as_is.sh
|
||||||
|
@@ -92,9 +92,13 @@ done >$copy_as_is_exclude_file
|
||||||
|
# COPY_AS_IS+=( /path/to/directory/* )
|
||||||
|
# which are used in our scripts and by users in their etc/rear/local.conf
|
||||||
|
# cf. https://github.com/rear/rear/pull/2405#issuecomment-633512932
|
||||||
|
+# Using '-i' when extracting is necessary to avoid a false regular exit of 'tar'
|
||||||
|
+# in particular when padding zeroes get added when a file being read shrinks
|
||||||
|
+# because for 'tar' (without '-i') two consecutive 512-blocks of zeroes mean EOF,
|
||||||
|
+# cf. https://github.com/rear/rear/pull/3027
|
||||||
|
# FIXME: The following code fails if file names contain characters from IFS (e.g. blanks),
|
||||||
|
# cf. https://github.com/rear/rear/issues/1372
|
||||||
|
-if ! tar -v -X $copy_as_is_exclude_file -P -C / -c ${COPY_AS_IS[*]} 2>$copy_as_is_filelist_file | tar $v -C $ROOTFS_DIR/ -x 1>/dev/null ; then
|
||||||
|
+if ! tar -v -X $copy_as_is_exclude_file -P -C / -c ${COPY_AS_IS[*]} 2>$copy_as_is_filelist_file | tar $v -C $ROOTFS_DIR/ -x -i 1>/dev/null ; then
|
||||||
|
Error "Failed to copy files and directories in COPY_AS_IS minus COPY_AS_IS_EXCLUDE"
|
||||||
|
fi
|
||||||
|
Log "Finished copying files and directories in COPY_AS_IS minus COPY_AS_IS_EXCLUDE"
|
@ -45,6 +45,7 @@ Patch54: rear-bz2130945.patch
|
|||||||
Patch55: rear-bz2131946.patch
|
Patch55: rear-bz2131946.patch
|
||||||
Patch56: s390-no-clobber-disks.patch
|
Patch56: s390-no-clobber-disks.patch
|
||||||
Patch57: rear-bz2188593-nbu-systemd.patch
|
Patch57: rear-bz2188593-nbu-systemd.patch
|
||||||
|
Patch58: rear-device-shrinking-bz2223895.patch
|
||||||
|
|
||||||
# rear contains only bash scripts plus documentation so that on first glance it could be "BuildArch: noarch"
|
# 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.
|
# but actually it is not "noarch" because it only works on those architectures that are explicitly supported.
|
||||||
|
Loading…
Reference in New Issue
Block a user