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: I89e318f630f488074369fb88556215989271260e
diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go
index 43fd390..6dfbfd1 100644
--- a/filesystem/filesystem.go
+++ b/filesystem/filesystem.go
@@ -751,7 +751,10 @@
}
if timestamp := proptools.String(f.properties.Fake_timestamp); timestamp != "" {
addStr("timestamp", timestamp)
+ } else if ctx.Config().Getenv("USE_FIXED_TIMESTAMP_IMG_FILES") == "true" {
+ addStr("use_fixed_timestamp", "true")
}
+
if uuid := proptools.String(f.properties.Uuid); uuid != "" {
addStr("uuid", uuid)
addStr("hash_seed", uuid)