diff options
author | 2025-02-12 19:36:03 +0000 | |
---|---|---|
committer | 2025-02-12 21:36:44 +0000 | |
commit | b5f40cf0b646a1e1868a05dfb4f8d98bcd19dd0e (patch) | |
tree | 121a1a89cd947e35e5cca549ae7af3ad483db04c /filesystem/android_device.go | |
parent | d71af183064d45dbeccf09553d3876c682dcc843 (diff) |
Add ab_ota_partitions prop to android_device
This will be used to generate ab_partitions.txt file in
target_files.zip
Test: Built soong target_files.zip locally
Bug: 388633394
Change-Id: I442c0907094abb4f68fb0c666efae52509aa9538
Diffstat (limited to 'filesystem/android_device.go')
-rw-r--r-- | filesystem/android_device.go | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/filesystem/android_device.go b/filesystem/android_device.go index 7e4beeaf8..d42927a6e 100644 --- a/filesystem/android_device.go +++ b/filesystem/android_device.go @@ -70,7 +70,8 @@ type DeviceProperties struct { // blueprint:"mutated" and still set it from filesystem_creator Main_device *bool - Ab_ota_updater *bool + Ab_ota_updater *bool + Ab_ota_partitions []string } type androidDevice struct { @@ -439,11 +440,15 @@ func (a *androidDevice) copyMetadataToTargetZip(ctx android.ModuleContext, build info, _ := android.OtherModuleProvider(ctx, child, android.OutputFilesProvider) builder.Command().Textf("cp").Inputs(info.DefaultOutputFiles).Textf(" %s/META/", targetFilesDir.String()) }) - } - builder.Command().Textf("cp").Input(android.PathForSource(ctx, "external/zucchini/version_info.h")).Textf(" %s/META/zucchini_config.txt", targetFilesDir.String()) - builder.Command().Textf("cp").Input(android.PathForSource(ctx, "system/update_engine/update_engine.conf")).Textf(" %s/META/update_engine_config.txt", targetFilesDir.String()) - if a.getFsInfos(ctx)["system"].ErofsCompressHints != nil { - builder.Command().Textf("cp").Input(a.getFsInfos(ctx)["system"].ErofsCompressHints).Textf(" %s/META/erofs_default_compress_hints.txt", targetFilesDir.String()) + builder.Command().Textf("cp").Input(android.PathForSource(ctx, "external/zucchini/version_info.h")).Textf(" %s/META/zucchini_config.txt", targetFilesDir.String()) + builder.Command().Textf("cp").Input(android.PathForSource(ctx, "system/update_engine/update_engine.conf")).Textf(" %s/META/update_engine_config.txt", targetFilesDir.String()) + if a.getFsInfos(ctx)["system"].ErofsCompressHints != nil { + builder.Command().Textf("cp").Input(a.getFsInfos(ctx)["system"].ErofsCompressHints).Textf(" %s/META/erofs_default_compress_hints.txt", targetFilesDir.String()) + } + // ab_partitions.txt + abPartitionsSorted := android.SortedUniqueStrings(a.deviceProps.Ab_ota_partitions) + abPartitionsSortedString := proptools.ShellEscape(strings.Join(abPartitionsSorted, "\\n")) + builder.Command().Textf("echo -e").Flag(abPartitionsSortedString).Textf(" > %s/META/ab_partitions.txt", targetFilesDir.String()) } } |