Build system_other image in soong-only builds

This just builds an empty system_other image for now, the dexpreopt
files will be added in a followup change.

Bug: 390269431
Test: m --soong-only
Change-Id: Ic4a9bcb8b7ba1eb4444b3339d6c0b0cdfd485714
diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go
index ad19cc6..e485e4f 100644
--- a/filesystem/filesystem.go
+++ b/filesystem/filesystem.go
@@ -378,6 +378,11 @@
 	// Name of the module that produced this FilesystemInfo origionally. (though it may be
 	// re-exported by super images or boot images)
 	ModuleName string
+	// The property file generated by this module and passed to build_image.
+	// It's exported here so that system_other can reuse system's property file.
+	BuildImagePropFile android.Path
+	// Paths to all the tools referenced inside of the build image property file.
+	BuildImagePropFileDeps android.Paths
 }
 
 var FilesystemProvider = blueprint.NewProvider[FilesystemInfo]()
@@ -484,9 +489,11 @@
 
 	var mapFile android.Path
 	var outputHermetic android.Path
+	var buildImagePropFile android.Path
+	var buildImagePropFileDeps android.Paths
 	switch f.fsType(ctx) {
 	case ext4Type, erofsType, f2fsType:
-		f.output, outputHermetic = f.buildImageUsingBuildImage(ctx, builder, rootDir, rebasedDir)
+		f.output, outputHermetic, buildImagePropFile, buildImagePropFileDeps = f.buildImageUsingBuildImage(ctx, builder, rootDir, rebasedDir)
 		mapFile = f.getMapFile(ctx)
 	case compressedCpioType:
 		f.output = f.buildCpioImage(ctx, builder, rootDir, true)
@@ -508,17 +515,15 @@
 	android.WriteFileRule(ctx, fileListFile, f.installedFilesList())
 
 	fsInfo := FilesystemInfo{
-		Output:       f.output,
-		FileListFile: fileListFile,
-		RootDir:      rootDir,
-		RebasedDir:   rebasedDir,
-		ModuleName:   ctx.ModuleName(),
-	}
-	if mapFile != nil {
-		fsInfo.MapFile = mapFile
-	}
-	if outputHermetic != nil {
-		fsInfo.OutputHermetic = outputHermetic
+		Output:                 f.output,
+		OutputHermetic:         outputHermetic,
+		FileListFile:           fileListFile,
+		RootDir:                rootDir,
+		RebasedDir:             rebasedDir,
+		MapFile:                mapFile,
+		ModuleName:             ctx.ModuleName(),
+		BuildImagePropFile:     buildImagePropFile,
+		BuildImagePropFileDeps: buildImagePropFileDeps,
 	}
 
 	android.SetProvider(ctx, FilesystemProvider, fsInfo)
@@ -670,7 +675,7 @@
 	builder *android.RuleBuilder,
 	rootDir android.OutputPath,
 	rebasedDir android.OutputPath,
-) (android.Path, android.Path) {
+) (android.Path, android.Path, android.Path, android.Paths) {
 	// run host_init_verifier
 	// Ideally we should have a concept of pluggable linters that verify the generated image.
 	// While such concept is not implement this will do.
@@ -721,7 +726,7 @@
 	// rootDir is not deleted. Might be useful for quick inspection.
 	builder.Build("build_filesystem_image", fmt.Sprintf("Creating filesystem %s", f.BaseModuleName()))
 
-	return output, outputHermetic
+	return output, outputHermetic, propFile, toolDeps
 }
 
 func (f *filesystem) buildFileContexts(ctx android.ModuleContext) android.Path {