summaryrefslogtreecommitdiff
path: root/filesystem/android_device.go
diff options
context:
space:
mode:
author Spandan Das <spandandas@google.com> 2025-02-27 22:04:20 -0800
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2025-02-27 22:04:20 -0800
commit01d9c47d8d52775ca2cb8938e51fcc086bfddc57 (patch)
tree87c9f89763c0ec550ba4c7187d78eaa5dd2a43ac /filesystem/android_device.go
parent433dcb4e7f8a93c93dd20361c55056a24e4f786e (diff)
parentdad9870c874e5d101180638165042859f9b1c756 (diff)
Merge "Generate META/apexkeys.txt" into main
Diffstat (limited to 'filesystem/android_device.go')
-rw-r--r--filesystem/android_device.go24
1 files changed, 20 insertions, 4 deletions
diff --git a/filesystem/android_device.go b/filesystem/android_device.go
index 31678aa3b..8b0dc1587 100644
--- a/filesystem/android_device.go
+++ b/filesystem/android_device.go
@@ -175,7 +175,7 @@ func (a *androidDevice) GenerateAndroidBuildActions(ctx android.ModuleContext) {
allInstalledModules := a.allInstalledModules(ctx)
- a.buildTargetFilesZip(ctx)
+ a.buildTargetFilesZip(ctx, allInstalledModules)
a.buildProguardZips(ctx, allInstalledModules)
var deps []android.Path
@@ -393,7 +393,7 @@ type targetFilesystemZipCopy struct {
destSubdir string
}
-func (a *androidDevice) buildTargetFilesZip(ctx android.ModuleContext) {
+func (a *androidDevice) buildTargetFilesZip(ctx android.ModuleContext, allInstalledModules []android.Module) {
targetFilesDir := android.PathForModuleOut(ctx, "target_files_dir")
targetFilesZip := android.PathForModuleOut(ctx, "target_files.zip")
@@ -497,7 +497,7 @@ func (a *androidDevice) buildTargetFilesZip(ctx android.ModuleContext) {
}
a.copyImagesToTargetZip(ctx, builder, targetFilesDir)
- a.copyMetadataToTargetZip(ctx, builder, targetFilesDir)
+ a.copyMetadataToTargetZip(ctx, builder, targetFilesDir, allInstalledModules)
builder.Command().
BuiltTool("soong_zip").
@@ -549,7 +549,7 @@ func (a *androidDevice) copyImagesToTargetZip(ctx android.ModuleContext, builder
}
}
-func (a *androidDevice) copyMetadataToTargetZip(ctx android.ModuleContext, builder *android.RuleBuilder, targetFilesDir android.WritablePath) {
+func (a *androidDevice) copyMetadataToTargetZip(ctx android.ModuleContext, builder *android.RuleBuilder, targetFilesDir android.WritablePath, allInstalledModules []android.Module) {
// Create a META/ subdirectory
builder.Command().Textf("mkdir -p %s/META", targetFilesDir.String())
if proptools.Bool(a.deviceProps.Ab_ota_updater) {
@@ -597,8 +597,24 @@ func (a *androidDevice) copyMetadataToTargetZip(ctx android.ModuleContext, build
if releaseTools := android.PathForModuleSrc(ctx, proptools.String(a.deviceProps.Releasetools_extension)); releaseTools != nil {
builder.Command().Textf("cp").Input(releaseTools).Textf(" %s/META/", targetFilesDir.String())
}
+ // apexkeys.txt
+ var installedApexKeys []android.Path
+ for _, installedModule := range allInstalledModules {
+ if info, ok := android.OtherModuleProvider(ctx, installedModule, ApexKeyPathInfoProvider); ok {
+ installedApexKeys = append(installedApexKeys, info.ApexKeyPath)
+ }
+ }
+ installedApexKeys = android.SortedUniquePaths(installedApexKeys) // Sort by keypath to match make
+ builder.Command().Text("cat").Inputs(installedApexKeys).Textf(" >> %s/META/apexkeys.txt", targetFilesDir.String())
+
}
+type ApexKeyPathInfo struct {
+ ApexKeyPath android.Path
+}
+
+var ApexKeyPathInfoProvider = blueprint.NewProvider[ApexKeyPathInfo]()
+
// Filenames for the partition specific fs_config files.
// Hardcode the ramdisk files to their boot image prefix
func (a *androidDevice) filesystemConfigNameForTargetFiles(partition string) string {