summaryrefslogtreecommitdiff
path: root/filesystem/filesystem.go
diff options
context:
space:
mode:
author Justin Yun <justinyun@google.com> 2024-08-30 21:11:33 +0900
committer Justin Yun <justinyun@google.com> 2024-09-05 11:02:57 +0900
commit34baa2e47ca4f9917122c60e003b1d50fd3ecf3f (patch)
treeff60507857bc3d8f9991a9658bc93944cb3a246d /filesystem/filesystem.go
parenta136147c9c0b27cc1508fcb80fd19accbe7b0121 (diff)
Update $PRODUCT_OUT from the soong system image files
When building a system image from 'android_system_image' module, update the $PRODUCT_OUT files with the files installed to the system image. Soong updates the $PRODUCT_OUT files only if the android_system_image module has "update_product_out: true" property. Bug: 350599535 Test: lunch aosp_cf_x86_64_phone_soong_system-trunk_staging-userdebug && m Test: adb sync Change-Id: Ia3418c5380cac42d5c766e8304c8ed2bab3d835a
Diffstat (limited to 'filesystem/filesystem.go')
-rw-r--r--filesystem/filesystem.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go
index 5c7ef434f..a8f97e3b7 100644
--- a/filesystem/filesystem.go
+++ b/filesystem/filesystem.go
@@ -136,6 +136,9 @@ type filesystemProperties struct {
// Install aconfig_flags.pb file for the modules installed in this partition.
Gen_aconfig_flags_pb *bool
+ // Update the Base_dir of the $PRODUCT_OUT directory with the packaging files.
+ Update_product_out *bool
+
Fsverity fsverityProperties
}
@@ -331,6 +334,14 @@ func (f *filesystem) copyPackagingSpecs(ctx android.ModuleContext, builder *andr
return f.CopySpecsToDirs(ctx, builder, dirsToSpecs)
}
+func (f *filesystem) copyFilesToProductOut(ctx android.ModuleContext, builder *android.RuleBuilder, rebasedDir android.OutputPath) {
+ if !proptools.Bool(f.properties.Update_product_out) {
+ return
+ }
+ installPath := android.PathForModuleInPartitionInstall(ctx, f.partitionName())
+ builder.Command().Textf("cp -prf %s/* %s", rebasedDir, installPath)
+}
+
func (f *filesystem) buildImageUsingBuildImage(ctx android.ModuleContext) android.OutputPath {
rootDir := android.PathForModuleOut(ctx, "root").OutputPath
rebasedDir := rootDir
@@ -348,6 +359,7 @@ func (f *filesystem) buildImageUsingBuildImage(ctx android.ModuleContext) androi
f.buildFsverityMetadataFiles(ctx, builder, specs, rootDir, rebasedDir)
f.buildEventLogtagsFile(ctx, builder, rebasedDir)
f.buildAconfigFlagsFiles(ctx, builder, specs, rebasedDir)
+ f.copyFilesToProductOut(ctx, builder, rebasedDir)
// run host_init_verifier
// Ideally we should have a concept of pluggable linters that verify the generated image.
@@ -490,6 +502,7 @@ func (f *filesystem) buildCpioImage(ctx android.ModuleContext, compressed bool)
f.buildFsverityMetadataFiles(ctx, builder, specs, rootDir, rebasedDir)
f.buildEventLogtagsFile(ctx, builder, rebasedDir)
f.buildAconfigFlagsFiles(ctx, builder, specs, rebasedDir)
+ f.copyFilesToProductOut(ctx, builder, rebasedDir)
output := android.PathForModuleOut(ctx, f.installFileName()).OutputPath
cmd := builder.Command().