Use fixed timestamp in img files using an environment variable
This creates hermetic img files, and will be used to assert equivalence
between make and soong built img files.
An alternative would be to use the timestamp from build_date.txt, but
that causes a full push on the first adb sync (b/385995921)
Test: spot checked that system_ext.img built by make and soong are bit
identical (with notice files commeted out)
Change-Id: I038c1ee31dff6211e38db0ba63b993f3856c4c0f
diff --git a/core/Makefile b/core/Makefile
index a990caf..de129d8 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -2398,7 +2398,7 @@
$(hide) echo "root_dir=$(TARGET_ROOT_OUT)" >> $(1)
$(if $(filter true,$(PRODUCT_USE_DYNAMIC_PARTITION_SIZE)),\
$(hide) echo "use_dynamic_partition_size=true" >> $(1))
-$(if $(COPY_IMAGES_FOR_TARGET_FILES_ZIP),\
+$(if $(USE_FIXED_TIMESTAMP_IMG_FILES)$(COPY_IMAGES_FOR_TARGET_FILES_ZIP),\
$(hide) echo "use_fixed_timestamp=true" >> $(1))
$(if $(3),$(hide) $(foreach kv,$(3),echo "$(kv)" >> $(1);))
$(hide) sort -o $(1) $(1)