From 620a03f669a9075f2d78c2fcf7db45f7046481bc Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 18 Oct 2024 14:16:13 +0200 Subject: [PATCH 1/2] dissect-image: uppercase first char of dissect error message systematically Some of the log message stricts used proper uppercasing, others didn't. Fix that to make it uniform. --- src/shared/dissect-image.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c index 4585582523..9c2f35d58b 100644 --- a/src/shared/dissect-image.c +++ b/src/shared/dissect-image.c @@ -1659,13 +1659,13 @@ int dissect_log_error(int log_level, int r, const char *name, const VeritySettin name, strna(verity ? verity->data_path : NULL)); case -ERFKILL: - return log_full_errno(log_level, r, "%s: image does not match image policy.", name); + return log_full_errno(log_level, r, "%s: Image does not match image policy.", name); case -ENOMSG: - return log_full_errno(log_level, r, "%s: no suitable partitions found.", name); + return log_full_errno(log_level, r, "%s: No suitable partitions found.", name); default: - return log_full_errno(log_level, r, "%s: cannot dissect image: %m", name); + return log_full_errno(log_level, r, "%s: Cannot dissect image: %m", name); } } From 2186334e00acba6e6c1a4564bce60474eecfbf16 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 18 Oct 2024 14:16:53 +0200 Subject: [PATCH 2/2] dissect-image: generate better log message for EUCLEAN dissect error Fixes: #31799 --- src/shared/dissect-image.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c index 9c2f35d58b..86fd1ef865 100644 --- a/src/shared/dissect-image.c +++ b/src/shared/dissect-image.c @@ -708,7 +708,9 @@ static int dissect_image( * Returns -ERFKILL if image doesn't match image policy * Returns -EBADR if verity data was provided externally for an image that has a GPT partition table (i.e. is not just a naked fs) * Returns -EPROTONOSUPPORT if DISSECT_IMAGE_ADD_PARTITION_DEVICES is set but the block device does not have partition logic enabled - * Returns -ENOMSG if we didn't find a single usable partition (and DISSECT_IMAGE_REFUSE_EMPTY is set) */ + * Returns -ENOMSG if we didn't find a single usable partition (and DISSECT_IMAGE_REFUSE_EMPTY is set) + * Returns -EUCLEAN if some file system had an ambiguous file system superblock signature + */ uint64_t diskseq = m->loop ? m->loop->diskseq : 0; @@ -1664,6 +1666,9 @@ int dissect_log_error(int log_level, int r, const char *name, const VeritySettin case -ENOMSG: return log_full_errno(log_level, r, "%s: No suitable partitions found.", name); + case -EUCLEAN: + return log_full_errno(log_level, r, "%s: Partition with ambiguous file system superblock signature found.", name); + default: return log_full_errno(log_level, r, "%s: Cannot dissect image: %m", name); }