Copy system_other.img to target_files.zip
Similar to https://r.android.com/3489814, this adds an additional rule
in systemOtherImage to create a hermetic version of system_other.img
with pinned timestamps. This information will be provided to
android_device via super_image.
block_list information is not implemented for system_other to match the
make behavior
Test: Built the soong built target_files.zip locally
Bug: 385383524
Change-Id: I4cbb4f8a5380203eaef846b3d8a56eb7791f8a34
diff --git a/filesystem/android_device.go b/filesystem/android_device.go
index 960c96a..c14cc4c 100644
--- a/filesystem/android_device.go
+++ b/filesystem/android_device.go
@@ -398,8 +398,12 @@
superPartition := ctx.GetDirectDepProxyWithTag(*a.partitionProps.Super_partition_name, superPartitionDepTag)
if info, ok := android.OtherModuleProvider(ctx, superPartition, SuperImageProvider); ok {
for _, partition := range android.SortedKeys(info.SubImageInfo) {
- builder.Command().Textf("cp ").Input(info.SubImageInfo[partition].OutputHermetic).Textf(" %s/IMAGES/", targetFilesDir.String())
- builder.Command().Textf("cp ").Input(info.SubImageInfo[partition].MapFile).Textf(" %s/IMAGES/", targetFilesDir.String())
+ if info.SubImageInfo[partition].OutputHermetic != nil {
+ builder.Command().Textf("cp ").Input(info.SubImageInfo[partition].OutputHermetic).Textf(" %s/IMAGES/", targetFilesDir.String())
+ }
+ if info.SubImageInfo[partition].MapFile != nil {
+ builder.Command().Textf("cp ").Input(info.SubImageInfo[partition].MapFile).Textf(" %s/IMAGES/", targetFilesDir.String())
+ }
}
} else {
ctx.ModuleErrorf("Super partition %s does set SuperImageProvider\n", superPartition.Name())