From: Daan De Meyer Date: Wed, 30 Nov 2022 16:04:14 +0000 (+0100) Subject: repart: Ignore copy failures for unsupported file types X-Git-Tag: v253-rc1~400^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F25579%2Fhead;p=thirdparty%2Fsystemd.git repart: Ignore copy failures for unsupported file types e.g. vfat doesn't support symlinks, sockets, fifos, etc so let's ignore any copy failures related to unsupported file types when populating filesystems. --- diff --git a/man/repart.d.xml b/man/repart.d.xml index 7e19ab7e0cc..fe3de8d58a4 100644 --- a/man/repart.d.xml +++ b/man/repart.d.xml @@ -420,6 +420,10 @@ The copy operation is executed before the file system is registered in the partition table, thus ensuring that a file system populated this way only ever exists fully initialized. + Note that CopyFiles= will skip copying files that aren't supported by the + target filesystem (e.g symlinks, fifos, sockets and devices on vfat). When an unsupported file type + is encountered, repart will skip copying this file and write a log message about it. + This option cannot be combined with CopyBlocks=. When systemd-repart is invoked with the or diff --git a/src/partition/repart.c b/src/partition/repart.c index 54f2f7f8553..ce65ead62a0 100644 --- a/src/partition/repart.c +++ b/src/partition/repart.c @@ -3731,14 +3731,14 @@ static int do_copy_files( sfd, ".", pfd, fn, override_uid, override_gid, - COPY_REFLINK|COPY_HOLES|COPY_MERGE|COPY_REPLACE|COPY_SIGINT|COPY_HARDLINKS|COPY_ALL_XATTRS, + COPY_REFLINK|COPY_HOLES|COPY_MERGE|COPY_REPLACE|COPY_SIGINT|COPY_HARDLINKS|COPY_ALL_XATTRS|COPY_GRACEFUL_WARN, denylist); } else r = copy_tree_at( sfd, ".", tfd, ".", override_uid, override_gid, - COPY_REFLINK|COPY_HOLES|COPY_MERGE|COPY_REPLACE|COPY_SIGINT|COPY_HARDLINKS|COPY_ALL_XATTRS, + COPY_REFLINK|COPY_HOLES|COPY_MERGE|COPY_REPLACE|COPY_SIGINT|COPY_HARDLINKS|COPY_ALL_XATTRS|COPY_GRACEFUL_WARN, denylist); if (r < 0) return log_error_errno(r, "Failed to copy '%s%s' to '%s%s': %m",