diff options
author | 2025-02-27 22:05:09 -0800 | |
---|---|---|
committer | 2025-02-27 22:05:09 -0800 | |
commit | 5efa02606a465f8c13b1c6923d32021afae9bb68 (patch) | |
tree | e536223a0b74155c0b5833a5a7f0bb77ab9d6b8e /filesystem/android_device.go | |
parent | 301362bc83c5e15398a7b6f50605b46ca22dff55 (diff) | |
parent | 853a7a471a2c70f03a934161f264fe69240f829c (diff) |
Merge changes Ia21f1456,Ie966aa61 into main
* changes:
Generate META/(root|vendor_boot)_filesystem_config.txt
Create META/boot_filesystem_config.txt in target_files.zip
Diffstat (limited to 'filesystem/android_device.go')
-rw-r--r-- | filesystem/android_device.go | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/filesystem/android_device.go b/filesystem/android_device.go index 8b0dc1587..a2fa0f08a 100644 --- a/filesystem/android_device.go +++ b/filesystem/android_device.go @@ -587,7 +587,22 @@ func (a *androidDevice) copyMetadataToTargetZip(ctx android.ModuleContext, build if android.InList(partition, []string{"userdata"}) { continue } - builder.Command().Textf("cp").Input(fsInfos[partition].FilesystemConfig).Textf(" %s/META/%s", targetFilesDir.String(), a.filesystemConfigNameForTargetFiles(partition)) + if partition != "vendor_ramdisk" { + // vendor_ramdisk will be handled separately. + builder.Command().Textf("cp").Input(fsInfos[partition].FilesystemConfig).Textf(" %s/META/%s", targetFilesDir.String(), a.filesystemConfigNameForTargetFiles(partition)) + } + if partition == "ramdisk" { + // Create an additional copy at boot_filesystem_config.txt + builder.Command().Textf("cp").Input(fsInfos[partition].FilesystemConfig).Textf(" %s/META/boot_filesystem_config.txt", targetFilesDir.String()) + } + if partition == "system" { + // Create root_filesystem_config from the assembled ROOT/ intermediates directory + a.generateFilesystemConfigForTargetFiles(ctx, builder, targetFilesDir.String(), targetFilesDir.String()+"/ROOT", "root_filesystem_config.txt") + } + if partition == "vendor_ramdisk" { + // Create vendor_boot_filesystem_config from the assembled VENDOR_BOOT/RAMDISK intermediates directory + a.generateFilesystemConfigForTargetFiles(ctx, builder, targetFilesDir.String(), targetFilesDir.String()+"/VENDOR_BOOT/RAMDISK", "vendor_boot_filesystem_config.txt") + } } // Copy ramdisk_node_list if ramdiskNodeList := android.PathForModuleSrc(ctx, proptools.String(a.deviceProps.Ramdisk_node_list)); ramdiskNodeList != nil { @@ -615,6 +630,19 @@ type ApexKeyPathInfo struct { var ApexKeyPathInfoProvider = blueprint.NewProvider[ApexKeyPathInfo]() +func (a *androidDevice) generateFilesystemConfigForTargetFiles(ctx android.ModuleContext, builder *android.RuleBuilder, targetFilesDir, stagingDir, filename string) { + fsConfigOut := android.PathForModuleOut(ctx, filename) + ctx.Build(pctx, android.BuildParams{ + Rule: fsConfigRule, + Output: fsConfigOut, + Args: map[string]string{ + "rootDir": stagingDir, + "prefix": "", + }, + }) + builder.Command().Textf("cp").Input(fsConfigOut).Textf(" %s/META/", targetFilesDir) +} + // Filenames for the partition specific fs_config files. // Hardcode the ramdisk files to their boot image prefix func (a *androidDevice) filesystemConfigNameForTargetFiles(partition string) string { |