diff mbox series

[2/3] image-host: fix 'unknown error' error message

Message ID 20240916082446.32082-3-al.kochet@gmail.com
State Accepted
Commit 9e81f13dbb41843abb25e6c4b20961f092630f13
Delegated to: Simon Glass
Headers show
Series Implement signing FIT images during image build | expand

Commit Message

Alexander Kochetkov Sept. 16, 2024, 8:24 a.m. UTC
From: Alexander Kochetkov <al.kochet@gmail.com>

Fix error message like this:
Can't add verification data for node 'fdt-1' (<unknown error>)

We get unknown error because we decode error as fdt error
but actually it is system error.

Signed-off-by: Alexander Kochetkov <al.kochet@gmail.com>
---
 tools/image-host.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Glass Oct. 9, 2024, 1:50 a.m. UTC | #1
On Mon, 16 Sept 2024 at 02:25, <al.kochet@gmail.com> wrote:
>
> From: Alexander Kochetkov <al.kochet@gmail.com>
>
> Fix error message like this:
> Can't add verification data for node 'fdt-1' (<unknown error>)
>
> We get unknown error because we decode error as fdt error
> but actually it is system error.
>
> Signed-off-by: Alexander Kochetkov <al.kochet@gmail.com>
> ---
>  tools/image-host.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>


>
> diff --git a/tools/image-host.c b/tools/image-host.c
> index 7bfc0cb6b1..ac14d9aa86 100644
> --- a/tools/image-host.c
> +++ b/tools/image-host.c
> @@ -1333,7 +1333,7 @@ int fit_add_verification_data(const char *keydir, const char *keyfile,
>                 if (ret) {
>                         fprintf(stderr, "Can't add verification data for node '%s' (%s)\n",
>                                 fdt_get_name(fit, noffset, NULL),
> -                               fdt_strerror(ret));
> +                               strerror(-ret));
>                         return ret;
>                 }
>         }
> --
> 2.17.1
>
Simon Glass Oct. 17, 2024, 11:12 p.m. UTC | #2
On Mon, 16 Sept 2024 at 02:25, <al.kochet@gmail.com> wrote:
>
> From: Alexander Kochetkov <al.kochet@gmail.com>
>
> Fix error message like this:
> Can't add verification data for node 'fdt-1' (<unknown error>)
>
> We get unknown error because we decode error as fdt error
> but actually it is system error.
>
> Signed-off-by: Alexander Kochetkov <al.kochet@gmail.com>
> ---
>  tools/image-host.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>


>
Applied to u-boot-dm, thanks!
diff mbox series

Patch

diff --git a/tools/image-host.c b/tools/image-host.c
index 7bfc0cb6b1..ac14d9aa86 100644
--- a/tools/image-host.c
+++ b/tools/image-host.c
@@ -1333,7 +1333,7 @@  int fit_add_verification_data(const char *keydir, const char *keyfile,
 		if (ret) {
 			fprintf(stderr, "Can't add verification data for node '%s' (%s)\n",
 				fdt_get_name(fit, noffset, NULL),
-				fdt_strerror(ret));
+				strerror(-ret));
 			return ret;
 		}
 	}