diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-03-19 20:31:29 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-04-19 23:16:02 +0200 |
commit | d17db7b2bf716dbf6c20691755b4710a8068e284 (patch) | |
tree | 3be6e468ec1aeacb0a334e3bd663a2303661f2f8 /src/partition | |
parent | repart: add --image= switch (diff) | |
download | systemd-d17db7b2bf716dbf6c20691755b4710a8068e284.tar.xz systemd-d17db7b2bf716dbf6c20691755b4710a8068e284.zip |
repart: when we can't fit in all partitions explain how large the image would have to be
Diffstat (limited to 'src/partition')
-rw-r--r-- | src/partition/repart.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/partition/repart.c b/src/partition/repart.c index 081f95ebe7..1ee5eaa25e 100644 --- a/src/partition/repart.c +++ b/src/partition/repart.c @@ -4167,8 +4167,6 @@ static int determine_auto_size(Context *c) { Partition *p; assert_se(c); - assert_se(arg_size == UINT64_MAX); - assert_se(arg_size_auto); LIST_FOREACH(partitions, p, c->partitions) { uint64_t m; @@ -4352,9 +4350,13 @@ static int run(int argc, char *argv[]) { if (context_allocate_partitions(context)) break; /* Success! */ - if (!context_drop_one_priority(context)) - return log_error_errno(SYNTHETIC_ERRNO(ENOSPC), - "Can't fit requested partitions into free space, refusing."); + if (!context_drop_one_priority(context)) { + r = log_error_errno(SYNTHETIC_ERRNO(ENOSPC), + "Can't fit requested partitions into free space, refusing."); + + determine_auto_size(context); + return r; + } } /* Now assign free space according to the weight logic */ |