]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
repart: Initialize split_name_format in copy_from_one()
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 8 Sep 2024 08:27:55 +0000 (10:27 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 9 Sep 2024 11:22:26 +0000 (13:22 +0200)
Let's allow splitting the partitions from an existing disk image
by initializing split_name_format when using --copy-from=.

src/partition/repart.c

index 118f7be6180d5a82322fff5ebe221dc940d4e0e1..a1aa3c759cd2d9346f774160295c95761a76f360 100644 (file)
@@ -2513,6 +2513,10 @@ static int context_copy_from_one(Context *context, const char *src) {
                 if (!np->definition_path)
                         return log_oom();
 
+                np->split_name_format = strdup("%t");
+                if (!np->split_name_format)
+                        return log_oom();
+
                 r = determine_current_padding(c, t, p, secsz, grainsz, &padding);
                 if (r < 0)
                         return r;