repart: Apply verity-sig max size based on partition type
We already do this for partition_min_size(), let's do it for partition_max_size() as well. This makes sure repart doesn't accidentally try to grow verity sig partitions to larger sizes than the hardcoded max size in systemd.
This commit is contained in:
+2
-2
@@ -921,7 +921,7 @@ static uint64_t partition_min_size(const Context *context, const Partition *p) {
|
||||
return p->current_size;
|
||||
}
|
||||
|
||||
if (IN_SET(p->type.designator, PARTITION_ROOT_VERITY_SIG, PARTITION_USR_VERITY_SIG))
|
||||
if (partition_designator_is_verity_sig(p->type.designator))
|
||||
return VERITY_SIG_SIZE;
|
||||
|
||||
sz = p->current_size != UINT64_MAX ? p->current_size : HARD_MIN_SIZE;
|
||||
@@ -967,7 +967,7 @@ static uint64_t partition_max_size(const Context *context, const Partition *p) {
|
||||
return p->current_size;
|
||||
}
|
||||
|
||||
if (p->verity == VERITY_SIG)
|
||||
if (partition_designator_is_verity_sig(p->type.designator))
|
||||
return VERITY_SIG_SIZE;
|
||||
|
||||
override_max = p->suppressing ? MIN(p->size_max, p->suppressing->size_max) : p->size_max;
|
||||
|
||||
Reference in New Issue
Block a user