1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 09:21:26 +03:00

repart: when we can't fit in all partitions explain how large the image would have to be

This commit is contained in:
Lennart Poettering 2021-03-19 20:31:29 +01:00
parent 252d626711
commit d17db7b2bf

View File

@ -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 */