mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] image-rauc: improve error detection for hook script
@ 2024-02-20 10:19 Roland Hieber
  2024-03-15  4:06 ` [ptxdist] [APPLIED] " Michael Olbrich
  0 siblings, 1 reply; 2+ messages in thread
From: Roland Hieber @ 2024-02-20 10:19 UTC (permalink / raw)
  To: ptxdist; +Cc: Roland Hieber

If config/images/rauc-hooks.sh is not found, genimage will instead try
to copy a file with an empty file name from the temporary build folder,
resulting in the less helpful error message about "cp: -r not specified;
omitting directory". Catch this case early and error out with a better
message.

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 rules/image-rauc.make | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/rules/image-rauc.make b/rules/image-rauc.make
index def2ade1e237..a05c19f61de2 100644
--- a/rules/image-rauc.make
+++ b/rules/image-rauc.make
@@ -41,6 +41,10 @@ IMAGE_RAUC_BUNDLE_FORMAT := "crypt"
 endif
 
 ifdef PTXCONF_IMAGE_RAUC_HOOK
+ifndef IMAGE_RAUC_HOOK_FILE
+$(error IMAGE_RAUC_HOOK is enabled, but config/images/rauc-hooks.sh was not \
+	found in any component of PTXDIST_PATH)
+endif
 IMAGE_RAUC_ENV_HOOK = \
 	RAUC_HOOK_FILE="file hooks.sh { image = \\"$(IMAGE_RAUC_HOOK_FILE)\\" }" \
 	RAUC_HOOK_MANIFEST="filename=hooks.sh"
-- 
2.39.2




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ptxdist] [APPLIED] image-rauc: improve error detection for hook script
  2024-02-20 10:19 [ptxdist] [PATCH] image-rauc: improve error detection for hook script Roland Hieber
@ 2024-03-15  4:06 ` Michael Olbrich
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Olbrich @ 2024-03-15  4:06 UTC (permalink / raw)
  To: ptxdist; +Cc: Roland Hieber

Thanks, applied as 1da289a90f19c4f5aa56cf76c2c7a73aae5f756f.

Michael

[sent from post-receive hook]

On Fri, 15 Mar 2024 05:06:13 +0100, Roland Hieber <rhi@pengutronix.de> wrote:
> If config/images/rauc-hooks.sh is not found, genimage will instead try
> to copy a file with an empty file name from the temporary build folder,
> resulting in the less helpful error message about "cp: -r not specified;
> omitting directory". Catch this case early and error out with a better
> message.
> 
> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
> Message-Id: <20240220101909.1090342-1-rhi@pengutronix.de>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
> 
> diff --git a/rules/image-rauc.make b/rules/image-rauc.make
> index def2ade1e237..a05c19f61de2 100644
> --- a/rules/image-rauc.make
> +++ b/rules/image-rauc.make
> @@ -41,6 +41,10 @@ IMAGE_RAUC_BUNDLE_FORMAT := "crypt"
>  endif
>  
>  ifdef PTXCONF_IMAGE_RAUC_HOOK
> +ifndef IMAGE_RAUC_HOOK_FILE
> +$(error IMAGE_RAUC_HOOK is enabled, but config/images/rauc-hooks.sh was not \
> +	found in any component of PTXDIST_PATH)
> +endif
>  IMAGE_RAUC_ENV_HOOK = \
>  	RAUC_HOOK_FILE="file hooks.sh { image = \\"$(IMAGE_RAUC_HOOK_FILE)\\" }" \
>  	RAUC_HOOK_MANIFEST="filename=hooks.sh"



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-15  4:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-20 10:19 [ptxdist] [PATCH] image-rauc: improve error detection for hook script Roland Hieber
2024-03-15  4:06 ` [ptxdist] [APPLIED] " Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox