build: add devel option to store build config in firmware
authorVitaly Chekryzhev <13hakta@gmail.com>
Thu, 5 Jan 2017 07:06:26 +0000 (12:06 +0500)
committerStijn Tintel <stijn@linux-ipv6.be>
Sat, 18 Mar 2017 11:08:04 +0000 (12:08 +0100)
Store config.seed in firmware /etc/build.config

Signed-off-by: Vitaly Chekryzhev <13hakta@gmail.com>
config/Config-build.in
package/base-files/Makefile

index e0889fcccfc29b1364861933ceaa9e8595a697a6..d5e183926d4d6e734b5b64f6a271fe2b575e85bb 100644 (file)
@@ -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"
index 78c3dc9390cf58fde8483596563c2e6e5e500887..512fa66ca73bb8181510473e2cce63f2faa61d34 100644 (file)
@@ -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)