diff options
author | Paul Spooren <mail@aparcar.org> | 2020-11-01 11:53:39 -1000 |
---|---|---|
committer | Paul Spooren <mail@aparcar.org> | 2022-02-01 12:52:20 +0100 |
commit | 524cbcf6f5b07f3d9ee45e445da12760947e232e (patch) | |
tree | dbc7c8307e735f5d31b67e9a1a84aff455d58e8c | |
parent | 57293f51c48f1f7c4e8f1ab6fe2220761487bd65 (diff) | |
download | upstream-524cbcf6f5b07f3d9ee45e445da12760947e232e.tar.gz upstream-524cbcf6f5b07f3d9ee45e445da12760947e232e.tar.bz2 upstream-524cbcf6f5b07f3d9ee45e445da12760947e232e.zip |
build: store SOURCE_DATE_EPOCH in JSON info files
The source date epoch is the only reproducible date close to the actual
build date. It can be used for tooling like the firmware wizard to show
the image age.
Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit 165f0b00cdd2f763c1d478c2f58c535fc19b13bd)
[store source_date_epoch as integer]
Signed-off-by: Paul Spooren <mail@aparcar.org>
-rw-r--r-- | include/image.mk | 1 | ||||
-rwxr-xr-x | scripts/json_add_image_info.py | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/include/image.mk b/include/image.mk index ee9885c8f7..1c37d5839f 100644 --- a/include/image.mk +++ b/include/image.mk @@ -532,6 +532,7 @@ define Device/Build/image @mkdir -p $$(shell dirname $$@) DEVICE_ID="$(DEVICE_NAME)" \ BIN_DIR="$(BIN_DIR)" \ + SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) \ IMAGE_NAME="$(IMAGE_NAME)" \ IMAGE_TYPE=$(word 1,$(subst ., ,$(2))) \ IMAGE_FILESYSTEM="$(1)" \ diff --git a/scripts/json_add_image_info.py b/scripts/json_add_image_info.py index 9a640ad468..23d816916c 100755 --- a/scripts/json_add_image_info.py +++ b/scripts/json_add_image_info.py @@ -31,6 +31,7 @@ image_info = { "target": "{}/{}".format(getenv("TARGET"), getenv("SUBTARGET")), "version_code": getenv("VERSION_CODE"), "version_number": getenv("VERSION_NUMBER"), + "source_date_epoch": int(getenv("SOURCE_DATE_EPOCH")), "profiles": { device_id: { "image_prefix": getenv("IMAGE_PREFIX"), |