Browse Source

build: add devel option to store build config in firmware

Store config.seed in firmware /etc/build.config

Signed-off-by: Vitaly Chekryzhev <[email protected]>
Vitaly Chekryzhev 9 years ago
parent
commit
01337ba472
2 changed files with 10 additions and 0 deletions
  1. 6 0
      config/Config-build.in
  2. 4 0
      package/base-files/Makefile

+ 6 - 0
config/Config-build.in

@@ -67,6 +67,12 @@ menu "Global build settings"
 		  This removes all ipkg/opkg status data files from the target directory
 		  before building the root filesystem.
 
+	config INCLUDE_CONFIG
+		bool "Include build configuration in firmware" if DEVEL
+		default n
+		help
+		  If enabled, config.seed will be stored in /etc/build.config of firmware.
+
 	config COLLECT_KERNEL_DEBUG
 		bool
 		prompt "Collect kernel debug information"

+ 4 - 0
package/base-files/Makefile

@@ -168,6 +168,10 @@ define Package/base-files/install
 				echo "$$$${conffile##$(1)}" >> $(1)/CONTROL/conffiles; \
 		fi \
 	done
+
+	$(if $(CONFIG_INCLUDE_CONFIG), \
+		echo -e "# Build configuration for board $(BOARD)/$(SUBTARGET)/$(PROFILE)\n" >$(1)/etc/build.config; \
+		cat $(BIN_DIR)/config.seed >>$(1)/etc/build.config)
 endef
 
 ifneq ($(DUMP),1)