From 0c1a68b511ada4997e1db607087adebe6ea8abfd Mon Sep 17 00:00:00 2001 From: Spandan Das Date: Fri, 17 Jan 2025 20:11:35 +0000 Subject: Generate block_list only when building img for target_files.zip The same block_list file is currently declared in the propfile of primary .img file as well the secondary .img file (for target_files.zip). Both the .img files are created in the same ninja command, but in the current implementation the block_list file is generated twice with the same contents. This CL moves the block_list file to the image prop file of the secondary .img creation. Test: presubmits Change-Id: I0f8f4e4c7bec1ae5e370ac97d6608f9754e719e3 --- filesystem/filesystem.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'filesystem/filesystem.go') diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go index ad19cc6e0..6b3906a92 100644 --- a/filesystem/filesystem.go +++ b/filesystem/filesystem.go @@ -701,7 +701,9 @@ func (f *filesystem) buildImageUsingBuildImage( // Add an additional cmd to create a hermetic img file. This will contain pinned timestamps e.g. propFilePinnedTimestamp := android.PathForModuleOut(ctx, "for_target_files", "prop") - builder.Command().Textf("cat").Input(propFile).Flag(">").Output(propFilePinnedTimestamp).Textf(" && echo use_fixed_timestamp=true >> %s", propFilePinnedTimestamp) + builder.Command().Textf("cat").Input(propFile).Flag(">").Output(propFilePinnedTimestamp). + Textf(" && echo use_fixed_timestamp=true >> %s", propFilePinnedTimestamp). + Textf(" && echo block_list=%s >> %s", f.getMapFile(ctx).String(), propFilePinnedTimestamp) // mapfile will be an implicit output outputHermetic := android.PathForModuleOut(ctx, "for_target_files", f.installFileName()) builder.Command(). @@ -761,7 +763,6 @@ func (f *filesystem) buildPropFile(ctx android.ModuleContext) (android.Path, and } panic(fmt.Errorf("unsupported fs type %v", t)) } - addStr("block_list", f.getMapFile(ctx).String()) // This will be an implicit output addStr("fs_type", fsTypeStr(f.fsType(ctx))) addStr("mount_point", proptools.StringDefault(f.properties.Mount_point, "/")) -- cgit v1.2.3-59-g8ed1b