From 2a99f964ff76e3a81c415e1d1ad06ed57fe44db9 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Wed, 12 Oct 2022 14:40:29 +0200 Subject: [PATCH] repart: Skip partition_populate_directory() if no sources are provided --- src/partition/repart.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/partition/repart.c b/src/partition/repart.c index 6f4da2c6b5..494a3100b7 100644 --- a/src/partition/repart.c +++ b/src/partition/repart.c @@ -3627,6 +3627,11 @@ static int partition_populate_directory(Partition *p, const Set *denylist, char assert(ret); + if ((strv_isempty(p->copy_files) && strv_isempty(p->make_directories))) { + *ret = NULL; + return 0; + } + r = mkdtemp_malloc("/var/tmp/repart-XXXXXX", &root); if (r < 0) return log_error_errno(r, "Failed to create temporary directory: %m"); -- 2.25.1