Update $PRODUCT_OUT for auto generated partitions

This change allows the auto generated filesystem modules to copy the
installed files to $PRODUCT_OUT, on top of the currently allowed soong
defined system image.

Also, this change replaces the cp command with rsync, to prevent identical
files from being copied in incremental builds.

Test: rm -rf out/ && m aosp_cf_x86_64_phone_generated_device --soong-only
Bug: 376727180
Change-Id: I68c6319aad99358648aefa35a6acea8644100875
diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go
index 4027b9a..ae39efb 100644
--- a/filesystem/filesystem.go
+++ b/filesystem/filesystem.go
@@ -593,11 +593,11 @@
 }
 
 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) {