repart: use partition_designator_is_verity_sig() + partition_designator_is_verity() more
This commit is contained in:
+3
-5
@@ -2612,9 +2612,7 @@ static int partition_read_definition(Partition *p, const char *path, const char
|
||||
}
|
||||
|
||||
/* Verity partitions are read only, let's imply the RO flag hence, unless explicitly configured otherwise. */
|
||||
if ((IN_SET(p->type.designator,
|
||||
PARTITION_ROOT_VERITY,
|
||||
PARTITION_USR_VERITY) || p->verity == VERITY_DATA) && p->read_only < 0)
|
||||
if ((partition_designator_is_verity(p->type.designator) || p->verity == VERITY_DATA) && p->read_only < 0)
|
||||
p->read_only = true;
|
||||
|
||||
/* Default to "growfs" on, unless read-only */
|
||||
@@ -5325,7 +5323,7 @@ static int context_copy_blocks(Context *context) {
|
||||
continue;
|
||||
|
||||
/* For offline signing case */
|
||||
if (!set_isempty(arg_verity_settings) && IN_SET(p->type.designator, PARTITION_ROOT_VERITY_SIG, PARTITION_USR_VERITY_SIG))
|
||||
if (!set_isempty(arg_verity_settings) && partition_designator_is_verity_sig(p->type.designator))
|
||||
return partition_format_verity_sig(context, p);
|
||||
|
||||
if (p->copy_blocks_fd < 0)
|
||||
@@ -6298,7 +6296,7 @@ static int context_mkfs(Context *context) {
|
||||
continue;
|
||||
|
||||
/* For offline signing case */
|
||||
if (!set_isempty(arg_verity_settings) && IN_SET(p->type.designator, PARTITION_ROOT_VERITY_SIG, PARTITION_USR_VERITY_SIG))
|
||||
if (!set_isempty(arg_verity_settings) && partition_designator_is_verity_sig(p->type.designator))
|
||||
return partition_format_verity_sig(context, p);
|
||||
|
||||
/* Minimized partitions will use the copy blocks logic so skip those here. */
|
||||
|
||||
Reference in New Issue
Block a user