From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Tue, 20 Feb 2024 11:19:21 +0100 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rcNDd-00FuhV-1G for lore@lore.pengutronix.de; Tue, 20 Feb 2024 11:19:21 +0100 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1rcNDd-0003eV-5v; Tue, 20 Feb 2024 11:19:21 +0100 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rcNDV-0003eH-Mr; Tue, 20 Feb 2024 11:19:13 +0100 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rcNDV-001pCp-Al; Tue, 20 Feb 2024 11:19:13 +0100 Received: from rhi by dude04.red.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rcNDV-004bcV-0u; Tue, 20 Feb 2024 11:19:13 +0100 From: Roland Hieber To: ptxdist@pengutronix.de Date: Tue, 20 Feb 2024 11:19:09 +0100 Message-Id: <20240220101909.1090342-1-rhi@pengutronix.de> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Mail-Followup-To: Roland Hieber , ptxdist@pengutronix.de Content-Transfer-Encoding: 8bit Subject: [ptxdist] [PATCH] image-rauc: improve error detection for hook script X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: Roland Hieber Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false 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 --- 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