summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile11
-rw-r--r--docs/manual/customize-rootfs.txt7
2 files changed, 18 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 074674a16..5a8325145 100644
--- a/Makefile
+++ b/Makefile
@@ -91,6 +91,8 @@ EXTRAMAKEARGS = O=$(O)
NEED_WRAPPER=y
endif
+BUILDROOT_CONFIG=$(CONFIG_DIR)/.config
+
# Pull in the user's configuration file
ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
-include $(CONFIG_DIR)/.config
@@ -282,6 +284,15 @@ HOSTCC := $(CCACHE) $(HOSTCC)
HOSTCXX := $(CCACHE) $(HOSTCXX)
endif
+# Scripts in support/ or post-build scripts may need to reference
+# these locations, so export them so it is easier to use
+export BUILDROOT_CONFIG
+export TARGET_DIR
+export STAGING_DIR
+export HOST_DIR
+export BINARIES_DIR
+export BASE_DIR O # O and BASE_DIR are the same
+
#############################################################
#
# You should probably leave this stuff alone unless you know
diff --git a/docs/manual/customize-rootfs.txt b/docs/manual/customize-rootfs.txt
index a1a556b85..4d3b55970 100644
--- a/docs/manual/customize-rootfs.txt
+++ b/docs/manual/customize-rootfs.txt
@@ -37,6 +37,13 @@ there are a few ways to customize the resulting target filesystem.
certain package generates wrong or unneeded files, you should fix
that package rather than work around it with a post-build cleanup
script. _Among these first 3 methods, this one should be preferred_.
+ You may also use these variables in your post-build script:
+ - +BUILDROOT_CONFIG+: the path to the Buildroot .config file
+ - +HOST_DIR+, +STAGING_DIR+, +TARGET_DIR+: see
+ xref:generic-package-reference[]
+ - +BINARIES_DIR+: the place where all binary files (aka images) are
+ stored
+ - +BASE_DIR+ (or +O+): the base output directory
* A special package, 'customize', stored in +package/customize+ can be
used. You can put all the files that you want to see in the final