From 9b2a377edb9e566aded20a0d9a25200416d873c1 Mon Sep 17 00:00:00 2001 From: Markus Mayer Date: Tue, 21 Jan 2020 15:09:56 -0800 Subject: [PATCH] system/Config.in: introduce pre-build script We introduce the concept of a pre-build script that works similar to the already existing post-build and post-image scripts. The pre-build script(s) are executed before the build commences. This allows a user to run some preperatory tasks prior to the build. Signed-off-by: Markus Mayer Signed-off-by: Arnout Vandecappelle (Essensium/Mind) --- Makefile | 3 +++ system/Config.in | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/Makefile b/Makefile index ac98b84425..3099d35158 100644 --- a/Makefile +++ b/Makefile @@ -599,6 +599,9 @@ $(BUILD_DIR)/buildroot-config/auto.conf: $(BR2_CONFIG) .PHONY: prepare prepare: $(BUILD_DIR)/buildroot-config/auto.conf + @$(foreach s, $(call qstrip,$(BR2_ROOTFS_PRE_BUILD_SCRIPT)), \ + $(call MESSAGE,"Executing pre-build script $(s)"); \ + $(EXTRA_ENV) $(s) $(TARGET_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep)) .PHONY: world world: target-post-image diff --git a/system/Config.in b/system/Config.in index b3abeddd68..8c66cad12a 100644 --- a/system/Config.in +++ b/system/Config.in @@ -533,6 +533,16 @@ config BR2_ROOTFS_OVERLAY They are copied as-is into the rootfs, excluding files ending with ~ and .git, .svn and .hg directories. +config BR2_ROOTFS_PRE_BUILD_SCRIPT + string "Custom scripts to run before commencing the build" + default "" + help + Specify a space-separated list of scripts to be run before the + build commences. + + This gives users the opportunity to do board-specific + preparations before starting the build. + config BR2_ROOTFS_POST_BUILD_SCRIPT string "Custom scripts to run before creating filesystem images" default ""