build: add buildinfo files for reproducibility

generate feeds.buildinfo and version.buildinfo in build dir after
containing the feed revisions (via ./scripts/feeds list -sf) as well as
the current revision of buildroot (via ./scripts/

With this information it should be possible to reproduce any build,
especially the release builds.

Usage would be to move feeds.buildinfo to feeds.conf and git checkout the
revision hash of version.buildinfo.

Content of feeds.buildinfo would look similar to this:

    src-git routing^bf475d6
    src-git telephony^470eb8e

Content of version.buildinfo would look similar to this:


Without the exact feed revision it is not possible to determine
installed package versions.

Also rename config.seed to config.buildinfo to follow the recommended
style of

Signed-off-by: Paul Spooren <>
Paul Spooren 5 years ago committed by Daniel Golle
parent bcfd1d7685
commit 454021581f

@ -89,12 +89,18 @@ prereq: $(target/stamp-prereq) tmp/.prereq_packages
checksum: FORCE
$(call sha256sums,$(BIN_DIR),$(CONFIG_BUILDBOT))
buildversion: FORCE
$(SCRIPT_DIR)/ > $(BIN_DIR)/version.buildinfo
feedsversion: FORCE
$(SCRIPT_DIR)/feeds list -fs > $(BIN_DIR)/feeds.buildinfo
diffconfig: FORCE
mkdir -p $(BIN_DIR)
$(SCRIPT_DIR)/ > $(BIN_DIR)/config.seed
$(SCRIPT_DIR)/ > $(BIN_DIR)/config.buildinfo
prepare: .config $(tools/stamp-compile) $(toolchain/stamp-compile)
$(_SINGLE)$(SUBMAKE) -r diffconfig
$(_SINGLE)$(SUBMAKE) -r diffconfig buildversion feedsversion
world: prepare $(target/stamp-compile) $(package/stamp-compile) $(package/stamp-install) $(target/stamp-install) FORCE
$(_SINGLE)$(SUBMAKE) -r package/index

@ -93,7 +93,7 @@ menu "Global build settings"
bool "Include build configuration in firmware" if DEVEL
default n
If enabled, config.seed will be stored in /etc/build.config of firmware.
If enabled, config.buildinfo will be stored in /etc/build.config of firmware.

@ -198,7 +198,7 @@ define Package/base-files/install
echo -e "# Build configuration for board $(BOARD)/$(SUBTARGET)/$(PROFILE)\n" >$(1)/etc/build.config; \
cat $(BIN_DIR)/config.seed >>$(1)/etc/build.config)
cat $(BIN_DIR)/config.buildinfo >>$(1)/etc/build.config)
mkdir -p $(1)/etc/opkg; \