2026-06-09 U-Boot Release Build Timestamp Note
Background
The board printed this U-Boot banner after boot:
U-Boot 2025.04-g99518e6b6f20-dirty (Jan 01 2021 - 00:00:00 +0000)The U-Boot release artifact was built under:
out/release-latest/ubootRoot Cause
The release script set a fixed default timestamp:
export SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH:-1609459200}1609459200 is 2021-01-01 00:00:00 UTC.
U-Boot consumes SOURCE_DATE_EPOCH in its Makefile and generates:
out/release-latest/uboot/include/generated/timestamp_autogenerated.hThe generated file contained:
#define U_BOOT_DATE "Jan 01 2021"
#define U_BOOT_TIME "00:00:00"
#define U_BOOT_TZ "+0000"
#define U_BOOT_EPOCH 16094592002
3
4
That generated timestamp is included by include/timestamp.h, then composed into common/version.c:
#define U_BOOT_VERSION_STRING U_BOOT_VERSION " (" U_BOOT_DATE " - " \
U_BOOT_TIME " " U_BOOT_TZ ")" CONFIG_IDENT_STRING2
So the board banner was not reading a hardware RTC. It was reporting the timestamp embedded at U-Boot build time.
Fix
The release script now uses the current UTC build time by default:
: "${SOURCE_DATE_EPOCH:=$(date -u +%s)}"
export SOURCE_DATE_EPOCH2
This makes the U-Boot banner match the release artifact build time.
If a byte-for-byte reproducible build is needed, pass a fixed value explicitly:
SOURCE_DATE_EPOCH=1740988800 ./scripts/release_builder/build_release_uboot.sh v0.1.0Files Changed
scripts/release_builder/build_release_uboot.shdocument/scripts/release_builder/build_release_uboot.sh.mddocument/notes/2026-06-09-uboot-release-build-timestamp.md
Verification
Before the fix, the generated artifact contained:
U-Boot 2025.04-g99518e6b6f20-dirty (Jan 01 2021 - 00:00:00 +0000)After rebuilding U-Boot with the fixed script, check:
sed -n '1,20p' out/release-latest/uboot/include/generated/timestamp_autogenerated.h
strings out/release-latest/uboot/u-boot-nodtb.bin | rg 'U-Boot 2025|Jan 01 2021'
sed -n '1,20p' out/release-latest/uboot/build_info.txt2
3
Expected result:
U_BOOT_EPOCHis no longer1609459200unless explicitly requested.- The U-Boot banner no longer shows
Jan 01 2021by default. build_info.txtrecords the actual build timestamp used for the artifact.