From: Zbigniew Jędrzejewski-Szmek Date: Wed, 24 Nov 2021 12:06:37 +0000 (+0100) Subject: dissect-image: provide a more useful message when ENOMEDIUM is returned X-Git-Tag: v250-rc1~170^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=48084df6ed5c65c98099020a2cd080bf324dc4e5;p=thirdparty%2Fsystemd.git dissect-image: provide a more useful message when ENOMEDIUM is returned --- diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c index c3345b3fad5..ec9bc51d009 100644 --- a/src/shared/dissect-image.c +++ b/src/shared/dissect-image.c @@ -3309,29 +3309,32 @@ int dissect_image_and_warn( return log_error_errno(r, "Dissecting images is not supported, compiled without blkid support."); case -ENOPKG: - return log_error_errno(r, "Couldn't identify a suitable partition table or file system in '%s'.", name); + return log_error_errno(r, "%s: Couldn't identify a suitable partition table or file system.", name); + + case -ENOMEDIUM: + return log_error_errno(r, "%s: The image does not pass validation.", name); case -EADDRNOTAVAIL: - return log_error_errno(r, "No root partition for specified root hash found in '%s'.", name); + return log_error_errno(r, "%s: No root partition for specified root hash found.", name); case -ENOTUNIQ: - return log_error_errno(r, "Multiple suitable root partitions found in image '%s'.", name); + return log_error_errno(r, "%s: Multiple suitable root partitions found in image.", name); case -ENXIO: - return log_error_errno(r, "No suitable root partition found in image '%s'.", name); + return log_error_errno(r, "%s: No suitable root partition found in image.", name); case -EPROTONOSUPPORT: return log_error_errno(r, "Device '%s' is loopback block device with partition scanning turned off, please turn it on.", name); + case -ENOTBLK: + return log_error_errno(r, "%s: Image is not a block device.", name); + case -EBADR: return log_error_errno(r, "Combining partitioned images (such as '%s') with external Verity data (such as '%s') not supported. " "(Consider setting $SYSTEMD_DISSECT_VERITY_SIDECAR=0 to disable automatic discovery of external Verity data.)", name, strna(verity ? verity->data_path : NULL)); - case -ENOTBLK: - return log_error_errno(r, "Specified image '%s' is not a block device.", name); - default: if (r < 0) return log_error_errno(r, "Failed to dissect image '%s': %m", name);