From: Daan De Meyer Date: Sun, 2 Oct 2022 08:51:53 +0000 (+0200) Subject: repart: Don't fail on missing verity sig partition X-Git-Tag: v252-rc1~35 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8e52ed024ddc09972abb76cb68df2885babf877e;p=thirdparty%2Fsystemd.git repart: Don't fail on missing verity sig partition Also, provide a proper error message when we fail to find a verity sibling partition. --- diff --git a/src/partition/repart.c b/src/partition/repart.c index 0bd19523ecf..471537d6534 100644 --- a/src/partition/repart.c +++ b/src/partition/repart.c @@ -1705,16 +1705,19 @@ static int context_read_definitions( continue; r = find_verity_sibling(context, p, mode, &q); - if (mode != VERITY_SIG && r == -ENXIO) - return log_syntax(NULL, LOG_ERR, p->definition_path, 1, SYNTHETIC_ERRNO(EINVAL), - "Missing verity %s partition for verity %s partition with VerityMatchKey=%s", - verity_mode_to_string(mode), verity_mode_to_string(p->verity), p->verity_match_key); - if (r == -ENOTUNIQ) + if (r == -ENXIO) { + if (mode != VERITY_SIG) + return log_syntax(NULL, LOG_ERR, p->definition_path, 1, SYNTHETIC_ERRNO(EINVAL), + "Missing verity %s partition for verity %s partition with VerityMatchKey=%s", + verity_mode_to_string(mode), verity_mode_to_string(p->verity), p->verity_match_key); + } else if (r == -ENOTUNIQ) return log_syntax(NULL, LOG_ERR, p->definition_path, 1, SYNTHETIC_ERRNO(EINVAL), "Multiple verity %s partitions found for verity %s partition with VerityMatchKey=%s", verity_mode_to_string(mode), verity_mode_to_string(p->verity), p->verity_match_key); - if (r < 0) - return r; + else if (r < 0) + return log_syntax(NULL, LOG_ERR, p->definition_path, 1, r, + "Failed to find verity %s partition for verity %s partition with VerityMatchKey=%s", + verity_mode_to_string(mode), verity_mode_to_string(p->verity), p->verity_match_key); if (q) { if (q->priority != p->priority)