diff options
author | 2025-01-16 14:55:35 -0800 | |
---|---|---|
committer | 2025-01-16 16:20:24 -0800 | |
commit | 74ee4e0adc7fb37d648b86852cae93746556e02e (patch) | |
tree | 9b56d0230554e90486e7bd57d96a6978bb42b1a7 /filesystem/filesystem.go | |
parent | feb2479506afeb4bf1e8b52a0f5edd21a420280b (diff) |
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
Diffstat (limited to 'filesystem/filesystem.go')
-rw-r--r-- | filesystem/filesystem.go | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go index ad19cc6e0..e485e4fdb 100644 --- a/filesystem/filesystem.go +++ b/filesystem/filesystem.go @@ -378,6 +378,11 @@ type FilesystemInfo struct { // 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 @@ func (f *filesystem) GenerateAndroidBuildActions(ctx android.ModuleContext) { 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 @@ func (f *filesystem) GenerateAndroidBuildActions(ctx android.ModuleContext) { 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 @@ func (f *filesystem) buildImageUsingBuildImage( 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 @@ func (f *filesystem) buildImageUsingBuildImage( // 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 { |