summaryrefslogtreecommitdiff
path: root/filesystem/android_device.go
diff options
context:
space:
mode:
author Spandan Das <spandandas@google.com> 2025-02-13 00:15:59 +0000
committer Spandan Das <spandandas@google.com> 2025-02-13 23:24:04 +0000
commitdd262fb12fe774d3e7700a090b48613f4d028f3e (patch)
treeec13e5d8d5fb1fc36b98a37717ff0772dd774ebe /filesystem/android_device.go
parent0094807f15d345435811f40687d11e87e182c4d5 (diff)
Generate $partition_filesystem_config.txt for target_files.zip
These files will be packaged into META subdir of target_files.zip Some details - This CL adds the filesystem_config.txt files for system, vendor, ... Some other partitions like system_other are currently missing (different module type) - There is a subtle difference between the make and soong build rule. In the make rule, it uses $TARGET_OUT (all partitions) as the -D in `fs_config`. In the soong rule, this implementation passes the staging directory of the filesystem. This difference does not seem to have a difference on the final result. - Some filesystem_config are currently missing/not bit-identical. These include boot, init_boot. For these, we actually want to use the configs from their ramdisk filesystems. I will do this in a followup CL Test: diff'd target_files.zip The following files are identical except NOTICE.xml.gz entry - odm_dlkm, odm, product, system_dlkm, system_ext, vendor_dlkm, vendor The following files are _not_ identical in names and/or contents - boot_filesystem_config.txt - root_filesystem_config.txt - system_other_filesystem_config.txt - vendor_boot_filesystem_config.txt Bug: 388633394 Change-Id: I3a3997c0ffd8100c44b4a50a63bf0709a61d4472
Diffstat (limited to 'filesystem/android_device.go')
-rw-r--r--filesystem/android_device.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/filesystem/android_device.go b/filesystem/android_device.go
index 62c86580a..38bfe6bc6 100644
--- a/filesystem/android_device.go
+++ b/filesystem/android_device.go
@@ -463,6 +463,29 @@ func (a *androidDevice) copyMetadataToTargetZip(ctx android.ModuleContext, build
builder.Command().Textf("cp").Input(a.getFsInfos(ctx)["system"].SelinuxFc).Textf(" %s/META/file_contexts.bin", targetFilesDir.String())
}
}
+ // Copy $partition_filesystem_config.txt
+ fsInfos := a.getFsInfos(ctx)
+ for _, partition := range android.SortedKeys(fsInfos) {
+ if fsInfos[partition].FilesystemConfig == nil {
+ continue
+ }
+ if android.InList(partition, []string{"userdata"}) {
+ continue
+ }
+ builder.Command().Textf("cp").Input(fsInfos[partition].FilesystemConfig).Textf(" %s/META/%s", targetFilesDir.String(), a.filesystemConfigNameForTargetFiles(partition))
+ }
+}
+
+// Filenames for the partition specific fs_config files.
+// Hardcode the ramdisk files to their boot image prefix
+func (a *androidDevice) filesystemConfigNameForTargetFiles(partition string) string {
+ name := partition + "_filesystem_config.txt"
+ if partition == "system" {
+ name = "filesystem_config.txt"
+ } else if partition == "ramdisk" {
+ name = "init_boot_filesystem_config.txt"
+ }
+ return name
}
func (a *androidDevice) getFilesystemInfo(ctx android.ModuleContext, depName string) FilesystemInfo {