Browse Source

Add post build action

@upstream
dir 7 years ago
parent
commit
9a6816465e
3 changed files with 16 additions and 0 deletions
  1. 6 0
      docs/customize-rootfs.txt
  2. 6 0
      target/Makefile
  3. 4 0
      target/config/Config.in.adk

+ 6 - 0
docs/customize-rootfs.txt

@@ -21,3 +21,9 @@ You can also point to another directory via:
 You can start with the example configuration files from +root_*+.
 The +extra+ directory will never be deleted by any clean target to avoid
 loss of customized configuration data.
+
+Another option is to configure a post-build action. This is available
+in +Global settings+. It must point to a script relative to the root
+of your openadk working copy. It will be invoked as part of the
++*-imageinstall+ step with $ADK_TOPDIR as first argument. You can use
+it e.g. to modify the +root_*+ filesystem before bundling it.

+ 6 - 0
target/Makefile

@@ -228,6 +228,12 @@ endif
 	$(MAKE) -C $(patsubst %-targethelp,%,$@) targethelp
 
 %-imageinstall: %-imageprepare
+ifdef ADK_POST_BUILD_ACTION
+ifneq ($(ADK_POST_BUILD_ACTION),"")
+	@printf "running post build action '$(ADK_POST_BUILD_ACTION)'\n"
+	$(ADK_TOPDIR)/$(ADK_POST_BUILD_ACTION) $(ADK_TOPDIR)
+endif
+endif
 	$(MAKE) -C $(patsubst %-imageinstall,%,$@) imageinstall
 	@for x in $$(ls $(ADK_TOPDIR)/scripts/postimage/*.sh 2>/dev/null); do \
 		[[ -x "$$x" ]] && $$x; \

+ 4 - 0
target/config/Config.in.adk

@@ -112,4 +112,8 @@ config ADK_TARGET_PORT
 	help
 	  Port to use for SSH when running make check.
 
+config ADK_POST_BUILD_ACTION
+	string "Path to script run post build. Must be relative to ADK_TOPDIR."
+        default ""
+
 endmenu