diff options
author | Vagrant Cascadian <vagrant@debian.org> | 2016-06-16 12:28:40 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-06-24 17:23:10 -0400 |
commit | 5847084f6bbd0778afb29f0574085d4210ea8cff (patch) | |
tree | 2ccd6681ecc410829fb8598a3c4fc7ba95e608bc /tools/fit_image.c | |
parent | 42ffa51fd46bc6fd4bf2c244f00a80df31d01596 (diff) | |
download | u-boot-5847084f6bbd0778afb29f0574085d4210ea8cff.tar.gz |
Respect SOURCE_DATE_EPOCH when building FIT images.
Embedding timestamps in FIT images results in unreproducible builds
for targets that generate a fit image, such as dra7xx_evm.
This patch uses the SOURCE_DATE_EPOCH environment variable, when set,
to use specified value for the date.
Thanks to HW42 for debugging the issue and providing the patch:
https://lists.alioth.debian.org/pipermail/reproducible-builds/Week-of-Mon-20160606/005722.html
For more information about reproducible builds and the
SOURCE_DATE_EPOCH specification:
https://reproducible-builds.org/specs/source-date-epoch/
https://reproducible-builds.org/
Signed-off-by: Vagrant Cascadian <vagrant@debian.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/fit_image.c')
-rw-r--r-- | tools/fit_image.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/fit_image.c b/tools/fit_image.c index 76a6de4579..58aa8e27db 100644 --- a/tools/fit_image.c +++ b/tools/fit_image.c @@ -51,8 +51,10 @@ static int fit_add_file_data(struct image_tool_params *params, size_t size_inc, } /* for first image creation, add a timestamp at offset 0 i.e., root */ - if (params->datafile) - ret = fit_set_timestamp(ptr, 0, sbuf.st_mtime); + if (params->datafile) { + time_t time = imagetool_get_source_date(params, sbuf.st_mtime); + ret = fit_set_timestamp(ptr, 0, time); + } if (!ret) { ret = fit_add_verification_data(params->keydir, dest_blob, ptr, |