From a0ddc511d9b3b2d4773214878c57629d1a1511eb Mon Sep 17 00:00:00 2001 From: Spandan Das Date: Mon, 6 Jan 2025 20:23:55 +0000 Subject: 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 --- filesystem/filesystem.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'filesystem/filesystem.go') diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go index 43fd390ce..6dfbfd1be 100644 --- a/filesystem/filesystem.go +++ b/filesystem/filesystem.go @@ -751,7 +751,10 @@ func (f *filesystem) buildPropFile(ctx android.ModuleContext) (android.Path, and } 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) -- cgit v1.2.3-59-g8ed1b