From 79730d4d9c00d72ee47163e49c931d21aa532967 Mon Sep 17 00:00:00 2001 From: mrziwang Date: Mon, 2 Dec 2024 22:13:59 -0800 Subject: Add super_image module type and create super image module in fsgen fsgen processes the variables exported from make and create the super image module. This module generates the misc-info.txt, which is used by build_super_image.py to build the super image. Test: CI Bug: 376726109 Change-Id: I74a3e68d697704f36a770b3c83e5f8821b3ac128 --- fsgen/filesystem_creator.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'fsgen/filesystem_creator.go') diff --git a/fsgen/filesystem_creator.go b/fsgen/filesystem_creator.go index 745aeaaa7..2acfb9c4e 100644 --- a/fsgen/filesystem_creator.go +++ b/fsgen/filesystem_creator.go @@ -51,6 +51,7 @@ type filesystemCreatorProps struct { Boot_image string `blueprint:"mutated" android:"path_device_first"` Vendor_boot_image string `blueprint:"mutated" android:"path_device_first"` Init_boot_image string `blueprint:"mutated" android:"path_device_first"` + Super_image string `blueprint:"mutated" android:"path_device_first"` } type filesystemCreator struct { @@ -157,6 +158,11 @@ func (f *filesystemCreator) createInternalModules(ctx android.LoadHookContext) { f.properties.Vbmeta_partition_names = append(f.properties.Vbmeta_partition_names, x.partitionName) } + if buildingSuperImage(partitionVars) { + createSuperImage(ctx, finalSoongGeneratedPartitions, partitionVars) + f.properties.Super_image = ":" + generatedModuleName(ctx.Config(), "super") + } + ctx.Config().Get(fsGenStateOnceKey).(*FsGenState).soongGeneratedPartitions = finalSoongGeneratedPartitions f.createDeviceModule(ctx, finalSoongGeneratedPartitions, f.properties.Vbmeta_module_names) } @@ -971,6 +977,14 @@ func (f *filesystemCreator) GenerateAndroidBuildActions(ctx android.ModuleContex diffTestFiles = append(diffTestFiles, diffTestFile) ctx.Phony("soong_generated_init_boot_filesystem_test", diffTestFile) } + if f.properties.Super_image != "" { + diffTestFile := android.PathForModuleOut(ctx, "super_diff_test.txt") + soongSuperImg := android.PathForModuleSrc(ctx, f.properties.Super_image) + makeSuperImage := android.PathForArbitraryOutput(ctx, fmt.Sprintf("target/product/%s/super.img", ctx.Config().DeviceName())) + createDiffTest(ctx, diffTestFile, soongSuperImg, makeSuperImage) + diffTestFiles = append(diffTestFiles, diffTestFile) + ctx.Phony("soong_generated_super_filesystem_test", diffTestFile) + } ctx.Phony("soong_generated_filesystem_tests", diffTestFiles...) } -- cgit v1.2.3-59-g8ed1b