diff options
Diffstat (limited to 'filesystem/filesystem.go')
| -rw-r--r-- | filesystem/filesystem.go | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go index 9c828e3a3..993c46e49 100644 --- a/filesystem/filesystem.go +++ b/filesystem/filesystem.go @@ -215,6 +215,9 @@ type FilesystemProperties struct { // Additional dependencies used for building android products Android_filesystem_deps AndroidFilesystemDeps + + // Name of the output. Default is $(module_name).img + Stem *string } type AndroidFilesystemDeps struct { @@ -392,7 +395,7 @@ func (f *filesystem) fsType(ctx android.ModuleContext) fsType { } func (f *filesystem) installFileName() string { - return f.BaseModuleName() + ".img" + return proptools.StringDefault(f.properties.Stem, f.BaseModuleName()+".img") } func (f *filesystem) partitionName() string { @@ -467,6 +470,7 @@ func (f *filesystem) GenerateAndroidBuildActions(ctx android.ModuleContext) { FileListFile: fileListFile, RootDir: rootDir, }) + f.fileListFile = fileListFile if proptools.Bool(f.properties.Unchecked_module) { @@ -601,11 +605,16 @@ func (f *filesystem) copyPackagingSpecs(ctx android.ModuleContext, builder *andr } func (f *filesystem) copyFilesToProductOut(ctx android.ModuleContext, builder *android.RuleBuilder, rebasedDir android.OutputPath) { - if f.Name() != ctx.Config().SoongDefinedSystemImage() { + if !(f.Name() == ctx.Config().SoongDefinedSystemImage() || proptools.Bool(f.properties.Is_auto_generated)) { return } installPath := android.PathForModuleInPartitionInstall(ctx, f.partitionName()) - builder.Command().Textf("cp -prf %s/* %s", rebasedDir, installPath) + builder.Command().Textf("rsync --checksum %s %s", rebasedDir, installPath) +} + +func copyImageFileToProductOut(ctx android.ModuleContext, builder *android.RuleBuilder, partition string, output android.Path) { + copyDir := android.PathForModuleInPartitionInstall(ctx, "").Join(ctx, fmt.Sprintf("%s.img", partition)) + builder.Command().Textf("rsync -a %s %s", output, copyDir) } func (f *filesystem) rootDirString() string { @@ -659,6 +668,10 @@ func (f *filesystem) buildImageUsingBuildImage(ctx android.ModuleContext) (andro Output(output). Text(rootDir.String()) // directory where to find fs_config_files|dirs + if !ctx.Config().KatiEnabled() { + copyImageFileToProductOut(ctx, builder, f.partitionName(), output) + } + // rootDir is not deleted. Might be useful for quick inspection. builder.Build("build_filesystem_image", fmt.Sprintf("Creating filesystem %s", f.BaseModuleName())) |