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 <r...@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


Reply via email to