trusted-firmware-a: use a reproducible build timestamp

TF-A embeds __TIME__ and __DATE__ in its build message, so bl2 and bl31
differ on every build, and so do all images that contain them.

Pass BUILD_MESSAGE_TIMESTAMP, derived from the source date of the
package, in the same format.

Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
John Crispin committed 2026-09-22 18:46:30 +02:00
1 parent e923974fc1
commit 1e7c8fbc29
1 file changed
+6
+6
View File
@@ -84,6 +84,11 @@ endef
DTC=$(wildcard $(LINUX_DIR)/scripts/dtc/dtc)
# TF-A embeds __TIME__ and __DATE__ by default, which makes the binaries
# differ on every build.
TFA_BUILD_TIMESTAMP=$(if $(PKG_SOURCE_DATE_EPOCH),$(shell LC_ALL=C perl -MPOSIX \
-e 'print strftime("%H:%M:%S, %b %e %Y", gmtime($(PKG_SOURCE_DATE_EPOCH)))'))
define Build/Compile/Trusted-Firmware-A
+unset CC; \
$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
@@ -92,6 +97,7 @@ define Build/Compile/Trusted-Firmware-A
$(if $(DTC),DTC="$(DTC)") \
PLAT=$(PLAT) \
BUILD_STRING="OpenWrt $(PKG_VERSION_PREFIX)$(PKG_VERSION)-$(PKG_RELEASE) ($(VARIANT))" \
$(if $(TFA_BUILD_TIMESTAMP),BUILD_MESSAGE_TIMESTAMP='"$(TFA_BUILD_TIMESTAMP)"') \
$(TFA_MAKE_FLAGS)
endef