Handle the ramdisk implicitly in target-file.zip
We should not be checking
ctx.DeviceConfig().BoardMoveRecoveryResourcesToVendorBoot() in
android_device, because there may be multiple android_devices in the
tree with different partition layouts. Instead, get the recovery image
files transitively from the vendor_boot image.
Bug: 376539388
Test: Built target_files.zip, checked all the files are still there.
Change-Id: I1837aedacf71063879b26b51b8fe28b684b96d78
diff --git a/filesystem/android_device.go b/filesystem/android_device.go
index 8d7f92f..4f6f983 100644
--- a/filesystem/android_device.go
+++ b/filesystem/android_device.go
@@ -302,11 +302,6 @@
targetFilesZipCopy{a.partitionProps.Init_boot_partition_name, "INIT_BOOT/RAMDISK"},
targetFilesZipCopy{a.partitionProps.Vendor_boot_partition_name, "VENDOR_BOOT/RAMDISK"},
}
- // TODO: Handle cases where recovery files are copied to BOOT/ or RECOVERY/
- // https://cs.android.com/android/platform/superproject/main/+/main:build/make/core/Makefile;l=6211-6219?q=core%2FMakefile&ss=android%2Fplatform%2Fsuperproject%2Fmain
- if ctx.DeviceConfig().BoardMoveRecoveryResourcesToVendorBoot() {
- toCopy = append(toCopy, targetFilesZipCopy{a.partitionProps.Recovery_partition_name, "VENDOR_BOOT/RAMDISK"})
- }
filesystemsToCopy := []targetFilesystemZipCopy{}
for _, zipCopy := range toCopy {
@@ -343,6 +338,12 @@
BuiltTool("acp").
Textf("-rd %s/. %s/%s", rootDirString, targetFilesDir, toCopy.destSubdir).
Implicit(toCopy.fsInfo.Output) // so that the staging dir is built
+ for _, extraRootDir := range toCopy.fsInfo.ExtraRootDirs {
+ builder.Command().
+ BuiltTool("acp").
+ Textf("-rd %s/. %s/%s", extraRootDir, targetFilesDir, toCopy.destSubdir).
+ Implicit(toCopy.fsInfo.Output) // so that the staging dir is built
+ }
if toCopy.destSubdir == "SYSTEM" {
// Create the ROOT partition in target_files.zip