[Buildroot] [git commit branch/2019.05.x] Makefile: ensure $BINARIES_DIR exist before post-image scripts

Peter Korsgaard peter at korsgaard.com
Sat Aug 31 07:59:45 UTC 2019


commit: https://git.buildroot.net/buildroot/commit/?id=7db3f33a988b30d8ae70385257c4f3bafb0b88ab
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/2019.05.x

When no filesystem is enabled, the $BINARIES_DIR is not created. Yet,
the post-image scripts are still run. When those want to generate an
image in there, they may fail as the dirctory does not exist (it did
exist before we started applying preparatory changes for top-level
parallel build, so scripts got to rely on that assumption).

Do in target-post-image as we do in the sdk rule: create the directory
before calling the scripts.

Signed-off-by: Brent Generous <bgenerous at impinj.com>
[yann.morin.1998 at free.fr:
  - create the directory before calling the scripts
  - don't drop the creation in the sdk rule
]
Signed-off-by: Yann E. MORIN <yann.morin.1998 at free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>

(cherry picked from commit d57e73078a315eb7419173d7e0503ce66c1df238)
Signed-off-by: Peter Korsgaard <peter at korsgaard.com>
---
 Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Makefile b/Makefile
index 738c3bf8c8..41047a4002 100644
--- a/Makefile
+++ b/Makefile
@@ -811,6 +811,7 @@ endif # merged /usr
 .PHONY: target-post-image
 target-post-image: $(TARGETS_ROOTFS) target-finalize staging-finalize
 	@rm -f $(ROOTFS_COMMON_TAR)
+	$(Q)mkdir -p $(BINARIES_DIR)
 	@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_IMAGE_SCRIPT)), \
 		$(call MESSAGE,"Executing post-image script $(s)"); \
 		$(EXTRA_ENV) $(s) $(BINARIES_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep))


More information about the buildroot mailing list